From 1ed29008aae667f2cb96c2718166850de605feed Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 10 Oct 2022 13:26:13 -0300 Subject: [PATCH] Small bug fixes and improvements --- API Custom Displays.txt | 2 +- API.lua | 16 +- API.txt | 28 +- Libs/DF/addon.lua | 18 +- Libs/DF/auras.lua | 132 +- Libs/DF/button.lua | 8 +- Libs/DF/cooltip.lua | 6 +- Libs/DF/fw.lua | 94 +- Libs/DF/help.lua | 4 +- Libs/DF/math.lua | 6 +- Libs/DF/normal_bar.lua | 60 +- Libs/DF/panel.lua | 672 +++-- Libs/DF/pictureedit.lua | 32 +- Libs/DF/slider.lua | 70 +- Libs/DF/spells.lua | 6 +- Libs/DF/split_bar.lua | 52 +- Libs/DF/textentry.lua | 34 +- Libs/LibDeflate/LibDeflate.lua | 2 +- Libs/LibOpenRaid/ThingsToMantain.lua | 8 +- Libs/LibOpenRaid/docs.txt | 4 +- Libs/NickTag-1.0/NickTag-1.0.lua | 108 +- boot.lua | 30 +- classes/class_combat.lua | 237 +- classes/class_custom.lua | 258 +- classes/class_damage.lua | 270 +- classes/class_error.lua | 4 +- classes/class_heal.lua | 319 ++- classes/class_instance.lua | 299 ++- classes/class_resources.lua | 128 +- classes/class_spelldamage.lua | 6 +- classes/class_spellresources.lua | 2 +- classes/class_spellutility.lua | 4 +- classes/class_utility.lua | 200 +- classes/container_actors.lua | 60 +- classes/container_pets.lua | 48 +- classes/container_segments.lua | 453 ++-- classes/container_spells.lua | 4 +- classes/custom_damagedone.lua | 36 +- classes/custom_healingdone.lua | 36 +- classes/include_instance.lua | 8 +- core/control.lua | 787 +++--- core/gears.lua | 206 +- core/meta.lua | 108 +- core/parser.lua | 2238 ++++++++--------- core/plugins.lua | 101 +- core/plugins_raid.lua | 24 +- core/plugins_solo.lua | 30 +- core/plugins_statusbar.lua | 134 +- core/plugins_toolbar.lua | 10 +- core/timemachine.lua | 24 +- core/util.lua | 427 ++-- core/windows.lua | 520 ++-- frames/anime.lua | 30 +- frames/fw_mods.lua | 12 +- frames/window_api.lua | 38 +- frames/window_benchmark.lua | 42 +- frames/window_bookmark.lua | 24 +- frames/window_brokertexteditor.lua | 12 +- frames/window_cdtracker.lua | 10 +- frames/window_classcolor.lua | 30 +- frames/window_copy.lua | 4 +- frames/window_currentdps.lua | 84 +- frames/window_custom.lua | 190 +- frames/window_custom_scripts.lua | 18 +- frames/window_dump.lua | 28 +- frames/window_eventtracker.lua | 78 +- frames/window_forge.lua | 70 +- frames/window_macros.lua | 24 +- frames/window_main.lua | 160 +- frames/window_news.lua | 8 +- frames/window_options2.lua | 21 +- frames/window_options2_sections.lua | 194 +- frames/window_plater.lua | 38 +- frames/window_playerbreakdown.lua | 540 ++-- frames/window_playerbreakdown_list.lua | 2 +- frames/window_profiler.lua | 2 +- frames/window_report.lua | 8 +- frames/window_rowtexteditor.lua | 24 +- frames/window_runcode.lua | 26 +- frames/window_scrolldamage.lua | 4 +- frames/window_spellcategory.lua | 4 +- frames/window_statistics.lua | 82 +- frames/window_switch.lua | 14 +- frames/window_wa.lua | 174 +- frames/window_welcome.lua | 122 +- functions/api2.lua | 44 +- functions/attributes.lua | 2 +- functions/boss.lua | 16 +- functions/bossmods.lua | 18 +- functions/buff.lua | 20 +- functions/classes.lua | 36 +- functions/coach.lua | 2 +- functions/deathmenu.lua | 72 +- functions/deathrecap.lua | 62 +- functions/dungeon.lua | 611 +++-- functions/events.lua | 18 +- functions/loaddata.lua | 34 +- functions/macros.lua | 4 +- functions/mythicdungeon.lua | 325 ++- functions/pack.lua | 2 +- functions/plater.lua | 12 +- functions/playerclass.lua | 100 +- functions/profiles.lua | 44 +- functions/rowanimation.lua | 2 +- functions/savedata.lua | 10 +- functions/skins.lua | 12 +- functions/slash.lua | 336 +-- functions/spellcache.lua | 14 +- functions/spells.lua | 6 +- functions/testbars.lua | 10 +- functions/timedata.lua | 42 +- .../Details_DataStorage.lua | 2 +- .../Details_EncounterDetails.lua | 248 +- plugins/Details_EncounterDetails/frames.lua | 306 +-- .../Details_RaidCheck/Details_RaidCheck.lua | 2 +- plugins/Details_Streamer/Details_Streamer.lua | 128 +- .../Details_TinyThreat/Details_TinyThreat.lua | 100 +- plugins/Details_Vanguard/Details_Vanguard.lua | 72 +- startup.lua | 4 +- 119 files changed, 6556 insertions(+), 6650 deletions(-) diff --git a/API Custom Displays.txt b/API Custom Displays.txt index 38498eec..fa0d8176 100644 --- a/API Custom Displays.txt +++ b/API Custom Displays.txt @@ -130,7 +130,7 @@ Total Code and Percent Code: *Total - the total made by all actors. local value, top, total, combat, instance = ... -local result = floor (value) +local result = floor(value) return total diff --git a/API.lua b/API.lua index aab257de..35c83146 100644 --- a/API.lua +++ b/API.lua @@ -49,7 +49,7 @@ local currentCombat = Details:GetCurrentCombat() @TITLE- Getting a specific combat:@ -@CODElocal combat = Details:GetCombat (segmentID = DETAILS_SEGMENTID_CURRENT)@ +@CODElocal combat = Details:GetCombat(segmentID = DETAILS_SEGMENTID_CURRENT)@ @DESCFor overall use DETAILS_SEGMENTID_OVERALL, for older segments use the combat index (1 ... 25), when the current combat ends, it is added to index 1 on the old segments table.@ @@ -58,10 +58,10 @@ local currentCombat = Details:GetCurrentCombat() @DESCThere's several ways to get a player object, the quick way is:@ -@CODElocal player = Details:GetActor (segmentID = DETAILS_SEGMENTID_CURRENT, attributeID = DETAILS_ATTRIBUTE_DAMAGE, "PlayerName")@ +@CODElocal player = Details:GetActor(segmentID = DETAILS_SEGMENTID_CURRENT, attributeID = DETAILS_ATTRIBUTE_DAMAGE, "PlayerName")@ @DESCThe segmentID is the same as described on GetCombat(), attributeID is the ID for the attribute type. -there is an alias which receives the player name as the first parameter: Details:GetPlayer (playerName, segmentID, attributeID), combat also accept GetActor(): combat:GetActor (attributeID, playerName). +there is an alias which receives the player name as the first parameter: Details:GetPlayer(playerName, segmentID, attributeID), combat also accept GetActor(): combat:GetActor(attributeID, playerName). Retriving actors is expensive, try to cache the object once you have it. @ @@ -71,7 +71,7 @@ Retriving actors is expensive, try to cache the object once you have it. @CODElocal combat = Details:GetCurrentCombat() @COMMENT--if the player is from a different realm, use 'playername-realmname'@ -local player = combat:GetActor (DETAILS_ATTRIBUTE_DAMAGE, "PlayerName") +local player = combat:GetActor(DETAILS_ATTRIBUTE_DAMAGE, "PlayerName") local damageDone = player.total local combatTime = combat:GetCombatTime() @@ -174,13 +174,13 @@ DETAILS_REJU_POTION_ID = 188018 [[ @TITLECombat Object:@ -actor = combat:GetActor ( attribute, character_name ) or actor = combat ( attribute, character_name ) +actor = combat:GetActor( attribute, character_name ) or actor = combat ( attribute, character_name ) @COMMENTreturns an actor object@ characterList = combat:GetActorList ( attribute ) @COMMENTreturns a numeric table with all actors of the specific attribute, contains players, npcs, pets, etc.@ -combatName = combat:GetCombatName ( try_to_find ) +combatName = combat:GetCombatName( try_to_find ) @COMMENTreturns the segment name, e.g. "Trainning Dummy", if try_to_find is true, it searches the combat for a enemy name.@ bossInfo = combat:GetBossInfo() @@ -266,7 +266,7 @@ returns a iterated table of actors inside the container. Usage: 'for index, actor in container:ListActors() do' Note: if the container is a spell container, returns pairs() instead: 'for spellid, spelltable in container:ListActors() do' -actor = container:GetActor (character_name) +actor = container:GetActor(character_name) returns the actor, for spell container use the spellid instead. container:GetSpell (spellid) @@ -733,7 +733,7 @@ Total Code and Percent Code: *Total - the total made by all actors. local value, top, total, combat, instance = ... -local result = floor (value) +local result = floor(value) return total ]], diff --git a/API.txt b/API.txt index e005a966..82e7a018 100644 --- a/API.txt +++ b/API.txt @@ -106,7 +106,7 @@ Getting a Combat Object: combat = Details:GetCurrentCombat() returns the current combat object. -combat = Details:GetCombat (combat) +combat = Details:GetCombat(combat) returns the requested combat object. if 'combat' is omitted, returns the current combat. combat can be a number: -1 for overall, 0 for current and > 0 for past segments (1, 2, 3, ...). @@ -124,7 +124,7 @@ reset only the overall segment Getting an Actor: ======================================= -local actor = Details:GetActor (combat = "current", attribute = DETAILS_ATTRIBUTE_DAMAGE, actorname = Details.playername) +local actor = Details:GetActor(combat = "current", attribute = DETAILS_ATTRIBUTE_DAMAGE, actorname = Details.playername) returns the actor for the requested combat, attribute and actor name. if some parameter are omitted, it uses the default value which are current combat, damage container and the name of the player character. @@ -135,13 +135,13 @@ Combat Object: A Combat object is a table with 4 numerical indexes holding: damage, healing, energy and misc containers. function for combat objects: -actor = combat:GetActor ( attribute, character_name ) or actor = combat ( attribute, character_name ) +actor = combat:GetActor( attribute, character_name ) or actor = combat ( attribute, character_name ) returns an actor object characterList = combat:GetActorList ( attribute ) returns a numeric table with all actors of the specific attribute, contains players, npcs, pets, etc. -combatName = combat:GetCombatName ( try_to_find ) +combatName = combat:GetCombatName( try_to_find ) returns the segment name, e.g. "Trainning Dummy", if try_to_find is true, it searches the combat for a enemy name. bossInfo = combat:GetBossInfo() @@ -235,7 +235,7 @@ returns if Details! is in combat or not. Details:IsInEncounter() returns if Details! is in a raid encounter combat. -damage, healing, energy, misc = Details:GetAllActors (combat, actorname) +damage, healing, energy, misc = Details:GetAllActors(combat, actorname) returns all the four actor objects for the requested combat and actor. combat must be a combat object. @@ -258,7 +258,7 @@ returns a iterated table of actors inside the container. Usage: 'for index, actor in container:ListActors() do' Note: if the container is a spell container, returns pairs() instead: 'for spellid, spelltable in container:ListActors() do' -actor = container:GetActor (character_name) +actor = container:GetActor(character_name) returns the actor, for spell container use the spellid instead. container:GetSpell (spellid) @@ -610,11 +610,11 @@ Examples: 1) Get the player damage, heal, dps and hps: local combat = Details:GetCurrentCombat() -local damageActor = combat:GetActor (DETAILS_ATTRIBUTE_DAMAGE, UnitName ("player")) -local healingActor = combat:GetActor (DETAILS_ATTRIBUTE_HEAL, UnitName ("player")) +local damageActor = combat:GetActor(DETAILS_ATTRIBUTE_DAMAGE, UnitName ("player")) +local healingActor = combat:GetActor(DETAILS_ATTRIBUTE_HEAL, UnitName ("player")) or -local damageActor = Details:GetActor ("current", DETAILS_ATTRIBUTE_DAMAGE, Details.playername) -local healingActor = Details:GetActor ("current", DETAILS_ATTRIBUTE_HEAL, Details.playername) +local damageActor = Details:GetActor("current", DETAILS_ATTRIBUTE_DAMAGE, Details.playername) +local healingActor = Details:GetActor("current", DETAILS_ATTRIBUTE_HEAL, Details.playername) local totalDamage, totalHeal = damageActor.total, healingActor.total @@ -702,13 +702,13 @@ for i, actor in damageContainer:ListActors() do actor.custom = 0 end -local source = damageContainer:GetActor (sourceNpc) +local source = damageContainer:GetActor(sourceNpc) local felfireVolleySpell = source:GetSpell (targetSpell) if (felfireVolleySpell) then for playerName, amount in pairs(felfireVolleySpell.targets) do --players who took damage from this ability --now this result may be placed on a external table or .custom may also be used - local targetActor = damageContainer:GetActor (playerName) + local targetActor = damageContainer:GetActor(playerName) targetActor.custom = amount end end @@ -749,14 +749,14 @@ Details.cache_npc_ids [90409] = npcName --for details! 2 - get the npc actor and its damage_from table. - local actor = damageContainer:GetActor (npcName) + local actor = damageContainer:GetActor(npcName) if (actor) then --reset the custom member on all actors: for i, actor in damageContainer:ListActors() do actor.custom = 0 end for playerName, _ in pairs(actor.damage_from) do - local player = damageContainer:GetActor (playerName) + local player = damageContainer:GetActor(playerName) if (player:IsPlayer()) then --we only want players. pets always has their damage merged on its owner damage. player.custom = actor.targets [npcName] end diff --git a/Libs/DF/addon.lua b/Libs/DF/addon.lua index 9aea39b9..3330f8fe 100644 --- a/Libs/DF/addon.lua +++ b/Libs/DF/addon.lua @@ -78,7 +78,7 @@ end --old create addon function DF:CreateAddOn (name, global_saved, global_table, options_table, broker) - local addon = LibStub ("AceAddon-3.0"):NewAddon (name, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0", "DetailsFramework-1.0", "AceComm-3.0") + local addon = LibStub("AceAddon-3.0"):NewAddon (name, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0", "DetailsFramework-1.0", "AceComm-3.0") _G [name] = addon addon.__name = name @@ -86,17 +86,17 @@ function DF:CreateAddOn (name, global_saved, global_table, options_table, broker if (global_saved) then if (broker and broker.Minimap and not global_table.Minimap) then - DF:Msg (name, "broker.Minimap is true but no global.Minimap declared.") + DF:Msg(name, "broker.Minimap is true but no global.Minimap declared.") end - self.db = LibStub ("AceDB-3.0"):New (global_saved, global_table or {}, true) + self.db = LibStub("AceDB-3.0"):New (global_saved, global_table or {}, true) end if (options_table) then - LibStub ("AceConfig-3.0"):RegisterOptionsTable (name, options_table) - addon.OptionsFrame1 = LibStub ("AceConfigDialog-3.0"):AddToBlizOptions (name, name) + LibStub("AceConfig-3.0"):RegisterOptionsTable (name, options_table) + addon.OptionsFrame1 = LibStub("AceConfigDialog-3.0"):AddToBlizOptions (name, name) - LibStub ("AceConfig-3.0"):RegisterOptionsTable (name .. "-Profiles", LibStub ("AceDBOptions-3.0"):GetOptionsTable (self.db)) - addon.OptionsFrame2 = LibStub ("AceConfigDialog-3.0"):AddToBlizOptions (name .. "-Profiles", "Profiles", name) + LibStub("AceConfig-3.0"):RegisterOptionsTable (name .. "-Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable (self.db)) + addon.OptionsFrame2 = LibStub("AceConfigDialog-3.0"):AddToBlizOptions (name .. "-Profiles", "Profiles", name) end if (broker) then @@ -108,7 +108,7 @@ function DF:CreateAddOn (name, global_saved, global_table, options_table, broker end end - local databroker = LibStub ("LibDataBroker-1.1"):NewDataObject (name, { + local databroker = LibStub("LibDataBroker-1.1"):NewDataObject (name, { type = broker.type or "launcher", icon = broker.icon or [[Interface\PvPRankBadges\PvPRank15]], text = broker.text or "", @@ -117,7 +117,7 @@ function DF:CreateAddOn (name, global_saved, global_table, options_table, broker }) if (databroker and broker.Minimap and global_table.Minimap) then - LibStub ("LibDBIcon-1.0"):Register (name, databroker, addon.db.profile.Minimap) + LibStub("LibDBIcon-1.0"):Register (name, databroker, addon.db.profile.Minimap) end end diff --git a/Libs/DF/auras.lua b/Libs/DF/auras.lua index 86a1aa86..efbca2fb 100644 --- a/Libs/DF/auras.lua +++ b/Libs/DF/auras.lua @@ -54,12 +54,12 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) DF.LoadingAuraAlertFrame:SetSize(340, 75) DF.LoadingAuraAlertFrame:SetPoint("center") DF.LoadingAuraAlertFrame:SetFrameStrata("TOOLTIP") - DF:ApplyStandardBackdrop (DF.LoadingAuraAlertFrame) + DF:ApplyStandardBackdrop(DF.LoadingAuraAlertFrame) 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.IsLoadingImage1 = DF:CreateImage (DF.LoadingAuraAlertFrame, [[Interface\DialogFrame\UI-Dialog-Icon-AlertOther]], 32, 32) + 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" @@ -70,7 +70,7 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName) DF.LoadingAuraAlertFrame:Show() - C_Timer.After (0, function() + C_Timer.After(0, function() if (hashMap and not indexTable) then for i = 1, CONST_MAX_SPELLS do local spellName = GetSpellInfo(i) @@ -204,11 +204,11 @@ local aura_panel_defaultoptions = { function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, texts) - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + 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") f.db = db @@ -260,7 +260,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t 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) + 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) @@ -269,7 +269,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t 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")) + 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) @@ -278,7 +278,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t 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")) + 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) @@ -344,18 +344,18 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --create the background 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) + 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) - DF:ApplyStandardBackdrop (background_add_tracklist) - background_add_tracklist.__background:SetVertexColor (0.27, 0.27, 0.47) + 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) @@ -411,7 +411,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t return spellID end - local add_blacklist_buff_button = self:CreateButton (background_add_blacklist, function() + 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:ClearFocus() @@ -436,9 +436,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t same_name_spells_add (spellId) end - end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", options.button_text_template)) + end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template)) - local add_blacklist_buff_button_id = self:CreateButton (background_add_blacklist, function() + 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:ClearFocus() @@ -467,9 +467,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t same_name_spells_add (spellId) end - 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)) + 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)) - local add_blacklist_debuff_button = self:CreateButton (background_add_blacklist, function() + 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:ClearFocus() @@ -493,9 +493,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --add to spells with the same name cache same_name_spells_add (spellId) end - end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", options.button_text_template)) + end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template)) - local add_blacklist_debuff_button_id = self:CreateButton (background_add_blacklist, function() + 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:ClearFocus() @@ -523,12 +523,12 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --add to spells with the same name cache same_name_spells_add (spellId) end - 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)) + 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)) --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) @@ -542,7 +542,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t 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 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:ClearFocus() @@ -566,9 +566,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --add to spells with the same name cache same_name_spells_add (spellId) end - end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", options.button_text_template)) + end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template)) - local add_tracklist_debuff_button_id = self:CreateButton (background_add_tracklist, function() + 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:ClearFocus() @@ -595,9 +595,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --add to spells with the same name cache same_name_spells_add (spellId) end - 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)) + 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)) - local add_tracklist_buff_button = self:CreateButton (background_add_tracklist, function() + 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:ClearFocus() @@ -623,9 +623,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t same_name_spells_add (spellId) end - end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", options.button_text_template)) + end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template)) - local add_tracklist_buff_button_id = self:CreateButton (background_add_tracklist, function() + 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:ClearFocus() @@ -654,7 +654,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --add to spells with the same name cache same_name_spells_add (spellId) end - 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)) + 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) @@ -697,13 +697,13 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t value = value or self.SpellID if not flag then - GameCooltip2:Preset (2) + GameCooltip2:Preset(2) GameCooltip2:SetOwner(self, "left", "right", 2, 0) GameCooltip2:SetOption("TextSize", 10) local spellName, _, spellIcon = GetSpellInfo(value) if (spellName) then - GameCooltip2:AddLine (spellName .. " (" .. value .. ")") + GameCooltip2:AddLine(spellName .. " (" .. value .. ")") GameCooltip2:AddIcon (spellIcon, 1, 1, 14, 14, .1, .9, .1, .9) end GameCooltip2:Show() @@ -719,14 +719,14 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end if (spellsWithSameName) then - GameCooltip2:Preset (2) + GameCooltip2:Preset(2) GameCooltip2:SetOwner(self, "left", "right", 2, 0) GameCooltip2:SetOption("TextSize", 10) for i, spellID in ipairs(spellsWithSameName) do local spellName, _, spellIcon = GetSpellInfo(spellID) if (spellName) then - GameCooltip2:AddLine (spellName .. " (" .. spellID .. ")") + GameCooltip2:AddLine(spellName .. " (" .. spellID .. ")") GameCooltip2:AddIcon (spellIcon, 1, 1, 14, 14, .1, .9, .1, .9) end end @@ -757,7 +757,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local auraTable = data [index] if (auraTable) then local line = self:GetLine (i) - local spellID, spellName, spellIcon, lowerSpellName, flag = unpack (auraTable) + local spellID, spellName, spellIcon, lowerSpellName, flag = unpack(auraTable) line.SpellID = spellID line.SpellName = spellName @@ -777,16 +777,16 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end local lineOnEnter = function(self) - self:SetBackdropColor(unpack (backdropColor_OnEnter)) + self:SetBackdropColor(unpack(backdropColor_OnEnter)) --GameTooltip:SetOwner(self, "ANCHOR_CURSOR") --GameTooltip:SetSpellByID(self.SpellID) - --GameTooltip:AddLine (" ") + --GameTooltip:AddLine(" ") --GameTooltip:Show() end local lineOnLeave = function(self) - self:SetBackdropColor(unpack (backdropColor)) + self:SetBackdropColor(unpack(backdropColor)) --GameTooltip:Hide() end @@ -810,7 +810,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t line:HookScript ("OnLeave", lineOnLeave) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (backdropColor)) + line:SetBackdropColor(unpack(backdropColor)) local icon = line:CreateTexture("$parentIcon", "overlay") icon:SetSize(lineHeight - 2, lineHeight - 2) @@ -822,7 +822,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t remove_button:SetSize(16, 16) remove_button:SetScript("OnClick", onRemoveClick) remove_button:SetPoint("topright", line, "topright") - remove_button:GetNormalTexture():SetDesaturated (true) + remove_button:GetNormalTexture():SetDesaturated(true) icon:SetPoint("left", line, "left", 2, 0) name:SetPoint("left", icon, "right", 3, 0) @@ -953,18 +953,18 @@ 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)) - local spellid = select (7, GetSpellInfo(self.value)) + self:SetBackdropColor(unpack(backdrop_color_on_enter)) + local spellid = select(7, GetSpellInfo(self.value)) if (spellid) then GameTooltip:SetOwner(self, "ANCHOR_CURSOR") GameTooltip:SetSpellByID(spellid) - GameTooltip:AddLine (" ") + GameTooltip:AddLine(" ") GameTooltip:Show() end end local line_onleave = function(self) - self:SetBackdropColor(unpack (backdrop_color)) + self:SetBackdropColor(unpack(backdrop_color)) GameTooltip:Hide() end @@ -974,7 +974,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t for i = 1, #data do if (data[i] == spell) then - tremove (data, i) + tremove(data, i) break end end @@ -990,7 +990,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t line:SetScript("OnLeave", line_onleave) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (backdrop_color)) + line:SetBackdropColor(unpack(backdrop_color)) local icon = line:CreateTexture("$parentIcon", "overlay") icon:SetSize(scroll_line_height - 2, scroll_line_height - 2) @@ -1001,7 +1001,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t remove_button:SetSize(16, 16) remove_button:SetScript("OnClick", onclick_remove_button) remove_button:SetPoint("topright", line, "topright") - remove_button:GetNormalTexture():SetDesaturated (true) + remove_button:GetNormalTexture():SetDesaturated(true) icon:SetPoint("left", line, "left", 2, 0) name:SetPoint("left", icon, "right", 2, 0) @@ -1053,12 +1053,12 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t f.debuffs_added = debuffs_added local buffs_added_name = DF:CreateLabel(buffs_added, "Buffs", 12, "silver") - buffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + buffs_added_name:SetTemplate(DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) 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") - debuffs_added_name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + debuffs_added_name:SetTemplate(DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) debuffs_added_name:SetPoint("bottomleft", debuffs_added, "topleft", 0, 2) debuffs_added.Title = debuffs_added_name @@ -1076,7 +1076,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t new_buff_entry:SetJustifyH("left") new_debuff_entry:SetJustifyH("left") - local add_buff_button = self:CreateButton (f_manual, function() + local add_buff_button = self:CreateButton(f_manual, function() local text = new_buff_entry.text new_buff_entry:SetText("") @@ -1099,14 +1099,14 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end ]]-- else - print ("spellId not found for spell:", spellName) + print("spellId not found for spell:", spellName) end end else --get the spellId local spellID = get_spellID_from_string (text) if (not spellID) then - print ("spellIs for spell ", text, "not found") + print("spellIs for spell ", text, "not found") return end @@ -1123,9 +1123,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t buffs_added:Refresh() end - end, 100, 20, "Add Buff", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + end, 100, 20, "Add Buff", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) - local add_debuff_button = self:CreateButton (f_manual, function() + local add_debuff_button = self:CreateButton(f_manual, function() local text = new_debuff_entry.text new_debuff_entry:SetText("") new_debuff_entry:ClearFocus() @@ -1146,14 +1146,14 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t end ]]-- else - print ("spellId not found for spell:", spellName) + print("spellId not found for spell:", spellName) end end else --get the spellId local spellID = get_spellID_from_string (text) if (not spellID) then - print ("spellIs for spell ", text, "not found") + print("spellIs for spell ", text, "not found") return end @@ -1171,7 +1171,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t debuffs_added:Refresh() end - end, 100, 20, "Add Debuff", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + 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) @@ -1179,7 +1179,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t 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 export_buff_button = self:CreateButton(f_manual, function() local str = "" for _, spellId in ipairs(f.db.aura_tracker.buff) do local spellName = GetSpellInfo(spellId) @@ -1191,9 +1191,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t export_box:SetFocus (true) export_box:HighlightText() - end, 120, 20, "Export Buffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + end, 120, 20, "Export Buffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) - local export_debuff_button = self:CreateButton (f_manual, function() + local export_debuff_button = self:CreateButton(f_manual, function() local str = "" for _, spellId in ipairs(f.db.aura_tracker.debuff) do local spellName = GetSpellInfo(spellId) @@ -1206,7 +1206,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t export_box:SetFocus (true) export_box:HighlightText() - end, 120, 20, "Export Debuffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + 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) diff --git a/Libs/DF/button.lua b/Libs/DF/button.lua index ae542a74..d80746b9 100644 --- a/Libs/DF/button.lua +++ b/Libs/DF/button.lua @@ -214,7 +214,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --texture local smember_texture = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2, _value3, _value4 = unpack (_value) + local _value1, _value2, _value3, _value4 = unpack(_value) if (_value1) then _object.button:SetNormalTexture(_value1) end @@ -239,10 +239,10 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin) --locked local smember_locked = function(_object, _value) if (_value) then - _object.button:SetMovable (false) + _object.button:SetMovable(false) return rawset(_object, "is_locked", true) else - _object.button:SetMovable (true) + _object.button:SetMovable(true) rawset(_object, "is_locked", false) return end @@ -1010,7 +1010,7 @@ end local setColorPickColor = function(button, ...) local red, green, blue, alpha = DF:ParseColors(...) - button.color_texture:SetVertexColor (red, green, blue, alpha) + button.color_texture:SetVertexColor(red, green, blue, alpha) end local colorpickCancel = function(self) diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index 9e38d139..78fdca6d 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -520,7 +520,7 @@ function DF:CreateCoolTip() statusbar.texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar") statusbar.texture:SetSize(300, 14) statusbar:SetStatusBarTexture (statusbar.texture) - statusbar:SetMinMaxValues (0, 100) + statusbar:SetMinMaxValues(0, 100) statusbar.spark = statusbar:CreateTexture("$parent_Spark", "BACKGROUND") statusbar.spark:Hide() @@ -583,7 +583,7 @@ function DF:CreateCoolTip() statusbar2.texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar") statusbar2.texture:SetSize(300, 14) statusbar2:SetStatusBarTexture (statusbar2.texture) - statusbar2:SetMinMaxValues (0, 100) + statusbar2:SetMinMaxValues(0, 100) --on load self:RegisterForClicks("LeftButtonDown") @@ -869,7 +869,7 @@ function DF:CreateCoolTip() local func = gameCooltip.FunctionsTableMain[self.index] local okay, errortext = pcall(func, gameCooltip.Host, gameCooltip.FixedValue, parameterTable[1], parameterTable[2], parameterTable[3], button) if (not okay) then - print ("Cooltip OnClick Error:", errortext) + print("Cooltip OnClick Error:", errortext) end end end diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index bba23d5b..021cca1a 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -417,14 +417,14 @@ function DF:FadeFrame(frame, t) frame.fading_out = false frame.fading_in = false frame:Show() - frame:SetAlpha (1) + frame:SetAlpha(1) elseif (t == 1) then frame.hidden = true frame.faded = true frame.fading_out = false frame.fading_in = false - frame:SetAlpha (0) + frame:SetAlpha(0) frame:Hide() end end @@ -650,7 +650,7 @@ if (symbol_1K) then elseif (number > 999999) then return format("%.2f", number/10000) .. symbol_10K elseif (number > 99999) then - return floor (number/10000) .. symbol_10K + return floor(number/10000) .. symbol_10K elseif (number > 9999) then return format("%.1f", (number/10000)) .. symbol_10K elseif (number > 999) then @@ -665,7 +665,7 @@ else elseif (number > 999999) then return format("%.2f", number/1000000) .. "M" elseif (number > 99999) then - return floor (number/1000) .. "K" + return floor(number/1000) .. "K" elseif (number > 999) then return format("%.1f", (number/1000)) .. "K" end @@ -2400,7 +2400,7 @@ end error ("Details! Framework: CreateInCombatTexture invalid frame on parameter 1.") end - local in_combat_background = DF:CreateImage (frame) + local in_combat_background = DF:CreateImage(frame) in_combat_background:SetColorTexture (.6, 0, 0, .1) in_combat_background:Hide() @@ -2439,7 +2439,7 @@ end TutorialAlertFrame:Hide() TutorialAlertFrame:SetScript("OnMouseUp", function(self) - if (self.clickfunc and type (self.clickfunc) == "function") then + if (self.clickfunc and type(self.clickfunc) == "function") then self.clickfunc() end self:Hide() @@ -2448,7 +2448,7 @@ end end -- - TutorialAlertFrame.label = type (maintext) == "string" and maintext or type (desctext) == "string" and desctext or "" + TutorialAlertFrame.label = type(maintext) == "string" and maintext or type(desctext) == "string" and desctext or "" MicroButtonAlert_SetText (TutorialAlertFrame, alert.label) -- @@ -2472,7 +2472,7 @@ end elseif (widget.widget_type == "color") then local default_value, g, b, a = widget._get() if (type(default_value) == "table") then - widget:SetColor (unpack (default_value)) + widget:SetColor (unpack(default_value)) else widget:SetColor (default_value, g, b, a) end @@ -2542,8 +2542,8 @@ end end end) - options_frame:SetMovable (true) - options_frame:EnableMouse (true) + options_frame:SetMovable(true) + options_frame:EnableMouse(true) options_frame:SetFrameStrata("DIALOG") options_frame:SetToplevel (true) @@ -2582,8 +2582,8 @@ end end end) - options_frame:SetMovable (true) - options_frame:EnableMouse (true) + options_frame:SetMovable(true) + options_frame:EnableMouse(true) options_frame:SetFrameStrata("DIALOG") options_frame:SetToplevel (true) @@ -2599,7 +2599,7 @@ end 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:SetVertexColor(1, 1, 1, 1) texturetitle:SetPoint("topleft", options_frame, "topleft", 2, -3) texturetitle:SetWidth(36) texturetitle:SetHeight(36) @@ -2612,7 +2612,7 @@ end c:SetWidth(32) c:SetHeight(32) c:SetPoint("TOPRIGHT", options_frame, "TOPRIGHT", -3, -3) - c:SetFrameLevel (options_frame:GetFrameLevel()+1) + c:SetFrameLevel(options_frame:GetFrameLevel()+1) return options_frame end @@ -2800,7 +2800,7 @@ function DF:InstallTemplate (widgetType, templateName, template, parentName) return newTemplate end -function DF:GetTemplate (widget_type, template_name) +function DF:GetTemplate(widget_type, template_name) widget_type = string.lower (widget_type) local template_table @@ -2833,7 +2833,7 @@ function DF:RunHooksForWidget (event, ...) local hooks = self.HookList [event] if (not hooks) then - print (self.widget:GetName(), "no hooks for", event) + print(self.widget:GetName(), "no hooks for", event) return end @@ -2853,7 +2853,7 @@ function DF:SetHook(hookType, func) local isRemoval = false for i = #self.HookList [hookType], 1, -1 do if (self.HookList [hookType] [i] == func) then - tremove (self.HookList [hookType], i) + tremove(self.HookList [hookType], i) isRemoval = true break end @@ -2863,7 +2863,7 @@ function DF:SetHook(hookType, func) end else if (DF.debug) then - print (debugstack()) + print(debugstack()) error ("Details! Framework: invalid function for widget " .. self.WidgetType .. ".") end end @@ -2893,7 +2893,7 @@ function DF:ClearHooks() end function DF:Error (errortext) - print ("|cFFFF2222Details! Framework Error|r:", errortext, self.GetName and self:GetName(), self.WidgetType, debugstack (2, 3, 0)) + print("|cFFFF2222Details! Framework Error|r:", errortext, self.GetName and self:GetName(), self.WidgetType, debugstack (2, 3, 0)) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -2997,7 +2997,7 @@ function DF:OpenInterfaceProfile() end end else - self:Msg ("Couldn't not find the profile panel.") + self:Msg("Couldn't not find the profile panel.") break end end @@ -3109,21 +3109,21 @@ local frameshake_shake_finished = function(parent, shakeObject) --automatic anchoring and reanching needs to the reviwed in the future if (#anchor == 1) then - local anchorTo = unpack (anchor) + local anchorTo = unpack(anchor) parent:ClearAllPoints() parent:SetPoint(anchorTo) elseif (#anchor == 2) then - local anchorTo, point1 = unpack (anchor) + local anchorTo, point1 = unpack(anchor) parent:ClearAllPoints() parent:SetPoint(anchorTo, point1) elseif (#anchor == 3) then - local anchorTo, point1, point2 = unpack (anchor) + local anchorTo, point1, point2 = unpack(anchor) parent:SetPoint(anchorTo, point1, point2) elseif (#anchor == 5) then - local anchorName1, anchorTo, anchorName2, point1, point2 = unpack (anchor) + local anchorName1, anchorTo, anchorName2, point1, point2 = unpack(anchor) parent:SetPoint(anchorName1, anchorTo, anchorName2, point1, point2) end end @@ -3137,7 +3137,7 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) deltaTime = deltaTime or 0 --update time left - shakeObject.TimeLeft = max (shakeObject.TimeLeft - deltaTime, 0) + shakeObject.TimeLeft = max(shakeObject.TimeLeft - deltaTime, 0) if (shakeObject.TimeLeft > 0) then --update fade in and out @@ -3172,13 +3172,13 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) local newX, newY if (shakeObject.AbsoluteSineX) then --absoluting only the sine wave, passing a negative scale will reverse the absolute direction - newX = shakeObject.Amplitude * abs (math.sin (shakeObject.XSineOffset)) * scaleShake * shakeObject.ScaleX + newX = shakeObject.Amplitude * abs(math.sin (shakeObject.XSineOffset)) * scaleShake * shakeObject.ScaleX else newX = shakeObject.Amplitude * math.sin (shakeObject.XSineOffset) * scaleShake * shakeObject.ScaleX end if (shakeObject.AbsoluteSineY) then - newY = shakeObject.Amplitude * abs (math.sin (shakeObject.YSineOffset)) * scaleShake * shakeObject.ScaleY + newY = shakeObject.Amplitude * abs(math.sin (shakeObject.YSineOffset)) * scaleShake * shakeObject.ScaleY else newY = shakeObject.Amplitude * math.sin (shakeObject.YSineOffset) * scaleShake * shakeObject.ScaleY end @@ -3188,13 +3188,13 @@ frameshake_do_update = function(parent, shakeObject, deltaTime) local anchor = shakeObject.Anchors [i] if (#anchor == 1 or #anchor == 3) then - local anchorTo, point1, point2 = unpack (anchor) + local anchorTo, point1, point2 = unpack(anchor) point1 = point1 or 0 point2 = point2 or 0 parent:SetPoint(anchorTo, point1 + newX, point2 + newY) elseif (#anchor == 5) then - local anchorName1, anchorTo, anchorName2, point1, point2 = unpack (anchor) + local anchorName1, anchorTo, anchorName2, point1, point2 = unpack(anchor) --parent:ClearAllPoints() parent:SetPoint(anchorName1, anchorTo, anchorName2, point1 + newX, point2 + newY) @@ -3390,7 +3390,7 @@ end local glow_overlay_setcolor = function(self, antsColor, glowColor) if (antsColor) then local r, g, b, a = DF:ParseColors(antsColor) - self.ants:SetVertexColor (r, g, b, a) + self.ants:SetVertexColor(r, g, b, a) self.AntsColor.r = r self.AntsColor.g = g self.AntsColor.b = b @@ -3399,7 +3399,7 @@ local glow_overlay_setcolor = function(self, antsColor, glowColor) if (glowColor) then local r, g, b, a = DF:ParseColors(glowColor) - self.outerGlow:SetVertexColor (r, g, b, a) + self.outerGlow:SetVertexColor(r, g, b, a) self.GlowColor.r = r self.GlowColor.g = g self.GlowColor.b = b @@ -3438,11 +3438,11 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor) parent.overlay:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", frameWidth * 0.32, -frameHeight * 0.36) local r, g, b, a = DF:ParseColors(antsColor or defaultColor) - glowFrame.ants:SetVertexColor (r, g, b, a) + glowFrame.ants:SetVertexColor(r, g, b, a) glowFrame.AntsColor = {r, g, b, a} local r, g, b, a = DF:ParseColors(glowColor or defaultColor) - glowFrame.outerGlow:SetVertexColor (r, g, b, a) + glowFrame.outerGlow:SetVertexColor(r, g, b, a) glowFrame.GlowColor = {r, g, b, a} glowFrame.outerGlow:SetScale(1.2) @@ -3478,7 +3478,7 @@ function DF:CreateAnts (parent, antTable, leftOffset, rightOffset, topOffset, bo t:SetAllPoints() t:SetTexture(antTable.Texture) t:SetBlendMode(antTable.BlendMode or "ADD") - t:SetVertexColor (DF:ParseColors(antTable.Color or "white")) + t:SetVertexColor(DF:ParseColors(antTable.Color or "white")) f.Texture = t f.AntTable = antTable @@ -3509,13 +3509,13 @@ local SetBorderAlpha = function(self, alpha1, alpha2, alpha3) self.Borders.Alpha3 = alpha3 or self.Borders.Alpha3 for _, texture in ipairs(self.Borders.Layer1) do - texture:SetAlpha (self.Borders.Alpha1) + texture:SetAlpha(self.Borders.Alpha1) end for _, texture in ipairs(self.Borders.Layer2) do - texture:SetAlpha (self.Borders.Alpha2) + texture:SetAlpha(self.Borders.Alpha2) end for _, texture in ipairs(self.Borders.Layer3) do - texture:SetAlpha (self.Borders.Alpha3) + texture:SetAlpha(self.Borders.Alpha3) end end @@ -3981,7 +3981,7 @@ function DF:GetClassSpecIDs (class) end local dispatch_error = function(context, errortext) - DF:Msg ( (context or "") .. " |cFFFF9900error|r: " .. (errortext or "")) + DF:Msg( (context or "") .. " |cFFFF9900error|r: " .. (errortext or "")) end --safe call an external func with payload and without telling who is calling @@ -4045,7 +4045,7 @@ function DF:CoreDispatch (context, func, ...) end ---/run local a, b =32,3; local f=function(c,d) return c+d, 2, 3;end; print (xpcall(f,geterrorhandler(),a,b)) +--/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 T = GetTime() @@ -4055,7 +4055,7 @@ function DF_CALC_PERFORMANCE() J = true return end - print ("Elapsed Time:", deltaTime) + print("Elapsed Time:", deltaTime) F:SetScript("OnUpdate", nil) end) end @@ -4339,7 +4339,7 @@ DF.CLEncounterID = { } function DF:GetPlayerRole() - local assignedRole = DF.UnitGroupRolesAssigned ("player") + local assignedRole = DF.UnitGroupRolesAssigned("player") if (assignedRole == "NONE") then local spec = DF.GetSpecialization() return spec and DF.GetSpecializationRole (spec) or "NONE" @@ -4663,7 +4663,7 @@ end local func = DF.RegisteredScriptsComm [ID] if (func) then DF:MakeFunctionSecure(func) - DF:Dispatch (func, commSource, select (5, unpack (data))) --this use xpcall + DF:Dispatch (func, commSource, select(5, unpack(data))) --this use xpcall end end end @@ -4685,7 +4685,7 @@ end function DF:SendScriptComm (ID, ...) if (DF.RegisteredScriptsComm [ID]) then local sourceName = UnitName ("player") .. "-" .. GetRealmName() - local data = LibAceSerializer:Serialize (ID, UnitGUID ("player"), sourceName, ...) + local data = LibAceSerializer:Serialize (ID, UnitGUID("player"), sourceName, ...) data = LibDeflate:CompressDeflate (data, {level = 9}) data = LibDeflate:EncodeForWoWAddonChannel (data) aceComm:SendCommMessage ("_GSC", data, "PARTY") @@ -4704,7 +4704,7 @@ DF.DebugMixin = { debug = true, CheckPoint = function(self, checkPointName, ...) - print (self:GetName(), checkPointName, ...) + print(self:GetName(), checkPointName, ...) end, CheckVisibilityState = function(self, widget) @@ -4712,12 +4712,12 @@ DF.DebugMixin = { self = widget or self local width, height = self:GetSize() - width = floor (width) - height = floor (height) + width = floor(width) + height = floor(height) local numPoints = self:GetNumPoints() - print ("shown:", self:IsShown(), "visible:", self:IsVisible(), "alpha:", self:GetAlpha(), "size:", width, height, "points:", numPoints) + print("shown:", self:IsShown(), "visible:", self:IsVisible(), "alpha:", self:GetAlpha(), "size:", width, height, "points:", numPoints) end, CheckStack = function(self) diff --git a/Libs/DF/help.lua b/Libs/DF/help.lua index 6b95c797..0c688acc 100644 --- a/Libs/DF/help.lua +++ b/Libs/DF/help.lua @@ -52,7 +52,7 @@ end 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") + print("Invalid parameter for SetPoint") return end return self.widget:SetPoint(v1, v2, v3, v4, v5) @@ -116,7 +116,7 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam help:ShowHelp() end) - setmetatable (help, HelpMetaFunctions) + setmetatable(help, HelpMetaFunctions) return help diff --git a/Libs/DF/math.lua b/Libs/DF/math.lua index 42e86424..671d7a8f 100644 --- a/Libs/DF/math.lua +++ b/Libs/DF/math.lua @@ -39,7 +39,7 @@ function DF:FindLookAtRotation (x1, y1, x2, y2) end --find the value scale between two given values. e.g: value of 500 in a range 0-100 result in 10 in a scale for 0-10 -function DF:MapRangeClamped (inputX, inputY, outputX, outputY, value) +function DF:MapRangeClamped(inputX, inputY, outputX, outputY, value) return DF:GetRangeValue (outputX, outputY, Clamp (DF:GetRangePercent (inputX, inputY, value), 0, 1)) end @@ -93,13 +93,13 @@ end --check if a number is near another number by a tolerance function DF:IsNearlyEqual (value1, value2, tolerance) tolerance = tolerance or SMALL_FLOAT - return abs (value1 - value2) <= tolerance + return abs(value1 - value2) <= tolerance end --check if a number is near zero function DF:IsNearlyZero (value, tolerance) tolerance = tolerance or SMALL_FLOAT - return abs (value) <= tolerance + return abs(value) <= tolerance end --check if a number is within a two other numbers, if isInclusive is true, it'll include the max value diff --git a/Libs/DF/normal_bar.lua b/Libs/DF/normal_bar.lua index 9822a24d..4678cdf5 100644 --- a/Libs/DF/normal_bar.lua +++ b/Libs/DF/normal_bar.lua @@ -9,7 +9,7 @@ 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 type = type --lua locals local _math_floor = math.floor --lua locals local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") @@ -58,7 +58,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] 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) @@ -70,7 +70,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] 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) @@ -229,24 +229,24 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) _object._texture.original_colors = {_value1, _value2, _value3, _value4} - _object.timer_texture:SetVertexColor (_value1, _value2, _value3, _value4) + _object.timer_texture:SetVertexColor(_value1, _value2, _value3, _value4) - _object.timer_textureR:SetVertexColor (_value1, _value2, _value3, _value4) + _object.timer_textureR:SetVertexColor(_value1, _value2, _value3, _value4) - return _object._texture:SetVertexColor (_value1, _value2, _value3, _value4) + return _object._texture:SetVertexColor(_value1, _value2, _value3, _value4) end --background color local smember_backgroundcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) - return _object.background:SetVertexColor (_value1, _value2, _value3, _value4) + return _object.background:SetVertexColor(_value1, _value2, _value3, _value4) end --icon local smember_icon = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2 = _unpack (_value) + local _value1, _value2 = _unpack(_value) _object._icon:SetTexture(_value1) if (_value2) then - _object._icon:SetTexCoord (_unpack (_value2)) + _object._icon:SetTexCoord (_unpack(_value2)) end else _object._icon:SetTexture(_value) @@ -256,14 +256,14 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] --texture local smember_texture = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2 = _unpack (_value) + local _value1, _value2 = _unpack(_value) _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)) - _object.timer_textureR:SetTexCoord (_unpack (_value2)) + _object._texture:SetTexCoord (_unpack(_value2)) + _object.timer_texture:SetTexCoord (_unpack(_value2)) + _object.timer_textureR:SetTexCoord (_unpack(_value2)) end else if (_value:find ("\\")) then @@ -320,7 +320,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] end --alpha local smember_alpha= function(_object, _value) - return _object:SetAlpha (_value) + return _object:SetAlpha(_value) end BarMetaFunctions.SetMembers = BarMetaFunctions.SetMembers or {} @@ -387,7 +387,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] 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") + print("Invalid parameter for SetPoint") return end return self.widget:SetPoint(v1, v2, v3, v4, v5) @@ -420,7 +420,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] function BarMetaFunctions:SetColor (r, g, b, a) r, g, b, a = DF:ParseColors(r, g, b, a) - self._texture:SetVertexColor (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 @@ -429,7 +429,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] function BarMetaFunctions:SetIcon (texture, ...) self._icon:SetTexture(texture) if (...) then - local L, R, U, D = _unpack (...) + local L, R, U, D = _unpack(...) self._icon:SetTexCoord (L, R, U, D) end end @@ -459,12 +459,12 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] function BarMetaFunctions:GetFrameLevel() return self.statusbar:GetFrameLevel() end - function BarMetaFunctions:SetFrameLevel (level, frame) + function BarMetaFunctions:SetFrameLevel(level, frame) if (not frame) then - return self.statusbar:SetFrameLevel (level) + return self.statusbar:SetFrameLevel(level) else local framelevel = frame:GetFrameLevel (frame) + level - return self.statusbar:SetFrameLevel (framelevel) + return self.statusbar:SetFrameLevel(framelevel) end end @@ -473,7 +473,7 @@ 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) @@ -499,7 +499,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] if (frame.MyObject.have_tooltip) then GameCooltip2:Reset() - GameCooltip2:AddLine (frame.MyObject.have_tooltip) + GameCooltip2:AddLine(frame.MyObject.have_tooltip) GameCooltip2:ShowCooltip(frame, "tooltip") end @@ -585,7 +585,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] return end if (self.TimerScheduled) then - DF:CancelTimer (self.TimerScheduled) + DF:CancelTimer(self.TimerScheduled) self.TimerScheduled = nil else if (self.statusbar:GetScript("OnUpdate")) then @@ -604,12 +604,12 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] local OnUpdate = function(self, elapsed) --percent of elapsed - local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo + local pct = abs(self.end_timer - GetTime() - self.tempo) / self.tempo if (self.inverse) then 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 @@ -673,7 +673,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]] self.timer = true self.HasTimer = true - self.TimerScheduled = DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self) + self.TimerScheduled = DF:ScheduleTimer("StartTimeBarAnimation", 0.1, self) end function DF:StartTimeBarAnimation (timebar) @@ -699,7 +699,7 @@ local build_statusbar = function(self) self.background:Hide() self.background:SetAllPoints() self.background:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) - self.background:SetVertexColor (.3, .3, .3, .3) + self.background:SetVertexColor(.3, .3, .3, .3) self.timertexture = self:CreateTexture("$parent_timerTexture", "ARTWORK") self.timertexture:Hide() @@ -818,8 +818,8 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) BarObject.statusbar:SetHeight(h) BarObject.statusbar:SetWidth(w) - BarObject.statusbar:SetFrameLevel (parent:GetFrameLevel()+1) - BarObject.statusbar:SetMinMaxValues (0, 100) + BarObject.statusbar:SetFrameLevel(parent:GetFrameLevel()+1) + BarObject.statusbar:SetMinMaxValues(0, 100) BarObject.statusbar:SetValue(value or 50) BarObject.statusbar.MyObject = BarObject @@ -857,7 +857,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name) BarObject.statusbar:SetScript("OnMouseUp", OnMouseUp) --set class - _setmetatable (BarObject, BarMetaFunctions) + _setmetatable(BarObject, BarMetaFunctions) --set texture if (texture_name) then diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 0970bccb..30fc9d88 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -10,7 +10,7 @@ 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 type = type --lua local local _math_floor = math.floor --lua local local loadstring = loadstring --lua local @@ -305,10 +305,10 @@ DF.LayoutFrame = { --locked local smember_locked = function(_object, _value) if (_value) then - _object.frame:SetMovable (false) + _object.frame:SetMovable(false) return _rawset (_object, "is_locked", true) else - _object.frame:SetMovable (true) + _object.frame:SetMovable(true) _rawset (_object, "is_locked", false) return end @@ -387,7 +387,7 @@ DF.LayoutFrame = { 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") + print("Invalid parameter for SetPoint") return end return self.widget:SetPoint(v1, v2, v3, v4, v5) @@ -415,10 +415,10 @@ DF.LayoutFrame = { -- backdrop function PanelMetaFunctions:SetBackdrop(background, edge, tilesize, edgesize, tile, left, right, top, bottom) - if (_type(background) == "boolean" and not background) then + if (type(background) == "boolean" and not background) then return self.frame:SetBackdrop(nil) - elseif (_type(background) == "table") then + elseif (type(background) == "table") then self.frame:SetBackdrop(background) else @@ -471,12 +471,12 @@ DF.LayoutFrame = { function PanelMetaFunctions:GetFrameLevel() return self.widget:GetFrameLevel() end - function PanelMetaFunctions:SetFrameLevel (level, frame) + function PanelMetaFunctions:SetFrameLevel(level, frame) if (not frame) then - return self.widget:SetFrameLevel (level) + return self.widget:SetFrameLevel(level) else local framelevel = frame:GetFrameLevel (frame) + level - return self.widget:SetFrameLevel (framelevel) + return self.widget:SetFrameLevel(framelevel) end end @@ -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) @@ -506,7 +506,7 @@ DF.LayoutFrame = { GameCooltip2:Reset() GameCooltip2:SetType ("tooltip") GameCooltip2:SetColor ("main", "transparent") - GameCooltip2:AddLine (frame.MyObject.have_tooltip) + GameCooltip2:AddLine(frame.MyObject.have_tooltip) GameCooltip2:SetOwner(frame) GameCooltip2:ShowCooltip() end @@ -591,10 +591,10 @@ DF.LayoutFrame = { ------------------------------------------------------------------------------------------------------------ --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) + return DF:NewPanel(parent, parent, name, member, w, h, backdrop, backdropcolor, bordercolor) end -function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropcolor, bordercolor) +function DF:NewPanel(parent, container, name, member, w, h, backdrop, backdropcolor, bordercolor) if (not name) then name = "DetailsFrameworkPanelNumber" .. DF.PanelCounter @@ -675,11 +675,11 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc PanelObject.frame:SetScript("OnMouseDown", OnMouseDown) PanelObject.frame:SetScript("OnMouseUp", OnMouseUp) - _setmetatable (PanelObject, PanelMetaFunctions) + _setmetatable(PanelObject, PanelMetaFunctions) if (backdrop) then PanelObject:SetBackdrop(backdrop) - elseif (_type(backdrop) == "boolean") then + elseif (type(backdrop) == "boolean") then PanelObject.frame:SetBackdrop(nil) end @@ -712,7 +712,7 @@ end local add_row = function(self, t, need_update) local index = #self.rows+1 - local thisrow = DF:NewPanel (self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20) + local thisrow = DF:NewPanel(self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20) thisrow.backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]} thisrow.color = {.3, .3, .3, .9} thisrow.type = t.type @@ -749,7 +749,7 @@ local align_rows = function(self) end local cur_width = 1 - local row_width = self._width / max (rows_shown, 0.0001) + local row_width = self._width / max(rows_shown, 0.0001) local sindex = 1 @@ -776,15 +776,15 @@ local align_rows = function(self) row:Show() - local type = row.type + local rowType = row.type - if (type == "text") then + if (rowType == "text") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local text = tremove (line.text_available) + local text = tremove(line.text_available) if (not text) then self:CreateRowText (line) - text = tremove (line.text_available) + text = tremove(line.text_available) end tinsert(line.text_inuse, text) text:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) @@ -793,13 +793,13 @@ local align_rows = function(self) DF:SetFontSize (text, row.textsize or 10) text:SetJustifyH(row.textalign or "left") end - elseif (type == "entry") then + elseif (rowType == "entry") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local entry = tremove (line.entry_available) + local entry = tremove(line.entry_available) if (not entry) then self:CreateRowEntry (line) - entry = tremove (line.entry_available) + entry = tremove(line.entry_available) end tinsert(line.entry_inuse, entry) entry:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) @@ -821,13 +821,13 @@ local align_rows = function(self) end end - elseif (type == "checkbox") then + elseif (rowType == "checkbox") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local checkbox = tremove (line.checkbox_available) + local checkbox = tremove(line.checkbox_available) if (not checkbox) then self:CreateCheckbox (line) - checkbox = tremove (line.checkbox_available) + checkbox = tremove(line.checkbox_available) end tinsert(line.checkbox_inuse, checkbox) @@ -844,13 +844,13 @@ local align_rows = function(self) checkbox.onleave_func = nil end - elseif (type == "button") then + elseif (rowType == "button") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local button = tremove (line.button_available) + local button = tremove(line.button_available) if (not button) then self:CreateRowButton (line) - button = tremove (line.button_available) + button = tremove(line.button_available) end tinsert(line.button_inuse, button) button:SetPoint("left", line, "left", self._anchors [#self._anchors], 0) @@ -890,26 +890,26 @@ local align_rows = function(self) end end - elseif (type == "icon") then + elseif (rowType == "icon") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local icon = tremove (line.icon_available) + local icon = tremove(line.icon_available) if (not icon) then self:CreateRowIcon (line) - icon = tremove (line.icon_available) + 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.func = row.func end - elseif (type == "texture") then + elseif (rowType == "texture") then for i = 1, #self.scrollframe.lines do local line = self.scrollframe.lines [i] - local texture = tremove (line.texture_available) + local texture = tremove(line.texture_available) if (not texture) then self:CreateRowTexture (line) - texture = tremove (line.texture_available) + 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) @@ -974,42 +974,42 @@ local update_rows = function(self, updated_rows) 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)) + tinsert(row.text_available, tremove(row.text_inuse, i)) end for i = 1, #row.text_available do row.text_available[i]:Hide() end for i = #row.entry_inuse, 1, -1 do - tinsert(row.entry_available, tremove (row.entry_inuse, i)) + tinsert(row.entry_available, tremove(row.entry_inuse, i)) end for i = 1, #row.entry_available do row.entry_available[i]:Hide() end for i = #row.button_inuse, 1, -1 do - tinsert(row.button_available, tremove (row.button_inuse, i)) + tinsert(row.button_available, tremove(row.button_inuse, i)) end for i = 1, #row.button_available do row.button_available[i]:Hide() end for i = #row.checkbox_inuse, 1, -1 do - tinsert(row.checkbox_available, tremove (row.checkbox_inuse, i)) + tinsert(row.checkbox_available, tremove(row.checkbox_inuse, i)) end for i = 1, #row.checkbox_available do row.checkbox_available[i]:Hide() end for i = #row.icon_inuse, 1, -1 do - tinsert(row.icon_available, tremove (row.icon_inuse, i)) + tinsert(row.icon_available, tremove(row.icon_inuse, i)) end for i = 1, #row.icon_available do row.icon_available[i]:Hide() end for i = #row.texture_inuse, 1, -1 do - tinsert(row.texture_available, tremove (row.texture_inuse, i)) + tinsert(row.texture_available, tremove(row.texture_inuse, i)) end for i = 1, #row.texture_available do row.texture_available[i]:Hide() @@ -1030,7 +1030,7 @@ end local create_panel_entry = function(self, row) row.entry_total = row.entry_total + 1 - local editbox = DF:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20) + local editbox = DF:NewTextEntry(row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20) editbox.align = "left" editbox:SetHook("OnEnterPressed", function() @@ -1053,7 +1053,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:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) editbox:SetBackdropColor(.2, .2, .2, 0.7) tinsert(row.entry_available, editbox) @@ -1065,7 +1065,7 @@ local create_panel_checkbox = function(self, row) local switch = DF:NewSwitch (row, nil, "$parentCheckBox" .. row.checkbox_total, nil, 20, 20, nil, nil, false) switch:SetAsCheckBox() - switch:SetTemplate(DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + switch:SetTemplate(DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) tinsert(row.checkbox_available, switch) end @@ -1395,7 +1395,7 @@ function DF:NewFillPanel(parent, rows, name, member, w, h, total_lines, fill_row --create lines function panel:UpdateRowAmount() local size = options.rowheight - local amount = math.floor (((panel._height-21) / size)) + 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") @@ -1454,7 +1454,7 @@ local color_pick_func = function() ColorPickerFrame:dcallback (r, g, b, a, ColorPickerFrame.dframe) end local color_pick_func_cancel = function() - ColorPickerFrame:SetColorRGB (unpack (ColorPickerFrame.previousValues)) + ColorPickerFrame:SetColorRGB (unpack(ColorPickerFrame.previousValues)) local r, g, b = ColorPickerFrame:GetColorRGB() local a = OpacitySliderFrame:GetValue() ColorPickerFrame:dcallback (r, g, b, a, ColorPickerFrame.dframe) @@ -1497,15 +1497,15 @@ function DF:IconPick (callback, close_when_select, param1, param2) DF.IconPickFrame:SetPoint("center", UIParent, "center") DF.IconPickFrame:SetWidth(416) DF.IconPickFrame:SetHeight(350) - DF.IconPickFrame:EnableMouse (true) - DF.IconPickFrame:SetMovable (true) + 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:SetFrameLevel (5000) + DF.IconPickFrame:SetFrameLevel(5000) DF.IconPickFrame:SetScript("OnMouseDown", function(self) if (not self.isMoving) then @@ -1526,7 +1526,7 @@ function DF:IconPick (callback, close_when_select, param1, param2) DF.IconPickFrame.preview = CreateFrame("frame", nil, UIParent, "BackdropTemplate") DF.IconPickFrame.preview:SetFrameStrata("tooltip") - DF.IconPickFrame.preview:SetFrameLevel (6001) + DF.IconPickFrame.preview:SetFrameLevel(6001) DF.IconPickFrame.preview:SetSize(76, 76) local preview_image_bg = DF:NewImage (DF.IconPickFrame.preview, nil, 76, 76) @@ -1543,12 +1543,12 @@ function DF:IconPick (callback, close_when_select, param1, param2) --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:SetTemplate (DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + 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 = DF:NewTextEntry(DF.IconPickFrame, nil, "$parentSearchBox", nil, 140, 20) DF.IconPickFrame.search:SetPoint("left", DF.IconPickFrame.searchLabel, "right", 2, 0) - DF.IconPickFrame.search:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + DF.IconPickFrame.search:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) DF.IconPickFrame.search:SetHook("OnTextChanged", function() DF.IconPickFrame.searching = DF.IconPickFrame.search:GetText() @@ -1565,11 +1565,11 @@ 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 = 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 = 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:SetHook("OnTextChanged", function() @@ -1589,8 +1589,8 @@ function DF:IconPick (callback, close_when_select, param1, param2) 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 + close_button:SetFrameLevel(close_button:GetFrameLevel()+2) + close_button:SetAlpha(0) --just hide, it is used below --accept custom icon button local accept_custom_icon = function() @@ -1603,7 +1603,7 @@ function DF:IconPick (callback, close_when_select, param1, param2) end 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 = 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) --fill with icons @@ -1893,7 +1893,7 @@ local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1} --with_label was making the frame stay in place while its parent moves --the slider was anchoring to with_label and here here were anchoring the slider again function DF:CreateScaleBar(frame, config) --~scale - local scaleBar, text = DF:CreateSlider(frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local scaleBar, text = DF:CreateSlider(frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")) scaleBar.thumb:SetWidth(24) scaleBar:SetValueStep(0.1) scaleBar:SetObeyStepOnDrag(true) @@ -1978,7 +1978,7 @@ function DF:CreateScaleBar(frame, config) --~scale end local no_options = {} -function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) +function DF:CreateSimplePanel(parent, w, h, title, name, panel_options, db) if (db and name and not db [name]) then db [name] = {scale = 1} @@ -1999,10 +1999,10 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) f:SetPoint("center", UIParent, "center", 0, 0) f:SetFrameStrata("FULLSCREEN") f:EnableMouse() - f:SetMovable (true) + f:SetMovable(true) f:SetBackdrop(SimplePanel_frame_backdrop) - f:SetBackdropColor(unpack (SimplePanel_frame_backdrop_color)) - f:SetBackdropBorderColor(unpack (SimplePanel_frame_backdrop_border_color)) + f:SetBackdropColor(unpack(SimplePanel_frame_backdrop_color)) + f:SetBackdropBorderColor(unpack(SimplePanel_frame_backdrop_border_color)) f.DontRightClickClose = panel_options.DontRightClickClose @@ -2020,7 +2020,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) f.TitleBar = title_bar local close = CreateFrame("button", name and name .. "CloseButton", title_bar) - close:SetFrameLevel (DF.FRAMELEVEL_OVERLAY) + close:SetFrameLevel(DF.FRAMELEVEL_OVERLAY) close:SetSize(16, 16) close:SetNormalTexture([[Interface\GLUES\LOGIN\Glues-CheckBox-Check]]) @@ -2030,7 +2030,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db) close:GetHighlightTexture():SetDesaturated(true) close:GetPushedTexture():SetDesaturated(true) - close:SetAlpha (0.7) + close:SetAlpha(0.7) close:SetScript("OnClick", simple_panel_close_click) f.Close = close @@ -2068,8 +2068,8 @@ end local Panel1PxOnToggleLock = function(self) if (self.IsLocked) then self.IsLocked = false - self:SetMovable (true) - self:EnableMouse (true) + self:SetMovable(true) + self:EnableMouse(true) self.Lock:GetNormalTexture():SetTexCoord (16/64, 32/64, 0, 1) self.Lock:GetHighlightTexture():SetTexCoord (16/32, 32/64, 0, 1) self.Lock:GetPushedTexture():SetTexCoord (16/64, 32/64, 0, 1) @@ -2081,8 +2081,8 @@ local Panel1PxOnToggleLock = function(self) end else self.IsLocked = true - self:SetMovable (false) - self:EnableMouse (false) + self:SetMovable(false) + self:EnableMouse(false) self.Lock:GetNormalTexture():SetTexCoord (0/64, 16/64, 0, 1) self.Lock:GetHighlightTexture():SetTexCoord (0/64, 16/64, 0, 1) self.Lock:GetPushedTexture():SetTexCoord (0/64, 16/64, 0, 1) @@ -2132,7 +2132,7 @@ end function DF:SavePositionOnScreen (frame) if (frame.db and frame.db.position) then local x, y = DF:GetPositionOnScreen (frame) - --print ("saving...", x, y, frame:GetName()) + --print("saving...", x, y, frame:GetName()) if (x and y) then frame.db.position.x, frame.db.position.y = x, y end @@ -2190,12 +2190,12 @@ function DF:Create1PxPanel(parent, w, h, title, name, config, title_anchor, no_s f:SetBackdropColor(0, 0, 0, 0.5) f.IsLocked = (config and config.IsLocked ~= nil and config.IsLocked) or false - f:SetMovable (true) - f:EnableMouse (true) + f:SetMovable(true) + f:EnableMouse(true) f:SetUserPlaced (true) f.db = config - --print (config.position.x, config.position.x) + --print(config.position.x, config.position.x) Panel1PxReadConfig (f) local close = CreateFrame("button", name and name .. "CloseButton", f, "BackdropTemplate") @@ -2206,7 +2206,7 @@ function DF:Create1PxPanel(parent, w, h, title, name, config, title_anchor, no_s close:GetNormalTexture():SetDesaturated(true) close:GetHighlightTexture():SetDesaturated(true) close:GetPushedTexture():SetDesaturated(true) - close:SetAlpha (0.7) + close:SetAlpha(0.7) local lock = CreateFrame("button", name and name .. "LockButton", f, "BackdropTemplate") lock:SetSize(16, 16) @@ -2222,7 +2222,7 @@ function DF:Create1PxPanel(parent, w, h, title, name, config, title_anchor, no_s --lock:GetNormalTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) --lock:GetHighlightTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) --lock:GetPushedTexture():SetTexCoord(73/256, 105/256, 64/128, 110/) - lock:SetAlpha (0.7) + lock:SetAlpha(0.7) close:SetPoint("topright", f, "topright", -3, -3) lock:SetPoint("right", close, "left", 3, 0) @@ -2273,21 +2273,21 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) tinsert(UISpecialFrames, "DetailsFrameworkPromptSimple") DF:CreateTitleBar (f, "Prompt!") - DF:ApplyStandardBackdrop (f) + DF:ApplyStandardBackdrop(f) local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal") 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_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) + 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) f.button_true = button_true - local button_false = DF:CreateButton (f, nil, 60, 20, "No", nil, nil, nil, nil, nil, nil, options_dropdown_template) + 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) f.button_false = button_false @@ -2296,7 +2296,7 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) if (my_func) then local okey, errormessage = pcall (my_func, true) if (not okey) then - print ("error:", errormessage) + print("error:", errormessage) end f:Hide() end @@ -2307,7 +2307,7 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) if (my_func) then local okey, errormessage = pcall (my_func, true) if (not okey) then - print ("error:", errormessage) + print("error:", errormessage) end f:Hide() end @@ -2335,7 +2335,7 @@ function DF:ShowPromptPanel (message, func_true, func_false, no_repeated, width) 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 @@ -2368,8 +2368,8 @@ function DF:ShowTextPromptPanel (message, callback) f:SetSize(400, 120) f:SetFrameStrata("FULLSCREEN") f:SetPoint("center", UIParent, "center", 0, 100) - f:EnableMouse (true) - f:SetMovable (true) + f:EnableMouse(true) + f:SetMovable(true) f:RegisterForDrag ("LeftButton") f:SetScript("OnDragStart", function() f:StartMoving() end) f:SetScript("OnDragStop", function() f:StopMovingOrSizing() end) @@ -2377,7 +2377,7 @@ function DF:ShowTextPromptPanel (message, callback) tinsert(UISpecialFrames, "DetailsFrameworkPrompt") DF:CreateTitleBar (f, "Prompt!") - DF:ApplyStandardBackdrop (f) + DF:ApplyStandardBackdrop(f) local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal") prompt:SetPoint("top", f, "top", 0, -25) @@ -2385,18 +2385,18 @@ function DF:ShowTextPromptPanel (message, callback) 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 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) f.EntryBox = textbox - local button_true = DF:CreateButton (f, nil, 60, 20, "Okey", nil, nil, nil, nil, nil, nil, options_dropdown_template) + 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) 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) + 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) f.button_false = button_false @@ -2406,7 +2406,7 @@ function DF:ShowTextPromptPanel (message, callback) local okey, errormessage = pcall (my_func, textbox:GetText()) textbox:ClearFocus() if (not okey) then - print ("error:", errormessage) + print("error:", errormessage) end f:Hide() end @@ -2445,12 +2445,12 @@ function DF:CreateOptionsButton (parent, callback, name) b:GetNormalTexture():SetDesaturated(true) b:GetHighlightTexture():SetDesaturated(true) b:GetPushedTexture():SetDesaturated(true) - b:SetAlpha (0.7) + b:SetAlpha(0.7) b:SetScript("OnClick", callback) b:SetScript("OnEnter", function(self) GameCooltip2:Reset() - GameCooltip2:AddLine ("Options") + GameCooltip2:AddLine("Options") GameCooltip2:ShowCooltip(self, "tooltip") end) b:SetScript("OnLeave", function(self) @@ -2470,7 +2470,7 @@ function DF:CreateFeedbackButton (parent, callback, name) b:SetScript("OnClick", callback) b:SetScript("OnEnter", function(self) GameCooltip2:Reset() - GameCooltip2:AddLine ("Send Feedback") + GameCooltip2:AddLine("Send Feedback") GameCooltip2:ShowCooltip(self, "tooltip") end) b:SetScript("OnLeave", function(self) @@ -2525,7 +2525,7 @@ local on_click_feedback = function(self) feedback_link_textbox:HighlightText() feedback_link_textbox:SetFocus() - feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) + feedback_link_textbox:SetFrameLevel(self:GetFrameLevel()+2) end local feedback_get_fb_line = function(self) @@ -2595,15 +2595,15 @@ local on_click_feedback = function(self) feedback_link_textbox:HighlightText() feedback_link_textbox:SetFocus() - feedback_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) + feedback_link_textbox:SetFrameLevel(self:GetFrameLevel()+2) end local on_enter_addon = function(self) if (self.tooltip) then - GameCooltip2:Preset (2) - GameCooltip2:AddLine ("|cFFFFFF00" .. self.name .. "|r") - GameCooltip2:AddLine ("") - GameCooltip2:AddLine (self.tooltip) + GameCooltip2:Preset(2) + GameCooltip2:AddLine("|cFFFFFF00" .. self.name .. "|r") + GameCooltip2:AddLine("") + GameCooltip2:AddLine(self.tooltip) GameCooltip2:ShowCooltip(self, "tooltip") end self.icon:SetBlendMode("ADD") @@ -2646,7 +2646,7 @@ local on_click_addon = function(self) addon_link_textbox:HighlightText() addon_link_textbox:SetFocus() - addon_link_textbox:SetFrameLevel (self:GetFrameLevel()+2) + addon_link_textbox:SetFrameLevel(self:GetFrameLevel()+2) end local feedback_get_addons_line = function(self) @@ -2659,7 +2659,7 @@ local feedback_get_addons_line = function(self) if (self.next_addons == 1) then 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] @@ -2687,7 +2687,7 @@ 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:SetTexCoord (unpack (table.coords or default_coords)) + line.icon:SetTexCoord (unpack(table.coords or default_coords)) line.desc:SetText(table.desc) line.link = table.link line:Show() @@ -2696,7 +2696,7 @@ end local feedback_add_addon = function(self, table) local block = self:GetAddonsLine() block.icon:SetTexture(table.icon) - block.icon:SetTexCoord (unpack (table.coords or default_coords)) + block.icon:SetTexCoord (unpack(table.coords or default_coords)) block.link = table.link block.tooltip = table.desc block.name = table.name @@ -2792,7 +2792,7 @@ local chart_panel_align_timelabels = function(self, elapsed_time) self.TimeScale = elapsed_time local linha = self.TimeLabels [17] - local minutos, segundos = math.floor (elapsed_time / 60), math.floor (elapsed_time % 60) + local minutos, segundos = math.floor(elapsed_time / 60), math.floor(elapsed_time % 60) if (segundos < 10) then segundos = "0" .. segundos end @@ -2813,7 +2813,7 @@ local chart_panel_align_timelabels = function(self, elapsed_time) local linha = self.TimeLabels [i] local this_time = time_div * (i-1) - local minutos, segundos = math.floor (this_time / 60), math.floor (this_time % 60) + local minutos, segundos = math.floor(this_time / 60), math.floor(this_time % 60) if (segundos < 10) then segundos = "0" .. segundos @@ -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 @@ -2889,9 +2889,8 @@ local chart_panel_reset = function(self) end local chart_panel_enable_line = function(f, thisbox) - local index = thisbox.index - local type = thisbox.type + local boxType = thisbox.type if (thisbox.enabled) then --disable @@ -2903,8 +2902,7 @@ local chart_panel_enable_line = function(f, thisbox) thisbox.enabled = true end - if (type == "graphic") then - + if (boxType == "graphic") then f.Graphic:ResetData() f.Graphic.max_value = 0 @@ -2912,10 +2910,10 @@ local chart_panel_enable_line = function(f, thisbox) local max_time = 0 for index, box in ipairs(f.BoxLabels) do - if (box.type == type and box.showing and box.enabled) then - local data = f.GData [index] + if (box.type == boxType and box.showing and box.enabled) then + local data = f.GData[index] - f.Graphic:AddDataSeries (data[1], data[2], nil, data[3]) + f.Graphic:AddDataSeries(data[1], data[2], nil, data[3]) if (data[4] > max) then max = data[4] @@ -2929,18 +2927,14 @@ local chart_panel_enable_line = function(f, thisbox) f:SetScale(max) f:SetTime (max_time) - elseif (type == "overlay") then - + elseif (boxType == "overlay") then chart_panel_overlay_reset (f) for index, box in ipairs(f.BoxLabels) do - if (box.type == type and box.showing and box.enabled) then - - f:AddOverlay (box.index) - + if (box.type == boxType and box.showing and box.enabled) then + f:AddOverlay(box.index) end end - end end @@ -3055,7 +3049,7 @@ local chart_panel_add_label = function(self, color, name, type, number) thisbox.type = type thisbox.index = number - thisbox.box:SetColorTexture (unpack (color)) + thisbox.box:SetColorTexture (unpack(color)) thisbox.text:SetText(name) thisbox.check:Show() @@ -3076,7 +3070,7 @@ local draw_overlay = function(self, this_overlay, overlayData, color) local pixel = self.Graphic:GetWidth() / self.TimeScale local index = 1 - local r, g, b, a = unpack (color or line_default_color) + local r, g, b, a = unpack(color or line_default_color) for i = 1, #overlayData, 2 do local aura_start = overlayData [i] @@ -3134,7 +3128,7 @@ end -- Define the tricube weight function function calc_cubeweight (i, j, d) - local w = ( 1 - math.abs ((j-i)/d)^3)^3 + local w = ( 1 - math.abs((j-i)/d)^3)^3 if w < 0 then w = 0 end @@ -3153,7 +3147,7 @@ local calc_lowess_smoothing = function(self, data, bandwidth) local E = 0 -- Calculate span of values to be included in the regression - local jmin = floor (i-bandwidth/2) + local jmin = floor(i-bandwidth/2) local jmax = ceil (i+bandwidth/2) if jmin < 1 then jmin = 1 @@ -3225,12 +3219,12 @@ end local do_SMA = function(value, max_value) if (#SMA_table == 10) then - tremove (SMA_table, 1) + tremove(SMA_table, 1) end SMA_table [#SMA_table + 1] = value - local new_value = calc_SMA (unpack (SMA_table)) / #SMA_table + local new_value = calc_SMA (unpack(SMA_table)) / #SMA_table if (new_value > SMA_max) then SMA_max = new_value @@ -3281,7 +3275,7 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti local _i = 3 - local graphMaxDps = math.max (self.max_value, max_value) + local graphMaxDps = math.max(self.max_value, max_value) if (not smoothLevel) then while (_i <= #content-2) do @@ -3341,10 +3335,10 @@ local chart_panel_add_data = function(self, graphicData, color, name, elapsed_ti end - tremove (content, 1) - tremove (content, 1) - tremove (content, #graphicData) - tremove (content, #graphicData) + tremove(content, 1) + tremove(content, 1) + tremove(content, #graphicData) + tremove(content, #graphicData) if (max_value > self.max_value) then --normalize previous data @@ -3453,7 +3447,7 @@ local chart_panel_right_click_close = function(self, value) end end -function DF:CreateChartPanel (parent, w, h, name) +function DF:CreateChartPanel(parent, w, h, name) if (not name) then name = "DFPanel" .. DF.PanelCounter @@ -3466,8 +3460,8 @@ function DF:CreateChartPanel (parent, w, h, name) local f = CreateFrame("frame", name, parent, "BackdropTemplate") f:SetSize(w or 500, h or 400) - f:EnableMouse (true) - f:SetMovable (true) + f:EnableMouse(true) + f:SetMovable(true) f:SetScript("OnMouseDown", chart_panel_mousedown) f:SetScript("OnMouseUp", chart_panel_mouseup) @@ -3479,8 +3473,8 @@ function DF:CreateChartPanel (parent, w, h, name) c:SetWidth(32) c:SetHeight(32) c:SetPoint("TOPRIGHT", f, "TOPRIGHT", -3, -7) - c:SetFrameLevel (f:GetFrameLevel()+1) - c:SetAlpha (0.9) + 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}) @@ -3542,17 +3536,17 @@ function DF:CreateChartPanel (parent, w, h, name) f.TimeLabelsHeight = 16 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) - f.TimeLabels [i] = time + local timeString = f:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + timeString:SetText("00:00") + timeString:SetPoint("bottomleft", f, "bottomleft", 78 + ((i-1)*36), f.TimeLabelsHeight) + f.TimeLabels [i] = timeString 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", timeString, "topright", 0, -10) line:Hide() - time.line = line + timeString.line = line end local bottom_texture = DF:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture") @@ -3683,7 +3677,7 @@ local gframe_reset = function(self) end if (self.GraphLib_Lines_Used) then for i = #self.GraphLib_Lines_Used, 1, -1 do - local line = tremove (self.GraphLib_Lines_Used) + local line = tremove(self.GraphLib_Lines_Used) tinsert(self.GraphLib_Lines, line) line:Hide() end @@ -3708,7 +3702,7 @@ local gframe_update = function(self, lines) local o = 1 local lastvalue = self:GetHeight()/2 - max_value = math.max (max_value, 0.0000001) + max_value = math.max(max_value, 0.0000001) for i = 1, min (amtlines, self._maxlines) do @@ -3770,7 +3764,7 @@ function DF:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, nam f._onleave_line = onleave f._linewidth = linewidth or 50 - f._maxlines = floor (f:GetWidth() / f._linewidth) + f._maxlines = floor(f:GetWidth() / f._linewidth) return f end @@ -3810,7 +3804,7 @@ end DF.TabContainerFunctions = {} -local button_tab_template = DF.table.copy ({}, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) +local button_tab_template = DF.table.copy ({}, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) button_tab_template.backdropbordercolor = nil DF.TabContainerFunctions.CreateUnderlineGlow = function(button) @@ -3821,7 +3815,7 @@ DF.TabContainerFunctions.CreateUnderlineGlow = function(button) selectedGlow:SetTexCoord (0, 95/128, 30/64, 38/64) selectedGlow:SetBlendMode("ADD") selectedGlow:SetHeight(8) - selectedGlow:SetAlpha (.75) + selectedGlow:SetAlpha(.75) selectedGlow:Hide() button.selectedUnderlineGlow = selectedGlow end @@ -3868,7 +3862,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 +3874,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() @@ -3902,11 +3896,11 @@ local tab_container_on_show = function(self) end function DF:CreateTabContainer (parent, title, frame_name, frameList, options_table, hookList) - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") options_table = options_table or {} local parentFrameWidth = parent:GetWidth() @@ -3926,7 +3920,7 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta local mainTitle = DF:CreateLabel(mainFrame, title, 24, "white") mainTitle:SetPoint("topleft", mainFrame, "topleft", 10, -30 + y_offset) - mainFrame:SetFrameLevel (200) + mainFrame:SetFrameLevel(200) mainFrame.AllFrames = {} mainFrame.AllButtons = {} @@ -3944,16 +3938,16 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta for i, frame in ipairs(frameList) do local f = CreateFrame("frame", "$parent" .. frame.name, mainFrame, "BackdropTemplate") f:SetAllPoints() - f:SetFrameLevel (210) + f:SetFrameLevel(210) f:Hide() 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) - PixelUtil.SetSize (tabButton, buttonWidth, buttonHeight) - tabButton:SetFrameLevel (220) + local tabButton = DF:CreateButton(mainFrame, DF.TabContainerFunctions.SelectIndex, buttonWidth, buttonHeight, frame.title, i, nil, nil, nil, "$parentTabButton" .. frame.name, false, button_tab_template) + PixelUtil.SetSize(tabButton, buttonWidth, buttonHeight) + tabButton:SetFrameLevel(220) tabButton.textsize = button_text_size tabButton.mainFrame = mainFrame DF.TabContainerFunctions.CreateUnderlineGlow (tabButton) @@ -3963,14 +3957,14 @@ function DF:CreateTabContainer (parent, title, frame_name, frameList, options_ta 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) + 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) if (options_table.close_text_alpha) then - right_click_to_back:SetAlpha (options_table.close_text_alpha) + right_click_to_back:SetAlpha(options_table.close_text_alpha) end end @@ -4055,17 +4049,17 @@ local simple_list_box_GetOrCreateWidget = function(self) local index = self.nextWidget 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 = 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.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 = DF:CreateButton(widget, function()end, 16, 16) 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) + widget.XButton.icon:SetDesaturated(true) if (not self.options.show_x_button) then widget.XButton:Hide() @@ -4098,14 +4092,14 @@ 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 - local coords = type (self.options.iconcoords) == "table" and self.options.iconcoords or {0, 1, 0, 1} + 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 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} + local coords = type(self.options.iconcoords) == "table" and self.options.iconcoords or {0, 1, 0, 1} widget:SetIcon (icon, self.options.row_height - 2, self.options.row_height - 2, "overlay", coords) end end @@ -4189,7 +4183,7 @@ function DF:CreateSimpleListBox (parent, name, title, empty_text, list_table, on end f.widgets = {} - DF:ApplyStandardBackdrop (f) + DF:ApplyStandardBackdrop(f) f.options = options or {} self.table.deploy (f.options, default_options) @@ -4202,17 +4196,17 @@ 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) local name = DF:CreateLabel(f, title, 12, "silver") - name:SetTemplate (DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + name:SetTemplate(DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) name:SetPoint("bottomleft", f, "topleft", 0, 2) f.Title = name local emptyLabel = DF:CreateLabel(f, empty_text, 12, "gray") - emptyLabel:SetAlpha (.6) + emptyLabel:SetAlpha(.6) emptyLabel:SetSize(f.options.width-10, f.options.height) emptyLabel:SetPoint("center", 0, 0) emptyLabel:Hide() @@ -4347,11 +4341,11 @@ end function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_amount, line_height) - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local SCROLL_ROLL_AMOUNT = line_amount @@ -4370,7 +4364,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ --check for valid data table if (type(data) ~= "table") then - print ("error: data must be a table. DF > CreateKeybindBox()") + print("error: data must be a table. DF > CreateKeybindBox()") return end @@ -4404,18 +4398,18 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ self.MyObject.selectedTexture:Show() --feedback ao jogador uma vez que as keybinds podem ter o mesmo valor - C_Timer.After (.04, function() new_keybind_frame:Hide() end) - C_Timer.After (.06, function() new_keybind_frame:Show() end) + C_Timer.After(.04, function() new_keybind_frame:Hide() end) + C_Timer.After(.06, function() new_keybind_frame:Show() end) --atualiza a scroll keybindScroll:UpdateScroll() end --choose which spec to use - local spec1 = DF:CreateButton (new_keybind_frame, switch_spec, 160, 20, "Spec1 Placeholder Text", 1, _, _, "SpecButton1", _, 0, options_button_template, options_text_template) - local spec2 = DF:CreateButton (new_keybind_frame, switch_spec, 160, 20, "Spec2 Placeholder Text", 1, _, _, "SpecButton2", _, 0, options_button_template, options_text_template) - local spec3 = DF:CreateButton (new_keybind_frame, switch_spec, 160, 20, "Spec3 Placeholder Text", 1, _, _, "SpecButton3", _, 0, options_button_template, options_text_template) - local spec4 = DF:CreateButton (new_keybind_frame, switch_spec, 160, 20, "Spec4 Placeholder Text", 1, _, _, "SpecButton4", _, 0, options_button_template, options_text_template) + local spec1 = DF:CreateButton(new_keybind_frame, switch_spec, 160, 20, "Spec1 Placeholder Text", 1, _, _, "SpecButton1", _, 0, options_button_template, options_text_template) + local spec2 = DF:CreateButton(new_keybind_frame, switch_spec, 160, 20, "Spec2 Placeholder Text", 1, _, _, "SpecButton2", _, 0, options_button_template, options_text_template) + local spec3 = DF:CreateButton(new_keybind_frame, switch_spec, 160, 20, "Spec3 Placeholder Text", 1, _, _, "SpecButton3", _, 0, options_button_template, options_text_template) + local spec4 = DF:CreateButton(new_keybind_frame, switch_spec, 160, 20, "Spec4 Placeholder Text", 1, _, _, "SpecButton4", _, 0, options_button_template, options_text_template) --format the button label and icon with the spec information local className, class = UnitClass ("player") @@ -4506,7 +4500,7 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local new_key_bind = function(self, button, specID) tinsert(new_keybind_frame.CurrentKeybindEditingSet, {key = "-none-", action = "_target", actiontext = ""}) - FauxScrollFrame_SetOffset (new_keybind_frame.keybindScroll, max (#new_keybind_frame.CurrentKeybindEditingSet-SCROLL_ROLL_AMOUNT, 0)) + FauxScrollFrame_SetOffset (new_keybind_frame.keybindScroll, max(#new_keybind_frame.CurrentKeybindEditingSet-SCROLL_ROLL_AMOUNT, 0)) new_keybind_frame.keybindScroll:UpdateScroll() end @@ -4575,21 +4569,21 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ local key = CopyTable (keybind) local specid, specName = DetailsFramework.GetSpecializationInfoByID (specID) tinsert(new_keybind_frame.Data [specID], key) - DF:Msg ("Keybind copied to " .. (specName or "")) + DF:Msg("Keybind copied to " .. (specName or "")) end end DF:QuickDispatch (callback) end local delete_keybind = function(self, button, keybindIndex) - tremove (new_keybind_frame.CurrentKeybindEditingSet, keybindIndex) + tremove(new_keybind_frame.CurrentKeybindEditingSet, keybindIndex) new_keybind_frame.keybindScroll:UpdateScroll() 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 createNewKeybind = DF:CreateButton (new_keybind_frame, new_key_bind, 160, 20, "New Key Bind", 1, _, _, "NewKeybindButton", _, 0, options_button_template, options_text_template) + 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:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]]) @@ -4655,10 +4649,10 @@ 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" @@ -4668,17 +4662,17 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ 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:SetBackdropColor(unpack(backdropColor)) f:SetScript("OnEnter", on_enter) f:SetScript("OnLeave", on_leave) tinsert(keybindScroll.Frames, f) 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.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.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) @@ -4718,12 +4712,12 @@ function DF:CreateKeybindBox (parent, name, data, callback, width, height, line_ 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")) - header.Action = DF:CreateLabel (header, "Action", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - header.Macro = DF:CreateLabel (header, "Spell Name / Macro", DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) - 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 = DF:CreateLabel (header, "Index", DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) + header.Key = DF:CreateLabel (header, "Key", DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) + header.Action = DF:CreateLabel (header, "Action", DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) + header.Macro = DF:CreateLabel (header, "Spell Name / Macro", DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")) + 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) @@ -4929,7 +4923,7 @@ function DF:CreateTitleBar (f, titleText) closeButton:GetHighlightTexture():SetDesaturated(true) closeButton:GetPushedTexture():SetDesaturated(true) - closeButton:SetAlpha (0.7) + closeButton:SetAlpha(0.7) 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") @@ -4976,12 +4970,12 @@ DF.IconRowFunctions = { newIconFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) newIconFrame:SetBackdropBorderColor(0, 0, 0, 0) - newIconFrame:EnableMouse (false) + newIconFrame:EnableMouse(false) local cooldownFrame = CreateFrame("cooldown", "$parentIconCooldown" .. self.NextIcon, newIconFrame, "CooldownFrameTemplate, BackdropTemplate") cooldownFrame:SetAllPoints() - cooldownFrame:EnableMouse (false) - cooldownFrame:SetFrameLevel (newIconFrame:GetFrameLevel()+1) + cooldownFrame:EnableMouse(false) + cooldownFrame:SetFrameLevel(newIconFrame:GetFrameLevel()+1) cooldownFrame:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer) cooldownFrame.noCooldownCount = self.options.surpress_tulla_omni_cc @@ -5062,7 +5056,7 @@ DF.IconRowFunctions = { if (spellIcon) then local iconFrame = self:GetIcon() iconFrame.Texture:SetTexture(spellIcon) - iconFrame.Texture:SetTexCoord (unpack (self.options.texcoord)) + iconFrame.Texture:SetTexCoord (unpack(self.options.texcoord)) if (borderColor) then iconFrame:SetBackdropBorderColor(Plater:ParseColors(borderColor)) @@ -5136,7 +5130,7 @@ DF.IconRowFunctions = { iconFrame.StackText:Hide() end - PixelUtil.SetSize (iconFrame, self.options.icon_width, self.options.icon_height) + PixelUtil.SetSize(iconFrame, self.options.icon_width, self.options.icon_height) iconFrame:Show() --update the size of the frame @@ -5188,13 +5182,13 @@ DF.IconRowFunctions = { FormatCooldownTime = function(formattedTime) if (formattedTime >= 3600) then - formattedTime = floor (formattedTime / 3600) .. "h" + formattedTime = floor(formattedTime / 3600) .. "h" elseif (formattedTime >= 60) then - formattedTime = floor (formattedTime / 60) .. "m" + formattedTime = floor(formattedTime / 60) .. "m" else - formattedTime = floor (formattedTime) + formattedTime = floor(formattedTime) end return formattedTime end, @@ -5347,8 +5341,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, } @@ -5414,8 +5408,8 @@ function DF:CreateIconRow (parent, name, options) 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:SetBackdropColor(unpack(f.options.backdrop_color)) + f:SetBackdropBorderColor(unpack(f.options.backdrop_border_color)) return f end @@ -5517,8 +5511,8 @@ DF.HeaderCoreFunctions = { Refresh = function(self) --refresh background frame self:SetBackdrop(self.options.backdrop) - 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)) --reset all header frames for i = 1, #self.columnHeadersCreated do @@ -5563,7 +5557,7 @@ DF.HeaderCoreFunctions = { if (self.options.use_line_separators) then columnHeader.Separator:Show() columnHeader.Separator:SetWidth(self.options.line_separator_width) - columnHeader.Separator:SetColorTexture(unpack (self.options.line_separator_color)) + columnHeader.Separator:SetColorTexture(unpack(self.options.line_separator_color)) columnHeader.Separator:ClearAllPoints() if (self.options.line_separator_gap_align) then @@ -5699,10 +5693,10 @@ DF.HeaderCoreFunctions = { if (growDirection == "right" or growDirection == "left") then self.HeaderWidth = self.HeaderWidth + columnHeader:GetWidth() + self.options.padding - self.HeaderHeight = math.max (self.HeaderHeight, columnHeader:GetHeight()) + self.HeaderHeight = math.max(self.HeaderHeight, columnHeader:GetHeight()) elseif (growDirection == "top" or growDirection == "bottom") then - self.HeaderWidth = math.max (self.HeaderWidth, columnHeader:GetWidth()) + self.HeaderWidth = math.max(self.HeaderWidth, columnHeader:GetWidth()) self.HeaderHeight = self.HeaderHeight + columnHeader:GetHeight() + self.options.padding end @@ -5902,7 +5896,7 @@ DF.RadioGroupCoreFunctions = { end, CreateCheckbox = function(self) - local checkbox = DF:CreateSwitch(self, function()end, false, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) + local checkbox = DF:CreateSwitch(self, function()end, false, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) checkbox:SetAsCheckBox() checkbox.Icon = DF:CreateImage(checkbox, "", 16, 16) checkbox.Label = DF:CreateLabel(checkbox, "") @@ -6008,13 +6002,13 @@ function DF:CreateCheckboxGroup(parent, radioOptions, name, options, anchorOptio 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: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")) + 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 @@ -6095,7 +6089,7 @@ function DF:CreateLoadFilterParser (callback) end elseif (event == "PLAYER_ROLES_ASSIGNED") then - local assignedRole = UnitGroupRolesAssigned ("player") + local assignedRole = UnitGroupRolesAssigned("player") if (assignedRole == "NONE") then local spec = DetailsFramework.GetSpecialization() if (spec) then @@ -6110,7 +6104,7 @@ function DF:CreateLoadFilterParser (callback) DF.CurrentPlayerRole = assignedRole end - --print ("Plater Script Update:", event, ...) + --print("Plater Script Update:", event, ...) DF:QuickDispatch (callback, f.EncounterIDCached) end) @@ -6209,7 +6203,7 @@ function DF:PassLoadFilters (loadTable, encounterID) --role if (loadTable.role.Enabled) then - local assignedRole = UnitGroupRolesAssigned ("player") + local assignedRole = UnitGroupRolesAssigned("player") if (assignedRole == "NONE") then local spec = DetailsFramework.GetSpecialization() if (spec) then @@ -6297,13 +6291,13 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) if (not DetailsFrameworkLoadConditionsPanel) then - local f = DF:CreateSimplePanel (UIParent, 970, 505, "Load Conditions", "DetailsFrameworkLoadConditionsPanel") + local f = DF:CreateSimplePanel(UIParent, 970, 505, "Load Conditions", "DetailsFrameworkLoadConditionsPanel") f:SetBackdropColor(0, 0, 0, 1) f.AllRadioGroups = {} f.AllTextEntries = {} f.OptionsTable = optionsTable - DF:ApplyStandardBackdrop (f, false, 1.1) + DF:ApplyStandardBackdrop(f, false, 1.1) local xStartAt = 10 local x2StartAt = 500 @@ -6374,7 +6368,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) --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, @@ -6428,7 +6422,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) 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 = DF:CreateImage(otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() local removeTalent = function(_, _, talentID) @@ -6446,14 +6440,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end --talents selected to load - GameCooltip2:AddLine ("select a talent to remove it (added from a different spec or character)", "", 1, "orange", "orange", 9) - GameCooltip2:AddLine ("$div", nil, nil, -1, -1) + GameCooltip2:AddLine("select a talent to remove it (added from a different spec or character)", "", 1, "orange", "orange", 9) + 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 local talentID, name, texture, selected, available = GetTalentInfoByID (talentID) if (name) then - GameCooltip2:AddLine (name) + GameCooltip2:AddLine(name) GameCooltip2:AddIcon (texture, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip2:AddMenu (1, removeTalent, talentID) end @@ -6528,7 +6522,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) 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 = DF:CreateImage(otherTalents, [[Interface\BUTTONS\AdventureGuideMicrobuttonAlert]], 24, 24) otherTalents.Texture:SetAllPoints() local removeTalent = function(_, _, talentID) @@ -6546,14 +6540,14 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) end --talents selected to load - GameCooltip2:AddLine ("select a talent to remove it (added from a different spec or character)", "", 1, "orange", "orange", 9) - GameCooltip2:AddLine ("$div", nil, nil, -1, -1) + GameCooltip2:AddLine("select a talent to remove it (added from a different spec or character)", "", 1, "orange", "orange", 9) + 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 local _, name, texture = GetPvpTalentInfoByID (talentID) if (name) then - GameCooltip2:AddLine (name) + GameCooltip2:AddLine(name) GameCooltip2:AddIcon (texture, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip2:AddMenu (1, removeTalent, talentID) end @@ -6683,8 +6677,8 @@ 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 encounterIDEditbox = DF:CreateTextEntry (f, function()end, 200, 20, "EncounterEditbox", _, _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_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) encounterIDEditbox.DBKey = "encounter_ids" @@ -6697,8 +6691,8 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions) 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 mapIDEditbox = DF:CreateTextEntry (f, function()end, 200, 20, "MapEditbox", _, _, DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_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) mapIDEditbox.DBKey = "map_ids" @@ -6824,12 +6818,12 @@ DF.DataScrollFunctions = { 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: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 @@ -6856,10 +6850,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) @@ -6992,9 +6986,9 @@ end --]=] function DF:CreateNewsFrame (parent, name, options, newsTable, db) - local f = DF:CreateSimplePanel (parent, 400, 700, options and options.title or default_newsframe_options.title, name, {UseScaleBar = db and true}, db) + local f = DF:CreateSimplePanel(parent, 400, 700, options and options.title or default_newsframe_options.title, name, {UseScaleBar = db and true}, db) f:SetFrameStrata("MEDIUM") - DF:ApplyStandardBackdrop (f) + DF:ApplyStandardBackdrop(f) DF:Mixin (f, DF.OptionsFunctions) DF:Mixin (f, DF.LayoutFrame) @@ -7003,8 +6997,8 @@ function DF:CreateNewsFrame (parent, name, options, newsTable, db) 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:SetBackdropColor(unpack(f.options.backdrop_color)) + f:SetBackdropBorderColor(unpack(f.options.backdrop_border_color)) local scrollOptions = { data = newsTable, @@ -7041,25 +7035,25 @@ end } ]] -function DF:BuildStatusbarAuthorInfo (f, addonBy, authorsNameString) +function DF:BuildStatusbarAuthorInfo(f, addonBy, authorsNameString) local authorName = DF:CreateLabel(f, "" .. (addonBy or "An addon by ") .. "|cFFFFFFFF" .. (authorsNameString or "Terciob") .. "|r") authorName.textcolor = "silver" local discordLabel = DF:CreateLabel(f, "Discord: ") discordLabel.textcolor = "silver" - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + 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:SetFrameLevel (5000) + discordTextEntry:SetFrameLevel(5000) 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) + authorName:SetAlpha(.6) + discordLabel:SetAlpha(.6) + discordTextEntry:SetAlpha(.6) discordTextEntry:SetBackdropBorderColor(1, 1, 1, 0) discordTextEntry:SetHook("OnEditFocusGained", function() @@ -7093,8 +7087,8 @@ function DF:CreateStatusBar(f, options) end statusBar:SetHeight(20) - DF:ApplyStandardBackdrop (statusBar) - statusBar:SetAlpha (0.8) + DF:ApplyStandardBackdrop(statusBar) + statusBar:SetAlpha(0.8) return statusBar end @@ -7351,7 +7345,7 @@ DF.StatusBarFunctions = { function UnitFrameStats() for functionName, functionTable in pairs(debugPerformance.CPUUsageByFunction) do - debugPerformance.CPUUsageByFunction [functionName] = floor (functionTable.usage) + debugPerformance.CPUUsageByFunction [functionName] = floor(functionTable.usage) end for functionName, functionTable in pairs(debugPerformance.CPUUsageByFunction) do @@ -7509,7 +7503,7 @@ DF.StatusBarFunctions = { --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.healAbsorbIndicator:SetVertexColor (.1, .8, .8) + self.healAbsorbIndicator:SetVertexColor(.1, .8, .8) self.shieldAbsorbIndicator:SetTexture(self.Settings.ShieldIndicatorTexture, true, true) self.shieldAbsorbGlow:SetWidth(self.Settings.ShieldGlowWidth) @@ -7537,7 +7531,7 @@ DF.StatusBarFunctions = { --when the unit max health is changed healthBarMetaFunctions.UpdateMaxHealth = function(self) local maxHealth = UnitHealthMax (self.displayedUnit) - self:SetMinMaxValues (0, maxHealth) + self:SetMinMaxValues(0, maxHealth) self.currentHealthMax = maxHealth self:RunHooksForWidget ("OnHealthMaxChange", self, self.displayedUnit) @@ -7546,7 +7540,7 @@ DF.StatusBarFunctions = { healthBarMetaFunctions.UpdateHealth = function(self) -- update max health regardless to avoid weird wrong values on UpdateMaxHealth sometimes -- local maxHealth = UnitHealthMax (self.displayedUnit) - -- self:SetMinMaxValues (0, maxHealth) + -- self:SetMinMaxValues(0, maxHealth) -- self.currentHealthMax = maxHealth self.oldHealth = self.currentHealth @@ -7580,7 +7574,7 @@ 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: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 @@ -7590,7 +7584,7 @@ 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: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 @@ -7607,7 +7601,7 @@ 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: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) @@ -7857,7 +7851,7 @@ DF.PowerFrameFunctions = { --power update UpdateMaxPower = function(self) self.currentPowerMax = UnitPowerMax (self.displayedUnit, self.powerType) - self:SetMinMaxValues (self.minPower, self.currentPowerMax) + self:SetMinMaxValues(self.minPower, self.currentPowerMax) if (self.currentPowerMax == 0 and self.Settings.HideIfNoPower) then self:Hide() @@ -7868,7 +7862,7 @@ 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, @@ -8080,14 +8074,14 @@ DF.CastFrameFunctions = { self.background:SetColorTexture (self.Settings.BackgroundColor:GetColor()) self.background:SetAllPoints() self.extraBackground:SetColorTexture (0, 0, 0, 1) - self.extraBackground:SetVertexColor (self.Settings.BackgroundColor:GetColor()) + self.extraBackground:SetVertexColor(self.Settings.BackgroundColor:GetColor()) self.extraBackground:SetAllPoints() self:SetTexture(self.Settings.Texture) self.BorderShield:SetPoint("center", self, "left", 0, 0) self.BorderShield:SetTexture(self.Settings.BorderShieldTexture) - self.BorderShield:SetTexCoord (unpack (self.Settings.BorderShieldCoords)) + self.BorderShield:SetTexCoord (unpack(self.Settings.BorderShieldCoords)) self.BorderShield:SetSize(self.Settings.BorderShieldWidth, self.Settings.BorderShieldHeight) self.Icon:SetPoint("center", self, "left", 2, 0) @@ -8309,13 +8303,13 @@ DF.CastFrameFunctions = { self.scheduledHideTime:Cancel() end - self.scheduledHideTime = C_Timer.NewTimer (delay, self.DoScheduledHide) + self.scheduledHideTime = C_Timer.NewTimer(delay, self.DoScheduledHide) self.scheduledHideTime.castBar = self 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. - self:SetAlpha (1) + self:SetAlpha(1) --cancel any timer to hide scheduled self:CancelScheduleToHide() end, @@ -8379,10 +8373,10 @@ DF.CastFrameFunctions = { --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) + local remainingTime = abs(self.value) if (remainingTime > 999) then self.percentText:SetText("") else @@ -8469,7 +8463,7 @@ DF.CastFrameFunctions = { --animation finished script Animation_FadeOutFinished = function(self) local castBar = self:GetParent() - castBar:SetAlpha (1) + castBar:SetAlpha(1) castBar:Hide() end, @@ -8482,7 +8476,7 @@ DF.CastFrameFunctions = { Animation_FadeInFinished = function(self) local castBar = self:GetParent() castBar:Show() - castBar:SetAlpha (1) + castBar:SetAlpha(1) end, --animation calls @@ -8579,9 +8573,9 @@ DF.CastFrameFunctions = { self.value = GetTime() - self.spellStartTime self.maxValue = self.spellEndTime - self.spellStartTime - self:SetMinMaxValues (0, self.maxValue) + self:SetMinMaxValues(0, self.maxValue) self:SetValue(self.value) - self:SetAlpha (1) + self:SetAlpha(1) self.Icon:SetTexture(texture) self.Icon:Show() self.Text:SetText(text or name) @@ -8593,7 +8587,7 @@ DF.CastFrameFunctions = { self.flashTexture:Hide() self:Animation_StopAllAnimations() - self:SetAlpha (1) + self:SetAlpha(1) --set the statusbar color self:UpdateCastColor() @@ -8641,10 +8635,10 @@ DF.CastFrameFunctions = { self.value = self.spellEndTime - GetTime() self.maxValue = self.spellEndTime - self.spellStartTime - self:SetMinMaxValues (0, self.maxValue) + self:SetMinMaxValues(0, self.maxValue) self:SetValue(self.value) - self:SetAlpha (1) + self:SetAlpha(1) self.Icon:SetTexture(texture) self.Icon:Show() self.Text:SetText(text) @@ -8656,7 +8650,7 @@ DF.CastFrameFunctions = { self.flashTexture:Hide() self:Animation_StopAllAnimations() - self:SetAlpha (1) + self:SetAlpha(1) --set the statusbar color self:UpdateCastColor() @@ -8751,7 +8745,7 @@ 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 self:UpdateCastColor() @@ -8772,7 +8766,7 @@ 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() @@ -8797,7 +8791,7 @@ DF.CastFrameFunctions = { self.spellEndTime = endTime / 1000 self.value = GetTime() - self.spellStartTime self.maxValue = self.spellEndTime - self.spellStartTime - self:SetMinMaxValues (0, self.maxValue) + self:SetMinMaxValues(0, self.maxValue) end, UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, unit, ...) @@ -8817,7 +8811,7 @@ DF.CastFrameFunctions = { end self.maxValue = self.spellEndTime - self.spellStartTime - self:SetMinMaxValues (0, self.maxValue) + self:SetMinMaxValues(0, self.maxValue) self:SetValue(self.value) end, @@ -8838,7 +8832,7 @@ DF.CastFrameFunctions = { } -- for classic era use LibClassicCasterino: -local LibCC = LibStub ("LibClassicCasterino", true) +local LibCC = LibStub("LibClassicCasterino", true) if IS_WOW_PROJECT_CLASSIC_ERA and LibCC then local fCast = CreateFrame("frame") @@ -8974,7 +8968,7 @@ function DF:CreateCastBar (parent, name, settingsOverride) local flashTexture = castBar:CreateTexture(nil, "overlay", nil, 7) flashTexture:SetColorTexture (1, 1, 1, 1) flashTexture:SetAllPoints() - flashTexture:SetAlpha (0) + flashTexture:SetAlpha(0) flashTexture:Hide() flashTexture:SetBlendMode("ADD") castBar.flashTexture = flashTexture @@ -9024,7 +9018,7 @@ 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 - texture:SetVertexColor (r, g, b, a) + texture:SetVertexColor(r, g, b, a) end end, @@ -9044,7 +9038,7 @@ function DF:CreateBorderFrame (parent, name) local parentName = name or "DetailsFrameworkBorderFrame" .. tostring (math.random (1, 100000000)) local f = CreateFrame("frame", parentName, parent, "BackdropTemplate") - f:SetFrameLevel (f:GetFrameLevel()+1) + f:SetFrameLevel(f:GetFrameLevel()+1) f:SetAllPoints() DF:Mixin (f, DF.BorderFunctions) @@ -9200,7 +9194,7 @@ end RegisterEvents = function(self) --register events for index, eventTable in ipairs(self.UnitFrameEvents) do - local event, isUnitEvent = unpack (eventTable) + local event, isUnitEvent = unpack(eventTable) if (not isUnitEvent) then self:RegisterEvent (event) else @@ -9225,7 +9219,7 @@ end --unregister events, called when this unit frame losses its unit UnregisterEvents = function(self) for index, eventTable in ipairs(self.UnitFrameEvents) do - local event, firstUnit, secondUnit = unpack (eventTable) + local event, firstUnit, secondUnit = unpack(eventTable) self:UnregisterEvent (event) end @@ -9556,31 +9550,31 @@ function DF:CreateUnitFrame (parent, name, unitFrameSettingsOverride, healthBarS local baseFrameLevel = globalBaseFrameLevel globalBaseFrameLevel = globalBaseFrameLevel + 50 - f:SetFrameLevel (baseFrameLevel) + f:SetFrameLevel(baseFrameLevel) --create the healthBar local healthBar = DF:CreateHealthBar (f, false, healthBarSettingsOverride) - healthBar:SetFrameLevel (baseFrameLevel + 1) + healthBar:SetFrameLevel(baseFrameLevel + 1) f.healthBar = healthBar --create the power bar local powerBar = DF:CreatePowerBar (f, false, powerBarSettingsOverride) - powerBar:SetFrameLevel (baseFrameLevel + 2) + powerBar:SetFrameLevel(baseFrameLevel + 2) f.powerBar = powerBar --create the castBar local castBar = DF:CreateCastBar (f, false, castBarSettingsOverride) - castBar:SetFrameLevel (baseFrameLevel + 3) + castBar:SetFrameLevel(baseFrameLevel + 3) f.castBar = castBar --border frame local borderFrame = DF:CreateBorderFrame (f, f:GetName() .. "Border") - borderFrame:SetFrameLevel (f:GetFrameLevel() + 5) + 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") - overlayFrame:SetFrameLevel (f:GetFrameLevel() + 6) + overlayFrame:SetFrameLevel(f:GetFrameLevel() + 6) f.overlayFrame = overlayFrame --unit frame layers @@ -9593,7 +9587,7 @@ function DF:CreateUnitFrame (parent, name, unitFrameSettingsOverride, healthBarS f.targetOverlay = overlayFrame:CreateTexture(nil, "artwork") f.targetOverlay:SetTexture(healthBar:GetTexture()) f.targetOverlay:SetBlendMode("ADD") - f.targetOverlay:SetAlpha (.5) + f.targetOverlay:SetAlpha(.5) f.targetOverlay:SetAllPoints(healthBar) end @@ -9650,10 +9644,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) @@ -9701,7 +9695,7 @@ DF.TimeLineElapsedTimeFunctions = { DF:SetFontOutline (label, self.options.text_outline) if (self.options.draw_line) then - label.line:SetVertexColor (unpack (self.options.draw_line_color)) + label.line:SetVertexColor(unpack(self.options.draw_line_color)) label.line:SetWidth(self.options.draw_line_thickness) label.line:Show() else @@ -9729,7 +9723,7 @@ DF.TimeLineElapsedTimeFunctions = { --scale the distance between each label showing the time with the parent's scale distance = distance * scale - distance = max (distance, minDistance) + distance = max(distance, minDistance) local amountSegments = ceil (effectiveArea / distance) @@ -9740,7 +9734,7 @@ DF.TimeLineElapsedTimeFunctions = { 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()) @@ -9827,7 +9821,7 @@ DF.TimeLineBlockFunctions = { if (self.dataIndex % 2 == 1) then self:SetBackdropColor(0, 0, 0, 0) else - local r, g, b, a = unpack (self.backdrop_color) + local r, g, b, a = unpack(self.backdrop_color) self:SetBackdropColor(r, g, b, a) end @@ -9842,17 +9836,17 @@ DF.TimeLineBlockFunctions = { for i = 1, #timelineData do local blockInfo = timelineData [i] - local time = blockInfo [1] + local timeInSeconds = blockInfo [1] local length = blockInfo [2] local isAura = blockInfo [3] local auraDuration = blockInfo [4] local payload = blockInfo.payload - local xOffset = pixelPerSecond * time + local xOffset = pixelPerSecond * timeInSeconds local width = pixelPerSecond * length - if (time < -0.2) then + if (timeInSeconds < -0.2) then xOffset = xOffset / 2.5 end @@ -9863,36 +9857,36 @@ DF.TimeLineBlockFunctions = { PixelUtil.SetPoint(block, "left", self, "left", xOffset + headerWidth, 0) block.info.spellId = spellId - block.info.time = time + block.info.time = timeInSeconds block.info.duration = auraDuration block.info.payload = payload if (useIconOnBlock) then block.icon:SetTexture(lineData.icon) block.icon:SetTexCoord (.1, .9, .1, .9) - block.icon:SetAlpha (.834) + block.icon:SetAlpha(.834) block.icon:SetSize(self:GetHeight(), self:GetHeight()) - if (time < -0.2) then - block.icon:SetDesaturated (true) + if (timeInSeconds < -0.2) then + block.icon:SetDesaturated(true) else - block.icon:SetDesaturated (false) + block.icon:SetDesaturated(false) end - PixelUtil.SetSize (block, self:GetHeight(), self:GetHeight()) + PixelUtil.SetSize(block, self:GetHeight(), self:GetHeight()) if (isAura) then block.auraLength:Show() block.auraLength:SetWidth(pixelPerSecond * isAura) - block:SetWidth(max (pixelPerSecond * isAura, 16)) + block:SetWidth(max(pixelPerSecond * isAura, 16)) else block.auraLength:Hide() end - block.background:SetVertexColor (0, 0, 0, 0) + block.background:SetVertexColor(0, 0, 0, 0) else - block.background:SetVertexColor (0, 0, 0, 0) - PixelUtil.SetSize (block, max (width, 16), self:GetHeight()) + block.background:SetVertexColor(0, 0, 0, 0) + PixelUtil.SetSize(block, max(width, 16), self:GetHeight()) block.auraLength:Hide() end end @@ -9916,7 +9910,7 @@ DF.TimeLineBlockFunctions = { 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) + auraLength:SetVertexColor(1, 1, 1, 0.1) block.icon = icon block.text = text @@ -9926,7 +9920,7 @@ DF.TimeLineBlockFunctions = { block:SetScript("OnEnter", self:GetParent():GetParent().options.block_on_enter) block:SetScript("OnLeave", self:GetParent():GetParent().options.block_on_leave) - block:SetMouseClickEnabled (false) + block:SetMouseClickEnabled(false) block.info = {} end @@ -9975,17 +9969,17 @@ DF.TimeLineFunctions = { line:SetScript("OnEnter", self.options.on_enter) line:SetScript("OnLeave", self.options.on_leave) - line:SetMouseClickEnabled (false) + line:SetMouseClickEnabled(false) line:SetBackdrop(self.options.backdrop) - line:SetBackdropColor(unpack (self.options.backdrop_color)) - line:SetBackdropBorderColor(unpack (self.options.backdrop_border_color)) + 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) + local icon = DF:CreateImage(line, "", self.options.line_height, self.options.line_height) icon:SetPoint("left", line, "left", 2, 0) line.icon = icon - local text = DF:CreateLabel(line, "", DF:GetTemplate ("font", self.options.title_template)) + local text = DF:CreateLabel(line, "", DF:GetTemplate("font", self.options.title_template)) text:SetPoint("left", icon.widget, "right", 2, 0) line.text = text @@ -10028,12 +10022,12 @@ DF.TimeLineFunctions = { self.body.effectiveWidth = bodyWidth --reduce the default canvas size from the body with and don't allow the max value be negative - local newMaxValue = max (bodyWidth - (self:GetWidth() - self.options.header_width), 0) + local newMaxValue = max(bodyWidth - (self:GetWidth() - self.options.header_width), 0) --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:SetMinMaxValues(0, newMaxValue) + self.horizontalSlider:SetValue(DF:MapRangeClamped(oldMin, oldMax, 0, newMaxValue, self.horizontalSlider:GetValue())) local defaultColor = self.data.defaultColor or {1, 1, 1, 1} @@ -10049,7 +10043,7 @@ DF.TimeLineFunctions = { local bodyHeight = (lineHeight + linePadding) * #self.data.lines self.body:SetHeight(bodyHeight) - self.verticalSlider:SetMinMaxValues (0, max (bodyHeight - self:GetHeight(), 0)) + self.verticalSlider:SetMinMaxValues(0, max(bodyHeight - self:GetHeight(), 0)) self.verticalSlider:SetValue(0) --refresh lines @@ -10291,8 +10285,8 @@ function DF:ShowErrorMessage (errorMessage, titleText) f:SetSize(400, 120) f:SetFrameStrata("FULLSCREEN") f:SetPoint("center", UIParent, "center", 0, 100) - f:EnableMouse (true) - f:SetMovable (true) + f:EnableMouse(true) + f:SetMovable(true) f:RegisterForDrag ("LeftButton") f:SetScript("OnDragStart", function() f:StartMoving() end) f:SetScript("OnDragStop", function() f:StopMovingOrSizing() end) @@ -10301,7 +10295,7 @@ function DF:ShowErrorMessage (errorMessage, titleText) DF.ErrorMessagePanel = f DF:CreateTitleBar (f, "Details! Framework Error!") - DF:ApplyStandardBackdrop (f) + DF:ApplyStandardBackdrop(f) local errorLabel = f:CreateFontString (nil, "overlay", "GameFontNormal") errorLabel:SetPoint("top", f, "top", 0, -25) @@ -10309,10 +10303,10 @@ function DF:ShowErrorMessage (errorMessage, titleText) 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 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) + 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) f.closeButton = closeButton @@ -10448,7 +10442,7 @@ DF.ListboxFunctions = { local headerColumn = listBox.headerTable[i] if (headerColumn.isDelete) then - local deleteButton = DF:CreateButton(line, DF.ListboxFunctions.deleteEntry, 20, self.lineHeight, "X", listBox.data, index, nil, nil, nil, nil, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local deleteButton = DF:CreateButton(line, DF.ListboxFunctions.deleteEntry, 20, self.lineHeight, "X", listBox.data, index, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")) line.deleteButton = deleteButton line:AddFrameToHeaderAlignment(deleteButton) diff --git a/Libs/DF/pictureedit.lua b/Libs/DF/pictureedit.lua index 474e5039..5f936904 100644 --- a/Libs/DF/pictureedit.lua +++ b/Libs/DF/pictureedit.lua @@ -8,10 +8,10 @@ local _ local texCoordinates local CreateImageEditorFrame = function() - local editorWindow = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEdit", nil, 650, 500, false) + local editorWindow = DF:NewPanel(UIParent, nil, "DetailsFrameworkImageEdit", nil, 650, 500, false) editorWindow:SetPoint("center", UIParent, "center") editorWindow:SetResizable(true) - editorWindow:SetMovable (true) + editorWindow:SetMovable(true) editorWindow:SetClampedToScreen (true) tinsert(UISpecialFrames, "DetailsFrameworkImageEdit") editorWindow:SetFrameStrata("TOOLTIP") @@ -37,11 +37,11 @@ local CreateImageEditorFrame = function() 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:SetFrameLevel(editorWindow:GetFrameLevel()) background_frame:SetSize(790, 560) background_frame:SetResizable(true) - background_frame:SetMovable (true) + background_frame:SetMovable(true) background_frame:SetScript("OnMouseDown", function() editorWindow:StartMoving() @@ -51,7 +51,7 @@ local CreateImageEditorFrame = function() end) DF:CreateTitleBar (background_frame, "Image Editor") - DF:ApplyStandardBackdrop (background_frame, false, 0.98) + DF:ApplyStandardBackdrop(background_frame, false, 0.98) DF:CreateStatusBar(background_frame) background_frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) @@ -117,8 +117,8 @@ local CreateImageEditorFrame = function() bottomSlider:SetThumbTexture (bottomSliderThumpTexture) bottomSlider:SetHook("OnValueChange", function(_, _, value) - value = math.abs (value-100) - bottomCoordTexture.image:SetHeight(math.max (editorWindow.frame:GetHeight()/100*value, 1)) + value = math.abs(value-100) + bottomCoordTexture.image:SetHeight(math.max(editorWindow.frame:GetHeight()/100*value, 1)) if (editorWindow.callback_func) then editorWindow.accept(nil, nil, true) end @@ -180,8 +180,8 @@ local CreateImageEditorFrame = function() rightSlider:SetThumbTexture (rightSliderThumpTexture) --]] rightSlider:SetHook("OnValueChange", function(_, _, value) - value = math.abs (value-100) - rightCoordTexture.image:SetWidth(math.max (editorWindow.frame:GetWidth()/100*value, 1)) + value = math.abs(value-100) + rightCoordTexture.image:SetWidth(math.max(editorWindow.frame:GetWidth()/100*value, 1)) if (editorWindow.callback_func) then editorWindow.accept(nil, nil, true) end @@ -191,11 +191,11 @@ local CreateImageEditorFrame = function() --Edit Buttons - local buttonsBackground = DF:NewPanel (UIParent, nil, "DetailsFrameworkImageEditButtonsBg", nil, 115, 230) + local buttonsBackground = DF:NewPanel(UIParent, nil, "DetailsFrameworkImageEditButtonsBg", nil, 115, 230) --buttonsBackground:SetPoint("topleft", window, "topright", 2, 0) buttonsBackground:SetPoint("topright", background_frame, "topright", -8, -10) buttonsBackground:Hide() - --buttonsBackground:SetMovable (true) + --buttonsBackground:SetMovable(true) tinsert(UISpecialFrames, "DetailsFrameworkImageEditButtonsBg") buttonsBackground:SetFrameStrata("TOOLTIP") @@ -311,7 +311,7 @@ local CreateImageEditorFrame = function() changeColorButton:SetPoint("topright", buttonsBackground, "topright", -8, -95 + yMod) changeColorButton:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - alphaFrame = DF:NewPanel (buttonsBackground, nil, "DetailsFrameworkImageEditAlphaBg", nil, 40, 225) + alphaFrame = DF:NewPanel(buttonsBackground, nil, "DetailsFrameworkImageEditAlphaBg", nil, 40, 225) alphaFrame:SetPoint("topleft", buttonsBackground, "topright", 2, 0) alphaFrame:Hide() local alphaSlider = DF:NewSlider (alphaFrame, nil, "$parentAlphaSlider", "alphaSlider", 30, 220, 1, 100, 1, edit_texture:GetAlpha()*100) @@ -364,7 +364,7 @@ local CreateImageEditorFrame = function() resizer:SetHeight(16) resizer:SetPoint("BOTTOMRIGHT", editorWindow.widget, "BOTTOMRIGHT", 0, 0) resizer:EnableMouse(true) - resizer:SetFrameLevel (editorWindow.widget:GetFrameLevel() + 2) + resizer:SetFrameLevel(editorWindow.widget:GetFrameLevel() + 2) resizer:SetScript("OnMouseDown", function(self, button) editorWindow.widget:StartSizing("BOTTOMRIGHT") @@ -389,9 +389,9 @@ local CreateImageEditorFrame = function() topSliderThumpTexture:SetWidth(editorWindow.width) bottomSliderThumpTexture:SetWidth(editorWindow.width) - rightCoordTexture.image:SetWidth(math.max ( (editorWindow.frame:GetWidth() / 100 * math.abs (rightSlider:GetValue()-100)), 1)) + rightCoordTexture.image:SetWidth(math.max( (editorWindow.frame:GetWidth() / 100 * math.abs(rightSlider:GetValue()-100)), 1)) leftCoordTexture.image:SetWidth(editorWindow.frame:GetWidth()/100*leftSlider:GetValue()) - bottomCoordTexture:SetHeight(math.max ( (editorWindow.frame:GetHeight() / 100 * math.abs (bottomSlider:GetValue()-100)), 1)) + bottomCoordTexture:SetHeight(math.max( (editorWindow.frame:GetHeight() / 100 * math.abs(bottomSlider:GetValue()-100)), 1)) topCoordTexture:SetHeight(editorWindow.frame:GetHeight()/100*topSlider:GetValue()) if (editorWindow.callback_func) then @@ -500,7 +500,7 @@ local CreateImageEditorFrame = function() dragFrame:EnableMouse(false) dragFrame:Hide() dragFrame:SetScript("OnUpdate", nil) - print (self.ClickedAt[1], self.ClickedAt[2], self.ReleaseAt[1], self.ReleaseAt[2]) + print(self.ClickedAt[1], self.ClickedAt[2], self.ReleaseAt[1], self.ReleaseAt[2]) end end) diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index 16093144..02fdb826 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -292,7 +292,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) self:ClearFocus() self.slider:Disable() self.slider.amt:Hide() - self:SetAlpha (.4) + self:SetAlpha(.4) if (not self.is_checkbox) then if (not self.lock_texture) then @@ -326,19 +326,19 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) return end - slider.thumb:SetAlpha (1) + 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 - GameCooltip2:Preset (2) - GameCooltip2:AddLine (slider.MyObject.have_tooltip) + GameCooltip2:Preset(2) + GameCooltip2:AddLine(slider.MyObject.have_tooltip) GameCooltip2:ShowCooltip(slider, "tooltip") else - GameCooltip2:Preset (2) - GameCooltip2:AddLine ("Right Click to Type the Value", "", 1, "", "", 10) + GameCooltip2:Preset(2) + GameCooltip2:AddLine("Right Click to Type the Value", "", 1, "", "", 10) GameCooltip2:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125) GameCooltip2:ShowCooltip(slider, "tooltip") end @@ -358,10 +358,10 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) return end - slider.thumb:SetAlpha (.7) + 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) @@ -391,7 +391,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) f:SetPoint("bottomright", host, "topright", 5, -5) f:SetFrameStrata("FULLSCREEN") - f:SetFrameLevel (host:GetFrameLevel() + 1000) + f:SetFrameLevel(host:GetFrameLevel() + 1000) f:Show() if (f.isGoingToHide) then f:SetScript("OnUpdate", nil) @@ -481,7 +481,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) else 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 @@ -533,7 +533,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) else 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 @@ -631,12 +631,12 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) DFSliderMetaFunctions.editbox_typevalue:SetPoint("center", self.widget, "center") DFSliderMetaFunctions.editbox_typevalue:SetFocus() DFSliderMetaFunctions.editbox_typevalue:SetParent(self.widget) - DFSliderMetaFunctions.editbox_typevalue:SetFrameLevel (self.widget:GetFrameLevel()+1) + DFSliderMetaFunctions.editbox_typevalue:SetFrameLevel(self.widget:GetFrameLevel()+1) if (self.useDecimals) then 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() @@ -734,7 +734,7 @@ DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin) if (slider.MyObject.useDecimals) then 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 @@ -759,7 +759,7 @@ 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) end @@ -774,7 +774,7 @@ local SwitchOnClick = function(self, button, forced_value, value) 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) end @@ -836,13 +836,13 @@ local switch_disable = function(self) self._text:Hide() 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:SetDesaturated(true) self.lock_texture:SetPoint("center", self._thumb, "center") end self.lock_texture:Show() end - self:SetAlpha (.4) + self:SetAlpha(.4) rawset (self, "lockdown", true) end local switch_enable = function(self) @@ -855,14 +855,14 @@ local switch_enable = function(self) else 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:SetDesaturated(true) self.lock_texture:SetPoint("center", self._thumb, "center") end self.lock_texture:Hide() self._text:Show() end - self:SetAlpha (1) + self:SetAlpha(1) return rawset (self, "lockdown", false) end @@ -887,14 +887,14 @@ 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) 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) end @@ -902,7 +902,7 @@ local set_as_checkbok = function(self) end -function DF:CreateSwitch (parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func, with_label, switch_template, label_template) +function DF:CreateSwitch(parent, on_switch, default_value, w, h, ltext, rtext, member, name, color_inverted, switch_func, return_func, with_label, switch_template, label_template) local switch, label = DF:NewSwitch (parent, parent, name, member, w or 60, h or 20, ltext, rtext, default_value, color_inverted, switch_func, return_func, with_label, switch_template, label_template) if (on_switch) then switch.OnSwitch = on_switch @@ -955,7 +955,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa 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:SetAlpha(0.7) thumb:SetPoint("left", slider.widget, "left") local text = slider:CreateFontString (nil, "overlay", "GameFontHighlightSmall") @@ -977,7 +977,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa slider.isSwitch = true if (switch_template) then - slider:SetTemplate (switch_template) + slider:SetTemplate(switch_template) end if (with_label) then @@ -987,14 +987,14 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa with_label = label if (label_template) then - label:SetTemplate (label_template) + label:SetTemplate(label_template) end end return slider, with_label end -function DFSliderMetaFunctions:SetTemplate (template) +function DFSliderMetaFunctions:SetTemplate(template) --slider e switch if (template.width) then @@ -1045,7 +1045,7 @@ function DFSliderMetaFunctions:SetTemplate (template) if (template.thumbcolor) then if (self.thumb) then local r, g, b, a = DF:ParseColors(template.thumbcolor) - self.thumb:SetVertexColor (r, g, b, a) + self.thumb:SetVertexColor(r, g, b, a) end end @@ -1138,7 +1138,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de SliderObject.slider:SetWidth(w) SliderObject.slider:SetHeight(h) SliderObject.slider:SetOrientation ("horizontal") - SliderObject.slider:SetMinMaxValues (min, max) + SliderObject.slider:SetMinMaxValues(min, max) SliderObject.slider:SetValue(defaultv) SliderObject.ivalue = defaultv @@ -1150,7 +1150,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de 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) + SliderObject.thumb:SetAlpha(0.7) SliderObject.slider:SetThumbTexture (SliderObject.thumb) SliderObject.slider.thumb = SliderObject.thumb @@ -1168,7 +1168,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de if (SliderObject.useDecimals) then 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) @@ -1198,7 +1198,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de SliderObject.slider:SetScript("OnMouseDown", OnMouseDown) SliderObject.slider:SetScript("OnMouseUp", OnMouseUp) - setmetatable (SliderObject, DFSliderMetaFunctions) + setmetatable(SliderObject, DFSliderMetaFunctions) if (with_label) then local label = DF:CreateLabel(SliderObject.slider, with_label, nil, nil, nil, "label", nil, "overlay") @@ -1207,12 +1207,12 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de with_label = label if (label_template) then - label:SetTemplate (label_template) + label:SetTemplate(label_template) end end if (slider_template) then - SliderObject:SetTemplate (slider_template) + SliderObject:SetTemplate(slider_template) end return SliderObject, with_label diff --git a/Libs/DF/spells.lua b/Libs/DF/spells.lua index 2167a89c..7d647def 100644 --- a/Libs/DF/spells.lua +++ b/Libs/DF/spells.lua @@ -1424,7 +1424,7 @@ function DF:GetSpellsForEncounterFromJournal (instanceEJID, encounterEJID) local name, description, encounterID, rootSectionID, link = DetailsFramework.EncounterJournal.EJ_GetEncounterInfo (encounterEJID) --taloc (primeiro boss de Uldir) if (not name) then - print ("DetailsFramework: Encounter Info Not Found!", instanceEJID, encounterEJID) + print("DetailsFramework: Encounter Info Not Found!", instanceEJID, encounterEJID) return {} end @@ -1436,11 +1436,11 @@ function DF:GetSpellsForEncounterFromJournal (instanceEJID, encounterEJID) while (nextID [1]) do --get the deepest section in the hierarchy - local ID = tremove (nextID) + local ID = tremove(nextID) local sectionInfo = C_EncounterJournal.GetSectionInfo (ID) if (sectionInfo) then - if (sectionInfo.spellID and type (sectionInfo.spellID) == "number" and sectionInfo.spellID ~= 0) then + if (sectionInfo.spellID and type(sectionInfo.spellID) == "number" and sectionInfo.spellID ~= 0) then tinsert(spellIDs, sectionInfo.spellID) end diff --git a/Libs/DF/split_bar.lua b/Libs/DF/split_bar.lua index f0773977..0f3c653b 100644 --- a/Libs/DF/split_bar.lua +++ b/Libs/DF/split_bar.lua @@ -9,7 +9,7 @@ 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 type = type --lua local local _math_floor = math.floor --lua local local cleanfunction = function() end @@ -57,7 +57,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] 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) @@ -71,7 +71,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] 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) @@ -232,7 +232,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] local smember_rcolor = function(_object, _value) local _value1, _value2, _value3, _value4 = DF:ParseColors(_value) _object.rightTexture.original_colors = {_value1, _value2, _value3, _value4} - return _object.rightTexture:SetVertexColor (_value1, _value2, _value3, _value4) + return _object.rightTexture:SetVertexColor(_value1, _value2, _value3, _value4) end --left color local smember_lcolor = function(_object, _value) @@ -240,15 +240,15 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] _object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4) _object.texture.original_colors = {_value1, _value2, _value3, _value4} - return _object.texture:SetVertexColor (_value1, _value2, _value3, _value4) + return _object.texture:SetVertexColor(_value1, _value2, _value3, _value4) end --right icon local smember_ricon = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2 = _unpack (_value) + local _value1, _value2 = _unpack(_value) _object.iconright:SetTexture(_value1) if (_value2) then - _object.iconright:SetTexCoord (_unpack (_value2)) + _object.iconright:SetTexCoord (_unpack(_value2)) end else _object.iconright:SetTexture(_value) @@ -258,10 +258,10 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] --left icon local smember_licon = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2 = _unpack (_value) + local _value1, _value2 = _unpack(_value) _object.iconleft:SetTexture(_value1) if (_value2) then - _object.iconleft:SetTexCoord (_unpack (_value2)) + _object.iconleft:SetTexCoord (_unpack(_value2)) end else _object.iconleft:SetTexture(_value) @@ -271,12 +271,12 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] --texture local smember_texture = function(_object, _value) if (type(_value) == "table") then - local _value1, _value2 = _unpack (_value) + local _value1, _value2 = _unpack(_value) _object.texture:SetTexture(_value1) _object.rightTexture:SetTexture(_value1) if (_value2) then - _object.texture:SetTexCoord (_unpack (_value2)) - _object.rightTexture:SetTexCoord (_unpack (_value2)) + _object.texture:SetTexCoord (_unpack(_value2)) + _object.rightTexture:SetTexCoord (_unpack(_value2)) end else _object.texture:SetTexture(_value) @@ -356,7 +356,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] 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") + print("Invalid parameter for SetPoint") return end return self.widget:SetPoint(v1, v2, v3, v4, v5) @@ -393,18 +393,18 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] -- colors function SplitBarMetaFunctions:SetLeftColor (r, g, b, a) r, g, b, a = DF:ParseColors(r, g, b, a) - self.texture:SetVertexColor (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) - self.rightTexture:SetVertexColor (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) - self.background:SetVertexColor (r, g, b, a) + self.background:SetVertexColor(r, g, b, a) self.background.original_colors = {r, g, b, a} end @@ -420,14 +420,14 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] function SplitBarMetaFunctions:SetLeftIcon (texture, ...) self.iconleft:SetTexture(texture) if (...) then - local L, R, U, D = unpack (...) + local L, R, U, D = unpack(...) self.iconleft:SetTexCoord (L, R, U, D) end end function SplitBarMetaFunctions:SetRightIcon (texture, ...) self.iconright:SetTexture(texture) if (...) then - local L, R, U, D = unpack (...) + local L, R, U, D = unpack(...) self.iconright:SetTexCoord (L, R, U, D) end end @@ -448,18 +448,18 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] function SplitBarMetaFunctions:GetFrameLevel() return self.statusbar:GetFrameLevel() end - function SplitBarMetaFunctions:SetFrameLevel (level, frame) + function SplitBarMetaFunctions:SetFrameLevel(level, frame) if (not frame) then - return self.statusbar:SetFrameLevel (level) + return self.statusbar:SetFrameLevel(level) else local framelevel = frame:GetFrameLevel (frame) + level - return self.statusbar:SetFrameLevel (framelevel) + return self.statusbar:SetFrameLevel(framelevel) end end -- 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) @@ -571,7 +571,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]] if (frame.MyObject.have_tooltip) then GameCooltip2:Reset() - GameCooltip2:AddLine (frame.MyObject.have_tooltip) + GameCooltip2:AddLine(frame.MyObject.have_tooltip) GameCooltip2:ShowCooltip(frame, "tooltip") end end @@ -661,7 +661,7 @@ local build_statusbar = function(self) self.background:SetPoint("topleft", self, "topleft") self.background:SetPoint("bottomleft", self, "bottomleft") self.background:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]) - self.background:SetVertexColor (.3, .3, .3, 1) + 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) @@ -703,7 +703,7 @@ local build_statusbar = function(self) self.righttext:SetPoint("RIGHT", self.righticon, "LEFT", -3, 0) self:SetStatusBarTexture (self.texture) - self:SetMinMaxValues (1, 100) + self:SetMinMaxValues(1, 100) self:SetValue(50) DetailsFrameworkSplitlBar_OnCreate (self) end @@ -800,7 +800,7 @@ function DF:NewSplitBar (parent, container, name, member, w, h) SplitBarObject.statusbar:SetScript("OnMouseUp", OnMouseUp) SplitBarObject.statusbar:SetScript("OnSizeChanged", OnSizeChanged) - _setmetatable (SplitBarObject, SplitBarMetaFunctions) + _setmetatable(SplitBarObject, SplitBarMetaFunctions) return SplitBarObject end diff --git a/Libs/DF/textentry.lua b/Libs/DF/textentry.lua index 77b9f0d4..1c2375df 100644 --- a/Libs/DF/textentry.lua +++ b/Libs/DF/textentry.lua @@ -244,9 +244,9 @@ 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:SetTextColor (unpack (self.enabled_text_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)) self.editbox.borderframe:SetBackdropColor(r, g, b, a) @@ -294,8 +294,8 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 end if (capsule.have_tooltip) then - GameCooltip2:Preset (2) - GameCooltip2:AddLine (capsule.have_tooltip) + GameCooltip2:Preset(2) + GameCooltip2:AddLine(capsule.have_tooltip) GameCooltip2:ShowCooltip(textentry, "tooltip") 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 @@ -481,7 +481,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1 ------------------------------------------------------------------------------------------------------------ -function TextEntryMetaFunctions:SetTemplate (template) +function TextEntryMetaFunctions:SetTemplate(template) if (template.width) then self.editbox:SetWidth(template.width) end @@ -512,10 +512,10 @@ end --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) + return DF:NewTextEntry(parent, parent, name, member, w, h, func, nil, nil, nil, with_label, entry_template, label_template) end -function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, param2, space, with_label, entry_template, label_template) +function DF:NewTextEntry(parent, container, name, member, w, h, func, param1, param2, space, with_label, entry_template, label_template) if (not name) then name = "DetailsFrameworkTextEntryNumber" .. DF.TextEntryCounter @@ -596,7 +596,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p w = space elseif (w and space) then if (DF.debug) then - --print ("warning: you are using width and space, try use only space for better results.") + --print("warning: you are using width and space, try use only space for better results.") end end @@ -604,7 +604,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p TextEntryObject.editbox:SetHeight(h) TextEntryObject.editbox:SetJustifyH("center") - TextEntryObject.editbox:EnableMouse (true) + TextEntryObject.editbox:EnableMouse(true) TextEntryObject.editbox:SetText("") TextEntryObject.editbox:SetAutoFocus (false) @@ -659,20 +659,20 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p TextEntryObject.editbox:SetScript("OnTextChanged", OnTextChanged) TextEntryObject.editbox:SetScript("OnTabPressed", OnTabPressed) - setmetatable (TextEntryObject, TextEntryMetaFunctions) + setmetatable(TextEntryObject, TextEntryMetaFunctions) if (with_label) then 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) if (label_template) then - label:SetTemplate (label_template) + label:SetTemplate(label_template) end with_label = label end if (entry_template) then - TextEntryObject:SetTemplate (entry_template) + TextEntryObject:SetTemplate(entry_template) end return TextEntryObject, with_label @@ -680,7 +680,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p 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) + local editbox = DF:NewTextEntry(parent, parent, name, member, w, h, func, param1, param2) -- editbox:SetHook("OnEditFocusGained", SpellEntryOnEditFocusGained) -- editbox:SetHook("OnTextChanged", SpellEntryOnTextChanged) @@ -820,7 +820,7 @@ local get_last_word = function(self) local character = text:sub (i, i) if (character:match ("%a")) then self.lastword = character .. self.lastword - --print (self.lastword) + --print(self.lastword) else break end @@ -889,7 +889,7 @@ end local AutoComplete_OnEditFocusGained = function(editboxWidget) local capsule = editboxWidget.MyObject or editboxWidget capsule:GetLastWord() - --print ("last word:", editboxWidget.lastword) + --print("last word:", editboxWidget.lastword) editboxWidget.end_selection = nil editboxWidget.focusGained = true capsule.characters_count = editboxWidget:GetText():len() diff --git a/Libs/LibDeflate/LibDeflate.lua b/Libs/LibDeflate/LibDeflate.lua index c7926a87..9829c1ef 100644 --- a/Libs/LibDeflate/LibDeflate.lua +++ b/Libs/LibDeflate/LibDeflate.lua @@ -2617,7 +2617,7 @@ local function Inflate(state) elseif block_type == 2 then status = DecompressDynamicBlock(state) else - return nil, -1 -- invalid block type (type == 3) + return nil, -1 -- invalid block type(type == 3) end if status ~= 0 then return nil, status diff --git a/Libs/LibOpenRaid/ThingsToMantain.lua b/Libs/LibOpenRaid/ThingsToMantain.lua index 7fef0ef1..85b3a1bc 100644 --- a/Libs/LibOpenRaid/ThingsToMantain.lua +++ b/Libs/LibOpenRaid/ThingsToMantain.lua @@ -202,7 +202,7 @@ elseif (isExpansion_Shadowlands()) then -- how to get the enchantId: -- local itemLink = GetInventoryItemLink("player", slotId) - -- local enchandId = select (3, strsplit(":", itemLink)) + -- local enchandId = select(3, strsplit(":", itemLink)) -- print("enchantId:", enchandId) LIB_OPEN_RAID_ENCHANT_IDS = { --FEET @@ -257,7 +257,7 @@ elseif (isExpansion_Shadowlands()) then -- how to get the gemId: -- local itemLink = GetInventoryItemLink("player", slotId) - -- local gemId = select (4, strsplit(":", itemLink)) + -- local gemId = select(4, strsplit(":", itemLink)) -- print("gemId:", gemId) LIB_OPEN_RAID_GEM_IDS = { [173126] = true, --Straddling Jewel Doublet (green, +12 speed) @@ -357,7 +357,7 @@ elseif (isExpansion_Dragonflight()) then -- how to get the enchantId: -- local itemLink = GetInventoryItemLink("player", slotId) - -- local enchandId = select (3, strsplit(":", itemLink)) + -- local enchandId = select(3, strsplit(":", itemLink)) -- print("enchantId:", enchandId) LIB_OPEN_RAID_ENCHANT_IDS = { --FEET @@ -412,7 +412,7 @@ elseif (isExpansion_Dragonflight()) then -- how to get the gemId: -- local itemLink = GetInventoryItemLink("player", slotId) - -- local gemId = select (4, strsplit(":", itemLink)) + -- local gemId = select(4, strsplit(":", itemLink)) -- print("gemId:", gemId) LIB_OPEN_RAID_GEM_IDS = { [173126] = true, --Straddling Jewel Doublet (green, +12 speed) diff --git a/Libs/LibOpenRaid/docs.txt b/Libs/LibOpenRaid/docs.txt index 1bf671cf..5cc7aac4 100644 --- a/Libs/LibOpenRaid/docs.txt +++ b/Libs/LibOpenRaid/docs.txt @@ -281,7 +281,7 @@ openRaidLib.RegisterCallback(MyAddonObject, "CooldownRemoved", "OnUnitLostCooldo =================================================================================================================================== function MyAddonObject.OnCooldownListWipe(allUnitsCooldowns) - --print ("is nil:", next(allUnitsCooldowns)) + --print("is nil:", next(allUnitsCooldowns)) end --registering the callback: @@ -329,7 +329,7 @@ openRaidLib.RegisterCallback(MyAddonObject, "GearDurabilityUpdate", "OnGearDurab =================================================================================================================================== function MyAddonObject.OnGearListWiped(allUnitsGear) - --print ("is nil:", next(allUnitsGear)) + --print("is nil:", next(allUnitsGear)) end --registering the callback: diff --git a/Libs/NickTag-1.0/NickTag-1.0.lua b/Libs/NickTag-1.0/NickTag-1.0.lua index 618ee94b..ebba144b 100644 --- a/Libs/NickTag-1.0/NickTag-1.0.lua +++ b/Libs/NickTag-1.0/NickTag-1.0.lua @@ -76,9 +76,9 @@ end return target end - function NickTag:Msg (...) + function NickTag:Msg(...) if (NickTag.debug) then - print ("|cFFFFFF00NickTag:|r", ...) + print("|cFFFFFF00NickTag:|r", ...) end end @@ -219,15 +219,15 @@ end return end - local _type, serial, arg3, name, realm, version = select (2, NickTag:Deserialize (data)) + local type, serial, arg3, name, realm, version = select(2, NickTag:Deserialize (data)) --0x1: received a full persona - if (_type == CONST_COMM_FULLPERSONA) then + if (type == CONST_COMM_FULLPERSONA) then local receivedPersona = arg3 version = name - if (not receivedPersona or type (receivedPersona) ~= "table") then - NickTag:Msg ("FULLPERSONA received but it's invalid ", source) + if (not receivedPersona or type(receivedPersona) ~= "table") then + NickTag:Msg("FULLPERSONA received but it's invalid ", source) return end @@ -245,14 +245,14 @@ end if (allowNickName) then storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME] else - storedPersona [CONST_INDEX_NICKNAME] = LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"] + storedPersona [CONST_INDEX_NICKNAME] = LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"] end storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME] --update the rest --avatar path - storedPersona [CONST_INDEX_AVATAR_PATH] = type (receivedPersona [CONST_INDEX_AVATAR_PATH]) == "string" and receivedPersona [CONST_INDEX_AVATAR_PATH] or "" + 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 @@ -260,10 +260,10 @@ end 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 - storedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] or 0 - storedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] or 1 + 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 + storedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] or 0 + storedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] or 1 else storedPersona [CONST_INDEX_AVATAR_TEXCOORD] = {0, 1, 0, 1} end @@ -274,29 +274,29 @@ end 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 - storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] or 0 - storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] or 1 + 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 + storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] or 0 + storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] or 1 else storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] = {0, 1, 0, 1} end --background path - storedPersona [CONST_INDEX_BACKGROUND_PATH] = type (receivedPersona [CONST_INDEX_BACKGROUND_PATH]) == "string" and receivedPersona [CONST_INDEX_BACKGROUND_PATH] or "" + 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 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 - storedPersona [CONST_INDEX_BACKGROUND_COLOR][3] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3] or 1 + 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 + storedPersona [CONST_INDEX_BACKGROUND_COLOR][3] = type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3] or 1 else storedPersona [CONST_INDEX_BACKGROUND_COLOR] = {1, 1, 1} end NickTag:SyncSiblings() - NickTag:Msg ("FULLPERSONA received and updated for character: ", source, "new nickname: ", receivedPersona [CONST_INDEX_NICKNAME]) + NickTag:Msg("FULLPERSONA received and updated for character: ", source, "new nickname: ", receivedPersona [CONST_INDEX_NICKNAME]) end end @@ -312,7 +312,7 @@ end function NickTag.OnEvent (self, event, ...) if (NickTag.EventFrame.InfoSendCooldown > time()) then if (not NickTag.EventFrame.ScheduledSend or NickTag.EventFrame.ScheduledSend._cancelled) then - NickTag.EventFrame.ScheduledSend = C_Timer.NewTimer (30, NickTag.SendPersona) + NickTag.EventFrame.ScheduledSend = C_Timer.NewTimer(30, NickTag.SendPersona) end else NickTag:SendPersona() @@ -334,7 +334,7 @@ end if (not nickTable) then return end - NickTag:Msg ("SendPersona() -> broadcast") + NickTag:Msg("SendPersona() -> broadcast") if (NickTag.EventFrame.ScheduledSend and not NickTag.EventFrame.ScheduledSend._cancelled) then NickTag.EventFrame.ScheduledSend:Cancel() @@ -346,7 +346,7 @@ end NickTag.send_scheduled = false --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 + if (NickTag:GetNickname (UnitName ("player")) == LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]) then nickTable [CONST_INDEX_NICKNAME] = UnitName ("player") end @@ -378,7 +378,7 @@ end playerPersona [CONST_INDEX_BACKGROUND_COLOR] = false playerPersona [CONST_INDEX_REVISION] = playerPersona [CONST_INDEX_REVISION] + 1 - C_Timer.After (1, NickTag.SendPersona) + C_Timer.After(1, NickTag.SendPersona) end end end @@ -405,7 +405,7 @@ end pool.last_version = minor else --sometimes player guid isn't available right after logon, so, just schedule until it become available. - NickTag:ScheduleTimer ("ResetCache", 0.3) + NickTag:ScheduleTimer("ResetCache", 0.3) end end @@ -489,7 +489,7 @@ end local check_repeated = function(char) if (char == " ") then have_repeated = true - elseif (string.len (char) > 2) then + elseif (string.len(char) > 2) then have_repeated = true elseif (char == " ") then count_spaces = count_spaces + 1 @@ -502,7 +502,7 @@ end --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 + 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) @@ -532,9 +532,9 @@ end --limit nickname to 12 characters, same as wow. --cyrillic seems to double the len using 2 bytes - local len = string.len (name) + 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. @@ -543,13 +543,13 @@ end -- 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 --]=] @@ -563,7 +563,7 @@ 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 @@ -578,7 +578,7 @@ end --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) + NickTag:Msg("SetNickname() invalid name ", name) return false, errortype end @@ -607,11 +607,11 @@ end --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) + NickTag:ScheduleTimer("SendPersona", 1) end else - NickTag:Msg ("SetNickname() name is the same on the pool ", name, nickTable [CONST_INDEX_NICKNAME]) + NickTag:Msg("SetNickname() name is the same on the pool ", name, nickTable [CONST_INDEX_NICKNAME]) end return true @@ -622,7 +622,7 @@ end if (l == nil) then l, r, t, b = 0, 1, 0, 1 elseif (type(l) == "table") then - l, r, t, b = unpack (l) + l, r, t, b = unpack(l) end --check data before @@ -655,7 +655,7 @@ end if (not NickTag.send_scheduled) then NickTag.send_scheduled = true - NickTag:ScheduleTimer ("SendPersona", 1) + NickTag:ScheduleTimer("SendPersona", 1) end end @@ -713,7 +713,7 @@ end if (not NickTag.send_scheduled) then NickTag.send_scheduled = true - NickTag:ScheduleTimer ("SendPersona", 1) + NickTag:ScheduleTimer("SendPersona", 1) end end @@ -766,7 +766,7 @@ end if (not silent) then assert (type(playerName) == "string", "NickTag 'GetNicknameTable' expects a string on #1 argument.") else - if (not playerName or type (playerName) ~= "string") then + if (not playerName or type(playerName) ~= "string") then return end end @@ -851,7 +851,7 @@ do 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])) + 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) @@ -866,7 +866,7 @@ do elseif (button.isBackground) then local background = NickTag.background_pool [button.IconID] _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) - _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) + _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack(background [3])) avatar_pick_frame.selected_background = background [1] avatar_pick_frame.selected_texcoord = background [3] end @@ -874,7 +874,7 @@ do local selectedColor = function() local r, g, b = ColorPickerFrame:GetColorRGB() - background_texture:SetVertexColor (r, g, b) + background_texture:SetVertexColor(r, g, b) avatar_pick_frame.selected_color[1] = r avatar_pick_frame.selected_color[2] = g avatar_pick_frame.selected_color[3] = b @@ -883,7 +883,7 @@ do 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:SetFrameLevel(avatar_pick_frame:GetFrameLevel()+2) okey:SetScript("OnClick", function(self) avatar_pick_frame:Hide() if (avatar_pick_frame.callback) then @@ -893,7 +893,7 @@ do 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:SetFrameLevel(avatar_pick_frame:GetFrameLevel()+2) change_color:SetScript("OnClick", function(self) ColorPickerFrame.func = selectedColor @@ -1019,8 +1019,8 @@ do end local background = NickTag.background_pool [n] _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) - _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) - _G.AvatarPickFrameBackgroundPreview:SetVertexColor (unpack (avatar_pick_frame.selected_color)) + _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) @@ -1033,7 +1033,7 @@ do if (type(b) ~= "number" or b > 1) then b = 1 end - _G.AvatarPickFrameBackgroundPreview:SetVertexColor (r, g, b) + _G.AvatarPickFrameBackgroundPreview:SetVertexColor(r, g, b) avatar_pick_frame.selected_color[1] = r avatar_pick_frame.selected_color[2] = g avatar_pick_frame.selected_color[3] = b @@ -1048,7 +1048,7 @@ do avatar_pick_frame:SetScript("OnShow", function() --get player avatar - local avatar = NickTag:GetNicknameTable (UnitGUID ("player")) + local avatar = NickTag:GetNicknameTable (UnitGUID("player")) if (avatar) then _G.AvatarPickFrameName:SetText( avatar [1] or UnitName ("player")) @@ -1061,7 +1061,7 @@ do avatar_pick_frame.selected_background = avatar [CONST_INDEX_BACKGROUND_PATH] or [[Interface\PetBattles\Weather-ArcaneStorm]] if (avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) then - _G.AvatarPickFrameBackgroundPreview:SetTexCoord ( unpack (avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) ) + _G.AvatarPickFrameBackgroundPreview:SetTexCoord ( unpack(avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) ) avatar_pick_frame.selected_texcoord = avatar [CONST_INDEX_BACKGROUND_TEXCOORD] else _G.AvatarPickFrameBackgroundPreview:SetTexCoord ( 0.129609375, 1, 1, 0 ) @@ -1069,10 +1069,10 @@ do end if (avatar [CONST_INDEX_BACKGROUND_COLOR]) then - _G.AvatarPickFrameBackgroundPreview:SetVertexColor ( unpack (avatar [CONST_INDEX_BACKGROUND_COLOR]) ) + _G.AvatarPickFrameBackgroundPreview:SetVertexColor( unpack(avatar [CONST_INDEX_BACKGROUND_COLOR]) ) avatar_pick_frame.selected_color = avatar [CONST_INDEX_BACKGROUND_COLOR] else - _G.AvatarPickFrameBackgroundPreview:SetVertexColor ( 1, 1, 1 ) + _G.AvatarPickFrameBackgroundPreview:SetVertexColor( 1, 1, 1 ) avatar_pick_frame.selected_color = {1, 1, 1} end else @@ -1085,9 +1085,9 @@ do if (background) then _G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] ) avatar_pick_frame.selected_background = background [1] - _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3])) + _G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack(background [3])) avatar_pick_frame.selected_texcoord = background [3] - _G.AvatarPickFrameBackgroundPreview:SetVertexColor (unpack (avatar_pick_frame.selected_color)) + _G.AvatarPickFrameBackgroundPreview:SetVertexColor(unpack(avatar_pick_frame.selected_color)) avatar_pick_frame.selected_color = avatar_pick_frame.selected_color end diff --git a/boot.lua b/boot.lua index ac012815..1e918f24 100644 --- a/boot.lua +++ b/boot.lua @@ -809,7 +809,7 @@ do [12] = "DEMONHUNTER", } - local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details") + local Loc = LibStub("AceLocale-3.0"):GetLocale ("Details") _detalhes.segmentos = { label = Loc ["STRING_SEGMENT"]..": ", @@ -859,20 +859,20 @@ do --frames local _CreateFrame = CreateFrame --api locals - local _UIParent = UIParent --api locals + local UIParent = UIParent --api locals --Info Window - _detalhes.playerDetailWindow = _CreateFrame ("Frame", "DetailsPlayerDetailsWindow", _UIParent, "BackdropTemplate") + _detalhes.playerDetailWindow = _CreateFrame ("Frame", "DetailsPlayerDetailsWindow", UIParent, "BackdropTemplate") _detalhes.PlayerDetailsWindow = _detalhes.playerDetailWindow --Event Frame - _detalhes.listener = _CreateFrame ("Frame", nil, _UIParent) + _detalhes.listener = _CreateFrame ("Frame", nil, UIParent) _detalhes.listener:RegisterEvent ("ADDON_LOADED") _detalhes.listener:SetFrameStrata("LOW") - _detalhes.listener:SetFrameLevel (9) + _detalhes.listener:SetFrameLevel(9) _detalhes.listener.FrameTime = 0 - _detalhes.overlay_frame = _CreateFrame ("Frame", nil, _UIParent) + _detalhes.overlay_frame = _CreateFrame ("Frame", nil, UIParent) _detalhes.overlay_frame:SetFrameStrata("TOOLTIP") --Pet Owner Finder @@ -926,7 +926,7 @@ do end end) f:SetToplevel (true) - f:SetMovable (true) + f:SetMovable(true) end return f @@ -990,7 +990,7 @@ do return end for a,b in pairs(t) do - print (a,b) + print(a,b) end end @@ -1006,7 +1006,7 @@ do copy = {} for orig_key, orig_value in next, orig, nil do --print(orig_key, orig_value) - copy [Details.CopyTable (orig_key)] = Details.CopyTable (orig_value) + copy [Details.CopyTable(orig_key)] = Details.CopyTable(orig_value) end else copy = orig @@ -1022,25 +1022,25 @@ do function _detalhes:ShowDelayMsg() if (_detalhes.delaymsgs and #_detalhes.delaymsgs > 0) then for _, msg in ipairs(_detalhes.delaymsgs) do - print (msg) + print(msg) end end _detalhes.delaymsgs = {} end --print messages - function _detalhes:Msg (_string, arg1, arg2, arg3, arg4) + function _detalhes:Msg(_string, arg1, arg2, arg3, arg4) if (self.__name) then --yes, we have a name! - print ("|cffffaeae" .. self.__name .. "|r |cffcc7c7c(plugin)|r: " .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "") + 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 "") + print(Loc ["STRING_DETAILS1"] .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "") end end --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.") + _detalhes:Msg("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.") function _detalhes:wipe_combat_after_failed_load() _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() @@ -1052,7 +1052,7 @@ do _detalhes_database.tabela_overall = nil _detalhes_database.tabela_historico = nil - _detalhes:Msg ("seems failed to load, please type /reload to try again.") + _detalhes:Msg("seems failed to load, please type /reload to try again.") end Details.Schedules.After(5, _detalhes.wipe_combat_after_failed_load) diff --git a/classes/class_combat.lua b/classes/class_combat.lua index d9da206b..abeff575 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -1,24 +1,21 @@ --- combat class object local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ - + --[[global]] DETAILS_TOTALS_ONLYGROUP = true ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers - - local _setmetatable = setmetatable -- lua local - local _ipairs = ipairs -- lua local + local ipairs = ipairs -- lua local local _pairs = pairs -- lua local local _bit_band = bit.band -- lua local local _date = date -- lua local - local _table_remove = table.remove -- lua local - local _rawget = rawget + local tremove = table.remove -- lua local + local rawget = rawget local _math_max = math.max - local _math_floor = math.floor - local _GetTime = GetTime + local floor = math.floor + local GetTime = GetTime ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --constants @@ -29,13 +26,13 @@ local class_type_cura = _detalhes.atributos.cura local class_type_e_energy = _detalhes.atributos.e_energy local class_type_misc = _detalhes.atributos.misc - + local REACTION_HOSTILE = 0x00000040 local CONTROL_PLAYER = 0x00000100 --local _tempo = time() - local _tempo = _GetTime() - + local _tempo = GetTime() + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --api functions @@ -52,54 +49,54 @@ function combate:GetDate() return self.data_inicio, self.data_fim end - + --set the combat date function combate:SetDate (started, ended) - if (started and type (started) == "string") then + if (started and type(started) == "string") then self.data_inicio = started end - if (ended and type (ended) == "string") then + if (ended and type(ended) == "string") then self.data_fim = ended - end + end end - + --return data for charts function combate:GetTimeData (name) return self.TimeData [name] end - + function combate:GetContainer (attribute) return self [attribute] end - + function combate:GetRoster() return self.raid_roster end - + function combate:InstanceType() - return _rawget (self, "instance_type") + return rawget (self, "instance_type") end - + function combate:IsTrash() - return _rawget (self, "is_trash") + return rawget (self, "is_trash") end - + function combate:GetDifficulty() return self.is_boss and self.is_boss.diff end - + function combate:GetBossInfo() return self.is_boss end - + function combate:GetPhases() return self.PhaseData end - + function combate:GetPvPInfo() return self.is_pvp end - + function combate:GetMythicDungeonInfo() return self.is_mythic_dungeon end @@ -107,21 +104,21 @@ function combate:GetMythicDungeonTrashInfo() return self.is_mythic_dungeon_trash end - + function combate:IsMythicDungeon() local is_segment = self.is_mythic_dungeon_segment local run_id = self.is_mythic_dungeon_run_id return is_segment, run_id end - + function combate:IsMythicDungeonOverall() return self.is_mythic_dungeon and self.is_mythic_dungeon.OverallSegment end - + function combate:GetArenaInfo() return self.is_arena end - + function combate:GetDeaths() return self.last_events_tables end @@ -144,29 +141,29 @@ function combate:GetCombatId() return self.combat_id end - + function combate:GetCombatNumber() return self.combat_counter end - + function combate:GetAlteranatePower() return self.alternate_power end - + --return the name of the encounter or enemy - function combate:GetCombatName (try_find) + function combate:GetCombatName(try_find) if (self.is_pvp) then return self.is_pvp.name - + elseif (self.is_boss) then return self.is_boss.encounter - + elseif (self.is_mythic_dungeon_trash) then return self.is_mythic_dungeon_trash.ZoneName .. " (" .. Loc ["STRING_SEGMENTS_LIST_TRASH"] .. ")" - - elseif (_rawget (self, "is_trash")) then + + elseif (rawget (self, "is_trash")) then return Loc ["STRING_SEGMENT_TRASH"] - + else if (self.enemy) then return self.enemy @@ -177,27 +174,27 @@ end return Loc ["STRING_UNKNOW"] end - + --[[global]] DETAILS_SEGMENTID_OVERALL = -1 --[[global]] DETAILS_SEGMENTID_CURRENT = 0 - + --enum segments type --[[global]] DETAILS_SEGMENTTYPE_GENERIC = 0 - + --[[global]] DETAILS_SEGMENTTYPE_OVERALL = 1 - + --[[global]] DETAILS_SEGMENTTYPE_DUNGEON_TRASH = 5 --[[global]] DETAILS_SEGMENTTYPE_DUNGEON_BOSS = 6 - + --[[global]] DETAILS_SEGMENTTYPE_RAID_TRASH = 7 --[[global]] DETAILS_SEGMENTTYPE_RAID_BOSS = 8 - + --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC = 10 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH = 11 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL = 12 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL = 13 --[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS = 14 - + --[[global]] DETAILS_SEGMENTTYPE_PVP_ARENA = 20 --[[global]] DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND = 21 @@ -216,31 +213,31 @@ elseif (isMythicDungeonTrashOverall) then return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL end - + local bossEncounter = self.is_boss if (bossEncounter) then return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS end - + return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC end end - + --arena local arenaInfo = self.is_arena if (arenaInfo) then return DETAILS_SEGMENTTYPE_PVP_ARENA end - + --battleground local battlegroundInfo = self.is_pvp if (battlegroundInfo) then return DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND end - + --dungeon or raid local instanceType = self.instance_type - + if (instanceType == "party") then local bossEncounter = self.is_boss if (bossEncounter) then @@ -248,7 +245,7 @@ else return DETAILS_SEGMENTTYPE_DUNGEON_TRASH end - + elseif (instanceType == "raid") then local bossEncounter = self.is_boss if (bossEncounter) then @@ -257,12 +254,12 @@ return DETAILS_SEGMENTTYPE_RAID_TRASH end end - + --overall data if (self == _detalhes.tabela_overall) then return DETAILS_SEGMENTTYPE_OVERALL end - + return DETAILS_SEGMENTTYPE_GENERIC end @@ -271,38 +268,38 @@ return self [container]._ActorTable end - function combate:GetActor (container, name) + function combate:GetActor(container, name) local index = self [container] and self [container]._NameIndexTable [name] if (index) then return self [container]._ActorTable [index] end return nil end - + --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 combatTime = self:GetCombatTime() + local m, s = floor(combatTime/60), floor(combatTime%60) return m, s end - + function combate:GetCombatTime() if (self.end_time) then return _math_max (self.end_time - self.start_time, 0.1) elseif (self.start_time and _detalhes.in_combat and self ~= _detalhes.tabela_overall) then - return _math_max (_GetTime() - self.start_time, 0.1) + return _math_max (GetTime() - self.start_time, 0.1) else return 0.1 end end - + function combate:GetStartTime() return self.start_time end function combate:SetStartTime (t) self.start_time = t end - + function combate:GetEndTime() return self.end_time end @@ -312,7 +309,7 @@ --return the total of a specific attribute local power_table = {0, 1, 3, 6, 0, "alternatepower"} - + function combate:GetTotal (attribute, subAttribute, onlyGroup) if (attribute == 1 or attribute == 2) then if (onlyGroup) then @@ -320,7 +317,7 @@ else return self.totals [attribute] end - + elseif (attribute == 3) then if (subAttribute == 5) then --resources return self.totals.resources or 0 @@ -330,7 +327,7 @@ else return self.totals [attribute] [power_table [subAttribute]] end - + elseif (attribute == 4) then local subName = _detalhes:GetInternalSubAttributeName (attribute, subAttribute) if (onlyGroup) then @@ -339,18 +336,16 @@ return self.totals [attribute] [subName] end end - + return 0 end - + function combate:CreateAlternatePowerTable (actorName) local t = {last = 0, total = 0} self.alternate_power [actorName] = t return t end - local tremove = _G.tremove - --delete an actor from the combat ~delete ~erase ~remove function combate:DeleteActor(attribute, actorName, removeDamageTaken, cannotRemap) local container = self[attribute] @@ -369,7 +364,7 @@ for i = 1, #actorTable do local actor = actorTable[i] if (actor.nome == actorName) then - --print ("Details: found the actor: ", actorName, actor.nome, i) + --print("Details: found the actor: ", actorName, actor.nome, i) indexToDelete = i break end @@ -412,7 +407,7 @@ if (indexToDelete) then local actorToDelete = self(attribute, actorName) local actorToDelete2 = container._ActorTable[indexToDelete] - + if (actorToDelete ~= actorToDelete2) then Details:Msg("error 0xDE8745") end @@ -445,18 +440,18 @@ function combate:NovaTabela (iniciada, _tabela_overall, combatId, ...) 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 - - _setmetatable (esta_tabela, combate) - + + 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 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 @@ -479,45 +474,45 @@ esta_tabela.data_fim = 0 esta_tabela.data_inicio = 0 esta_tabela.tempo_start = _tempo - + --record deaths esta_tabela.last_events_tables = {} - + --last events from players esta_tabela.player_last_events = {} - + --players in the raid esta_tabela.raid_roster = {} esta_tabela.raid_roster_indexed = {} - + --frags esta_tabela.frags = {} esta_tabela.frags_need_refresh = false - + --alternate power esta_tabela.alternate_power = {} - + --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 esta_tabela.spells_cast_timeline = {} esta_tabela.aura_timeline = {} esta_tabela.cleu_timeline = {} - + --cleu events esta_tabela.cleu_events = { n = 1 --event counter } - + --Skill cache (not used) esta_tabela.CombatSkillCache = {} -- a tabela sem o tempo de inicio � a tabela descartavel do inicio do addon if (iniciada) then --esta_tabela.start_time = _tempo - esta_tabela.start_time = _GetTime() + esta_tabela.start_time = GetTime() esta_tabela.end_time = nil else esta_tabela.start_time = 0 @@ -530,7 +525,7 @@ esta_tabela[3].need_refresh = true esta_tabela[4].need_refresh = true esta_tabela[5].need_refresh = true - + 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] @@ -558,13 +553,13 @@ 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. voidzone_damage = 0, frags_total = 0, --end } - + esta_tabela.totals_grupo = { 0, --dano 0, --cura @@ -574,13 +569,13 @@ [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 + dead = 0, --armazena quantas vezes essa oessia morreu cooldowns_defensive = 0, --armazena quantos cooldowns a raid usou buff_uptime = 0, debuff_uptime = 0 @@ -606,7 +601,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 +616,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 @@ -647,11 +642,11 @@ function combate:seta_tempo_decorrido() --self.end_time = _tempo - self.end_time = _GetTime() + self.end_time = GetTime() end function _detalhes.refresh:r_combate (tabela_combate, shadow) - _setmetatable (tabela_combate, _detalhes.combate) + setmetatable(tabela_combate, _detalhes.combate) tabela_combate.__index = _detalhes.combate tabela_combate.shadow = shadow end @@ -671,50 +666,50 @@ end --sub dano - for index, actor_T2 in _ipairs(combate2[1]._ActorTable) do + 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 + 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 + 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 + 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 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) + for i = #combate1.last_events_tables, #combate1.last_events_tables-amt_mortes, -1 do + tremove(combate1.last_events_tables, #combate1.last_events_tables) end end - + --frags - for fragName, fragAmount in pairs(combate2.frags) do + for fragName, fragAmount in pairs(combate2.frags) do if (fragAmount) then if (combate1.frags [fragName]) then combate1.frags [fragName] = combate1.frags [fragName] - fragAmount @@ -724,19 +719,19 @@ end end combate1.frags_need_refresh = true - + --alternate power local overallPowerTable = combate1.alternate_power - for actorName, powerTable in pairs(combate2.alternate_power) do + for actorName, powerTable in pairs(combate2.alternate_power) do local power = overallPowerTable [actorName] if (power) then power.total = power.total - powerTable.total end combate2.alternate_power [actorName].last = 0 end - + return combate1 - + end combate.__add = function(combate1, combate2) @@ -746,11 +741,11 @@ if (combate1 ~= _detalhes.tabela_overall) then custom_combat = combate1 end - + 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 shadow = _detalhes.atributo_damage:r_connect_shadow (actor, true, custom_combat) elseif (class_type == class_type_cura) then @@ -760,16 +755,16 @@ elseif (class_type == class_type_misc) then shadow = _detalhes.atributo_misc:r_connect_shadow (actor, true, custom_combat) end - + shadow.boss_fight_component = actor.boss_fight_component or shadow.boss_fight_component shadow.fight_component = actor.fight_component or shadow.fight_component shadow.grupo = actor.grupo or shadow.grupo end end - + --alternate power local overallPowerTable = combate1.alternate_power - for actorName, powerTable in pairs(combate2.alternate_power) do + for actorName, powerTable in pairs(combate2.alternate_power) do local power = overallPowerTable [actorName] if (not power) then power = combate1:CreateAlternatePowerTable (actorName) diff --git a/classes/class_custom.lua b/classes/class_custom.lua index bd04a44a..bc71cf55 100644 --- a/classes/class_custom.lua +++ b/classes/class_custom.lua @@ -15,14 +15,14 @@ local _table_insert = table.insert --lua local local _table_size = table.getn --lua local local _setmetatable = setmetatable --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _rawget= rawget --lua local local _math_min = math.min --lua local local _math_max = math.max --lua local local _bit_band = bit.band --lua local local _unpack = unpack --lua local - local _type = type --lua local + local type = type --lua local local _pcall = pcall -- lua local local _GetSpellInfo = _detalhes.getspellinfo -- api local @@ -34,7 +34,7 @@ local _GetUnitName = GetUnitName -- api local local _string_replace = _detalhes.string.replace --details api - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --constants @@ -116,7 +116,7 @@ DetailsFramework:SetEnvironment(func) _detalhes.custom_function_cache [instance.customName] = func else - _detalhes:Msg ("|cFFFF9900error compiling code for custom display " .. (instance.customName or "") .. " |r:", errortext) + _detalhes:Msg("|cFFFF9900error compiling code for custom display " .. (instance.customName or "") .. " |r:", errortext) end if (custom_object.tooltip) then @@ -125,7 +125,7 @@ DetailsFramework:SetEnvironment(tooltip_script) _detalhes.custom_function_cache [instance.customName .. "Tooltip"] = tooltip_script else - _detalhes:Msg ("|cFFFF9900error compiling tooltip code for custom display " .. (instance.customName or "") .. " |r:", errortext) + _detalhes:Msg("|cFFFF9900error compiling tooltip code for custom display " .. (instance.customName or "") .. " |r:", errortext) end end @@ -135,7 +135,7 @@ DetailsFramework:SetEnvironment(total_script) _detalhes.custom_function_cache [instance.customName .. "Total"] = total_script else - _detalhes:Msg ("|cFFFF9900error compiling total code for custom display " .. (instance.customName or "") .. " |r:", errortext) + _detalhes:Msg("|cFFFF9900error compiling total code for custom display " .. (instance.customName or "") .. " |r:", errortext) end end @@ -145,19 +145,19 @@ DetailsFramework:SetEnvironment(percent_script) _detalhes.custom_function_cache [instance.customName .. "Percent"] = percent_script else - _detalhes:Msg ("|cFFFF9900error compiling percent code for custom display " .. (instance.customName or "") .. " |r:", errortext) + _detalhes:Msg("|cFFFF9900error compiling percent code for custom display " .. (instance.customName or "") .. " |r:", errortext) end end end if (not func) then - _detalhes:Msg (Loc ["STRING_CUSTOM_FUNC_INVALID"], func) + _detalhes:Msg(Loc ["STRING_CUSTOM_FUNC_INVALID"], func) _detalhes:EndRefresh (instance, 0, combat, combat [1]) end local okey, _total, _top, _amount = _pcall (func, combat, instance_container, instance) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display function|r:", _total) + _detalhes:Msg("|cFFFF9900error on custom display function|r:", _total) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end @@ -216,14 +216,14 @@ 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) if (not okey) then - _detalhes:Msg ("|cFFFF9900percent script error|r:", percent) + _detalhes:Msg("|cFFFF9900percent script error|r:", percent) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end else @@ -233,7 +233,7 @@ if (total_script) then 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) + _detalhes:Msg("|cFFFF9900total script error|r:", value) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end @@ -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 @@ -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()) @@ -422,8 +422,8 @@ row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") row1:SetValue(100) - local r, g, b = unpack (instance.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + 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:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -458,8 +458,8 @@ row1.lineText4:SetText(_detalhes:ToK2 (total) .. " (" .. _detalhes:ToK (total / combat_time) .. ")") row1:SetValue(100) - local r, g, b = unpack (instance.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + 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:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -511,7 +511,7 @@ --local value, top, total, combat, instance = ... okey, percent = _pcall (percent_script, self.value, top, total, combat, instance, self) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display function|r:", percent) + _detalhes:Msg("|cFFFF9900error on custom display function|r:", percent) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end else @@ -530,7 +530,7 @@ if (total_script) then local okey, value = _pcall (total_script, self.value, top, total, combat, instance, self) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display function|r:", value) + _detalhes:Msg("|cFFFF9900error on custom display function|r:", value) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end @@ -578,10 +578,10 @@ if (not school_color) then school_color = _detalhes.school_colors ["unknown"] end - actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color) + actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack(school_color) else local color = _detalhes.school_colors ["unknown"] - actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (color) + actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack(color) end else actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() @@ -614,10 +614,10 @@ 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) + esta_barra.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then - esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) + esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end return self:RefreshBarra (esta_barra, instancia) @@ -674,10 +674,10 @@ if (not school_color) then school_color = _detalhes.school_colors ["unknown"] end - actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (school_color) + actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack(school_color) else local color = _detalhes.school_colors ["unknown"] - actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack (color) + actor_class_color_r, actor_class_color_g, actor_class_color_b = _unpack(color) end else actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor() @@ -690,7 +690,7 @@ if (self.classe == "UNKNOW") then 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) + esta_barra.icone_classe:SetVertexColor(1, 1, 1) elseif (self.classe == "UNGROUPPLAYER") then if (self.enemy) then @@ -710,12 +710,12 @@ esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) end end - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + 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: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) + esta_barra.icone_classe:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) else if (self.id) then @@ -725,17 +725,17 @@ 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:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec or self.my_actor.spec])) + 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:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) + 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:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) + esta_barra.icone_classe:SetTexCoord (_unpack(CLASS_ICON_TCOORDS [self.classe])) end end - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + esta_barra.icone_classe:SetVertexColor(1, 1, 1) end --left text @@ -746,14 +746,14 @@ end function atributo_custom:CreateCustomActorContainer() - return _setmetatable ({ + return _setmetatable({ _NameIndexTable = {}, _ActorTable = {} }, {__index = atributo_custom}) end function atributo_custom:ResetCustomActorContainer() - for _, actor in _ipairs(self._ActorTable) do + for _, actor in ipairs(self._ActorTable) do actor.value = actor.value - _math_floor(actor.value) --actor.value = _detalhes:GetOrderNumber(actor.nome) end @@ -856,7 +856,7 @@ end end - local newActor = _setmetatable ({ + local newActor = _setmetatable({ nome = actor.nome or actor.name, classe = class, value = _detalhes:GetOrderNumber(), @@ -865,7 +865,7 @@ }, atributo_custom.mt) newActor.name_complement = name_complement - newActor.displayName = actor.displayName or (_detalhes:GetOnlyName (newActor.nome) .. (name_complement or "")) + newActor.displayName = actor.displayName or (_detalhes:GetOnlyName(newActor.nome) .. (name_complement or "")) newActor.spec = actor.spec newActor.enemy = actor.enemy @@ -891,7 +891,7 @@ newActor.classe = Details:GetClass(actor.nome or actor.name) or "UNKNOW" end if (newActor.classe == "UNGROUPPLAYER") then - --atributo_custom:ScheduleTimer ("UpdateClass", 5, {newActor = newActor, actor = actor}) + --atributo_custom:ScheduleTimer("UpdateClass", 5, {newActor = newActor, actor = actor}) Details.Schedules.NewTimer(5, atributo_custom.UpdateClass, self, {new_actor = newActor, actor = actor}) end end @@ -912,7 +912,7 @@ end function atributo_custom:CreateCustomDisplayObject() - return _setmetatable ({ + return _setmetatable({ name = "new custom", icon = [[Interface\ICONS\TEMP]], author = "unknown", @@ -958,13 +958,13 @@ if (not school_color) then school_color = _detalhes.school_colors ["unknown"] end - r, g, b = _unpack (school_color) + r, g, b = _unpack(school_color) else r, g, b = actor:GetClassColor() end if (actor.id) then - _detalhes:AddTooltipSpellHeaderText (select (1, _GetSpellInfo(actor.id)), "yellow", 1, select (3, _GetSpellInfo(actor.id)), 0.90625, 0.109375, 0.15625, 0.875) + _detalhes:AddTooltipSpellHeaderText (select(1, _GetSpellInfo(actor.id)), "yellow", 1, select(3, _GetSpellInfo(actor.id)), 0.90625, 0.109375, 0.15625, 0.875) else _detalhes:AddTooltipSpellHeaderText (custom_object:GetName(), "yellow", 1, custom_object:GetIcon(), 0.90625, 0.109375, 0.15625, 0.875) end @@ -980,7 +980,7 @@ end local okey, errortext = _pcall (func, actor, instance.showing, instance, keydown) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display tooltip function|r:", errortext) + _detalhes:Msg("|cFFFF9900error on custom display tooltip function|r:", errortext) return false end end @@ -1084,7 +1084,7 @@ 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 @@ -1121,7 +1121,7 @@ --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 @@ -1135,14 +1135,14 @@ end --restore metatable and indexes - for index, custom_object in _ipairs(_detalhes.custom) do - _setmetatable (custom_object, atributo_custom) + 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 @@ -1180,7 +1180,7 @@ break end end - setmetatable (object, _detalhes.atributo_custom) + setmetatable(object, _detalhes.atributo_custom) object.__index = _detalhes.atributo_custom _detalhes.custom [#_detalhes.custom+1] = object end @@ -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 @@ -1287,7 +1287,7 @@ if (potionUsed) then local name, _, icon = GetSpellInfo(spellId) - GameCooltip:AddLine (name, potionUsed.activedamt) + GameCooltip:AddLine(name, potionUsed.activedamt) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) end @@ -1309,7 +1309,7 @@ table.remove (self.custom, i) end end - setmetatable (PotionUsed, _detalhes.atributo_custom) + setmetatable(PotionUsed, _detalhes.atributo_custom) PotionUsed.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = PotionUsed end @@ -1366,29 +1366,29 @@ local hs = actor:GetSpell (6262) if (hs) then - GameCooltip:AddLine (select (1, GetSpellInfo(6262)), _detalhes:ToK(hs.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo(6262)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddLine(select(1, GetSpellInfo(6262)), _detalhes:ToK(hs.total)) + GameCooltip:AddIcon (select(3, GetSpellInfo(6262)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_HEALTH_POTION_ID) if (pot) then - GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddLine(select(1, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), _detalhes:ToK(pot.total)) + GameCooltip:AddIcon (select(3, GetSpellInfo(DETAILS_HEALTH_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_HEALTH_POTION2_ID) if (pot) then - GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddLine(select(1, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), _detalhes:ToK(pot.total)) + GameCooltip:AddIcon (select(3, GetSpellInfo(DETAILS_HEALTH_POTION2_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end local pot = actor:GetSpell (DETAILS_REJU_POTION_ID) if (pot) then - GameCooltip:AddLine (select (1, GetSpellInfo(DETAILS_REJU_POTION_ID)), _detalhes:ToK(pot.total)) - GameCooltip:AddIcon (select (3, GetSpellInfo(DETAILS_REJU_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) + GameCooltip:AddLine(select(1, GetSpellInfo(DETAILS_REJU_POTION_ID)), _detalhes:ToK(pot.total)) + GameCooltip:AddIcon (select(3, GetSpellInfo(DETAILS_REJU_POTION_ID)), 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end @@ -1412,7 +1412,7 @@ table.remove (self.custom, i) end end - setmetatable (Healthstone, _detalhes.atributo_custom) + setmetatable(Healthstone, _detalhes.atributo_custom) Healthstone.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = Healthstone end @@ -1431,7 +1431,7 @@ script_version = 3, total_script = [[ local value, top, total, combat, instance = ... - local minutos, segundos = math.floor (value/60), math.floor (value%60) + local minutos, segundos = math.floor(value/60), math.floor(value%60) return minutos .. "m " .. segundos .. "s" ]], percent_script = [[ @@ -1478,7 +1478,7 @@ table.remove (self.custom, i) end end - setmetatable (DamageActivityTime, _detalhes.atributo_custom) + setmetatable(DamageActivityTime, _detalhes.atributo_custom) DamageActivityTime.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = DamageActivityTime end @@ -1495,7 +1495,7 @@ script_version = 2, total_script = [[ local value, top, total, combat, instance = ... - local minutos, segundos = math.floor (value/60), math.floor (value%60) + local minutos, segundos = math.floor(value/60), math.floor(value%60) return minutos .. "m " .. segundos .. "s" ]], percent_script = [[ @@ -1542,7 +1542,7 @@ table.remove (self.custom, i) end end - setmetatable (HealActivityTime, _detalhes.atributo_custom) + setmetatable(HealActivityTime, _detalhes.atributo_custom) HealActivityTime.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = HealActivityTime end @@ -1569,7 +1569,7 @@ for index, character in ipairs(misc_actors) do if (character.cc_done and character:IsPlayer()) then - local cc_done = floor (character.cc_done) + local cc_done = floor(character.cc_done) instance_container:AddValue (character, cc_done) total = total + cc_done if (cc_done > top) then @@ -1592,7 +1592,7 @@ for index, spell in ipairs(spells) do local name, _, icon = GetSpellInfo(spell [1]) - GameCooltip:AddLine (name, spell [2]) + GameCooltip:AddLine(name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) end @@ -1609,7 +1609,7 @@ _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6) for index, target in ipairs(targets) do - GameCooltip:AddLine (target[1], target [2]) + GameCooltip:AddLine(target[1], target [2]) _detalhes:AddTooltipBackgroundStatusbar() local class, _, _, _, _, r, g, b = _detalhes:GetClass (target [1]) @@ -1624,7 +1624,7 @@ ]], total_script = [[ local value, top, total, combat, instance = ... - return floor (value) + return floor(value) ]], } @@ -1638,7 +1638,7 @@ end end if (not have) then - setmetatable (CC_Done, _detalhes.atributo_custom) + setmetatable(CC_Done, _detalhes.atributo_custom) CC_Done.__index = _detalhes.atributo_custom for i, custom in ipairs(self.custom) do @@ -1734,7 +1734,7 @@ for index, spell in ipairs(spells) do local name, _, icon = GetSpellInfo(spell [1]) - GameCooltip:AddLine (name, spell [2]) + GameCooltip:AddLine(name, spell [2]) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) end @@ -1743,7 +1743,7 @@ _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6) for index, t in ipairs(from) do - GameCooltip:AddLine (t[1], t[2]) + GameCooltip:AddLine(t[1], t[2]) _detalhes:AddTooltipBackgroundStatusbar() local class, _, _, _, _, r, g, b = _detalhes:GetClass (t [1]) @@ -1758,7 +1758,7 @@ ]], total_script = [[ local value, top, total, combat, instance = ... - return floor (value) + return floor(value) ]], } @@ -1772,7 +1772,7 @@ end end if (not have) then - setmetatable (CC_Received, _detalhes.atributo_custom) + setmetatable(CC_Received, _detalhes.atributo_custom) CC_Received.__index = _detalhes.atributo_custom for i, custom in ipairs(self.custom) do @@ -1808,7 +1808,7 @@ local player local pet_attribute - local role = DetailsFramework.UnitGroupRolesAssigned ("player") + local role = DetailsFramework.UnitGroupRolesAssigned("player") local spec = DetailsFramework.GetSpecialization() role = spec and DetailsFramework.GetSpecializationRole (spec) or role @@ -1868,7 +1868,7 @@ local GC = GameCooltip GC:SetOption("YSpacingMod", 0) - local role = DetailsFramework.UnitGroupRolesAssigned ("player") + local role = DetailsFramework.UnitGroupRolesAssigned("player") if (spell.n_dmg) then @@ -1888,7 +1888,7 @@ if (misc_actor) then local debuff_uptime = misc_actor.debuff_uptime_spells and misc_actor.debuff_uptime_spells._ActorTable [spell.id] and misc_actor.debuff_uptime_spells._ActorTable [spell.id].uptime if (debuff_uptime) then - debuff_uptime_total = floor (debuff_uptime / instance.showing:GetCombatTime() * 100) + debuff_uptime_total = floor(debuff_uptime / instance.showing:GetCombatTime() * 100) end local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spell.id] @@ -1909,30 +1909,30 @@ end --Cooltip code - GC:AddLine ("Casts:", cast_string or "?") + GC:AddLine("Casts:", cast_string or "?") GC:AddStatusBar (100, 1, R, G, B, A) if (debuff_uptime_total ~= "") then - GC:AddLine ("Uptime:", (debuff_uptime_total or "?") .. "%") + GC:AddLine("Uptime:", (debuff_uptime_total or "?") .. "%") GC:AddStatusBar (100, 1, R, G, B, A) end - GC:AddLine ("Hits:", spell.counter) + GC:AddLine("Hits:", spell.counter) GC:AddStatusBar (100, 1, R, G, B, A) local average = spell.total / total_hits - GC:AddLine ("Average:", _detalhes:ToK (average)) + GC:AddLine("Average:", _detalhes:ToK (average)) GC:AddStatusBar (100, 1, R, G, B, A) - GC:AddLine ("E-Dps:", _detalhes:ToK (spell.total / combat_time)) + GC:AddLine("E-Dps:", _detalhes:ToK (spell.total / combat_time)) GC:AddStatusBar (100, 1, R, G, B, A) - GC:AddLine ("School:", schooltext) + GC:AddLine("School:", schooltext) GC:AddStatusBar (100, 1, R, G, B, A) - --GC:AddLine (" ") + --GC:AddLine(" ") - GC:AddLine ("Normal Hits: ", spell.n_amt .. " (" ..floor ( spell.n_amt/total_hits*100) .. "%)") + GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)") GC:AddStatusBar (100, 1, R, G, B, A) local n_average = spell.n_dmg / spell.n_amt @@ -1940,12 +1940,12 @@ local P = average/n_average*100 T = P*T/100 - GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_dmg / T )) + GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_dmg / T )) GC:AddStatusBar (100, 1, R, G, B, A) - --GC:AddLine (" ") + --GC:AddLine(" ") - GC:AddLine ("Critical Hits: ", spell.c_amt .. " (" ..floor ( spell.c_amt/total_hits*100) .. "%)") + GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)") GC:AddStatusBar (100, 1, R, G, B, A) if (spell.c_amt > 0) then @@ -1955,9 +1955,9 @@ T = P*T/100 local crit_dps = spell.c_dmg / T - GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps)) + GC:AddLine("Average / E-Dps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps)) else - GC:AddLine ("Average / E-Dps: ", "0 / 0") + GC:AddLine("Average / E-Dps: ", "0 / 0") end GC:AddStatusBar (100, 1, R, G, B, A) @@ -1977,22 +1977,22 @@ local combat_time = instance.showing:GetCombatTime() --Cooltip code - GC:AddLine ("Hits:", spell.counter) + GC:AddLine("Hits:", spell.counter) GC:AddStatusBar (100, 1, R, G, B, A) local average = spell.total / total_hits - GC:AddLine ("Average:", _detalhes:ToK (average)) + GC:AddLine("Average:", _detalhes:ToK (average)) GC:AddStatusBar (100, 1, R, G, B, A) - GC:AddLine ("E-Hps:", _detalhes:ToK (spell.total / combat_time)) + GC:AddLine("E-Hps:", _detalhes:ToK (spell.total / combat_time)) GC:AddStatusBar (100, 1, R, G, B, A) - GC:AddLine ("School:", schooltext) + GC:AddLine("School:", schooltext) GC:AddStatusBar (100, 1, R, G, B, A) - --GC:AddLine (" ") + --GC:AddLine(" ") - GC:AddLine ("Normal Hits: ", spell.n_amt .. " (" ..floor ( spell.n_amt/total_hits*100) .. "%)") + GC:AddLine("Normal Hits: ", spell.n_amt .. " (" ..floor( spell.n_amt/total_hits*100) .. "%)") GC:AddStatusBar (100, 1, R, G, B, A) local n_average = spell.n_curado / spell.n_amt @@ -2000,12 +2000,12 @@ local P = average/n_average*100 T = P*T/100 - GC:AddLine ("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_curado / T )) + GC:AddLine("Average / E-Dps: ", _detalhes:ToK (n_average) .. " / " .. format ("%.1f",spell.n_curado / T )) GC:AddStatusBar (100, 1, R, G, B, A) - --GC:AddLine (" ") + --GC:AddLine(" ") - GC:AddLine ("Critical Hits: ", spell.c_amt .. " (" ..floor ( spell.c_amt/total_hits*100) .. "%)") + GC:AddLine("Critical Hits: ", spell.c_amt .. " (" ..floor( spell.c_amt/total_hits*100) .. "%)") GC:AddStatusBar (100, 1, R, G, B, A) if (spell.c_amt > 0) then @@ -2015,9 +2015,9 @@ T = P*T/100 local crit_dps = spell.c_curado / T - GC:AddLine ("Average / E-Hps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps)) + GC:AddLine("Average / E-Hps: ", _detalhes:ToK (c_average) .. " / " .. _detalhes:comma_value (crit_dps)) else - GC:AddLine ("Average / E-Hps: ", "0 / 0") + GC:AddLine("Average / E-Hps: ", "0 / 0") end GC:AddStatusBar (100, 1, R, G, B, A) @@ -2026,7 +2026,7 @@ percent_script = [[ local value, top, total, combat, instance = ... - local dps = _detalhes:ToK (floor (value) / combat:GetCombatTime()) + local dps = _detalhes:ToK (floor(value) / combat:GetCombatTime()) local percent = string.format("%.1f", value/total*100) return dps .. ", " .. percent ]], @@ -2040,7 +2040,7 @@ end end if (not have) then - setmetatable (MySpells, _detalhes.atributo_custom) + setmetatable(MySpells, _detalhes.atributo_custom) MySpells.__index = _detalhes.atributo_custom for i, custom in ipairs(self.custom) do @@ -2115,7 +2115,7 @@ local DamageOnStar = RaidTargets [128] if (DamageOnStar) then --RAID_TARGET_8 is the built-in localized word for 'Skull'. - GameCooltip:AddLine (RAID_TARGET_8 .. ":", format_func (_, DamageOnStar)) + GameCooltip:AddLine(RAID_TARGET_8 .. ":", format_func (_, DamageOnStar)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_8", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end @@ -2132,7 +2132,7 @@ end end if (not have) then - setmetatable (DamageOnSkullTarget, _detalhes.atributo_custom) + setmetatable(DamageOnSkullTarget, _detalhes.atributo_custom) DamageOnSkullTarget.__index = _detalhes.atributo_custom for i, custom in ipairs(self.custom) do @@ -2203,49 +2203,49 @@ local DamageOnStar = RaidTargets [1] if (DamageOnStar) then - GameCooltip:AddLine (RAID_TARGET_1 .. ":", format_func (_, DamageOnStar)) + GameCooltip:AddLine(RAID_TARGET_1 .. ":", format_func (_, DamageOnStar)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_1", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnCircle = RaidTargets [2] if (DamageOnCircle) then - GameCooltip:AddLine (RAID_TARGET_2 .. ":", format_func (_, DamageOnCircle)) + GameCooltip:AddLine(RAID_TARGET_2 .. ":", format_func (_, DamageOnCircle)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_2", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnDiamond = RaidTargets [4] if (DamageOnDiamond) then - GameCooltip:AddLine (RAID_TARGET_3 .. ":", format_func (_, DamageOnDiamond)) + GameCooltip:AddLine(RAID_TARGET_3 .. ":", format_func (_, DamageOnDiamond)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_3", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnTriangle = RaidTargets [8] if (DamageOnTriangle) then - GameCooltip:AddLine (RAID_TARGET_4 .. ":", format_func (_, DamageOnTriangle)) + GameCooltip:AddLine(RAID_TARGET_4 .. ":", format_func (_, DamageOnTriangle)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_4", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnMoon = RaidTargets [16] if (DamageOnMoon) then - GameCooltip:AddLine (RAID_TARGET_5 .. ":", format_func (_, DamageOnMoon)) + GameCooltip:AddLine(RAID_TARGET_5 .. ":", format_func (_, DamageOnMoon)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_5", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnSquare = RaidTargets [32] if (DamageOnSquare) then - GameCooltip:AddLine (RAID_TARGET_6 .. ":", format_func (_, DamageOnSquare)) + GameCooltip:AddLine(RAID_TARGET_6 .. ":", format_func (_, DamageOnSquare)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_6", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end local DamageOnCross = RaidTargets [64] if (DamageOnCross) then - GameCooltip:AddLine (RAID_TARGET_7 .. ":", format_func (_, DamageOnCross)) + GameCooltip:AddLine(RAID_TARGET_7 .. ":", format_func (_, DamageOnCross)) GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_7", 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height) Details:AddTooltipBackgroundStatusbar() end @@ -2262,7 +2262,7 @@ end end if (not have) then - setmetatable (DamageOnAnyTarget, _detalhes.atributo_custom) + setmetatable(DamageOnAnyTarget, _detalhes.atributo_custom) DamageOnAnyTarget.__index = _detalhes.atributo_custom for i, custom in ipairs(self.custom) do @@ -2298,9 +2298,9 @@ local total, top, amount = 0, 0, 0 --get the overall combat - local OverallCombat = Details:GetCombat (-1) + local OverallCombat = Details:GetCombat(-1) --get the current combat - local CurrentCombat = Details:GetCombat (0) + local CurrentCombat = Details:GetCombat(0) if (not OverallCombat.GetActorList or not CurrentCombat.GetActorList) then return 0, 0, 0 @@ -2344,16 +2344,16 @@ --Cooltip code --get the overall combat - local OverallCombat = Details:GetCombat (-1) + local OverallCombat = Details:GetCombat(-1) --get the current combat - local CurrentCombat = Details:GetCombat (0) + local CurrentCombat = Details:GetCombat(0) local AllSpells = {} local playerTotal = 0 --overall - local player = OverallCombat [1]:GetActor (actor.nome) + local player = OverallCombat [1]:GetActor(actor.nome) if (player) then playerTotal = playerTotal + player.total local playerSpells = player:GetSpellList() @@ -2363,7 +2363,7 @@ end --current if (Details.in_combat) then - local player = CurrentCombat [1]:GetActor (actor.nome) + local player = CurrentCombat [1]:GetActor(actor.nome) if (player) then playerTotal = playerTotal + player.total local playerSpells = player:GetSpellList() @@ -2386,7 +2386,7 @@ local topSpellTotal = sortedList and sortedList[1] and sortedList[1][2] or 0 for i, t in ipairs(sortedList) do - local spellID, total = unpack (t) + local spellID, total = unpack(t) if (total > 1) then local spellName, _, spellIcon = Details.GetSpellInfo(spellID) @@ -2397,7 +2397,7 @@ formatedSpellPercent = formatedSpellPercent .. "0" end - GameCooltip:AddLine (spellName, format_func (_, total) .. " " .. formatedSpellPercent .. "%") + GameCooltip:AddLine(spellName, format_func (_, total) .. " " .. formatedSpellPercent .. "%") Details:AddTooltipBackgroundStatusbar(false, total / topSpellTotal * 100) GameCooltip:AddIcon (spellIcon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height, 0.078125, 0.921875, 0.078125, 0.921875) @@ -2415,11 +2415,11 @@ local value, top, total, combat, instance = ... --get the time of overall combat - local OverallCombatTime = Details:GetCombat (-1):GetCombatTime() + local OverallCombatTime = Details:GetCombat(-1):GetCombatTime() --get the time of current combat if the player is in combat if (Details.in_combat) then - local CurrentCombatTime = Details:GetCombat (0):GetCombatTime() + local CurrentCombatTime = Details:GetCombat(0):GetCombatTime() OverallCombatTime = OverallCombatTime + CurrentCombatTime end @@ -2447,7 +2447,7 @@ table.remove (self.custom, i) end end - setmetatable (DynamicOverallDamage, _detalhes.atributo_custom) + setmetatable(DynamicOverallDamage, _detalhes.atributo_custom) DynamicOverallDamage.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = DynamicOverallDamage end @@ -2479,7 +2479,7 @@ --get the damage absorbed by all the actor pets for petIndex, petName in ipairs(actor.pets) do - local pet = Combat :GetActor (1, petName) + local pet = Combat :GetActor(1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed end @@ -2513,21 +2513,21 @@ --get the damage absorbed by all the actor pets for petIndex, petName in ipairs(actor.pets) do - local pet = Combat :GetActor (1, petName) + local pet = Combat :GetActor(1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed end end - GameCooltip:AddLine (actor:Name(), format_func (_, actor.totalabsorbed)) + GameCooltip:AddLine(actor:Name(), format_func (_, actor.totalabsorbed)) Details:AddTooltipBackgroundStatusbar() for petIndex, petName in ipairs(actor.pets) do - local pet = Combat :GetActor (1, petName) + local pet = Combat :GetActor(1, petName) if (pet) then totalAbsorb = totalAbsorb + pet.totalabsorbed - GameCooltip:AddLine (petName, format_func (_, pet.totalabsorbed)) + GameCooltip:AddLine(petName, format_func (_, pet.totalabsorbed)) Details:AddTooltipBackgroundStatusbar() end @@ -2548,7 +2548,7 @@ table.remove (self.custom, i) end end - setmetatable (DamageOnShields, _detalhes.atributo_custom) + setmetatable(DamageOnShields, _detalhes.atributo_custom) DamageOnShields.__index = _detalhes.atributo_custom self.custom [#self.custom+1] = DamageOnShields end diff --git a/classes/class_damage.lua b/classes/class_damage.lua index 1fb5f333..9ab8f5e6 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -1,8 +1,8 @@ --damage object local Details = _G.Details - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) - local Translit = LibStub ("LibTranslit-1.0") + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) + local Translit = LibStub("LibTranslit-1.0") local gump = Details.gump local _ @@ -16,15 +16,15 @@ local _table_size = table.getn --lua local local _setmetatable = setmetatable --lua local local _getmetatable = getmetatable --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _rawget= rawget --lua local local _math_min = math.min --lua local local _math_max = math.max --lua local - local _math_abs = math.abs --lua local + local abs = math.abs --lua local local bitBand = bit.band --lua local local unpack = unpack --lua local - local _type = type --lua local + local type = type --lua local local GameTooltip = GameTooltip --api local local _IsInRaid = IsInRaid --api local local _IsInGroup = IsInGroup --api local @@ -278,7 +278,7 @@ 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 @@ -293,7 +293,7 @@ function Details:ContainerSortEnemies (container, amount, keyName2) --[[exported end function Details:TooltipForCustom (barra) --[[exported]] - GameCooltip:AddLine (Loc ["STRING_LEFT_CLICK_SHARE"]) + GameCooltip:AddLine(Loc ["STRING_LEFT_CLICK_SHARE"]) return true end @@ -366,7 +366,7 @@ function Details:GetBarColor(actor) --[[exported]] end function Details:GetSpellLink(spellid) --[[exported]] - if (_type(spellid) ~= "number") then + if (type(spellid) ~= "number") then return spellid end @@ -440,7 +440,7 @@ end spells = container_habilidades:NovoContainer (container_damage) } - _setmetatable (_new_damageActor, atributo_damage) + _setmetatable(_new_damageActor, atributo_damage) return _new_damageActor end @@ -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 @@ -485,7 +485,7 @@ end local from_spell = tabela [1] --spellid local from_spellname if (from_spell) then - from_spellname = select (1, GetSpellInfo(from_spell)) + from_spellname = select(1, GetSpellInfo(from_spell)) end --get a list of all damage actors @@ -540,7 +540,7 @@ end else for playername, ff_table in pairs(character.friendlyfire) do for spellid, amount in pairs(ff_table.spells) do - local spellname = select (1, GetSpellInfo(spellid)) + local spellname = select(1, GetSpellInfo(spellid)) if (spellname == from_spellname) then local damage_actor = combat (1, playername) local heal_actor = combat (2, playername) @@ -608,7 +608,7 @@ end if (not is_custom_spell) then for spellid, spell in pairs(character.spells._ActorTable) do if (spellid ~= from_spell) then - local spellname = select (1, GetSpellInfo(spellid)) + local spellname = select(1, GetSpellInfo(spellid)) if (spellname == from_spellname) then for targetname, amount in pairs(spell.targets) do @@ -650,8 +650,8 @@ end 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) + local spellname, _, spellicon = select(1, _GetSpellInfo(from_spell)) + GameCooltip:AddLine(spellname .. " " .. Loc ["STRING_CUSTOM_ATTRIBUTE_DAMAGE"], nil, nil, headerColor, nil, 10) GameCooltip:AddIcon (spellicon, 1, 1, 14, 14, 0.078125, 0.921875, 0.078125, 0.921875) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\key_shift]], 1, 2, Details.tooltip_key_size_width, Details.tooltip_key_size_height, 0, 1, 0, 0.640625, Details.tooltip_key_overlay2) Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5) @@ -661,7 +661,7 @@ end local lineHeight = Details.tooltip.line_height for index, t in ipairs(Targets) do - GameCooltip:AddLine (Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format ("%.1f", t[2]/total*100) .. "%)") + GameCooltip:AddLine(Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format ("%.1f", t[2]/total*100) .. "%)") local class, _, _, _, _, r, g, b = Details:GetClass (t[1]) GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.8, false, byspell_tooltip_background) @@ -681,7 +681,7 @@ end end end - GameCooltip:AddLine (" ") + GameCooltip:AddLine(" ") Details:AddTooltipReportLineText() GameCooltip:SetOption("YSpacingMod", 0) @@ -710,7 +710,7 @@ end local from_spell = @SPELLID@ local from_spellname if (from_spell) then - from_spellname = select (1, GetSpellInfo(from_spell)) + from_spellname = select(1, GetSpellInfo(from_spell)) end --get a list of all damage actors @@ -759,7 +759,7 @@ end for playername, ff_table in pairs(character.friendlyfire) do for spellid, amount in pairs(ff_table.spells) do - local spellname = select (1, GetSpellInfo(spellid)) + local spellname = select(1, GetSpellInfo(spellid)) if (spellname == from_spellname) then local damage_actor = combat (1, playername) local heal_actor = combat (2, playername) @@ -823,7 +823,7 @@ end if (not is_custom_spell) then for spellid, spell in pairs(character.spells._ActorTable) do if (spellid ~= from_spell) then - local spellname = select (1, GetSpellInfo(spellid)) + local spellname = select(1, GetSpellInfo(spellid)) if (spellname == from_spellname) then for targetname, amount in pairs(spell.targets) do @@ -876,7 +876,7 @@ 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 if (not CustomObject.OnSwitchShow) then @@ -907,13 +907,13 @@ end new_custom_object.script = new_code tinsert(Details.custom, new_custom_object) - setmetatable (new_custom_object, Details.atributo_custom) + setmetatable(new_custom_object, Details.atributo_custom) new_custom_object.__index = Details.atributo_custom return instance:TrocaTabela(instance.segmento, 5, #Details.custom) end - local DTBS_format_name = function(player_name) return Details:GetOnlyName (player_name) end + local DTBS_format_name = function(player_name) return Details:GetOnlyName(player_name) end local DTBS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / bs_tooltip_table.damage_total * 100) .. "%)" end function atributo_damage:ReportSingleDTBSLine (spell, instance, ShiftKeyDown, ControlKeyDown) @@ -937,7 +937,7 @@ end local thisLine = instance.barras [whichRowLine] --pega a refer�ncia da barra na janela if (not thisLine) then - print ("DEBUG: problema com "..whichRowLine .. " " .. colocacao) + print("DEBUG: problema com "..whichRowLine .. " " .. colocacao) return end @@ -950,7 +950,7 @@ end thisLine.colocacao = colocacao if (not _getmetatable (tabela)) then - _setmetatable (tabela, {__call = RefreshBarraBySpell}) + _setmetatable(tabela, {__call = RefreshBarraBySpell}) tabela._custom = true end @@ -1081,7 +1081,7 @@ end for i = 1, math.min (min, #damage_taken_table) do local t = damage_taken_table [i] - GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. format ("%.1f", t[2] / total * 100) .. "%)") + GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. format ("%.1f", t[2] / total * 100) .. "%)") local classe = t[3] if (not classe) then classe = "UNKNOW" @@ -1104,11 +1104,11 @@ end GameCooltip:AddStatusBar (t[2] / top * 100, 1, r, g, b, 1, false, enemies_background) end else - GameCooltip:AddLine (Loc ["STRING_NO_DATA"], nil, 1, "white") + GameCooltip:AddLine(Loc ["STRING_NO_DATA"], nil, 1, "white") GameCooltip:AddIcon (instancia.row_info.icon_file, nil, nil, 14, 14, unpack(Details.class_coords ["UNKNOW"])) end - GameCooltip:AddLine (" ") + GameCooltip:AddLine(" ") Details:AddTooltipReportLineText() GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") @@ -1126,7 +1126,7 @@ end local thisLine = instancia.barras [whichRowLine] --pega a refer�ncia da barra na janela if (not thisLine) then - print ("DEBUG: problema com "..whichRowLine.." "..rank) + print("DEBUG: problema com "..whichRowLine.." "..rank) return end @@ -1139,7 +1139,7 @@ end thisLine.colocacao = colocacao if (not _getmetatable (tabela)) then - _setmetatable (tabela, {__call = RefreshBarraFrags}) + _setmetatable(tabela, {__call = RefreshBarraFrags}) tabela._custom = true end @@ -1295,7 +1295,7 @@ end local value, top, total, combat, instance, custom_actor = ... local uptime = custom_actor.uptime or 0 - local minutos, segundos = floor (uptime / 60), floor (uptime % 60) + local minutos, segundos = floor(uptime / 60), floor(uptime % 60) if (minutos > 0) then uptime = "" .. minutos .. "m " .. segundos .. "s" .. "" else @@ -1313,7 +1313,7 @@ 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 if (not CustomObject.OnSwitchShow) then @@ -1349,7 +1349,7 @@ end new_custom_object.total_script = new_total_code tinsert(Details.custom, new_custom_object) - setmetatable (new_custom_object, Details.atributo_custom) + setmetatable(new_custom_object, Details.atributo_custom) new_custom_object.__index = Details.atributo_custom return instance:TrocaTabela(instance.segmento, 5, #Details.custom) @@ -1372,8 +1372,8 @@ end local t = {} for index, void_table in ipairs(tooltip_void_zone_temp) do --ir� reportar dano zero tamb�m - if (void_table[1] and type (void_table[1]) == "string" and void_table[2] and void_table[3] and type (void_table[3]) == "table") then - local actor_table = {Details:GetOnlyName (void_table[1])} + if (void_table[1] and type(void_table[1]) == "string" and void_table[2] and void_table[3] and type(void_table[3]) == "table") then + local actor_table = {Details:GetOnlyName(void_table[1])} local m, s = _math_floor(void_table[3].uptime / 60), _math_floor(void_table[3].uptime % 60) if (m > 0) then actor_table [2] = FormatTooltipNumber (_, void_table[3].damage) .. " (" .. m .. "m " .. s .. "s" .. ")" @@ -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 @@ -1490,9 +1490,9 @@ end local minutos, segundos = _math_floor(debuff_table.uptime / 60), _math_floor(debuff_table.uptime % 60) if (minutos > 0) then - GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. minutos .. "m " .. segundos .. "s" .. ")") + GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. minutos .. "m " .. segundos .. "s" .. ")") else - GameCooltip:AddLine (Details:GetOnlyName (t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. segundos .. "s" .. ")") + GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. segundos .. "s" .. ")") end local classe = Details:GetClass (t[1]) @@ -1517,7 +1517,7 @@ end end - GameCooltip:AddLine (" ") + GameCooltip:AddLine(" ") Details:AddTooltipReportLineText() GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") @@ -1536,7 +1536,7 @@ end local thisLine = instancia.barras [whichRowLine] if (not thisLine) then - print ("DEBUG: problema com "..whichRowLine.." "..rank) + print("DEBUG: problema com "..whichRowLine.." "..rank) return end @@ -1560,10 +1560,10 @@ end local porcentagem if (instancia.row_info.percent_type == 1) then - total = max (total, 0.0001) + total = max(total, 0.0001) porcentagem = format ("%.1f", self.damage / total * 100) elseif (instancia.row_info.percent_type == 2) then - local top = max (instancia.top, 0.0001) + local top = max(instancia.top, 0.0001) porcentagem = format ("%.1f", self.damage / top * 100) end @@ -1657,7 +1657,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta --pega qual a sub key que ser� usada --sub keys if (exportar) then - if (_type(exportar) == "boolean") then + if (type(exportar) == "boolean") then if (subAttribute == 1) then --DAMAGE DONE keyName = "total" @@ -1839,10 +1839,10 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (this_spell) then this_spell [1] = spellid this_spell [2] = 0 - this_spell [3] = spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1 + this_spell [3] = spell.spellschool or Details.spell_school_cache [select(1, GetSpellInfo(spellid))] or 1 bs_index_table [spellname] = bs_index else - this_spell = {spellid, 0, spell.spellschool or Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1} + this_spell = {spellid, 0, spell.spellschool or Details.spell_school_cache [select(1, GetSpellInfo(spellid))] or 1} bs_table [bs_index] = this_spell bs_index_table [spellname] = bs_index end @@ -1874,10 +1874,10 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta if (this_spell) then this_spell [1] = spellid this_spell [2] = 0 - this_spell [3] = Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1 + this_spell [3] = Details.spell_school_cache [select(1, GetSpellInfo(spellid))] or 1 bs_index_table [spellname] = bs_index else - this_spell = {spellid, 0, Details.spell_school_cache [select (1, GetSpellInfo(spellid))] or 1} + this_spell = {spellid, 0, Details.spell_school_cache [select(1, GetSpellInfo(spellid))] or 1} bs_table [bs_index] = this_spell bs_index_table [spellname] = bs_index end @@ -1932,7 +1932,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta local whichRowLine = 1 local lineContainer = instancia.barras - --print (bs_index, #bs_table, instancia.barraS[1], instancia.barraS[2]) + --print(bs_index, #bs_table, instancia.barraS[1], instancia.barraS[2]) for i = instancia.barraS[1], instancia.barraS[2], 1 do atributo_damage:AtualizarBySpell (bs_table[i], whichRowLine, i, instancia) @@ -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 @@ -2076,7 +2076,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta elseif (windowMode == modo_ALL) then --mostrando ALL --faz o sort da categoria e retorna o amount corrigido - --print (keyName) + --print(keyName) if (subAttribute == 2) then local combat_time = instancia.showing:GetCombatTime() total = atributo_damage:ContainerRefreshDps (actorTableContent, combat_time) @@ -2141,7 +2141,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta end -- if (not isUsingCache) then - for index, player in _ipairs(actorTableContent) do + 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 @@ -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 @@ -2376,7 +2376,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta end end else - -- /run print (Details:GetInstance(1).barraS[2]) -- vai do 5 ao 1 -- qual barra come�a no 1 -- i = 5 at� 1 -- player 5 atualiza na barra 1 / player 1 atualiza na barra 5 + -- /run print(Details:GetInstance(1).barraS[2]) -- vai do 5 ao 1 -- qual barra come�a no 1 -- i = 5 at� 1 -- player 5 atualiza na barra 1 / player 1 atualiza na barra 5 for i = instancia.barraS[2], instancia.barraS[1], -1 do if (actorTableContent[i]) then actorTableContent[i]:RefreshLine(instancia, lineContainer, whichRowLine, i, total, subAttribute, forcar, keyName, combatTime, percentageType, useAnimations, barsShowData, barsBrackets, barsSeparator) @@ -2582,7 +2582,7 @@ function atributo_damage:RefreshLine(instance, lineContainer, whichRowLine, rank local thisLine = lineContainer[whichRowLine] if (not thisLine) then - print ("DEBUG: problema com "..whichRowLine.." "..rank) + print("DEBUG: problema com "..whichRowLine.." "..rank) return end @@ -2687,7 +2687,7 @@ function atributo_damage:RefreshLine(instance, lineContainer, whichRowLine, rank if (diff_from_topdps) then local threshold = diff_from_topdps / instance.player_top_dps_threshold * 100 if (threshold < 100) then - threshold = _math_abs (threshold - 100) + threshold = abs(threshold - 100) else threshold = 5 end @@ -3153,7 +3153,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) r, g, b = unpack(Details.class_colors [owner.classe]) else if (not Details.class_colors [self.classe]) then - return print ("Details!: error class not found:", self.classe, "for", self.nome) + return print("Details!: error class not found:", self.classe, "for", self.nome) end r, g, b = unpack(Details.class_colors [self.classe]) end @@ -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 @@ -3265,16 +3265,16 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end if (instancia.sub_atributo == 1 or instancia.sub_atributo == 6) then - GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, totalDamage) .." ("..percent.."%)") + GameCooltip:AddLine(nome_magia, FormatTooltipNumber (_, totalDamage) .." ("..percent.."%)") else - GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, _math_floor(totalDPS)) .." ("..percent.."%)") + GameCooltip:AddLine(nome_magia, FormatTooltipNumber (_, _math_floor(totalDPS)) .." ("..percent.."%)") end GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar (false, totalDamage/topAbility*100) end else - GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --spell reflected @@ -3291,7 +3291,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local spellName, _, spellIcon = _GetSpellInfo(spellId) if (spellName) then - GameCooltip:AddLine (spellName, FormatTooltipNumber (_, damageDone) .. " (" .. _math_floor(damageDone / self.total * 100) .. "%)") + GameCooltip:AddLine(spellName, FormatTooltipNumber (_, damageDone) .. " (" .. _math_floor(damageDone / self.total * 100) .. "%)") Details:AddTooltipBackgroundStatusbar (false, damageDone / self.total * 100) GameCooltip:AddIcon (spellIcon, 1, 1, icon_size.W, icon_size.H, 0.1, 0.9, 0.1, 0.9) end @@ -3326,7 +3326,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) for i = 1, _math_min(max_targets, #ActorTargetsSortTable) do local este_inimigo = ActorTargetsSortTable [i] - GameCooltip:AddLine (este_inimigo[1], FormatTooltipNumber (_, este_inimigo[2]) .." ("..format("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)") + GameCooltip:AddLine(este_inimigo[1], FormatTooltipNumber (_, este_inimigo[2]) .." ("..format("%.1f", este_inimigo[2]/ActorDamageWithPet*100).."%)") GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-StatIcons]], nil, nil, icon_size.W, icon_size.H, 0, 0.5, 0, 0.5, {.7, .7, .7, 1}, nil, true) Details:AddTooltipBackgroundStatusbar (false, este_inimigo[2] / topEnemy * 100) end @@ -3345,7 +3345,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) --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 @@ -3385,8 +3385,8 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) end end - --GameTooltip:AddLine (" ") - --GameCooltip:AddLine (" ") + --GameTooltip:AddLine(" ") + --GameCooltip:AddLine(" ") local _quantidade = 0 local added_logo = false @@ -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 @@ -3420,9 +3420,9 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) local n = _table [1]:gsub (("%s%<.*"), "") if (instancia.sub_atributo == 1) then - GameCooltip:AddLine (n, FormatTooltipNumber (_, _table [2]) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") + GameCooltip:AddLine(n, FormatTooltipNumber (_, _table [2]) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") else - GameCooltip:AddLine (n, FormatTooltipNumber (_, _math_floor(_table [3])) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") + GameCooltip:AddLine(n, FormatTooltipNumber (_, _math_floor(_table [3])) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)") end Details:AddTooltipBackgroundStatusbar (false, _table [2] / topPet * 100) @@ -3474,7 +3474,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown) for i = 1, #playerPhases do --[1] Phase Number [2] Amount Done [3] Rank [4] Percent - GameCooltip:AddLine ("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format ("%.1f", playerPhases [i][4]) .. "%)") + GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format ("%.1f", playerPhases [i][4]) .. "%)") GameCooltip:AddIcon ([[Interface\Garrison\orderhall-missions-mechanic9]], 1, 1, 14, 14, 11/64, 53/64, 11/64, 53/64) Details:AddTooltipBackgroundStatusbar() end @@ -3495,7 +3495,7 @@ local on_switch_show_frags = function(instance) return true end -local ENEMIES_format_name = function(player) if (player == 0) then return false end return Details:GetOnlyName (player.nome) end +local ENEMIES_format_name = function(player) if (player == 0) then return false end return Details:GetOnlyName(player.nome) end local ENEMIES_format_amount = function(amount) if (amount <= 0) then return false end return Details:ToK(amount) .. " (" .. format ("%.1f", amount / tooltip_temp_table.damage_total * 100) .. "%)" end function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, ControlKeyDown, fromFrags) @@ -3504,7 +3504,7 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, local custom_name = inimigo .. " -" .. Loc ["STRING_CUSTOM_ENEMY_DT"] --procura se j� tem um custom: - 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 if (not CustomObject.OnSwitchShow) then @@ -3530,7 +3530,7 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, } tinsert(Details.custom, new_custom_object) - setmetatable (new_custom_object, Details.atributo_custom) + setmetatable(new_custom_object, Details.atributo_custom) new_custom_object.__index = Details.atributo_custom return instance:TrocaTabela(instance.segmento, 5, #Details.custom) @@ -3543,7 +3543,7 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true}) end -local FRAGS_format_name = function(player_name) return Details:GetOnlyName (player_name) end +local FRAGS_format_name = function(player_name) return Details:GetOnlyName(player_name) end local FRAGS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / frags_tooltip_table.damage_total * 100) .. "%)" end function atributo_damage:ReportSingleFragsLine (frag, instance, ShiftKeyDown, ControlKeyDown) @@ -3574,7 +3574,7 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) --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 @@ -3612,9 +3612,9 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) local player = tooltip_temp_table [o][1] local total = tooltip_temp_table [o][2] - local player_name = Details:GetOnlyName (player:name()) + local player_name = Details:GetOnlyName(player:name()) - GameCooltip:AddLine (player_name .. " ", FormatTooltipNumber (_, total) .." (" .. format ("%.1f", (total / damage_taken) * 100) .. "%)") + GameCooltip:AddLine(player_name .. " ", FormatTooltipNumber (_, total) .." (" .. format ("%.1f", (total / damage_taken) * 100) .. "%)") local classe = player:class() if (not classe) then @@ -3640,22 +3640,22 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown) GameCooltip:SetOption("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") --damage done and heal - GameCooltip:AddLine (" ") - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_ENEMIES_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) + GameCooltip:AddLine(" ") + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_DAMAGE_ENEMIES_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) local half = 0.00048828125 GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375) GameCooltip:AddStatusBar (0, 1, r, g, b, 1, false, enemies_background) local heal_actor = instancia.showing (2, self.nome) if (heal_actor) then - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) else - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], 0) + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_HEAL_ENEMY"], 0) end GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, 14, 14, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375) GameCooltip:AddStatusBar (0, 1, r, g, b, 1, false, enemies_background) - GameCooltip:AddLine (" ") + GameCooltip:AddLine(" ") Details:AddTooltipReportLineText() GameCooltip:SetOption("YSpacingMod", 0) @@ -3682,7 +3682,7 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) 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 @@ -3790,19 +3790,19 @@ 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:AddLine(spellname .. " (|cFFFFFF00" .. spell [3] .. "|r)", FormatTooltipNumber (_, spell [2]).." (" .. format ("%.1f", (spell [2] / damage_taken) * 100).."%)") GameCooltip:AddIcon (spellicon, 1, 1, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar() end else - local aggressorName = Details:GetOnlyName (meus_agressores[i][1]) + local aggressorName = Details:GetOnlyName(meus_agressores[i][1]) if (ismaximized and meus_agressores[i][1]:find (Details.playername)) then - GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow") + GameCooltip:AddLine(aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow") else - GameCooltip:AddLine (aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)") + GameCooltip:AddLine(aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)") end local classe = meus_agressores[i][3] @@ -3821,17 +3821,17 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown) if (instancia.sub_atributo == 6) then - GameCooltip:AddLine (" ") - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) + GameCooltip:AddLine(" ") + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_DAMAGE_DONE"], FormatTooltipNumber (_, _math_floor(self.total))) local half = 0.00048828125 GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, icon_size.W, icon_size.H, 0.005859375 + half, 0.025390625 - half, 0.3623046875, 0.3818359375) Details:AddTooltipBackgroundStatusbar() local heal_actor = instancia.showing (2, self.nome) if (heal_actor) then - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_HEAL_DONE"], FormatTooltipNumber (_, _math_floor(heal_actor.heal_enemy_amt))) else - GameCooltip:AddLine (Loc ["STRING_ATTRIBUTE_HEAL_DONE"], 0) + GameCooltip:AddLine(Loc ["STRING_ATTRIBUTE_HEAL_DONE"], 0) end GameCooltip:AddIcon (instancia:GetSkinTexture(), 1, 1, icon_size.W, icon_size.H, 0.037109375 + half, 0.056640625 - half, 0.3623046875, 0.3818359375) Details:AddTooltipBackgroundStatusbar() @@ -3900,7 +3900,7 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown classe = "UNKNOW" end - GameCooltip:AddLine (Details:GetOnlyName (DamagedPlayers[i][1]), FormatTooltipNumber (_, DamagedPlayers[i][2]).." ("..format("%.1f", DamagedPlayers[i][2]/FriendlyFireTotal*100).."%)") + GameCooltip:AddLine(Details:GetOnlyName(DamagedPlayers[i][1]), FormatTooltipNumber (_, DamagedPlayers[i][2]).." ("..format("%.1f", DamagedPlayers[i][2]/FriendlyFireTotal*100).."%)") GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\espadas", nil, nil, lineHeight, lineHeight) Details:AddTooltipBackgroundStatusbar() @@ -3944,7 +3944,7 @@ function atributo_damage:ToolTip_FriendlyFire (instancia, numero, barra, keydown 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:AddLine(nome, FormatTooltipNumber (_, SpellsInOrder[i][2]).." ("..format("%.1f", SpellsInOrder[i][2]/FriendlyFireTotal*100).."%)") GameCooltip:AddIcon (icone, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) Details:AddTooltipBackgroundStatusbar() end @@ -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 @@ -4039,7 +4039,7 @@ function atributo_damage:MontaInfoFriendlyFire() 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:SetAlpha(.9) --volta a alfa antiga barra.on_focus = false end end @@ -4051,7 +4051,7 @@ function atributo_damage:MontaInfoFriendlyFire() barra.textura:SetValue(tabela[2]/FirstPlaceDamage*100) end - barra.lineText1:SetText(index .. instancia.divisores.colocacao .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda + barra.lineText1:SetText(index .. instancia.divisores.colocacao .. Details:GetOnlyName(tabela[1])) --seta o texto da esqueda barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .."%)") --seta o texto da direita local classe = tabela[4] @@ -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 @@ -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) @@ -4280,7 +4280,7 @@ 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:SetAlpha(.9) --volta a alfa antiga row.on_focus = false end end @@ -4343,7 +4343,7 @@ function atributo_damage:MontaInfoDamageDone() --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 @@ -4376,7 +4376,7 @@ function atributo_damage:MontaInfoDamageDone() 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 @@ -4435,7 +4435,7 @@ function atributo_damage:MontaInfoDamageDone() 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 @@ -4449,7 +4449,7 @@ function atributo_damage:MontaInfoDamageDone() barra.textura:SetValue(tabela[2]/max_*100) end - barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela[1])) --seta o texto da esqueda + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela[1])) --seta o texto da esqueda barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .. "%)") --seta o texto da direita barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE @@ -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] @@ -4537,7 +4537,7 @@ function atributo_damage:MontaInfoDamageDone() barra.textura:SetStatusBarColor (1, 0.8, 0.8) barra.textura:SetStatusBarColor (1, 1, 1, 1) - barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela[1])) + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela[1])) if (info.sub_atributo == 2) then barra.lineText4:SetText(Details:comma_value ( _math_floor(tabela[2]/meu_tempo)) .. " (" .. format ("%.1f", tabela[3]) .. "%)") @@ -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 @@ -4600,7 +4600,7 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra) 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 @@ -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 @@ -4648,7 +4648,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) if (barra.lineText1:IsTruncated()) then Details:CooltipPreset(2) GameCooltip:SetOption("FixedWidth", nil) - GameCooltip:AddLine (barra.lineText1.text) + GameCooltip:AddLine(barra.lineText1.text) GameCooltip:SetOwner(barra, "bottomleft", "topleft", 5, -10) GameCooltip:ShowCooltip() end @@ -4675,7 +4675,7 @@ 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 @@ -4689,7 +4689,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra) barra.textura:SetValue(tabela[2]/max_*100) --muito mais rapido... end - barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName (tabela [1])) --seta o texto da esqueda + barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela [1])) --seta o texto da esqueda Details:name_space_info (barra) if (spell.total > 0) then @@ -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 @@ -4765,7 +4765,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra) 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 @@ -4824,7 +4824,7 @@ local MontaDetalhesBuffProcs = function(actor, row, instance) if (spec) then local mainAuras = Details.important_auras [spec] if (mainAuras) then - local miscActor = instance:GetShowingCombat():GetActor (4, actor:name()) + local miscActor = instance:GetShowingCombat():GetActor(4, actor:name()) if (miscActor and miscActor.buff_uptime_spells) then --get the auras local added = 0 @@ -5044,7 +5044,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia) _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 @@ -5060,7 +5060,7 @@ function Details:BuildPlayerDetailsSpellChart() if (not playerDetailSmallChart) then playerDetailSmallChart = CreateFrame("frame", "DetailsPlayerDetailSmallChart", info,"BackdropTemplate") - DetailsFramework:ApplyStandardBackdrop (playerDetailSmallChart) + DetailsFramework:ApplyStandardBackdrop(playerDetailSmallChart) playerDetailSmallChart.Lines = {} for i = 1, 200 do @@ -5075,8 +5075,8 @@ function Details:BuildPlayerDetailsSpellChart() local eventList = {} --build the list of tokens - for i = 1, select ("#", ... ) do - local tokenId = select (i, ...) + for i = 1, select("#", ... ) do + local tokenId = select(i, ...) tokenIdList [tokenId] = true end @@ -5156,11 +5156,11 @@ function atributo_damage:MontaTooltipDamageTaken (thisLine, index) _table_sort(habilidades, Details.Sort2) - GameTooltip:AddLine (index..". "..thisLine.nome_inimigo) - GameTooltip:AddLine (Loc ["STRING_DAMAGE_TAKEN_FROM2"]..":") - GameTooltip:AddLine (" ") + GameTooltip:AddLine(index..". "..thisLine.nome_inimigo) + 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) @@ -5221,7 +5221,7 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia) end --add pets - for _, PetName in _ipairs(self.pets) do + for _, PetName in ipairs(self.pets) do local PetActor = instancia.showing (class_type, PetName) if (PetActor) then local PetSkillsContainer = PetActor.spells._ActorTable @@ -5274,17 +5274,17 @@ 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 if (is_dps) then --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t "..tabela[1], Details:comma_value ( _math_floor(tabela[2] / meu_tempo) ).." (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) - GameCooltip:AddLine (tabela[1], Details:comma_value ( _math_floor(tabela[2] / meu_tempo) ).." ("..format("%.1f", tabela[2]/total*100).."%)") + GameCooltip:AddLine(tabela[1], Details:comma_value ( _math_floor(tabela[2] / meu_tempo) ).." ("..format("%.1f", tabela[2]/total*100).."%)") else --GameCooltip:AddDoubleLine (index..". |T"..tabela[3]..":0|t " .. tabela[1], SelectedToKFunction(_, tabela[2]) .. " (".._cstr("%.1f", tabela[2]/total*100).."%)", 1, 1, 1, 1, 1, 1) - GameCooltip:AddLine (tabela[1], SelectedToKFunction(_, tabela[2]) .. " ("..format("%.1f", tabela[2]/total*100).."%)") + GameCooltip:AddLine(tabela[1], SelectedToKFunction(_, tabela[2]) .. " ("..format("%.1f", tabela[2]/total*100).."%)") end GameCooltip:AddIcon (tabela[3], nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) @@ -5480,7 +5480,7 @@ end shadow.start_time = shadow.start_time - tempo --pets (add unique pet names) - for _, petName in _ipairs(actor.pets) do + for _, petName in ipairs(actor.pets) do local hasPet = false for i = 1, #shadow.pets do if (shadow.pets[i] == petName) then @@ -5543,7 +5543,7 @@ end --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" and key ~= "spellschool") then if (not habilidade_shadow [key]) then habilidade_shadow [key] = 0 @@ -5695,7 +5695,7 @@ atributo_damage.__add = function(tabela1, tabela2) end --pets (add unique pet names) - for _, petName in _ipairs(tabela2.pets) do + for _, petName in ipairs(tabela2.pets) do local hasPet = false for i = 1, #tabela1.pets do if (tabela1.pets[i] == petName) then @@ -5736,7 +5736,7 @@ atributo_damage.__add = function(tabela1, tabela2) --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" and key ~= "spellschool") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 @@ -5830,7 +5830,7 @@ atributo_damage.__sub = function(tabela1, tabela2) --subtrai os valores da habilidade for key, value in _pairs(habilidade) do - if (_type(value) == "number") then + if (type(value) == "number") then if (key ~= "id" and key ~= "spellschool") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 @@ -5870,7 +5870,7 @@ end function Details.refresh:r_atributo_damage (este_jogador, shadow) --restaura metas do ator - _setmetatable (este_jogador, Details.atributo_damage) + _setmetatable(este_jogador, Details.atributo_damage) este_jogador.__index = Details.atributo_damage --restaura as metas dos containers Details.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) @@ -5933,9 +5933,9 @@ end local player_name = player:name() if (player_name:find (Details.playername)) then - GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2, "yellow") + GameCooltip:AddLine(player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2, "yellow") else - GameCooltip:AddLine (player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2) + GameCooltip:AddLine(player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2) end local classe = player:class() diff --git a/classes/class_error.lua b/classes/class_error.lua index b6a408a0..2fde29d7 100644 --- a/classes/class_error.lua +++ b/classes/class_error.lua @@ -14,13 +14,13 @@ do return _error.errortext end _error.__call = function(_this) - print (_this.errortext) + print(_this.errortext) end function _detalhes:NewError (_msg) local this_error = {} this_error.errortext = _msg - setmetatable (this_error, _error) + setmetatable(this_error, _error) return this_error end diff --git a/classes/class_heal.lua b/classes/class_heal.lua index 63f681f2..c8d84259 100644 --- a/classes/class_heal.lua +++ b/classes/class_heal.lua @@ -4,9 +4,9 @@ local _cstr = string.format local _math_floor = math.floor local _setmetatable = setmetatable local _pairs = pairs -local _ipairs = ipairs +local ipairs = ipairs local _unpack = unpack -local _type = type +local type = type local _table_sort = table.sort local _cstr = string.format local _table_insert = table.insert @@ -26,9 +26,9 @@ local _string_replace = _detalhes.string.replace --details api local _detalhes = _G._detalhes local _ -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ( "Details" ) -local Translit = LibStub ("LibTranslit-1.0") +local Translit = LibStub("LibTranslit-1.0") local gump = _detalhes.gump @@ -112,7 +112,7 @@ function atributo_heal:NovaTabela (serial, nome, link) targets_absorbs = {} } - _setmetatable (_new_healActor, atributo_heal) + _setmetatable(_new_healActor, atributo_heal) return _new_healActor end @@ -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 @@ -239,7 +239,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo --pega qual a sub key que ser� usada if (exportar) then - if (_type(exportar) == "boolean") then + if (type(exportar) == "boolean") then if (sub_atributo == 1) then --healing DONE keyName = "total" elseif (sub_atributo == 2) then --HPS @@ -344,7 +344,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end -- if (not using_cache) then - for index, player in _ipairs(conteudo) do + 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 @@ -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 @@ -444,8 +444,8 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end row1:SetValue(100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -514,8 +514,8 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo end row1:SetValue(100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -567,7 +567,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo if (instancia.atributo == 5) then --custom --zerar o .custom dos Actors - for index, player in _ipairs(conteudo) do + for index, player in ipairs(conteudo) do if (player.custom > 0) then player.custom = 0 else @@ -600,7 +600,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu local thisLine = instancia.barras[whichRowLine] --pega a refer�ncia da barra na janela if (not thisLine) then - print ("DEBUG: problema com "..whichRowLine.." "..lugar) + print("DEBUG: problema com "..whichRowLine.." "..lugar) return end @@ -628,7 +628,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or instancia.segmento == -1) then if (instancia.segmento == -1 and combat_time == 0) then - local p = _detalhes.tabela_vigente (2, self.nome) + local p = _detalhes.tabela_vigente(2, self.nome) if (p) then local t = p:Tempo() hps = healing_total / t @@ -641,7 +641,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu hps = healing_total / combat_time self.last_hps = hps end - else -- /dump _detalhes:GetCombat (2)(1, "Ditador").on_hold + else -- /dump _detalhes:GetCombat(2)(1, "Ditador").on_hold if (not self.on_hold) then hps = healing_total/self:Tempo() --calcula o dps deste objeto self.last_hps = hps --salva o dps dele @@ -904,10 +904,10 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc 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) + thisLine.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then - thisLine.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) + thisLine.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end return self:RefreshBarra (thisLine, instancia) @@ -963,28 +963,27 @@ function atributo_heal:RefreshBarra (thisLine, instancia, from_resize) end -function _detalhes:CloseShields (combat) - +function _detalhes:CloseShields(combat) local escudos = _detalhes.escudos local container = combat[2] - local time = time() + local timeNow = time() local parser = _detalhes.parser local GetSpellInfo = GetSpellInfo --n�o colocar no cache de spells - for alvo_name, spellid_table in _pairs (escudos) do + for alvo_name, spellid_table in _pairs(escudos) do local tgt = container:PegarCombatente (_, alvo_name) if (tgt) then - for spellid, owner_table in _pairs (spellid_table) do + for spellid, owner_table in _pairs(spellid_table) do local spellname = GetSpellInfo(spellid) - for owner, amount in _pairs (owner_table) do + for owner, amount in _pairs(owner_table) do if (amount > 0) then local obj = container:PegarCombatente (_, owner) if (obj) then - parser:heal ("SPELL_AURA_REMOVED", time, obj.serial, owner, obj.flag_original, tgt.serial, alvo_name, tgt.flag_original, nil, spellid, spellname, nil, 0, _math_ceil (amount), 0, 0, nil, true) + parser:heal ("SPELL_AURA_REMOVED", timeNow, obj.serial, owner, obj.flag_original, tgt.serial, alvo_name, tgt.flag_original, nil, spellid, spellname, nil, 0, _math_ceil (amount), 0, 0, nil, true) end end @@ -1009,7 +1008,7 @@ function atributo_heal:ToolTip (instancia, numero, barra, keydown) return self:TooltipForCustom (barra) else --GameTooltip:ClearLines() - --GameTooltip:AddLine (barra.colocacao..". "..self.nome) + --GameTooltip:AddLine(barra.colocacao..". "..self.nome) 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 @@ -1030,9 +1029,9 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local container = instancia.showing [2] @@ -1046,23 +1045,23 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) local icon_size = _detalhes.tooltip.icon_size local icon_border = _detalhes.tooltip.icon_border_texcoord - for spellID, spell in _pairs (self.spells._ActorTable) do + for spellID, spell in _pairs(self.spells._ActorTable) do if (spell.totaldenied > 0 and spell.heal_denied) then --my spells which denied heal tinsert(spellList, {spell, spell.totaldenied}) --players affected - for playerName, amount in _pairs (spell.targets) do + for playerName, amount in _pairs(spell.targets) do targetList [playerName] = (targetList [playerName] or 0) + amount end --spells with heal denied - for spellID, amount in _pairs (spell.heal_denied) do + for spellID, amount in _pairs(spell.heal_denied) do spellsDenied [spellID] = (spellsDenied [spellID] or 0) + amount end --healers denied - for healerName, amount in _pairs (spell.heal_denied_healers) do + for healerName, amount in _pairs(spell.heal_denied_healers) do healersDenied [healerName] = (healersDenied [healerName] or 0) + amount end end @@ -1089,7 +1088,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) end for i = 1, _math_min(tooltip_max_abilities, #spellList) do - local spellObject, spellTotal = unpack (spellList [i]) + local spellObject, spellTotal = unpack(spellList [i]) if (spellTotal < 1) then break @@ -1097,7 +1096,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) local spellName, _, spellIcon = _GetSpellInfo(spellObject.id) - GameCooltip:AddLine (spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") + GameCooltip:AddLine(spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1107,7 +1106,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) --Target Players local playerSorted = {} - for playerName, amount in _pairs (targetList) do + for playerName, amount in _pairs(targetList) do tinsert(playerSorted, {playerName, amount}) end table.sort (playerSorted, _detalhes.Sort2) @@ -1131,9 +1130,9 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) for i = 1, _math_min(tooltip_max_abilities2, #playerSorted) do - local playerName, amountDenied = unpack (playerSorted [i]) + local playerName, amountDenied = unpack(playerSorted [i]) - GameCooltip:AddLine (playerName .. ": ", FormatTooltipNumber (_, amountDenied) .." (" .. _cstr ("%.1f", amountDenied / totalDenied * 100) .. "%)") + GameCooltip:AddLine(playerName .. ": ", FormatTooltipNumber (_, amountDenied) .." (" .. _cstr ("%.1f", amountDenied / totalDenied * 100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() local targetActor = container:PegarCombatente (nil, playerName) or instancia.showing [1]:PegarCombatente (nil, playerName) @@ -1145,7 +1144,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, _unpack(_detalhes.class_coords [classe])) end end @@ -1153,7 +1152,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) -- Spells Affected local spellsSorted = {} - for spellID, amount in _pairs (spellsDenied) do + for spellID, amount in _pairs(spellsDenied) do tinsert(spellsSorted, {spellID, amount}) end table.sort (spellsSorted, _detalhes.Sort2) @@ -1169,7 +1168,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) for i = 1, _math_min(tooltip_max_abilities3, #spellsSorted) do - local spellID, spellTotal = unpack (spellsSorted [i]) + local spellID, spellTotal = unpack(spellsSorted [i]) if (spellTotal < 1) then break @@ -1177,7 +1176,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) local spellName, _, spellIcon = _GetSpellInfo(spellID) - GameCooltip:AddLine (spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") + GameCooltip:AddLine(spellName .. ": ", FormatTooltipNumber (_, spellTotal) .. " (" .. _cstr ("%.1f", spellTotal / totalDenied) .."%)") GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() @@ -1190,15 +1189,15 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) local healersSorted = {} - for healerName, amount in _pairs (healersDenied) do + for healerName, amount in _pairs(healersDenied) do tinsert(healersSorted, {healerName, amount}) end table.sort (healersSorted, _detalhes.Sort2) for i = 1, #healersSorted do - local playerName, amountDenied = unpack (healersSorted [i]) + local playerName, amountDenied = unpack(healersSorted [i]) - GameCooltip:AddLine (playerName .. ": ", FormatTooltipNumber (_, amountDenied) .." (" .. _cstr ("%.1f", amountDenied / totalDenied * 100) .. "%)") + GameCooltip:AddLine(playerName .. ": ", FormatTooltipNumber (_, amountDenied) .." (" .. _cstr ("%.1f", amountDenied / totalDenied * 100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar() local targetActor = container:PegarCombatente (nil, playerName) or instancia.showing [1]:PegarCombatente (nil, playerName) @@ -1210,7 +1209,7 @@ function atributo_heal:ToolTip_HealingDenied (instancia, numero, barra, keydown) if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, _unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, _unpack(_detalhes.class_coords [classe])) end end end @@ -1223,9 +1222,9 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local curadores = self.healing_from @@ -1236,7 +1235,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) 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 local alvos = este_curador.targets @@ -1281,7 +1280,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) onyName = Translit:Transliterate(onyName, "!") end - GameCooltip:AddLine (onyName, FormatTooltipNumber (_, meus_curadores[i][2]).." (".._cstr ("%.1f", (meus_curadores[i][2]/total_curado) * 100).."%)") + GameCooltip:AddLine(onyName, FormatTooltipNumber (_, meus_curadores[i][2]).." (".._cstr ("%.1f", (meus_curadores[i][2]/total_curado) * 100).."%)") local classe = meus_curadores[i][3] if (not classe) then classe = "UNKNOW" @@ -1294,7 +1293,7 @@ function atributo_heal:ToolTip_HealingTaken (instancia, numero, barra, keydown) local texture, l, r, t, b = _detalhes:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, _unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, _unpack(_detalhes.class_coords [classe])) end end @@ -1312,9 +1311,9 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local ActorHealingTable = {} @@ -1338,7 +1337,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) local ActorTotal = self [actor_key] --add actor spells - for _spellid, _skill in _pairs (ActorSkillsContainer) do + for _spellid, _skill in _pairs(ActorSkillsContainer) do local SkillName, _, SkillIcon = _GetSpellInfo(_spellid) if (_skill [skill_key] > 0 or _skill.anti_heal) then _table_insert (ActorHealingTable, { @@ -1355,10 +1354,10 @@ 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 + for _spellid, _skill in _pairs(petActor:GetActorSpells()) do if (_skill [skill_key] > 0) then local SkillName, _, SkillIcon = _GetSpellInfo(_spellid) local petName = petName:gsub ((" <.*"), "") @@ -1380,7 +1379,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) --TOP Curados ActorSkillsContainer = self.targets - for target_name, amount in _pairs (ActorSkillsContainer) do + for target_name, amount in _pairs(ActorSkillsContainer) do if (amount > 0) then --translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019) @@ -1443,7 +1442,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor(antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end - GameCooltip:AddLine (spellName , formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)") + GameCooltip:AddLine(spellName , formatedTotal .. " (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)") elseif (instancia.sub_atributo == 3) then --overheal local overheal = ActorHealingTable[i][2] @@ -1455,7 +1454,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) 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]) @@ -1463,7 +1462,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) if (antiHeal) then formatedTotal = formatedTotal .. " [|cFFFF5500" .. FormatTooltipNumber (_, _math_floor(antiHeal)) .." " .. Loc ["STRING_DAMAGE"] .."|r] " end - GameCooltip:AddLine (spellName , formatedTotal .. " (" .. _cstr ("%.1f", ActorHealingTable[i][3]) .. "%)") + GameCooltip:AddLine(spellName , formatedTotal .. " (" .. _cstr ("%.1f", ActorHealingTable[i][3]) .. "%)") end @@ -1473,8 +1472,8 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end if (instancia.sub_atributo == 6) then - GameCooltip:AddLine ("") - GameCooltip:AddLine (Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack (self.click_to_report_color)) + GameCooltip:AddLine("") + GameCooltip:AddLine(Loc ["STRING_REPORT_LEFTCLICK"], nil, 1, _unpack(self.click_to_report_color)) GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625) GameCooltip:ShowCooltip() @@ -1508,10 +1507,10 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) end if (ismaximized and ActorHealingTargets[i][1]:find (_detalhes.playername)) then - GameCooltip:AddLine (ActorHealingTargets[i][1], FormatTooltipNumber (_, ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)", nil, "yellow") + GameCooltip:AddLine(ActorHealingTargets[i][1], FormatTooltipNumber (_, ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)", nil, "yellow") GameCooltip:AddStatusBar (100, 1, .5, .5, .5, .7) else - GameCooltip:AddLine (ActorHealingTargets[i][1], FormatTooltipNumber (_, ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)") + GameCooltip:AddLine(ActorHealingTargets[i][1], FormatTooltipNumber (_, ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)") _detalhes:AddTooltipBackgroundStatusbar (false, ActorHealingTargets[i][2] / topTarget * 100) end @@ -1525,7 +1524,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, icon_size.W, icon_size.H, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, icon_size.W, icon_size.H, _unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, icon_size.W, icon_size.H, _unpack(_detalhes.class_coords [classe])) end end end @@ -1539,7 +1538,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) 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 +1574,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 +1595,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) @@ -1648,7 +1647,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown) for i = 1, #playerPhases do --[1] Phase Number [2] Amount Done [3] Rank [4] Percent - GameCooltip:AddLine ("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. _cstr ("%.1f", playerPhases [i][4]) .. "%)") + GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. _cstr ("%.1f", playerPhases [i][4]) .. "%)") GameCooltip:AddIcon ([[Interface\Garrison\orderhall-missions-mechanic9]], 1, 1, 14, 14, 11/64, 53/64, 11/64, 53/64) _detalhes:AddTooltipBackgroundStatusbar() end @@ -1684,7 +1683,7 @@ function atributo_heal:MontaInfoHealTaken() local meus_curandeiros = {} local este_curandeiro - for nome, _ in _pairs (curandeiros) do + for nome, _ in _pairs(curandeiros) do este_curandeiro = showing._ActorTable[showing._NameIndexTable[nome]] if (este_curandeiro) then local alvos = este_curandeiro.targets @@ -1708,7 +1707,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) @@ -1738,7 +1737,7 @@ function atributo_heal:MontaInfoOverHealing() local minhas_curas = {} local barras = info.barras1 - for spellid, tabela in _pairs (tabela) do + for spellid, tabela in _pairs(tabela) do local nome, _, icone = _GetSpellInfo(spellid) _table_insert (minhas_curas, {spellid, tabela.overheal, tabela.overheal/total*100, nome, icone}) end @@ -1746,11 +1745,11 @@ function atributo_heal:MontaInfoOverHealing() --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 +1763,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] @@ -1786,7 +1785,7 @@ function atributo_heal:MontaInfoOverHealing() 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:SetAlpha(.9) --volta a alfa antiga barra.on_focus = false end end @@ -1819,7 +1818,7 @@ function atributo_heal:MontaInfoOverHealing() local jogadores_overhealed = {} tabela = self.targets_overheal local heal_container = instancia.showing[2] - for target_name, amount in _pairs (tabela) do + for target_name, amount in _pairs(tabela) do local classe = "UNKNOW" local actor_object = heal_container._ActorTable [heal_container._NameIndexTable [tabela.nome]] if (actor_object) then @@ -1834,7 +1833,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] @@ -1860,7 +1859,7 @@ function atributo_heal:MontaInfoOverHealing() if (not texCoords) then texCoords = _detalhes.class_coords ["UNKNOW"] end - barra.icone:SetTexCoord (_unpack (texCoords)) + barra.icone:SetTexCoord (_unpack(texCoords)) barra.minha_tabela = self barra.nome_inimigo = tabela [1] @@ -1887,7 +1886,7 @@ function atributo_heal:MontaInfoHealingDone() meu_tempo = info.instancia.showing:GetCombatTime() end - for spellid, tabela in _pairs (tabela) do + for spellid, tabela in _pairs(tabela) do local nome, rank, icone = _GetSpellInfo(spellid) _table_insert (minhas_curas, { spellid, @@ -1906,11 +1905,11 @@ function atributo_heal:MontaInfoHealingDone() 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 +1931,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] @@ -1971,7 +1970,7 @@ function atributo_heal:MontaInfoHealingDone() --TOP CURADOS local healedTargets = {} tabela = self.targets - for target_name, amount in _pairs (tabela) do + for target_name, amount in _pairs(tabela) do _table_insert (healedTargets, {target_name, amount, amount / total*100}) end _table_sort(healedTargets, _detalhes.Sort2) @@ -1979,7 +1978,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] @@ -2002,10 +2001,10 @@ function atributo_heal:MontaInfoHealingDone() else barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE local texCoords = _detalhes.class_coords ["ENEMY"] - barra.icone:SetTexCoord (_unpack (texCoords)) + 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 @@ -2046,8 +2045,8 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) GameCooltip:SetOption("MinWidth", max(230, thisLine:GetWidth()*0.98)) --add spells - for spellid, tabela in _pairs (container) do - for target_name, amount in _pairs (tabela ["targets" .. targets_key]) do + for spellid, tabela in _pairs(container) do + for target_name, amount in _pairs(tabela ["targets" .. targets_key]) do if (target_name == inimigo) then local nome, _, icone = _GetSpellInfo(spellid) habilidades [#habilidades+1] = {nome, amount, icone} @@ -2057,13 +2056,13 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) --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 - for _spellid, _skill in _pairs (PetSkillsContainer) do + for _spellid, _skill in _pairs(PetSkillsContainer) do - for target_name, amount in _pairs (_skill ["targets" .. targets_key]) do + for target_name, amount in _pairs(_skill ["targets" .. targets_key]) do if (target_name == inimigo) then local nome, _, icone = _GetSpellInfo(_spellid) habilidades [#habilidades+1] = {nome, amount, icone} @@ -2087,16 +2086,16 @@ function atributo_heal:MontaTooltipAlvos (thisLine, index, instancia) local is_hps = info.instancia.sub_atributo == 2 if (is_hps) then - --GameTooltip:AddLine (index..". "..inimigo) - --GameTooltip:AddLine (Loc ["STRING_HEALING_HPS_FROM"] .. ":") - --GameTooltip:AddLine (" ") - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_HEALING_HPS_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + --GameTooltip:AddLine(index..". "..inimigo) + --GameTooltip:AddLine(Loc ["STRING_HEALING_HPS_FROM"] .. ":") + --GameTooltip:AddLine(" ") + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_HEALING_HPS_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 1) else - --GameTooltip:AddLine (index..". "..inimigo) - --GameTooltip:AddLine (Loc ["STRING_HEALING_FROM"] .. ":") - --GameTooltip:AddLine (" ") - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_HEALING_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + --GameTooltip:AddLine(index..". "..inimigo) + --GameTooltip:AddLine(Loc ["STRING_HEALING_FROM"] .. ":") + --GameTooltip:AddLine(" ") + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_HEALING_FROM"] .. ":", {1, 0.9, 0.0, 1}, 1, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 1) end @@ -2105,7 +2104,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,9 +2112,9 @@ 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).."%)") + GameCooltip:AddLine(spellName, SelectedToKFunction (_, tabela[2]).." (".. _cstr ("%.1f", tabela[2]/total*100).."%)") end GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W + 4, icon_size.H + 4, icon_border.L, icon_border.R, icon_border.T, icon_border.B) @@ -2140,7 +2139,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 @@ -2159,7 +2158,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}) @@ -2171,7 +2170,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra) 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 @@ -2279,7 +2278,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) if (not spell_cast and misc_actor.spell_cast) then local spellname = GetSpellInfo(spellid) - for casted_spellid, amount in _pairs (misc_actor.spell_cast) do + for casted_spellid, amount in _pairs(misc_actor.spell_cast) do local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then spell_cast = amount .. " (|cFFFFFF00?|r)" @@ -2306,7 +2305,7 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra) if (normal_hits > 0) then local normal_curado = esta_magia.n_curado local media_normal = normal_curado/normal_hits - media_normal = max (media_normal, 0.000001) + media_normal = max(media_normal, 0.000001) local T = (meu_tempo*normal_curado)/esta_magia.total local P = media/media_normal*100 @@ -2494,33 +2493,33 @@ end _detalhes.refresh:r_atributo_heal (actor, shadow) --copia o container de alvos (captura de dados) - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do shadow.targets [target_name] = 0 end - for target_name, amount in _pairs (actor.targets_overheal) do + for target_name, amount in _pairs(actor.targets_overheal) do shadow.targets_overheal [target_name] = 0 end - for target_name, amount in _pairs (actor.targets_absorbs) do + for target_name, amount in _pairs(actor.targets_absorbs) do shadow.targets_absorbs [target_name] = 0 end --copia o container de habilidades (captura de dados) - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) --refresh e soma os valores dos alvos - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do if (not habilidade_shadow.targets [target_name]) then habilidade_shadow.targets [target_name] = 0 end end - for target_name, amount in _pairs (habilidade.targets_overheal) do + for target_name, amount in _pairs(habilidade.targets_overheal) do if (not habilidade_shadow.targets_overheal [target_name]) then habilidade_shadow.targets_overheal [target_name] = 0 end end - for target_name, amount in _pairs (habilidade.targets_absorbs) do + for target_name, amount in _pairs(habilidade.targets_absorbs) do if (not habilidade_shadow.targets_absorbs [target_name]) then habilidade_shadow.targets_absorbs [target_name] = 0 end @@ -2532,12 +2531,12 @@ end habilidade_shadow.heal_denied = habilidade_shadow.heal_denied or {} habilidade_shadow.heal_denied_healers = habilidade_shadow.heal_denied_healers or {} --copia - for spellID, amount in _pairs (habilidade.heal_denied) do + for spellID, amount in _pairs(habilidade.heal_denied) do if (not habilidade_shadow.heal_denied [spellID]) then habilidade_shadow.heal_denied [spellID] = 0 end end - for healerName, amount in _pairs (habilidade.heal_denied_healers) do + for healerName, amount in _pairs(habilidade.heal_denied_healers) do if (not habilidade_shadow.heal_denied_healers [healerName]) then habilidade_shadow.heal_denied_healers [healerName] = 0 end @@ -2588,7 +2587,7 @@ end shadow.start_time = shadow.start_time - tempo --pets (add unique pet names) - for _, petName in _ipairs(actor.pets) do + for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end @@ -2615,12 +2614,12 @@ end end --copia o healing_from (captura de dados) - for nome, _ in _pairs (actor.healing_from) do + for nome, _ in _pairs(actor.healing_from) do shadow.healing_from [nome] = true end --copia o heal_enemy (captura de dados) - for spellid, amount in _pairs (actor.heal_enemy) do + for spellid, amount in _pairs(actor.heal_enemy) do if (shadow.heal_enemy [spellid]) then shadow.heal_enemy [spellid] = shadow.heal_enemy [spellid] + amount else @@ -2629,29 +2628,29 @@ end end --copia o container de alvos (captura de dados) - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end - for target_name, amount in _pairs (actor.targets_overheal) do + for target_name, amount in _pairs(actor.targets_overheal) do shadow.targets_overheal [target_name] = (shadow.targets_overheal [target_name] or 0) + amount end - for target_name, amount in _pairs (actor.targets_absorbs) do + for target_name, amount in _pairs(actor.targets_absorbs) do shadow.targets_absorbs [target_name] = (shadow.targets_absorbs [target_name] or 0) + amount end --copia o container de habilidades (captura de dados) - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do --cria e soma o valor local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, nil, true) --refresh e soma os valores dos alvos - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end - for target_name, amount in _pairs (habilidade.targets_overheal) do + for target_name, amount in _pairs(habilidade.targets_overheal) do habilidade_shadow.targets_overheal [target_name] = (habilidade_shadow.targets_overheal [target_name] or 0) + amount end - for target_name, amount in _pairs (habilidade.targets_absorbs) do + for target_name, amount in _pairs(habilidade.targets_absorbs) do habilidade_shadow.targets_absorbs [target_name] = (habilidade_shadow.targets_absorbs [target_name] or 0) + amount end @@ -2661,17 +2660,17 @@ end habilidade_shadow.heal_denied = habilidade_shadow.heal_denied or {} habilidade_shadow.heal_denied_healers = habilidade_shadow.heal_denied_healers or {} --copia - for spellID, amount in _pairs (habilidade.heal_denied) do + for spellID, amount in _pairs(habilidade.heal_denied) do habilidade_shadow.heal_denied [spellID] = (habilidade_shadow.heal_denied [spellID] or 0) + amount end - for healerName, amount in _pairs (habilidade.heal_denied_healers) do + for healerName, amount in _pairs(habilidade.heal_denied_healers) do habilidade_shadow.heal_denied_healers [healerName] = (habilidade_shadow.heal_denied_healers [healerName] or 0) + amount end end --soma todos os demais valores - for key, value in _pairs (habilidade) do - if (_type(value) == "number") then + for key, value in _pairs(habilidade) do + if (type(value) == "number") then if (key ~= "id") then if (not habilidade_shadow [key]) then habilidade_shadow [key] = 0 @@ -2726,12 +2725,12 @@ atributo_heal.__add = function(tabela1, tabela2) tabela1.healing_taken = tabela1.healing_taken + tabela2.healing_taken --soma o healing_from - for nome, _ in _pairs (tabela2.healing_from) do + for nome, _ in _pairs(tabela2.healing_from) do tabela1.healing_from [nome] = true end --somar o heal_enemy - for spellid, amount in _pairs (tabela2.heal_enemy) do + for spellid, amount in _pairs(tabela2.heal_enemy) do if (tabela1.heal_enemy [spellid]) then tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] + amount else @@ -2740,28 +2739,28 @@ atributo_heal.__add = function(tabela1, tabela2) end --somar o container de alvos - for target_name, amount in _pairs (tabela2.targets) do + for target_name, amount in _pairs(tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end - for target_name, amount in _pairs (tabela2.targets_overheal) do + for target_name, amount in _pairs(tabela2.targets_overheal) do tabela1.targets_overheal [target_name] = (tabela1.targets_overheal [target_name] or 0) + amount end - for target_name, amount in _pairs (tabela2.targets_absorbs) do + for target_name, amount in _pairs(tabela2.targets_absorbs) do tabela1.targets_absorbs [target_name] = (tabela1.targets_absorbs [target_name] or 0) + amount end --soma o container de habilidades - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do --pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_HEAL", false) --soma os alvos - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_tabela1.targets = (habilidade_tabela1.targets [target_name] or 0) + amount end - for target_name, amount in _pairs (habilidade.targets_overheal) do + for target_name, amount in _pairs(habilidade.targets_overheal) do habilidade_tabela1.targets_overheal = (habilidade_tabela1.targets_overheal [target_name] or 0) + amount end - for target_name, amount in _pairs (habilidade.targets_absorbs) do + for target_name, amount in _pairs(habilidade.targets_absorbs) do habilidade_tabela1.targets_absorbs = (habilidade_tabela1.targets_absorbs [target_name] or 0) + amount end @@ -2771,17 +2770,17 @@ atributo_heal.__add = function(tabela1, tabela2) habilidade_tabela1.heal_denied = habilidade_tabela1.heal_denied or {} habilidade_tabela1.heal_denied_healers = habilidade_tabela1.heal_denied_healers or {} --copia - for spellID, amount in _pairs (habilidade.heal_denied) do + for spellID, amount in _pairs(habilidade.heal_denied) do habilidade_tabela1.heal_denied [spellID] = (habilidade_tabela1.heal_denied [spellID] or 0) + amount end - for healerName, amount in _pairs (habilidade.heal_denied_healers) do + for healerName, amount in _pairs(habilidade.heal_denied_healers) do habilidade_tabela1.heal_denied_healers [healerName] = (habilidade_tabela1.heal_denied_healers [healerName] or 0) + amount end end --soma os valores da habilidade - for key, value in _pairs (habilidade) do - if (_type(value) == "number") then + for key, value in _pairs(habilidade) do + if (type(value) == "number") then if (key ~= "id") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 @@ -2829,7 +2828,7 @@ atributo_heal.__sub = function(tabela1, tabela2) tabela1.healing_taken = tabela1.healing_taken - tabela2.healing_taken --reduz o heal_enemy - for spellid, amount in _pairs (tabela2.heal_enemy) do + for spellid, amount in _pairs(tabela2.heal_enemy) do if (tabela1.heal_enemy [spellid]) then tabela1.heal_enemy [spellid] = tabela1.heal_enemy [spellid] - amount else @@ -2838,38 +2837,38 @@ atributo_heal.__sub = function(tabela1, tabela2) end --reduz o container de alvos - for target_name, amount in _pairs (tabela2.targets) do + 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 - for target_name, amount in _pairs (tabela2.targets_overheal) do + for target_name, amount in _pairs(tabela2.targets_overheal) do if (tabela1.targets_overheal [target_name]) then tabela1.targets_overheal [target_name] = tabela1.targets_overheal [target_name] - amount end end - for target_name, amount in _pairs (tabela2.targets_absorbs) do + for target_name, amount in _pairs(tabela2.targets_absorbs) do if (tabela1.targets_absorbs [target_name]) then tabela1.targets_absorbs [target_name] = tabela1.targets_absorbs [target_name] - amount end end --reduz o container de habilidades - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do --pega a habilidade no primeiro ator local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_HEAL", false) --alvos - for target_name, amount in _pairs (habilidade.targets) do + 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 end end - for target_name, amount in _pairs (habilidade.targets_overheal) do + for target_name, amount in _pairs(habilidade.targets_overheal) do if (habilidade_tabela1.targets_overheal [target_name]) then habilidade_tabela1.targets_overheal [target_name] = habilidade_tabela1.targets_overheal [target_name] - amount end end - for target_name, amount in _pairs (habilidade.targets_absorbs) do + for target_name, amount in _pairs(habilidade.targets_absorbs) do if (habilidade_tabela1.targets_absorbs [target_name]) then habilidade_tabela1.targets_absorbs [target_name] = habilidade_tabela1.targets_absorbs [target_name] - amount end @@ -2881,17 +2880,17 @@ atributo_heal.__sub = function(tabela1, tabela2) habilidade_tabela1.heal_denied = habilidade_tabela1.heal_denied or {} habilidade_tabela1.heal_denied_healers = habilidade_tabela1.heal_denied_healers or {} --copia - for spellID, amount in _pairs (habilidade.heal_denied) do + for spellID, amount in _pairs(habilidade.heal_denied) do habilidade_tabela1.heal_denied [spellID] = (habilidade_tabela1.heal_denied [spellID] or 0) - amount end - for healerName, amount in _pairs (habilidade.heal_denied_healers) do + for healerName, amount in _pairs(habilidade.heal_denied_healers) do habilidade_tabela1.heal_denied_healers [healerName] = (habilidade_tabela1.heal_denied_healers [healerName] or 0) - amount end end --soma os valores da habilidade - for key, value in _pairs (habilidade) do - if (_type(value) == "number") then + for key, value in _pairs(habilidade) do + if (type(value) == "number") then if (key ~= "id") then if (not habilidade_tabela1 [key]) then habilidade_tabela1 [key] = 0 @@ -2916,7 +2915,7 @@ atributo_heal.__sub = function(tabela1, tabela2) end function _detalhes.refresh:r_atributo_heal (este_jogador, shadow) - _setmetatable (este_jogador, atributo_heal) + _setmetatable(este_jogador, atributo_heal) este_jogador.__index = atributo_heal _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) diff --git a/classes/class_instance.lua b/classes/class_instance.lua index 77d8609a..ad83cceb 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -1,12 +1,12 @@ -local AceLocale = LibStub ("AceLocale-3.0") +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 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 abs = math.abs --lua local local _table_remove = table.remove --lua local local _getmetatable = getmetatable --lua local local _setmetatable = setmetatable --lua local @@ -49,7 +49,7 @@ local segmentos = _detalhes.segmentos for index = 1, #_detalhes.tabela_instancias do local instancia = _detalhes.tabela_instancias [index] if (not _getmetatable (instancia)) then - _setmetatable (_detalhes.tabela_instancias[index], _detalhes) + _setmetatable(_detalhes.tabela_instancias[index], _detalhes) end end @@ -88,11 +88,11 @@ local segmentos = _detalhes.segmentos ------------------------------------------------------------------------------------------------------------------------ --API: call a function to all enabled instances -function _detalhes:InstanceCall (funcao, ...) +function _detalhes:InstanceCall(funcao, ...) if (type(funcao) == "string") then funcao = _detalhes [funcao] end - for index, instance in _ipairs(_detalhes.tabela_instancias) do + for index, instance in ipairs(_detalhes.tabela_instancias) do if (instance:IsAtiva()) then --only enabled funcao (instance, ...) end @@ -100,8 +100,8 @@ function _detalhes:InstanceCall (funcao, ...) end --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 +function _detalhes:InstanciaCallFunction(funcao, ...) + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (instancia:IsAtiva()) then --s� reabre se ela estiver ativa funcao (_, instancia, ...) end @@ -110,7 +110,7 @@ end --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 @@ -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 @@ -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 @@ -386,16 +386,16 @@ end if (config) then if (not _detalhes.profile_save_pos) then - self.posicao = Details.CopyTable (config.pos) + 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 @@ -404,17 +404,17 @@ end self.sub_atributo = config.sub_attribute self.modo = config.mode self.segmento = config.segment - self.snap = config.snap and Details.CopyTable (config.snap) or {} + self.snap = config.snap and Details.CopyTable(config.snap) or {} self.horizontalSnap = config.horizontalSnap self.verticalSnap = config.verticalSnap - self.sub_atributo_last = Details.CopyTable (config.sub_atributo_last) + self.sub_atributo_last = Details.CopyTable(config.sub_atributo_last) self.isLocked = config.isLocked self.last_raid_plugin = config.last_raid_plugin 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 @@ -445,7 +445,7 @@ end if (not self.baseframe) then --windown isn't initialized yet if (_detalhes.debug) then - _detalhes:Msg ("(debug) called HideWindow() but the window isn't initialized yet.") + _detalhes:Msg("(debug) called HideWindow() but the window isn't initialized yet.") end return end @@ -485,12 +485,12 @@ end if (not _detalhes.initializing) then _detalhes:SendEvent("DETAILS_INSTANCE_CLOSE", nil, self) end - end + ------------------------------------------------------------------------------------------------------------------------ function _detalhes:InstanciaFadeBarras (instancia, segmento) - local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in) + local _fadeType, _fadeSpeed = _unpack(_detalhes.row_fade_in) if (segmento) then if (instancia.segmento == segmento) then return Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") @@ -512,13 +512,13 @@ end if (window.meu_id == 1) then local instance2 = _detalhes:GetInstance(2) if (instance2 and instance2:IsEnabled()) then - _detalhes.move_janela_func (instance2.baseframe, true, instance2, true) - _detalhes.move_janela_func (instance2.baseframe, false, instance2, true) + _detalhes.move_janela_func(instance2.baseframe, true, instance2, true) + _detalhes.move_janela_func(instance2.baseframe, false, instance2, true) end elseif (window.meu_id == 2) then - _detalhes.move_janela_func (window.baseframe, true, window, true) - _detalhes.move_janela_func (window.baseframe, false, window, true) + _detalhes.move_janela_func(window.baseframe, true, window, true) + _detalhes.move_janela_func(window.baseframe, false, window, true) end end @@ -609,8 +609,8 @@ end 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.resize_direita:SetAlpha (0) - self.baseframe.resize_esquerda:SetAlpha (0) + 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) end @@ -622,8 +622,8 @@ end 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.resize_direita:SetAlpha (0) - self.baseframe.resize_esquerda:SetAlpha (0) + self.baseframe.resize_direita:SetAlpha(0) + self.baseframe.resize_esquerda:SetAlpha(0) end end end @@ -724,25 +724,28 @@ end end end + ------------------------------------------------------------------------------------------------------------------------ --apaga de vez um inst�ncia function _detalhes:ApagarInstancia (ID) - return _table_remove (_detalhes.tabela_instancias, ID) + return _table_remove(_detalhes.tabela_instancias, ID) end + ------------------------------------------------------------------------------------------------------------------------ --retorna quantas inst�ncia h� no momento function _detalhes:GetNumInstancesAmount() return #_detalhes.tabela_instancias end + function _detalhes:QuantasInstancias() return #_detalhes.tabela_instancias end + ------------------------------------------------------------------------------------------------------------------------ function _detalhes:DeleteInstance (id) - local instance = _detalhes:GetInstance(id) if (not instance) then @@ -752,7 +755,7 @@ end --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 + for snap_side, instance_id in _pairs(left_instance.snap) do if (instance_id == id) then --snap na proxima instancia left_instance.snap [snap_side] = nil end @@ -760,7 +763,7 @@ end end local right_instance = _detalhes:GetInstance(id+1) if (right_instance) then - for snap_side, instance_id in _pairs (right_instance.snap) do + for snap_side, instance_id in _pairs(right_instance.snap) do if (instance_id == id) then --snap na proxima instancia right_instance.snap [snap_side] = nil end @@ -771,7 +774,7 @@ end for i = id+1, #_detalhes.tabela_instancias do local this_instance = _detalhes:GetInstance(i) --fix the snaps - for snap_side, instance_id in _pairs (this_instance.snap) do + for snap_side, instance_id in _pairs(this_instance.snap) do if (instance_id == i+1) then --snap na proxima instancia this_instance.snap [snap_side] = i elseif (instance_id == i-1 and i-2 > 0) then --snap na instancia anterior @@ -790,15 +793,15 @@ end --cria uma nova inst�ncia e a joga para o container de inst�ncias function _detalhes:CreateInstance (id) - return _detalhes:CriarInstancia (_, id) + return _detalhes:CriarInstancia(_, id) end - function _detalhes:CriarInstancia (_, id) + 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"]) + _detalhes:Msg(Loc ["STRING_INSTANCE_LIMIT"]) return false end @@ -817,7 +820,7 @@ end if (_detalhes.standard_skin) then for key, value in pairs(_detalhes.standard_skin) do if (type(value) == "table") then - new_instance [key] = Details.CopyTable (value) + new_instance [key] = Details.CopyTable(value) else new_instance [key] = value end @@ -839,7 +842,7 @@ end for key, value in pairs(copy_from) do if (_detalhes.instance_defaults [key] ~= nil) then if (type(value) == "table") then - new_instance [key] = Details.CopyTable (value) + new_instance [key] = Details.CopyTable(value) else new_instance [key] = value end @@ -861,7 +864,7 @@ end end --antes de criar uma nova, ver se n�o h� alguma para reativar - for index, instancia in _ipairs(_detalhes.tabela_instancias) do + for index, instancia in ipairs(_detalhes.tabela_instancias) do if (not instancia:IsAtiva()) then instancia:AtivarInstancia() return instancia @@ -869,7 +872,7 @@ end end if (#_detalhes.tabela_instancias >= _detalhes.instances_amount) then - return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"]) + return _detalhes:Msg(Loc ["STRING_INSTANCE_LIMIT"]) end --verifica se n�o tem uma janela na pool de janelas fechadas @@ -927,22 +930,21 @@ function _detalhes:EstaAgrupada(esta_instancia, lado) --lado //// 1 = encostou n 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 local my_baseframe = self.baseframe - for lado, snap_to in _pairs (self.snap) do + for lado, snap_to in _pairs(self.snap) do local instancia_alvo = _detalhes.tabela_instancias [snap_to] if (instancia_alvo) then @@ -980,7 +982,7 @@ function _detalhes:BaseFrameSnap() 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 + for lado, snap_to in _pairs(instancia.snap) do if (snap_to < instancia.meu_id and snap_to ~= self.meu_id) then --se o lado que esta grudado for menor que o meu id... EX instnacia #2 grudada na #1 --ent�o tenho que pegar a inst�ncia do snap @@ -1032,9 +1034,9 @@ 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 + 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] @@ -1073,7 +1075,7 @@ function _detalhes:agrupar_janelas(lados) local instancia = self - for lado, esta_instancia in _pairs (lados) do + for lado, esta_instancia in _pairs(lados) do if (esta_instancia) then instancia.baseframe:ClearAllPoints() esta_instancia = _detalhes.tabela_instancias [esta_instancia] @@ -1155,7 +1157,7 @@ function _detalhes:agrupar_janelas(lados) end if (not _detalhes.disable_lock_ungroup_buttons) then - instancia.break_snap_button:SetAlpha (1) + instancia.break_snap_button:SetAlpha(1) end if (_detalhes.tutorial.unlock_button < 4) then @@ -1190,7 +1192,7 @@ function _detalhes:Desagrupar (instancia, lado, lado2) 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 @@ -1203,8 +1205,8 @@ function _detalhes:Desagrupar (instancia, lado, lado2) 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 index, iid in _pairs (esta_instancia.snap) do -- index = 1 left , 3 right, 2 bottom, 4 top + for id, esta_instancia in ipairs(_detalhes.tabela_instancias) do + for index, iid in _pairs(esta_instancia.snap) do -- index = 1 left , 3 right, 2 bottom, 4 top if (iid and (iid == ID or id == ID)) then -- iid = instancia.meu_id esta_instancia.snap [index] = nil @@ -1232,7 +1234,7 @@ function _detalhes:Desagrupar (instancia, lado, lado2) end end - instancia.break_snap_button:SetAlpha (0) + instancia.break_snap_button:SetAlpha(0) instancia.verticalSnap = false instancia.horizontalSnap = false @@ -1257,7 +1259,7 @@ function _detalhes:Desagrupar (instancia, lado, lado2) esta_instancia.snap [2] = nil end - instancia.break_snap_button:SetAlpha (0) + instancia.break_snap_button:SetAlpha(0) if (instancia.iniciada) then @@ -1272,7 +1274,7 @@ 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 @@ -1351,7 +1353,7 @@ end LastModo = modo_grupo, } - _setmetatable (new_instance, _detalhes) + _setmetatable(new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance --fill the empty instance with default values @@ -1373,7 +1375,7 @@ end function _detalhes:NovaInstancia (ID) local new_instance = {} - _setmetatable (new_instance, _detalhes) + _setmetatable(new_instance, _detalhes) _detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance --instance number @@ -1483,7 +1485,7 @@ end for key, value in pairs(style) do if (key ~= "skin") then if (type(value) == "table") then - instance [key] = Details.CopyTable (value) + instance [key] = Details.CopyTable(value) else instance [key] = value end @@ -1501,7 +1503,7 @@ end ------------------------------------------------------------------------------------------------------------------------ function _detalhes:FixToolbarMenu (instance) - --print ("fixing...", instance.meu_id) + --print("fixing...", instance.meu_id) --instance:ToolbarMenuButtons() end @@ -1650,10 +1652,10 @@ function _detalhes:SwitchBack() end if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then - _detalhes.RaidTables:switch (nil, prev_switch [5], self) + _detalhes.RaidTables:switch(nil, prev_switch [5], self) elseif (self.modo == _detalhes._detalhes_props["MODO_ALONE"]) then - _detalhes.SoloTables:switch (nil, prev_switch [6]) + _detalhes.SoloTables:switch(nil, prev_switch [6]) else _detalhes:TrocaTabela(self, prev_switch [4], prev_switch [2], prev_switch [3]) @@ -1685,7 +1687,7 @@ function _detalhes:SwitchTo (switch_table, nosave) _detalhes.RaidTables:EnableRaidMode (self, switch_table [2]) else local plugin = _detalhes:GetPlugin (plugin_global_name) - _detalhes:Msg ("Auto Switch: a window is already showing " .. (plugin.__name or "" .. ", please review your switch config.")) + _detalhes:Msg("Auto Switch: a window is already showing " .. (plugin.__name or "" .. ", please review your switch config.")) end else --muda para um atributo normal @@ -1703,7 +1705,7 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) self:SwitchBack() - local role = _UnitGroupRolesAssigned ("player") + local role = _UnitGroupRolesAssigned("player") local got_switch = false @@ -1760,7 +1762,7 @@ function _detalhes:CheckSwitchOnCombatStart (check_segment) local all_roles = self.switch_all_roles_in_combat - local role = _UnitGroupRolesAssigned ("player") + local role = _UnitGroupRolesAssigned("player") local got_switch = false if (role == "DAMAGER" and self.switch_damager_in_combat) then @@ -1816,7 +1818,7 @@ function _detalhes:ExportSkin() for key, value in pairs(self) do if (_detalhes.instance_defaults [key] ~= nil) then if (type(value) == "table") then - exported [key] = Details.CopyTable (value) + exported [key] = Details.CopyTable(value) else exported [key] = value end @@ -1871,7 +1873,7 @@ end function _detalhes:ApplySavedSkin (style) if (not style.version or _detalhes.preset_version > style.version) then - return _detalhes:Msg (Loc ["STRING_OPTIONS_PRESETTOOLD"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_PRESETTOOLD"]) end --set skin preset @@ -1883,7 +1885,7 @@ function _detalhes:ApplySavedSkin (style) for key, value in pairs(style) do if (key ~= "skin") then if (type(value) == "table") then - self [key] = Details.CopyTable (value) + self [key] = Details.CopyTable(value) else self [key] = value end @@ -1896,7 +1898,7 @@ function _detalhes:ApplySavedSkin (style) for key2, value2 in pairs(value) do if (self [key] [key2] == nil) then if (type(value2) == "table") then - self [key] [key2] = Details.CopyTable (_detalhes.instance_defaults [key] [key2]) + self [key] [key2] = Details.CopyTable(_detalhes.instance_defaults [key] [key2]) else self [key] [key2] = value2 end @@ -1905,7 +1907,7 @@ function _detalhes:ApplySavedSkin (style) end end - self.StatusBarSaved = style.StatusBarSaved and Details.CopyTable (style.StatusBarSaved) or {options = {}} + self.StatusBarSaved = style.StatusBarSaved and Details.CopyTable(style.StatusBarSaved) or {options = {}} self.StatusBar.options = self.StatusBarSaved.options _detalhes.StatusBar:UpdateChilds (self) @@ -1917,7 +1919,7 @@ function _detalhes:ApplySavedSkin (style) self.posicao = style.posicao self:RestoreMainWindowPosition() else - self.posicao = Details.CopyTable (self.posicao) + self.posicao = Details.CopyTable(self.posicao) end end @@ -1947,7 +1949,7 @@ function _detalhes:RefreshBars(instance) end function _detalhes:SetBackgroundColor(...) - local red = select (1, ...) + 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) @@ -2050,12 +2052,12 @@ function Details:PostponeSwitchToCurrent(instance) if (instance.is_interacting and instance.last_interaction < Details._tempo) then instance.last_interaction = Details._tempo end - --instance._postponing_switch = Details:ScheduleTimer ("PostponeSwitchToCurrent", 1, instance) + --instance._postponing_switch = Details:ScheduleTimer("PostponeSwitchToCurrent", 1, instance) instance._postponing_switch = Details.Schedules.NewTimer(1, 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 @@ -2063,7 +2065,7 @@ function Details:CheckSwitchToCurrent() if ((instance.last_interaction and (instance.last_interaction+3 > Details._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (Details.playerDetailWindow:IsShown())) then --postpone - --instance._postponing_switch = Details:ScheduleTimer ("PostponeSwitchToCurrent", 1, instance) + --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 @@ -2122,7 +2124,7 @@ function _detalhes:AtualizaSegmentos (instancia) elseif (instancia.segmento == 0) then --instancia.baseframe.rodape.segmento:SetText(segmentos.current) --localiza-me instancia.showing = _detalhes.tabela_vigente - --print ("==> Changing the Segment now! - classe_instancia.lua 1922") + --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 @@ -2131,18 +2133,17 @@ function _detalhes:AtualizaSegmentos (instancia) end function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) - if (instancia.freezed) then return --se esta congelada n�o tem o que fazer end local segmento = instancia.segmento - local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in) + 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] - --print ("==> Changing the Segment now! - classe_instancia.lua 1942") + --print("==> Changing the Segment now! - classe_instancia.lua 1942") Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true @@ -2152,7 +2153,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) elseif (segmento < _detalhes.segments_amount and segmento > 0) then instancia.showing = historico.tabelas [segmento] - --print ("==> Changing the Segment now! - classe_instancia.lua 1952") + --print("==> Changing the Segment now! - classe_instancia.lua 1952") Details.FadeHandler.Fader(instancia, _fadeType, _fadeSpeed, "barras") --"in", nil instancia.showing[instancia.atributo].need_refresh = true @@ -2161,11 +2162,9 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) instancia:RefreshMainWindow(true) _detalhes:AtualizarJanela (instancia) end - end local function ValidateAttribute (atributo, sub_atributo) - if (atributo == 1) then if (sub_atributo < 0 or sub_atributo > _detalhes.atributos[1]) then return false @@ -2199,7 +2198,6 @@ function _detalhes:SetDisplay(segment, attribute, subAttribute, isInstanceStarup 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 InstanceMode = iniciando_instancia iniciando_instancia = sub_atributo @@ -2213,7 +2211,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic iniciando_instancia = nil end - if (_type(instancia) == "number") then + if (type(instancia) == "number") then sub_atributo = atributo atributo = segmento segmento = instancia @@ -2227,7 +2225,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic 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 @@ -2269,13 +2267,15 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic 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,7 +2285,8 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic 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 @@ -2297,12 +2298,11 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic if (not ValidateAttribute (atributo, sub_atributo)) then sub_atributo = 1 atributo = 1 - _detalhes:Msg ("invalid attribute, switching to damage done.") + _detalhes:Msg("invalid attribute, switching to damage done.") end --Muda o segmento caso necess�rio if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then - --na troca de segmento, conferir se a instancia esta frozen if (instancia.freezed) then if (not iniciando_instancia) then @@ -2316,9 +2316,10 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic if (segmento == -1) then --overall instancia.showing = _detalhes.tabela_overall + elseif (segmento == 0) then --combate atual instancia.showing = _detalhes.tabela_vigente - --print ("==> Changing the Segment now! - classe_instancia.lua 2115") + --print("==> Changing the Segment now! - classe_instancia.lua 2115") else --alguma tabela do hist�rico instancia.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2328,7 +2329,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic end if (instancia.showing and instancia.showing.contra) then - --print ("DEBUG: contra", instancia.showing.contra) + --print("DEBUG: contra", instancia.showing.contra) end _detalhes:SendEvent("DETAILS_INSTANCE_CHANGESEGMENT", nil, instancia, segmento) @@ -2339,6 +2340,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic 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 + if (instance.freezed) then if (not iniciando_instancia) then instance:UnFreeze() @@ -2351,8 +2353,10 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic if (segmento == -1) then --overall instance.showing = _detalhes.tabela_overall + elseif (segmento == 0) then --combate atual - instance.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2148") + instance.showing = _detalhes.tabela_vigente; --print("==> Changing the Segment now! - classe_instancia.lua 2148") + else --alguma tabela do hist�rico instance.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2378,7 +2382,6 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic end end end - end --Muda o atributo caso necess�rio @@ -2390,7 +2393,6 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic end if (atributo ~= current_atributo or _detalhes.initializing or iniciando_instancia or (instancia.modo == modo_alone or instancia.modo == modo_raid)) then - if (instancia.modo == modo_alone and not (_detalhes.initializing or iniciando_instancia)) then if (_detalhes.SoloTables.Mode == #_detalhes.SoloTables.Plugins) then _detalhes.popup:Select(1, 1) @@ -2401,7 +2403,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic 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 @@ -2418,9 +2420,8 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic end if (_detalhes.cloud_process) then - if (_detalhes.debug) then - _detalhes:Msg ("(debug) instancia #"..instancia.meu_id.." found cloud process.") + _detalhes:Msg("(debug) instancia #"..instancia.meu_id.." found cloud process.") end local atributo = instancia.atributo @@ -2428,19 +2429,19 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet ("damage") and _detalhes.host_by) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) instancia need damage cloud.") + _detalhes:Msg("(debug) instancia need damage cloud.") end elseif (atributo == 2 and _detalhes.in_combat and (not _detalhes:CaptureGet ("heal") or _detalhes:CaptureGet ("aura")) and _detalhes.host_by) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) instancia need heal cloud.") + _detalhes:Msg("(debug) instancia need heal cloud.") end elseif (atributo == 3 and _detalhes.in_combat and not _detalhes:CaptureGet ("energy") and _detalhes.host_by) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) instancia need energy cloud.") + _detalhes:Msg("(debug) instancia need energy cloud.") end elseif (atributo == 4 and _detalhes.in_combat and not _detalhes:CaptureGet ("miscdata") and _detalhes.host_by) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) instancia need misc cloud.") + _detalhes:Msg("(debug) instancia need misc cloud.") end else time_left = nil @@ -2448,15 +2449,14 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic if (time_left) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) showing instance alert.") + _detalhes:Msg("(debug) showing instance alert.") end instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, time_left) end end - _detalhes:InstanceCall (_detalhes.CheckPsUpdate) + _detalhes:InstanceCall(_detalhes.CheckPsUpdate) _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo) - end if (sub_atributo ~= current_sub_atributo or _detalhes.initializing or iniciando_instancia or atributo_changed) then @@ -2513,7 +2513,6 @@ function _detalhes:GetRaidPluginName() end function _detalhes:GetInstanceAttributeText() - if (self.modo == modo_grupo or self.modo == modo_all) then local attribute = self.atributo local sub_attribute = self.sub_atributo @@ -2542,11 +2541,9 @@ function _detalhes:GetInstanceAttributeText() return "Unknown Plugin" end end - end function _detalhes:MontaRaidOption (instancia) - local available_plugins = _detalhes.RaidTables:GetAvailablePlugins() if (#available_plugins == 0) then @@ -2554,7 +2551,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 @@ -2572,7 +2569,7 @@ function _detalhes:MontaRaidOption (instancia) 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 @@ -2598,7 +2595,6 @@ local menu_icones = { } function _detalhes:MontaAtributosOption (instancia, func) - func = func or instancia.TrocaTabela local checked1 = instancia.atributo @@ -2607,7 +2603,7 @@ function _detalhes:MontaAtributosOption (instancia, func) local options if (atributo_ativo == 5) then --custom options = {Loc ["STRING_CUSTOM_NEW"]} - for index, custom in _ipairs(_detalhes.custom) do + for index, custom in ipairs(_detalhes.custom) do options [#options+1] = custom.name end else @@ -2649,7 +2645,7 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddMenu (2, func, true, i, o, options[o], nil, true) CoolTip:AddIcon (menu_icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1) else - CoolTip:AddLine (options[o], nil, 2, .5, .5, .5, 1) + CoolTip:AddLine(options[o], nil, 2, .5, .5, .5, 1) CoolTip:AddMenu (2, func, true, i, o) CoolTip:AddIcon (menu_icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1, {.3, .3, .3, 1}) end @@ -2662,8 +2658,8 @@ function _detalhes:MontaAtributosOption (instancia, func) --custom - --GameCooltip:AddLine ("$div") - CoolTip:AddLine ("$div", nil, 1, -3, 1) + --GameCooltip:AddLine("$div") + CoolTip:AddLine("$div", nil, 1, -3, 1) CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], nil, true) CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(5-1), p*(5), 0, 1) @@ -2671,13 +2667,13 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], nil, true) CoolTip:AddIcon ([[Interface\CHATFRAME\UI-ChatIcon-Maximize-Up]], 2, 1, 20, 20, 3/32, 29/32, 3/32, 29/32) - CoolTip:AddLine ("$div", nil, 2, nil, -8, -13) + 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) + CoolTip:AddLine(custom.name .. Loc ["STRING_CUSTOM_TEMPORARILY"], nil, 2) else - CoolTip:AddLine (custom.name, nil, 2) + CoolTip:AddLine(custom.name, nil, 2) end CoolTip:AddMenu (2, func, true, 5, index) @@ -2738,7 +2734,6 @@ local getFineTunedIconCoords = function(attribute, subAttribute) end function _detalhes:ChangeIcon(icon) - local skin = _detalhes.skins [self.skin] if (not skin) then skin = _detalhes.skins [_detalhes.default_skin_to_use] @@ -2811,7 +2806,7 @@ function _detalhes:ChangeIcon(icon) 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 @@ -2826,8 +2821,7 @@ function _detalhes:SetMode (qual) end function _detalhes:AlteraModo (instancia, qual, from_mode_menu) - - if (_type(instancia) == "number") then + if (type(instancia) == "number") then qual = instancia instancia = self end @@ -2854,7 +2848,7 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) instancia.sub_atributo = 1 end if (not instancia.showing[instancia.atributo]) then - instancia.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2636") + instancia.showing = _detalhes.tabela_vigente; --print("==> Changing the Segment now! - classe_instancia.lua 2636") end instancia.atributo = instancia.atributo or 1 instancia.showing[instancia.atributo].need_refresh = true @@ -2957,14 +2951,12 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) _detalhes.OnLeaveMainWindow(instancia, instancia.baseframe.cabecalho.modo_selecao) if (instancia.desaturated_menu) then - instancia.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated (true) + instancia.baseframe.cabecalho.modo_selecao:GetNormalTexture():SetDesaturated(true) end end - end local function GetDpsHps (_thisActor, key) - local keyname if (key == "dps") then keyname = "last_dps" @@ -3008,7 +3000,6 @@ local default_format_value3 = function(i, v1, v2) end function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) - f1 = f1 or default_format_value1 f2 = f2 or default_format_value2 f3 = f3 or default_format_value3 @@ -3040,7 +3031,7 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) 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 + if (v1 and v2 and type(v1) == "string" and type(v2) == "string") then v1 = v1 .. " " _detalhes.fontstring_len:SetText(v1) local len = _detalhes.fontstring_len:GetStringWidth() @@ -3058,7 +3049,7 @@ function _detalhes:FormatReportLines (report_table, data, f1, f2, f3) end local report_name_function = function(name) - local name, index = unpack (name) + local name, index = unpack(name) if (_detalhes.remove_realm_from_name and name:find ("-")) then return index .. ". " .. name:gsub (("%-.*"), "") @@ -3068,7 +3059,7 @@ local report_name_function = function(name) end local report_amount_function = function(t) - local amount, dps, percent, is_string, index = unpack (t) + local amount, dps, percent, is_string, index = unpack(t) if (not is_string) then if (dps) then @@ -3097,7 +3088,6 @@ end --Reportar o que esta na janela da inst�ncia function _detalhes:monta_relatorio (este_relatorio, custom) - if (custom) then --shrink local report_lines = {} @@ -3138,7 +3128,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) if (already_exists) then --push it to front - local t = tremove (_detalhes.latest_report_table, already_exists) + local t = tremove(_detalhes.latest_report_table, already_exists) t [4] = amt tinsert(_detalhes.latest_report_table, 1, t) else @@ -3150,7 +3140,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) end end - tremove (_detalhes.latest_report_table, 11) + tremove(_detalhes.latest_report_table, 11) end local barras = self.barras @@ -3160,7 +3150,6 @@ function _detalhes:monta_relatorio (este_relatorio, custom) local name_member = "nome" if (not is_current) then - local total, keyName, keyNameSec, first local container_amount = 0 local atributo = self.atributo @@ -3198,14 +3187,17 @@ function _detalhes:monta_relatorio (este_relatorio, custom) end end + 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 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 @@ -3220,6 +3212,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 if (_detalhes.custom [self.sub_atributo]) then @@ -3241,9 +3234,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom) for i = 1, container_amount do local actor = container [i] - if (actor) then - -- get the total local amount, is_string if (type(actor [keyName]) == "number") then @@ -3292,13 +3283,11 @@ function _detalhes:monta_relatorio (este_relatorio, custom) _detalhes:FormatReportLines (report_lines, t, report_name_function, report_amount_function, report_build_line) else for i = #raw_data_to_report, amt+1, -1 do - tremove (raw_data_to_report, i) + tremove(raw_data_to_report, i) end _detalhes:FormatReportLines (report_lines, raw_data_to_report, report_name_function, report_amount_function, report_build_line) end - else - local raw_data_to_report = {} for i = 1, amt do @@ -3319,11 +3308,9 @@ function _detalhes:monta_relatorio (este_relatorio, custom) end return self:envia_relatorio (report_lines) - end function _detalhes:envia_relatorio (linhas, custom) - local segmento = self.segmento local luta = nil local combatObject @@ -3331,7 +3318,7 @@ function _detalhes:envia_relatorio (linhas, custom) if (not custom) then if (not linhas[1]) then - return _detalhes:Msg (Loc ["STRING_ACTORFRAME_NOTHING"]) + return _detalhes:Msg(Loc ["STRING_ACTORFRAME_NOTHING"]) end if (segmento == -1) then --overall @@ -3492,8 +3479,8 @@ function _detalhes:envia_relatorio (linhas, custom) --adicionar o tempo de luta local segmentTime = "" if (combatObject) then - local time = combatObject:GetCombatTime() - segmentTime = _detalhes.gump:IntegerToTimer (time or 0) + local combatTime = combatObject:GetCombatTime() + segmentTime = _detalhes.gump:IntegerToTimer (combatTime or 0) end --effective ou active time @@ -3551,7 +3538,7 @@ function _detalhes:envia_relatorio (linhas, custom) end local channelName = GetChannelName (channel) - local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) + local timer = C_Timer.NewTimer(i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = "CHANNEL" timer.Arg3 = nil @@ -3565,7 +3552,7 @@ function _detalhes:envia_relatorio (linhas, custom) bnetAccountID = tonumber(bnetAccountID) for i = 1, #linhas do - local timer = C_Timer.NewTimer (i * delay / 1000, sendReportBnet) + local timer = C_Timer.NewTimer(i * delay / 1000, sendReportBnet) timer.Arg1 = bnetAccountID timer.Arg2 = linhas[i] end @@ -3577,12 +3564,12 @@ function _detalhes:envia_relatorio (linhas, custom) local alvo = _detalhes.report_to_who if (not alvo or alvo == "") then - _detalhes:Msg (Loc ["STRING_REPORT_INVALIDTARGET"]) + _detalhes:Msg(Loc ["STRING_REPORT_INVALIDTARGET"]) return end for i = 1, #linhas do - local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) + local timer = C_Timer.NewTimer(i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who timer.Arg3 = nil @@ -3602,16 +3589,16 @@ function _detalhes:envia_relatorio (linhas, custom) end alvo = nome else - _detalhes:Msg (Loc ["STRING_REPORT_INVALIDTARGET"]) + _detalhes:Msg(Loc ["STRING_REPORT_INVALIDTARGET"]) return end else - _detalhes:Msg (Loc ["STRING_REPORT_INVALIDTARGET"]) + _detalhes:Msg(Loc ["STRING_REPORT_INVALIDTARGET"]) return end for i = 1, #linhas do - local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) + local timer = C_Timer.NewTimer(i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who timer.Arg3 = nil @@ -3628,7 +3615,7 @@ function _detalhes:envia_relatorio (linhas, custom) end for i = 1, #linhas do - local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel) + local timer = C_Timer.NewTimer(i * delay / 1000, send_report_channel) timer.Arg1 = linhas[i] timer.Arg2 = to_who timer.Arg3 = nil diff --git a/classes/class_resources.lua b/classes/class_resources.lua index 6b4cb4f7..48864d15 100644 --- a/classes/class_resources.lua +++ b/classes/class_resources.lua @@ -5,14 +5,14 @@ local _math_floor = math.floor local _table_sort = table.sort local _table_insert = table.insert local _setmetatable = setmetatable -local _ipairs = ipairs +local ipairs = ipairs local _pairs = pairs local _rawget= rawget local _math_min = math.min local _math_max = math.max local _bit_band = bit.band local _unpack = unpack -local _type = type +local type = type --api locals local _GetSpellInfo = _detalhes.getspellinfo local GameTooltip = GameTooltip @@ -22,7 +22,7 @@ local _IsInGroup = IsInGroup local _string_replace = _detalhes.string.replace --details api local _detalhes = _G._detalhes -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ( "Details" ) local _ @@ -87,7 +87,7 @@ function atributo_energy:NovaTabela (serial, nome, link) spells = container_habilidades:NovoContainer (container_energy), } - _setmetatable (_new_energyActor, atributo_energy) + _setmetatable(_new_energyActor, atributo_energy) return _new_energyActor end @@ -200,7 +200,7 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia) local esta_barra = instancia.barras [whichRowLine] if (not esta_barra) then - print ("DEBUG: problema com "..whichRowLine.." "..colocacao) + print("DEBUG: problema com "..whichRowLine.." "..colocacao) return end @@ -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,7 +309,7 @@ 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 + 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 @@ -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 @@ -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 @@ -532,8 +532,8 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end row1:SetValue(100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -593,8 +593,8 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex end row1:SetValue(100) - local r, g, b = unpack (instancia.total_bar.color) - row1.textura:SetVertexColor (r, g, b) + local r, g, b = unpack(instancia.total_bar.color) + row1.textura:SetVertexColor(r, g, b) row1.icone_classe:SetTexture(instancia.total_bar.icon) row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375) @@ -653,7 +653,7 @@ function atributo_energy:RefreshLine(instancia, barras_container, whichRowLine, 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) + print("DEBUG: problema com "..whichRowLine.." "..lugar) return end @@ -737,10 +737,10 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior, 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) + esta_barra.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then - esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) + esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end return self:RefreshBarra (esta_barra, instancia) @@ -816,8 +816,8 @@ function atributo_energy:ToolTip (instancia, numero, barra, keydown) if (resource_string) then local icon = _detalhes.resource_icons [self.resource_type] - GameCooltip:AddLine (resource_string, floor (self.resource) .. " (" .. _cstr ("%.2f", self.resource / instancia.showing:GetCombatTime()) .. " per second)", 1, "white") - GameCooltip:AddIcon (icon.file, 1, 1, 16, 16, unpack (icon.coords)) + GameCooltip:AddLine(resource_string, floor(self.resource) .. " (" .. _cstr ("%.2f", self.resource / instancia.showing:GetCombatTime()) .. " per second)", 1, "white") + GameCooltip:AddIcon (icon.file, 1, 1, 16, 16, unpack(icon.coords)) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], resource_bg_coords, resource_bg_color, true) return true @@ -839,7 +839,7 @@ local reset_tooltips_table = function() t[1], t[2], t[3] = "", 0, "" end - for k, v in _pairs (energy_tooltips_hash) do + for k, v in _pairs(energy_tooltips_hash) do energy_tooltips_hash [k] = nil end end @@ -850,9 +850,9 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local powertype = self.powertype @@ -864,10 +864,10 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown --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 + for spellid, spell in _pairs(actor.spells._ActorTable) do local on_self = spell.targets [name] if (on_self) then local already_tracked = energy_tooltips_hash [spellid] @@ -925,7 +925,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown end local nome_magia, _, icone_magia = _GetSpellInfo(spell [1]) - GameCooltip:AddLine (nome_magia, FormatTooltipNumber (_, spell [2]).." (".._cstr("%.1f", (spell [2]/total_regenerado) * 100).."%)") + GameCooltip:AddLine(nome_magia, FormatTooltipNumber (_, spell [2]).." (".._cstr("%.1f", (spell [2]/total_regenerado) * 100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar (false, spell [2] / energy_tooltips_table [1][2] * 100) end @@ -934,7 +934,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown 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] @@ -983,7 +983,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown break end - GameCooltip:AddLine (source [1], FormatTooltipNumber (_, source [2]).." (".._cstr("%.1f", (source [2] / total_regenerado) * 100).."%)") + GameCooltip:AddLine(source [1], FormatTooltipNumber (_, source [2]).." (".._cstr("%.1f", (source [2] / total_regenerado) * 100).."%)") _detalhes:AddTooltipBackgroundStatusbar() local classe = source [3] @@ -993,7 +993,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, icon_size.W, icon_size.H, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, icon_size.W, icon_size.H, _unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, icon_size.W, icon_size.H, _unpack(_detalhes.class_coords [classe])) end end @@ -1001,7 +1001,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown --player generators local allGeneratorSpells = {} local allGenerated = 0 - for spellid, spellObject in _pairs (self.spells._ActorTable) do + for spellid, spellObject in _pairs(self.spells._ActorTable) do tinsert(allGeneratorSpells, {spellObject, spellObject.total, spellObject.totalover}) allGenerated = allGenerated + spellObject.total end @@ -1014,7 +1014,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown for i = 1, #allGeneratorSpells do local thisGenerator = allGeneratorSpells [i] local spellName, _, spellIcon = GetSpellInfo(thisGenerator[1].id) - GameCooltip:AddLine (spellName, FormatTooltipNumber (_, thisGenerator[2]) .. " (|cFFFF5555overflow: " .. FormatTooltipNumber (_, thisGenerator[3]) .. "|r | " .. _cstr ("%.1f", (thisGenerator[2] / allGenerated) * 100).."%)") + GameCooltip:AddLine(spellName, FormatTooltipNumber (_, thisGenerator[2]) .. " (|cFFFF5555overflow: " .. FormatTooltipNumber (_, thisGenerator[3]) .. "|r | " .. _cstr ("%.1f", (thisGenerator[2] / allGenerated) * 100).."%)") GameCooltip:AddIcon (spellIcon, nil, nil, icon_size.W, icon_size.H, .1, .9, .1, .9) _detalhes:AddTooltipBackgroundStatusbar() end @@ -1023,7 +1023,7 @@ function atributo_energy:ToolTipRegenRecebido (instancia, numero, barra, keydown _detalhes:AddTooltipSpellHeaderText (self.nome .. " Auto Regen Overflow", headerColor, 1, [[Interface\CHARACTERFRAME\Disconnect-Icon]], 0.3, 0.7, 0.3, 0.7) _detalhes:AddTooltipHeaderStatusbar (r, g, b, 1) - GameCooltip:AddLine ("Auto Regen Overflow", FormatTooltipNumber (_, self.passiveover) .. " ( " .. _cstr ("%.1f", self.passiveover / (self.passiveover + self.total) * 100) .. "%)") + GameCooltip:AddLine("Auto Regen Overflow", FormatTooltipNumber (_, self.passiveover) .. " ( " .. _cstr ("%.1f", self.passiveover / (self.passiveover + self.total) * 100) .. "%)") GameCooltip:AddIcon ([[Interface\COMMON\Indicator-Red]], nil, nil, icon_size.W, icon_size.H) _detalhes:AddTooltipBackgroundStatusbar() @@ -1066,10 +1066,10 @@ function atributo_energy:MontaInfoRegenRecebido() --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 + for spellid, spell in _pairs(actor.spells._ActorTable) do local on_self = spell.targets [my_name] if (on_self) then @@ -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 @@ -1142,7 +1142,7 @@ function atributo_energy:MontaInfoRegenRecebido() 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 @@ -1203,7 +1203,7 @@ function atributo_energy:MontaInfoRegenRecebido() barra.minha_tabela = self - --print ("nome_inimigo = ", tabela [1]) + --print("nome_inimigo = ", tabela [1]) barra.nome_inimigo = tabela [1] barra:Show() @@ -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 @@ -1235,7 +1235,7 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) --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 @@ -1286,10 +1286,10 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra) 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.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [tabela[3]])) barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") - barra.icone:SetTexCoord (_unpack (_detalhes.class_coords [tabela[3]])) + barra.icone:SetTexCoord (_unpack(_detalhes.class_coords [tabela[3]])) barra:Show() --mostra a barra @@ -1314,13 +1314,13 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) local actor = container._ActorTable [container._NameIndexTable [esta_barra.nome_inimigo]] - --print ("Mouse Over", actor, esta_barra.nome_inimigo, self.tipo) + --print("Mouse Over", actor, esta_barra.nome_inimigo, self.tipo) if (actor) then --spells: local i = 1 - for spellid, spell in _pairs (actor.spells._ActorTable) do + for spellid, spell in _pairs(actor.spells._ActorTable) do local on_self = spell.targets [my_name] if (on_self) then local t = energy_tooltips_table [i] @@ -1336,9 +1336,9 @@ function atributo_energy:MontaTooltipAlvos (esta_barra, index) i = i - 1 _table_sort (energy_tooltips_table, _detalhes.Sort2) - --print (i, #energy_tooltips_table) + --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 @@ -1371,7 +1371,7 @@ end --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) + --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 combat_table.totals [class_type] [self.powertype] = combat_table.totals [class_type] [self.powertype] - self.total if (self.grupo) then @@ -1381,7 +1381,7 @@ end end function atributo_energy:add_total (combat_table) - --print ("add total:", combat_table.totals [class_type] [self.powertype], self.total) + --print("add total:", combat_table.totals [class_type] [self.powertype], self.total) if (self.powertype and combat_table.totals [class_type] [self.powertype]) then combat_table.totals [class_type] [self.powertype] = combat_table.totals [class_type] [self.powertype] + self.total @@ -1423,15 +1423,15 @@ end end --targets - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do shadow.targets [target_name] = 0 end --spells - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) --spell targets - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = 0 end end @@ -1467,7 +1467,7 @@ end end --pets (add unique pet names) - for _, petName in _ipairs(actor.pets) do + for _, petName in ipairs(actor.pets) do DetailsFramework.table.addunique (shadow.pets, petName) end @@ -1477,7 +1477,7 @@ end shadow.alternatepower = shadow.alternatepower + actor.alternatepower if (not actor.powertype) then - --print ("actor without powertype", actor.nome, actor.powertype) + --print("actor without powertype", actor.nome, actor.powertype) actor.powertype = 1 end @@ -1496,12 +1496,12 @@ end end --targets - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do shadow.targets [target_name] = (shadow.targets [target_name] or 0) + amount end --spells - for spellid, habilidade in _pairs (actor.spells._ActorTable) do + for spellid, habilidade in _pairs(actor.spells._ActorTable) do local habilidade_shadow = shadow.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1509,7 +1509,7 @@ end habilidade_shadow.counter = habilidade_shadow.counter + habilidade.counter --spell targets - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_shadow.targets [target_name] = (habilidade_shadow.targets [target_name] or 0) + amount end @@ -1523,7 +1523,7 @@ function atributo_energy:ColetarLixo (lastevent) end function _detalhes.refresh:r_atributo_energy (este_jogador, shadow) - _setmetatable (este_jogador, _detalhes.atributo_energy) + _setmetatable(este_jogador, _detalhes.atributo_energy) este_jogador.__index = _detalhes.atributo_energy _detalhes.refresh:r_container_habilidades (este_jogador.spells, shadow and shadow.spells) @@ -1558,12 +1558,12 @@ atributo_energy.__add = function(tabela1, tabela2) tabela1.alternatepower = tabela1.alternatepower + tabela2.alternatepower --targets - for target_name, amount in _pairs (tabela2.targets) do + for target_name, amount in _pairs(tabela2.targets) do tabela1.targets [target_name] = (tabela1.targets [target_name] or 0) + amount end --spells - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1571,7 +1571,7 @@ atributo_energy.__add = function(tabela1, tabela2) habilidade_tabela1.counter = habilidade_tabela1.counter + habilidade.counter --spell targets - for target_name, amount in _pairs (habilidade.targets) do + for target_name, amount in _pairs(habilidade.targets) do habilidade_tabela1.targets [target_name] = (habilidade_tabela1.targets [target_name] or 0) + amount end @@ -1596,14 +1596,14 @@ atributo_energy.__sub = function(tabela1, tabela2) tabela1.alternatepower = tabela1.alternatepower - tabela2.alternatepower --targets - for target_name, amount in _pairs (tabela2.targets) do + 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 - for spellid, habilidade in _pairs (tabela2.spells._ActorTable) do + for spellid, habilidade in _pairs(tabela2.spells._ActorTable) do local habilidade_tabela1 = tabela1.spells:PegaHabilidade (spellid, true, "SPELL_ENERGY", false) @@ -1611,7 +1611,7 @@ atributo_energy.__sub = function(tabela1, tabela2) habilidade_tabela1.counter = habilidade_tabela1.counter - habilidade.counter --spell targets - for target_name, amount in _pairs (habilidade.targets) do + 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 end diff --git a/classes/class_spelldamage.lua b/classes/class_spelldamage.lua index 37c993a2..3b46310d 100644 --- a/classes/class_spelldamage.lua +++ b/classes/class_spelldamage.lua @@ -5,7 +5,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers - local _ipairs = ipairs--lua local + local ipairs = ipairs--lua local local _pairs = pairs--lua local local _UnitAura = UnitAura--api local @@ -152,7 +152,7 @@ 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 @@ -168,7 +168,7 @@ else - for BuffName, _ in _pairs (_detalhes.Buffs.BuffsTable) do + for BuffName, _ in _pairs(_detalhes.Buffs.BuffsTable) do local name = _UnitAura ("player", BuffName) if (name ~= nil) then local buff_info = SpellBuffDetails [name] or {["counter"] = 0, ["total"] = 0, ["critico"] = 0, ["critico_dano"] = 0} diff --git a/classes/class_spellresources.lua b/classes/class_spellresources.lua index 6a822647..935b40b1 100644 --- a/classes/class_spellresources.lua +++ b/classes/class_spellresources.lua @@ -7,7 +7,7 @@ --local pointers local _setmetatable = setmetatable --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _UnitAura = UnitAura --api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/classes/class_spellutility.lua b/classes/class_spellutility.lua index c4de7620..89a16d85 100644 --- a/classes/class_spellutility.lua +++ b/classes/class_spellutility.lua @@ -6,7 +6,7 @@ --local pointers local _setmetatable = setmetatable --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _UnitAura = UnitAura --api local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ function habilidade_misc:Add (serial, nome, flag, who_nome, token, spellID, spellName) - --print (self.id, GetSpellInfo(self.id)) + --print(self.id, GetSpellInfo(self.id)) if (spellID == "BUFF_OR_DEBUFF") then diff --git a/classes/class_utility.lua b/classes/class_utility.lua index bcc70fe5..6085d548 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -8,10 +8,10 @@ local pairs = pairs local _rawget= rawget local min = math.min local _math_max = math.max -local _math_abs = math.abs +local abs = math.abs local _bit_band = bit.band local unpack = unpack -local _type = type +local type = type --api locals local _GetSpellInfo = _detalhes.getspellinfo local GameTooltip = GameTooltip @@ -30,7 +30,7 @@ local _string_replace = _detalhes.string.replace --details api local _detalhes = _G._detalhes local Details = _detalhes -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ( "Details" ) local gump = _detalhes.gump @@ -153,7 +153,7 @@ function _detalhes:ContainerSortMisc(container, amount, keyName2) end --[[exported]] function _detalhes:GetSpellCastAmount (combat, actorName, spellId) - local misc_actor = combat:GetActor (4, actorName) + local misc_actor = combat:GetActor(4, actorName) if (misc_actor) then local spell_cast = misc_actor.spell_cast and misc_actor.spell_cast [spellId] @@ -228,10 +228,10 @@ function Details:ShowDeathTooltip(combatObject, deathTable) local evType = event[1] local spellName, _, spellIcon = _GetSpellInfo(event[2]) local amount = event[3] - local time = event[4] + local eventTime = event[4] local source = event[6] - if (time + 12 > timeOfDeath) then + if (eventTime + 12 > timeOfDeath) then if (type(evType) == "boolean") then --is damage or heal? if (evType) then --bool true @@ -252,10 +252,10 @@ function Details:ShowDeathTooltip(combatObject, deathTable) --end overkill = " (" .. Details:ToK(overkill) .. " |cFFFF8800overkill|r)" - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s |cFFFFFF00" .. spellName .. "|r (|cFFC6B0D9" .. source .. "|r)", "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s |cFFFFFF00" .. spellName .. "|r (|cFFC6B0D9" .. source .. "|r)", "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") else overkill = "" - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "-" .. Details:ToK(amount) .. critOrCrush .. overkill .. " (" .. healthPercent .. "%)", 1, "white", "white") end gameCooltip:AddIcon(spellIcon, nil, nil, nil, nil, .1, .9, .1, .9) @@ -272,12 +272,12 @@ function Details:ShowDeathTooltip(combatObject, deathTable) if (amount > Details.deathlog_healingdone_min) then if (combatObject.is_arena) then if (amount > Details.deathlog_healingdone_min_arena) then - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, nil, nil, .1, .9, .1, .9) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, true) end else - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (|cFFC6B0D9" .. source .. "|r)", "+" .. Details:ToK(amount) .. " (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, nil, nil, .1, .9, .1, .9) gameCooltip:AddStatusBar(healthPercent, 1, barTypeColors.heal, true) end @@ -287,7 +287,7 @@ function Details:ShowDeathTooltip(combatObject, deathTable) elseif (type(evType) == "number") then if (evType == 1) then --cooldown - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "cooldown (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ")", "cooldown (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon, nil, nil, nil, nil, .1, .9, .1, .9) gameCooltip:AddStatusBar(100, 1, barTypeColors.cooldown, true) @@ -301,7 +301,7 @@ function Details:ShowDeathTooltip(combatObject, deathTable) elseif (evType == 4) then --debuff - gameCooltip:AddLine("" .. format("%.1f", time - timeOfDeath) .. "s [x" .. amount .. "] " .. spellName .. " (" .. source .. ")", "debuff (" .. healthPercent .. "%)", 1, "white", "white") + gameCooltip:AddLine("" .. format("%.1f", eventTime - timeOfDeath) .. "s [x" .. amount .. "] " .. spellName .. " (" .. source .. ")", "debuff (" .. healthPercent .. "%)", 1, "white", "white") gameCooltip:AddIcon(spellIcon) gameCooltip:AddStatusBar(100, 1, barTypeColors.debuff, true) @@ -389,7 +389,7 @@ local ReportSingleDeathFunc = function(IsCurrent, IsReverse, AmtLines) t [#t+1] = table [1] .. table [4] .. table [2] .. table [3] end - local title = tremove (t, 1) + local title = tremove(t, 1) t = _detalhes.table.reverse (t) tinsert(t, 1, title) @@ -423,7 +423,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) 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 + 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]) @@ -437,7 +437,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) spelllink = spellname end - local source = _detalhes:GetOnlyName (evento [6]) + local source = _detalhes:GetOnlyName(evento [6]) local amount = evento [3] local hp = _math_floor(evento [5] / max_health * 100) if (hp > 100) then @@ -447,14 +447,14 @@ 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] if (amount > _detalhes.deathlog_healingdone_min) then local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) - local source = _detalhes:GetOnlyName (evento [6]) + local source = _detalhes:GetOnlyName(evento [6]) local spellname, _, spellicon = _GetSpellInfo(evento [2]) local hp = _math_floor(evento [5] / max_health * 100) @@ -473,7 +473,7 @@ function atributo_misc:ReportSingleDeadLine (morte, instancia) local elapsed = _cstr ("%.1f", evento [4] - time_of_death) .."s" local spelllink = GetSpellLink(evento [2]) - local source = _detalhes:GetOnlyName (evento [6]) + 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) @@ -524,13 +524,13 @@ 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 total, percent = unpack(t) local m, s = _math_floor(total / 60), _math_floor(total % 60) return _cstr ("%.1f", percent) .. "% (" .. m .. "m " .. s .. "s)" end @@ -579,7 +579,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta 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) + print("DEBUG: problema com "..whichRowLine.." "..lugar) return end @@ -592,7 +592,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta esta_barra.colocacao = colocacao if (not getmetatable (morte)) then - setmetatable (morte, {__call = RefreshBarraMorte}) + setmetatable(morte, {__call = RefreshBarraMorte}) morte._custom = true end @@ -607,7 +607,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta end --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]]) + local r, g, b, a = unpack(_detalhes.class_colors [morte[4]]) _detalhes:SetBarColors (esta_barra, instancia, r, g, b, a) if (instancia.row_info.use_spec_icons) then @@ -615,11 +615,11 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta 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:SetTexCoord (unpack (_detalhes.class_specs_coords[spec])) + 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:SetTexCoord (unpack (CLASS_ICON_TCOORDS [morte[4]])) + esta_barra.icone_classe:SetTexCoord (unpack(CLASS_ICON_TCOORDS [morte[4]])) else local texture, l, r, t, b = Details:GetUnknownClassIcon() esta_barra.icone_classe:SetTexture(texture) @@ -629,7 +629,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta else if (CLASS_ICON_TCOORDS [morte[4]]) then esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (unpack (CLASS_ICON_TCOORDS [morte[4]])) + esta_barra.icone_classe:SetTexCoord (unpack(CLASS_ICON_TCOORDS [morte[4]])) else local texture, l, r, t, b = Details:GetUnknownClassIcon() esta_barra.icone_classe:SetTexture(texture) @@ -637,7 +637,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta end end - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + esta_barra.icone_classe:SetVertexColor(1, 1, 1) if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --precisa atualizar o tooltip gump:UpdateTooltip (whichRowLine, esta_barra, instancia) @@ -664,7 +664,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo local modo = instancia.modo if (exportar) then - if (_type(exportar) == "boolean") then + if (type(exportar) == "boolean") then if (sub_atributo == 1) then --CC BREAKS keyName = "cc_break" elseif (sub_atributo == 2) then --RESS @@ -891,7 +891,7 @@ function atributo_misc:RefreshLine(instancia, barras_container, whichRowLine, lu 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) + print("DEBUG: problema com "..whichRowLine.." "..lugar) return end @@ -975,10 +975,10 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo 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) + esta_barra.textura:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end if (instancia.row_info.texture_background_class_color) then - esta_barra.background:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) + esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b) end return self:RefreshBarra (esta_barra, instancia) @@ -1079,9 +1079,9 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = self ["cc_break"] @@ -1097,7 +1097,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) --quantidade local nome_magia, _, icone_magia = _GetSpellInfo(_spellid) - GameCooltip:AddLine (nome_magia, _tabela.cc_break .. " (" .. _cstr ("%.1f", _tabela.cc_break / meu_total * 100) .. "%)") + 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) @@ -1105,7 +1105,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) 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) - GameCooltip:AddLine (nome_magia, amt_quebrada .. " ") + GameCooltip:AddLine(nome_magia, amt_quebrada .. " ") GameCooltip:AddIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, 1, 14, 14) GameCooltip:AddIcon (icone_magia, nil, 2, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) GameCooltip:AddStatusBar (100, 1, 1, 0, 0, .2) @@ -1113,12 +1113,12 @@ function atributo_misc:ToolTipCC (instancia, numero, barra) --em quem quebrou for target_name, amount in pairs(_tabela.targets) do - GameCooltip:AddLine (target_name .. ": ", amount .. " ") + GameCooltip:AddLine(target_name .. ": ", amount .. " ") local classe = _detalhes:GetClass (target_name) GameCooltip:AddIcon ([[Interface\AddOns\Details\images\espadas]], nil, 1, lineHeight, lineHeight) if (classe) then - GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) else GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, 2, lineHeight, lineHeight, .25, .5, 0, 1) end @@ -1135,9 +1135,9 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = _math_floor(self ["dispell"]) @@ -1164,12 +1164,12 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) for i = 1, min (25, #meus_dispells) do local esta_habilidade = meus_dispells[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else - GameTooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameTooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --quais habilidades foram dispaladas @@ -1186,7 +1186,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) for i = 1, min (25, #buffs_dispelados) do local esta_habilidade = buffs_dispelados[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end @@ -1208,7 +1208,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) break end - GameCooltip:AddLine (alvos_dispelados[i][1], _detalhes:comma_value (alvos_dispelados[i][2]) .." (".._cstr ("%.1f", alvos_dispelados[i][3]).."%)") + GameCooltip:AddLine(alvos_dispelados[i][1], _detalhes:comma_value (alvos_dispelados[i][2]) .." (".._cstr ("%.1f", alvos_dispelados[i][3]).."%)") _detalhes:AddTooltipBackgroundStatusbar() local targetActor = instancia.showing[4]:PegarCombatente (_, alvos_dispelados[i][1]) @@ -1221,7 +1221,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra) if (classe == "UNKNOW") then GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, 14, 14, .25, .5, 0, 1) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) end end end @@ -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 @@ -1335,7 +1335,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" for raidIndex = 1, _GetNumGroupMembers() do local target = "raid"..raidIndex.."target" - local his_target = _UnitGUID (target) + local his_target = _UnitGUID(target) if (his_target and not checked [his_target]) then local rect = UnitReaction (target, "player") @@ -1346,7 +1346,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" for debuffIndex = 1, 41 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff (target, debuffIndex) if (name and unitCaster) then - local playerGUID = _UnitGUID (unitCaster) + local playerGUID = _UnitGUID(unitCaster) if (playerGUID) then local playerName, realmName = _UnitName (unitCaster) @@ -1367,7 +1367,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local checked = {} for raidIndex = 1, _GetNumGroupMembers()-1 do - local his_target = _UnitGUID ("party"..raidIndex.."target") + local his_target = _UnitGUID("party"..raidIndex.."target") local rect = UnitReaction ("party"..raidIndex.."target", "player") if (his_target and not checked [his_target] and rect and rect <= 4) then @@ -1377,7 +1377,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("party"..raidIndex.."target", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - local playerGUID = _UnitGUID (unitCaster) + local playerGUID = _UnitGUID(unitCaster) if (playerGUID) then if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName @@ -1390,14 +1390,14 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end end - local his_target = _UnitGUID ("playertarget") + local his_target = _UnitGUID("playertarget") local rect = UnitReaction ("playertarget", "player") if (his_target and not checked [his_target] and rect and rect <= 4) then for debuffIndex = 1, 40 do local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - local playerGUID = _UnitGUID (unitCaster) + local playerGUID = _UnitGUID(unitCaster) if (playerGUID) then if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName @@ -1409,7 +1409,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" end else - local his_target = _UnitGUID ("playertarget") + local his_target = _UnitGUID("playertarget") if (his_target) then local reaction = UnitReaction ("playertarget", "player") if (reaction and reaction <= 4) then @@ -1417,7 +1417,7 @@ function _detalhes:CatchRaidDebuffUptime (in_or_out) -- "DEBUFF_UPTIME_IN" local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitDebuff ("playertarget", debuffIndex) if (name and unitCaster) then local playerName, realmName = _UnitName (unitCaster) - local playerGUID = _UnitGUID (unitCaster) + local playerGUID = _UnitGUID(unitCaster) if (playerGUID) then if (realmName and realmName ~= "") then playerName = playerName .. "-" .. realmName @@ -1451,7 +1451,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) for raidIndex = 1, _GetNumGroupMembers() do local RaidIndex = "raid" .. raidIndex - local playerGUID = _UnitGUID (RaidIndex) + local playerGUID = _UnitGUID(RaidIndex) if (playerGUID) then @@ -1508,7 +1508,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) if (name and unitCaster and UnitExists (unitCaster) and UnitExists ("party" .. groupIndex) and UnitIsUnit (unitCaster, "party" .. groupIndex)) then local playerName, realmName = _UnitName ("party"..groupIndex) - local playerGUID = _UnitGUID ("party"..groupIndex) + local playerGUID = _UnitGUID("party"..groupIndex) if (playerGUID) then if (realmName and realmName ~= "") then @@ -1535,7 +1535,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster and UnitExists (unitCaster) and UnitIsUnit (unitCaster, "player")) then local playerName = _UnitName ("player") - local playerGUID = _UnitGUID ("player") + local playerGUID = _UnitGUID("player") if (playerGUID) then if (in_or_out == "BUFF_UPTIME_IN") then if (_detalhes.PotionList [spellid]) then @@ -1576,7 +1576,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL") if (name and unitCaster and UnitExists (unitCaster) and UnitIsUnit (unitCaster, "player")) then local playerName = _UnitName ("player") - local playerGUID = _UnitGUID ("player") + local playerGUID = _UnitGUID("player") if (playerGUID) then if (in_or_out == "BUFF_UPTIME_IN") then @@ -1609,7 +1609,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out) end --]] - -- _detalhes:Msg (string_output) + -- _detalhes:Msg(string_output) end end @@ -1622,9 +1622,9 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = self ["debuff_uptime"] @@ -1640,7 +1640,7 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) end table.sort (debuffs_usados, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #debuffs_usados, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #debuffs_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) local icon_size = _detalhes.tooltip.icon_size @@ -1655,13 +1655,13 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) 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: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) elseif (minutos > 0) then - GameCooltip:AddLine (nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") + GameCooltip:AddLine(nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar (false, esta_habilidade[2] / _combat_time * 100) else - GameCooltip:AddLine (nome_magia, segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") + GameCooltip:AddLine(nome_magia, segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)") _detalhes:AddTooltipBackgroundStatusbar (false, esta_habilidade[2] / _combat_time * 100) end @@ -1669,7 +1669,7 @@ function atributo_misc:ToolTipDebuffUptime (instancia, numero, barra) end end else - GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end return true @@ -1710,7 +1710,7 @@ function atributo_misc:ToolTipBuffUptime(instance, barFrame) local minutes, seconds = floor(spellTable[2] / 60), floor(spellTable[2] % 60) if (spellTable[2] >= combatTime) then - --GameCooltip:AddLine (nome_magia, minutos .. "m " .. segundos .. "s" .. " (" .. _cstr ("%.1f", esta_habilidade[2] / _combat_time * 100) .. "%)", nil, "gray", "gray") + --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) elseif (minutes > 0) then @@ -1736,9 +1736,9 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = _math_floor(self ["cooldowns_defensive"]) @@ -1752,7 +1752,7 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) end table.sort (cooldowns_usados, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #cooldowns_usados, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #cooldowns_usados, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) local icon_size = _detalhes.tooltip.icon_size @@ -1763,12 +1763,12 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) for i = 1, min (25, #cooldowns_usados) do local esta_habilidade = cooldowns_usados[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", esta_habilidade[2]/meu_total*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else - GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --targets @@ -1780,12 +1780,12 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) end table.sort (alvos, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack (_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) if (#alvos > 0) then for i = 1, min (25, #alvos) do - GameCooltip:AddLine (_detalhes:GetOnlyName (alvos[i][1]) .. ": ", alvos[i][2], 1, "white", "white") + GameCooltip:AddLine(_detalhes:GetOnlyName(alvos[i][1]) .. ": ", alvos[i][2], 1, "white", "white") _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ("Interface\\Icons\\PALADIN_HOLY", nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) @@ -1804,7 +1804,7 @@ function atributo_misc:ToolTipDefensiveCooldowns (instancia, numero, barra) local texture, l, r, t, b = _detalhes:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, 14, 14, unpack(_detalhes.class_coords [classe])) end end end @@ -1820,9 +1820,9 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = self ["ress"] @@ -1838,19 +1838,19 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) end table.sort (meus_ress, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_ress, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_ress, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) if (#meus_ress > 0) then for i = 1, min (3, #meus_ress) do local esta_habilidade = meus_ress[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2] .. " (" .. _cstr ("%.1f", floor (esta_habilidade[2]) / floor (meu_total) * 100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2] .. " (" .. _cstr ("%.1f", floor(esta_habilidade[2]) / floor(meu_total) * 100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, lineHeight, lineHeight, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else - GameCooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameCooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --quem foi que o cara reviveu @@ -1862,12 +1862,12 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) end table.sort (alvos, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack (_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_TARGETS"], headerColor, #alvos, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) if (#alvos > 0) then for i = 1, min (3, #alvos) do - GameCooltip:AddLine (alvos[i][1], alvos[i][2]) + GameCooltip:AddLine(alvos[i][1], alvos[i][2]) _detalhes:AddTooltipBackgroundStatusbar() local targetActor = instancia.showing[4]:PegarCombatente (_, alvos[i][1]) @@ -1884,7 +1884,7 @@ function atributo_misc:ToolTipRess (instancia, numero, barra) local texture, l, r, t, b = _detalhes:GetSpecIcon (specID, false) GameCooltip:AddIcon (texture, 1, 1, lineHeight, lineHeight, l, r, t, b) else - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack (_detalhes.class_coords [classe])) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small", nil, nil, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe])) end end end @@ -1900,9 +1900,9 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) local owner = self.owner if (owner and owner.classe) then - r, g, b = unpack (_detalhes.class_colors [owner.classe]) + r, g, b = unpack(_detalhes.class_colors [owner.classe]) else - r, g, b = unpack (_detalhes.class_colors [self.classe]) + r, g, b = unpack(_detalhes.class_colors [self.classe]) end local meu_total = self ["interrupt"] @@ -1920,19 +1920,19 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) end table.sort (meus_interrupts, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_interrupts, _detalhes.tooltip_spell_icon.file, unpack (_detalhes.tooltip_spell_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELLS"], headerColor, #meus_interrupts, _detalhes.tooltip_spell_icon.file, unpack(_detalhes.tooltip_spell_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) if (#meus_interrupts > 0) then for i = 1, min (25, #meus_interrupts) do local esta_habilidade = meus_interrupts[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor (esta_habilidade[2])/floor (meu_total)*100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor(esta_habilidade[2])/floor(meu_total)*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end else - GameTooltip:AddLine (Loc ["STRING_NO_SPELL"]) + GameTooltip:AddLine(Loc ["STRING_NO_SPELL"]) end --quais habilidades foram interrompidas @@ -1943,14 +1943,14 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra) end table.sort (habilidades_interrompidas, _detalhes.Sort2) - _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELL_INTERRUPTED"] .. ":", headerColor, #habilidades_interrompidas, _detalhes.tooltip_target_icon.file, unpack (_detalhes.tooltip_target_icon.coords)) + _detalhes:AddTooltipSpellHeaderText (Loc ["STRING_SPELL_INTERRUPTED"] .. ":", headerColor, #habilidades_interrompidas, _detalhes.tooltip_target_icon.file, unpack(_detalhes.tooltip_target_icon.coords)) _detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha) if (#habilidades_interrompidas > 0) then for i = 1, min (25, #habilidades_interrompidas) do local esta_habilidade = habilidades_interrompidas[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - GameCooltip:AddLine (nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor (esta_habilidade[2])/floor (meu_total)*100).."%)") + GameCooltip:AddLine(nome_magia, esta_habilidade[2].." (".._cstr("%.1f", floor(esta_habilidade[2])/floor(meu_total)*100).."%)") GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B) _detalhes:AddTooltipBackgroundStatusbar() end @@ -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 @@ -2097,7 +2097,7 @@ function atributo_misc:MontaInfoInterrupt() 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:SetAlpha(.9) --volta a alfa antiga barra.on_focus = false end end @@ -2269,9 +2269,9 @@ function atributo_misc:MontaTooltipAlvos (esta_barra, index) table.sort (habilidades, _detalhes.Sort2) - GameTooltip:AddLine (index..". "..inimigo) - GameTooltip:AddLine (Loc ["STRING_SPELL_INTERRUPTED"] .. ":") - GameTooltip:AddLine (" ") + GameTooltip:AddLine(index..". "..inimigo) + GameTooltip:AddLine(Loc ["STRING_SPELL_INTERRUPTED"] .. ":") + GameTooltip:AddLine(" ") for index, tabela in ipairs(habilidades) do local nome, rank, icone = _GetSpellInfo(tabela[1]) @@ -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 @@ -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() @@ -2710,7 +2710,7 @@ function atributo_misc:ColetarLixo (lastevent) end function _detalhes.refresh:r_atributo_misc (este_jogador, shadow) - setmetatable (este_jogador, _detalhes.atributo_misc) + setmetatable(este_jogador, _detalhes.atributo_misc) este_jogador.__index = _detalhes.atributo_misc --refresh spell cast @@ -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 @@ -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 b7adb660..829766d1 100644 --- a/classes/container_actors.lua +++ b/classes/container_actors.lua @@ -19,7 +19,7 @@ local _getmetatable = getmetatable --lua local local _bit_band = bit.band --lua local local _table_sort = table.sort --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local AddUnique = DetailsFramework.table.addunique --framework @@ -90,7 +90,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --api functions - function container_combatentes:GetActor (actorName) + function container_combatentes:GetActor(actorName) local index = self._NameIndexTable [actorName] if (index) then return self._ActorTable [index] @@ -99,7 +99,7 @@ function container_combatentes:GetSpellSource (spellid) local t = self._ActorTable - --print ("getting the source", spellid, #t) + --print("getting the source", spellid, #t) for i = 1, #t do if (t[i].spells._ActorTable [spellid]) then return t[i].nome @@ -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,7 +141,7 @@ end function container_combatentes:ListActors() - return _ipairs(self._ActorTable) + return ipairs(self._ActorTable) end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -160,7 +160,7 @@ _NameIndexTable = {} } - _setmetatable (_newContainer, container_combatentes) + _setmetatable(_newContainer, container_combatentes) return _newContainer end @@ -180,7 +180,7 @@ _detalhes:ScheduleTimer("ReGuessSpec", 6, {novo_objeto}) end _detalhes:ScheduleTimer("ReGuessSpec", 15, {novo_objeto}) - --print (nome, "spec em cache:", have_cached) + --print(nome, "spec em cache:", have_cached) else if (_detalhes.streamer_config.quick_detection) then --shoot detection early if in quick detection @@ -283,10 +283,10 @@ end end - if ((_bit_band (flag, IS_GROUP_OBJECT) ~= 0 and actorObject.classe ~= "UNKNOW" and actorObject.classe ~= "UNGROUPPLAYER") or _detalhes:IsInCache (serial)) then + if ((_bit_band (flag, IS_GROUP_OBJECT) ~= 0 and actorObject.classe ~= "UNKNOW" and actorObject.classe ~= "UNGROUPPLAYER") or _detalhes:IsInCache(serial)) then actorObject.grupo = true - if (_detalhes:IsATank (serial)) then + if (_detalhes:IsATank(serial)) then actorObject.isTank = true end else @@ -336,7 +336,7 @@ local oponentes = GetNumArenaOpponentSpecs and GetNumArenaOpponentSpecs() or 5 local found = false for i = 1, oponentes do - local name = GetUnitName ("arena" .. i, true) + local name = GetUnitName("arena" .. i, true) if (name == nome) then local spec = GetArenaOpponentSpec and GetArenaOpponentSpec (i) if (spec) then @@ -350,14 +350,14 @@ end end - local role = UnitGroupRolesAssigned and UnitGroupRolesAssigned (nome) + local role = UnitGroupRolesAssigned and UnitGroupRolesAssigned(nome) if (role and role ~= "NONE") then actorObject.role = role found = true end if (not found and nome == _detalhes.playername) then - local role = UnitGroupRolesAssigned ("player") + local role = UnitGroupRolesAssigned("player") if (role and role ~= "NONE") then actorObject.role = role end @@ -398,7 +398,7 @@ --[=[ --Chromie - From 'The Deaths of Chromie' - if (serial and type (serial) == "string") then + if (serial and type(serial) == "string") then if (serial:match ("^Creature%-0%-%d+%-%d+%-%d+%-122663%-%w+$")) then actorObject.grupo = true end @@ -417,9 +417,9 @@ actorObject.monster = true end - if (serial and type (serial) == "string") then + if (serial and type(serial) == "string") then local npcID = _detalhes:GetNpcIdFromGuid (serial) - if (npcID and not _detalhes.npcid_pool [npcID] and type (npcID) == "number") then + if (npcID and not _detalhes.npcid_pool [npcID] and type(npcID) == "number") then _detalhes.npcid_pool [npcID] = nome end end @@ -437,7 +437,7 @@ local follower_text_object = _G ["DetailsPetOwnerFinderTextLeft3"] --not in use local find_pet_found_owner = function(ownerName, serial, nome, flag, self) - local ownerGuid = _UnitGUID (ownerName) + local ownerGuid = _UnitGUID(ownerName) if (ownerGuid) then _detalhes.tabela_pets:Adicionar (serial, nome, flag, ownerGuid, ownerName, 0x00000417) local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) @@ -483,7 +483,7 @@ local text1 = line1 and line1:GetText() if (text1 and text1 ~= "") then --for _, playerName in ipairs(Details.tabela_vigente.raid_roster_indexed) do - for playerName, _ in _pairs (_detalhes.tabela_vigente.raid_roster) do + for playerName, _ in _pairs(_detalhes.tabela_vigente.raid_roster) do local pName = playerName playerName = playerName:gsub ("%-.*", "") --remove realm name @@ -510,7 +510,7 @@ local line2 = _G ["DetailsPetOwnerFinderTextLeft3"] local text2 = line2 and line2:GetText() if (text2 and text2 ~= "") then - for playerName, _ in _pairs (_detalhes.tabela_vigente.raid_roster) do + for playerName, _ in _pairs(_detalhes.tabela_vigente.raid_roster) do --for _, playerName in ipairs(Details.tabela_vigente.raid_roster_indexed) do local pName = playerName playerName = playerName:gsub ("%-.*", "") --remove realm name @@ -542,10 +542,10 @@ --[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1 - --if (flag and nome:find ("Kastfall") and bit.band (flag, 0x2000) ~= 0) then - --print ("PET:", nome, _detalhes.tabela_pets.pets [serial], container_pets [serial]) + --if (flag and nome:find ("Kastfall") and bit.band(flag, 0x2000) ~= 0) then + --print("PET:", nome, _detalhes.tabela_pets.pets [serial], container_pets [serial]) --else - --print (nome, flag) + --print(nome, flag) --end --verifica se � um pet, se for confere se tem o nome do dono, se n�o tiver, precisa por @@ -648,7 +648,7 @@ --try to guess his class if (self.shadow) then --n�o executar 2x - _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) + _detalhes:ScheduleTimer("GuessClass", 1, {novo_objeto, self, 1}) end elseif (shouldScanOnce) then @@ -677,12 +677,12 @@ 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) + novo_objeto.enemy = true --print(nome.." EH UM INIMIGO -> " .. engRace) end --try to guess his class if (self.shadow) then --n�o executar 2x - _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) + _detalhes:ScheduleTimer("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -703,7 +703,7 @@ --try to guess his class if (self.shadow) then --n�o executar 2x - _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) + _detalhes:ScheduleTimer("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -723,7 +723,7 @@ --try to guess his class if (self.shadow) then --n�o executar 2x - _detalhes:ScheduleTimer ("GuessClass", 1, {novo_objeto, self, 1}) + _detalhes:ScheduleTimer("GuessClass", 1, {novo_objeto, self, 1}) end end @@ -769,7 +769,7 @@ if (_detalhes.debug) then if (_detalhes.debug_chr and nome:find (_detalhes.debug_chr) and self.tipo == 1) then local logLine = "" - local when = "[" .. date ("%H:%M:%S") .. format (".%4f", GetTime()-floor (GetTime())) .. "]" + local when = "[" .. date ("%H:%M:%S") .. format (".%4f", GetTime()-floor(GetTime())) .. "]" local log = "actor created - class: " .. (novo_objeto.classe or "noclass") local from = debugstack (2, 1, 0) logLine = logLine .. when .. " " .. log .. " " .. from .. "\n" @@ -845,7 +845,7 @@ --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 @@ -876,7 +876,7 @@ function _detalhes.refresh:r_container_combatentes (container, shadow) --reconstr�i meta e indexes - _setmetatable (container, _detalhes.container_combatentes) + _setmetatable(container, _detalhes.container_combatentes) container.__index = _detalhes.container_combatentes container.funcao_de_criacao = container_combatentes:FuncaoDeCriacao (container.tipo) diff --git a/classes/container_pets.lua b/classes/container_pets.lua index 28cda81d..b23d6e9d 100644 --- a/classes/container_pets.lua +++ b/classes/container_pets.lua @@ -14,7 +14,7 @@ local _GetNumGroupMembers = _G.GetNumGroupMembers local _setmetatable = setmetatable local _bit_band = bit.band --lua local local _pairs = pairs -local _ipairs = ipairs +local ipairs = ipairs local _table_wipe = table.wipe --details locals @@ -22,7 +22,7 @@ local is_ignored = _detalhes.pets_ignored function container_pets:NovoContainer() local esta_tabela = {} - _setmetatable (esta_tabela, _detalhes.container_pets) + _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, ...} return esta_tabela @@ -61,8 +61,8 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) if (_IsInRaid()) then for i = 1, _GetNumGroupMembers() do - if (pet_serial == _UnitGUID ("raidpet"..i)) then - dono_serial = _UnitGUID ("raid"..i) + if (pet_serial == _UnitGUID("raidpet"..i)) then + dono_serial = _UnitGUID("raid"..i) dono_flags = 0x00000417 --emulate sourceflag flag local nome, realm = _UnitName ("raid"..i) @@ -75,8 +75,8 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) elseif (_IsInGroup()) then for i = 1, _GetNumGroupMembers()-1 do - if (pet_serial == _UnitGUID ("partypet"..i)) then - dono_serial = _UnitGUID ("party"..i) + if (pet_serial == _UnitGUID("partypet"..i)) then + dono_serial = _UnitGUID("party"..i) dono_flags = 0x00000417 --emulate sourceflag flag local nome, realm = _UnitName ("party"..i) @@ -90,9 +90,9 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) end if (not dono_nome) then - if (pet_serial == _UnitGUID ("pet")) then + if (pet_serial == _UnitGUID("pet")) then dono_nome = _GetUnitName ("player") - dono_serial = _UnitGUID ("player") + dono_serial = _UnitGUID("player") if (_IsInGroup() or _IsInRaid()) then dono_flags = 0x00000417 --emulate sourceflag flag else @@ -114,7 +114,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags) 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) + _detalhes:Msg("couldn't find the owner of the pet:", pet_nome) end else is_ignored [pet_serial] = true @@ -126,7 +126,7 @@ end function container_pets:Unpet (...) local unitid = ... - local owner_serial = _UnitGUID (unitid) + local owner_serial = _UnitGUID(unitid) if (owner_serial) then --tira o pet existente da tabela de pets e do cache do core @@ -137,7 +137,7 @@ function container_pets:Unpet (...) _detalhes.pets_players [owner_serial] = nil end --verifica se h� um pet novo deste jogador - local pet_serial = _UnitGUID (unitid .. "pet") + local pet_serial = _UnitGUID(unitid .. "pet") if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then local nome, realm = _UnitName (unitid) @@ -159,14 +159,14 @@ end function container_pets:BuscarPets() if (_IsInRaid()) then for i = 1, _GetNumGroupMembers(), 1 do - local pet_serial = _UnitGUID ("raidpet"..i) + local pet_serial = _UnitGUID("raidpet"..i) if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then local nome, realm = _UnitName ("raid"..i) if (realm and realm ~= "") then nome = nome.."-"..realm end - local owner_serial = _UnitGUID ("raid"..i) + local owner_serial = _UnitGUID("raid"..i) _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, owner_serial, nome, 0x514) _detalhes.parser:RevomeActorFromCache (pet_serial) container_pets:PlayerPet (owner_serial, pet_serial) @@ -176,7 +176,7 @@ function container_pets:BuscarPets() elseif (_IsInGroup()) then for i = 1, _GetNumGroupMembers()-1, 1 do - local pet_serial = _UnitGUID ("partypet"..i) + local pet_serial = _UnitGUID("partypet"..i) if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then local nome, realm = _UnitName ("party"..i) @@ -184,24 +184,24 @@ function container_pets:BuscarPets() if (realm and realm ~= "") then nome = nome.."-"..realm end - _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID ("party"..i), nome, 0x514) + _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("partypet"..i), 0x1114, _UnitGUID("party"..i), nome, 0x514) end end end - local pet_serial = _UnitGUID ("pet") + local pet_serial = _UnitGUID("pet") if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then - _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID ("player"), _detalhes.playername, 0x514) + _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID("player"), _detalhes.playername, 0x514) end end else - local pet_serial = _UnitGUID ("pet") + local pet_serial = _UnitGUID("pet") if (pet_serial) then if (not _detalhes.tabela_pets.pets [pet_serial]) then - _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID ("player"), _detalhes.playername, 0x514) + _detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("pet"), 0x1114, _UnitGUID("player"), _detalhes.playername, 0x514) end end end @@ -223,14 +223,14 @@ function container_pets:Adicionar (pet_serial, pet_nome, pet_flags, dono_serial, end function _detalhes:WipePets() - return _table_wipe (_detalhes.tabela_pets.pets) + return _table_wipe(_detalhes.tabela_pets.pets) end function _detalhes:LimparPets() --erase old pet table by creating a new one local newPetTable = {} --minimum of 90 minutes to clean a pet from the pet table data - for PetSerial, PetTable in _pairs (_detalhes.tabela_pets.pets) do + 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 end @@ -245,17 +245,17 @@ function _detalhes:UpdatePets() have_schedule = false return container_pets:BuscarPets() end -function _detalhes:SchedulePetUpdate (seconds) +function _detalhes:SchedulePetUpdate(seconds) if (have_schedule) then return end have_schedule = true - --_detalhes:ScheduleTimer ("UpdatePets", seconds or 5) + --_detalhes:ScheduleTimer("UpdatePets", seconds or 5) Details.Schedules.NewTimer(seconds or 5, Details.UpdatePets, Details) end function _detalhes.refresh:r_container_pets (container) - _setmetatable (container, container_pets) + _setmetatable(container, container_pets) end diff --git a/classes/container_segments.lua b/classes/container_segments.lua index d04d1cd4..d33b57ce 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -1,135 +1,130 @@ -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale( "Details" ) --lua api -local _table_remove = table.remove -local _table_insert = table.insert -local _setmetatable = setmetatable -local _table_wipe = table.wipe +local tremove = table.remove +local tinsert = table.insert +local wipe = table.wipe -local _detalhes = _G._detalhes -local gump = _detalhes.gump - -local combate = _detalhes.combate -local historico = _detalhes.historico -local barra_total = _detalhes.barra_total -local container_pets = _detalhes.container_pets -local timeMachine = _detalhes.timeMachine +local Details = _G._detalhes +local combatClass = Details.combate +local segmentClass = Details.historico +local timeMachine = Details.timeMachine ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --API --reset only the overall data -function _detalhes:ResetSegmentOverallData() - return historico:resetar_overall() +function Details:ResetSegmentOverallData() + return segmentClass:resetar_overall() end --reset segments and overall data -function _detalhes:ResetSegmentData() - return historico:resetar() +function Details:ResetSegmentData() + return segmentClass:resetar() end --returns the current active segment -function _detalhes:GetCurrentCombat() - return _detalhes.tabela_vigente +function Details:GetCurrentCombat() + return Details.tabela_vigente end --returns a private table containing all stored segments -function _detalhes:GetCombatSegments() - return _detalhes.tabela_historico.tabelas +function Details:GetCombatSegments() + return Details.tabela_historico.tabelas end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --internal -function historico:NovoHistorico() +function segmentClass:NovoHistorico() local esta_tabela = {tabelas = {}} - _setmetatable (esta_tabela, historico) + setmetatable(esta_tabela, segmentClass) return esta_tabela end -function historico:adicionar_overall (tabela) - +function segmentClass:adicionar_overall (tabela) local zoneName, zoneType = GetInstanceInfo() - if (zoneType ~= "none" and tabela:GetCombatTime() <= _detalhes.minimum_overall_combat_time) then + if (zoneType ~= "none" and tabela:GetCombatTime() <= Details.minimum_overall_combat_time) then return end - if (_detalhes.overall_clear_newboss) then + if (Details.overall_clear_newboss) then --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.") + if (Details.last_encounter ~= Details.last_encounter2) then + if (Details.debug) then + Details: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(Details.tabela_historico.tabelas) do combat.overall_added = false end - historico:resetar_overall() + segmentClass:resetar_overall() end end end - + if (tabela.overall_added) then - _detalhes:Msg ("error > attempt to add a segment already added > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a segment already added > func historico:adicionar_overall()") return end + local mythicInfo = tabela.is_mythic_dungeon if (mythicInfo) then --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then - _detalhes:Msg ("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a TrashOverallSegment > func historico:adicionar_overall()") return elseif (mythicInfo.OverallSegment) then - _detalhes:Msg ("error > attempt to add a OverallSegment > func historico:adicionar_overall()") + Details:Msg("error > attempt to add a OverallSegment > func historico:adicionar_overall()") return end end - + --store the segments added to the overall data - _detalhes.tabela_overall.segments_added = _detalhes.tabela_overall.segments_added or {} + Details.tabela_overall.segments_added = Details.tabela_overall.segments_added or {} local this_clock = tabela.data_inicio - - local combatName = tabela:GetCombatName (true) + + local combatName = tabela:GetCombatName(true) local combatTime = tabela:GetCombatTime() local combatType = tabela:GetCombatType() - - tinsert(_detalhes.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = this_clock, type = combatType}) - if (#_detalhes.tabela_overall.segments_added > 40) then - tremove (_detalhes.tabela_overall.segments_added, 41) + tinsert(Details.tabela_overall.segments_added, 1, {name = combatName, elapsed = combatTime, clock = this_clock, type = combatType}) + + if (#Details.tabela_overall.segments_added > 40) then + tremove(Details.tabela_overall.segments_added, 41) end - - if (_detalhes.debug) then - _detalhes:Msg ("(debug) adding the segment to overall data: " .. (tabela:GetCombatName (true) or "no name") .. " with time of: " .. (tabela:GetCombatTime() or "no time")) + + if (Details.debug) then + Details:Msg("(debug) adding the segment to overall data: " .. (tabela:GetCombatName(true) or "no name") .. " with time of: " .. (tabela:GetCombatTime() or "no time")) end - - _detalhes.tabela_overall = _detalhes.tabela_overall + tabela + + Details.tabela_overall = Details.tabela_overall + tabela tabela.overall_added = true - - if (not _detalhes.tabela_overall.overall_enemy_name) then - _detalhes.tabela_overall.overall_enemy_name = tabela.is_boss and tabela.is_boss.name or tabela.enemy + + if (not Details.tabela_overall.overall_enemy_name) then + Details.tabela_overall.overall_enemy_name = tabela.is_boss and tabela.is_boss.name or tabela.enemy else - if (_detalhes.tabela_overall.overall_enemy_name ~= (tabela.is_boss and tabela.is_boss.name or tabela.enemy)) then - _detalhes.tabela_overall.overall_enemy_name = "-- x -- x --" + if (Details.tabela_overall.overall_enemy_name ~= (tabela.is_boss and tabela.is_boss.name or tabela.enemy)) then + Details.tabela_overall.overall_enemy_name = "-- x -- x --" end end - if (_detalhes.tabela_overall.start_time == 0) then - _detalhes.tabela_overall:SetStartTime (tabela.start_time) - _detalhes.tabela_overall:SetEndTime (tabela.end_time) + if (Details.tabela_overall.start_time == 0) then + Details.tabela_overall:SetStartTime (tabela.start_time) + Details.tabela_overall:SetEndTime (tabela.end_time) else - _detalhes.tabela_overall:SetStartTime (tabela.start_time - _detalhes.tabela_overall:GetCombatTime()) - _detalhes.tabela_overall:SetEndTime (tabela.end_time) + Details.tabela_overall:SetStartTime (tabela.start_time - Details.tabela_overall:GetCombatTime()) + Details.tabela_overall:SetEndTime (tabela.end_time) end - if (_detalhes.tabela_overall.data_inicio == 0) then - _detalhes.tabela_overall.data_inicio = _detalhes.tabela_vigente.data_inicio or 0 + if (Details.tabela_overall.data_inicio == 0) then + Details.tabela_overall.data_inicio = Details.tabela_vigente.data_inicio or 0 end - _detalhes.tabela_overall:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) - _detalhes:ClockPluginTickOnSegment() + Details.tabela_overall:seta_data (Details._detalhes_props.DATA_TYPE_END) + Details:ClockPluginTickOnSegment() - for id, instance in _detalhes:ListInstances() do + for id, instance in Details:ListInstances() do if (instance:IsEnabled()) then if (instance:GetSegment() == -1) then instance:ForceRefresh() @@ -138,24 +133,23 @@ function historico:adicionar_overall (tabela) end end -function _detalhes:ScheduleAddCombatToOverall (combat) --deprecated (15/03/2019) - local canAdd = _detalhes:CanAddCombatToOverall (combat) +function Details:ScheduleAddCombatToOverall (combat) --deprecated (15/03/2019) + local canAdd = Details:CanAddCombatToOverall (combat) if (canAdd) then - _detalhes.schedule_add_to_overall = _detalhes.schedule_add_to_overall or {} - tinsert(_detalhes.schedule_add_to_overall, combat) + Details.schedule_add_to_overall = Details.schedule_add_to_overall or {} + tinsert(Details.schedule_add_to_overall, combat) end end -function _detalhes:CanAddCombatToOverall (tabela) - +function Details:CanAddCombatToOverall (tabela) --already added if (tabela.overall_added) then return false end - + --already scheduled to add - if (_detalhes.schedule_add_to_overall) then --deprecated - for _, combat in ipairs(_detalhes.schedule_add_to_overall) do + if (Details.schedule_add_to_overall) then --deprecated + for _, combat in ipairs(Details.schedule_add_to_overall) do if (combat == tabela) then return false end @@ -168,77 +162,78 @@ function _detalhes:CanAddCombatToOverall (tabela) --do not add overall mythic+ dungeon segments if (mythicInfo.TrashOverallSegment) then return false + elseif (mythicInfo.OverallSegment) then return false end end --raid boss - flag 0x1 - if (bit.band (_detalhes.overall_flag, 0x1) ~= 0) then + if (bit.band(Details.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 return true end end end - + --raid trash - flag 0x2 - if (bit.band (_detalhes.overall_flag, 0x2) ~= 0) then + if (bit.band(Details.overall_flag, 0x2) ~= 0) then if (tabela.is_trash and tabela.instance_type == "raid") then return true end end - + --dungeon boss - flag 0x4 - if (bit.band (_detalhes.overall_flag, 0x4) ~= 0) then + if (bit.band(Details.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 - if (bit.band (_detalhes.overall_flag, 0x8) ~= 0) then + if (bit.band(Details.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 - if (bit.band (_detalhes.overall_flag, 0x10) ~= 0) then + if (bit.band(Details.overall_flag, 0x10) ~= 0) then return true end - + --is a PvP combat - if (tabela.is_pvp or tabela.is_arena) then + if (tabela.is_pvp or tabela.is_arena) then return true end - + return false end --sai do combate, chamou adicionar a tabela ao hist�rico -function historico:adicionar (tabela) +function segmentClass:adicionar (tabela) local tamanho = #self.tabelas - + --verifica se precisa dar UnFreeze() - if (tamanho < _detalhes.segments_amount) then --vai preencher um novo index vazio + if (tamanho < Details.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 ultima_tabela = tabela end - _detalhes:InstanciaCallFunction (_detalhes.CheckFreeze, tamanho+1, ultima_tabela) + Details:InstanciaCallFunction(Details.CheckFreeze, tamanho+1, ultima_tabela) end --add to history table - _table_insert (self.tabelas, 1, tabela) - + tinsert(self.tabelas, 1, tabela) + --count boss tries local boss = tabela.is_boss and tabela.is_boss.name if (boss) then - local try_number = _detalhes.encounter_counter [boss] - + local try_number = Details.encounter_counter [boss] + if (not try_number) then local previous_combat for i = 2, #self.tabelas do @@ -248,43 +243,43 @@ function historico:adicionar (tabela) break end end - + if (not try_number) then try_number = 1 end else - try_number = _detalhes.encounter_counter [boss] + 1 + try_number = Details.encounter_counter [boss] + 1 end - - _detalhes.encounter_counter [boss] = try_number + + Details.encounter_counter [boss] = try_number tabela.is_boss.try_number = try_number end - + --see if can add the encounter to overall data - local canAddToOverall = _detalhes:CanAddCombatToOverall (tabela) - + local canAddToOverall = Details:CanAddCombatToOverall (tabela) + if (canAddToOverall) then --if (InCombatLockdown()) then -- _detalhes:ScheduleAddCombatToOverall (tabela) -- if (_detalhes.debug) then - -- _detalhes:Msg ("(debug) overall data flag match > in combat scheduling overall addition.") + -- _detalhes:Msg("(debug) overall data flag match > in combat scheduling overall addition.") -- end --else - if (_detalhes.debug) then - _detalhes:Msg ("(debug) overall data flag match addind the combat to overall data.") + if (Details.debug) then + Details:Msg("(debug) overall data flag match addind the combat to overall data.") end - historico:adicionar_overall (tabela) + segmentClass:adicionar_overall (tabela) --end end - + --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 + 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 @@ -292,7 +287,7 @@ function historico:adicionar (tabela) jogador:DesregistrarNaTimeMachine() end end - for _, jogador in ipairs(container_heal._ActorTable) do + 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 @@ -300,12 +295,12 @@ function historico:adicionar (tabela) jogador:DesregistrarNaTimeMachine() end end - - if (_detalhes.trash_auto_remove) then + + if (Details.trash_auto_remove) then local _terceiro_combate = self.tabelas[3] - + 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 @@ -319,33 +314,33 @@ function historico:adicionar (tabela) end end --remover - _table_remove (self.tabelas, 3) - _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil) + tremove(self.tabelas, 3) + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil) end - + end end - + end --verifica se precisa apagar a �ltima tabela do hist�rico - if (#self.tabelas > _detalhes.segments_amount) then - + if (#self.tabelas > Details.segments_amount) then + local combat_removed, combat_index - + --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] local last_bossid = last_segment.is_boss and last_segment.is_boss.id - - if (_detalhes.zone_type == "raid" and bossid and last_bossid and bossid == last_bossid) then - + + if (Details.zone_type == "raid" and bossid and last_bossid and bossid == last_bossid) then + local shorter_combat local shorter_id local min_time = 99999 - + for i = 4, #self.tabelas do local combat = self.tabelas [i] if (combat.is_boss and combat.is_boss.id == bossid and combat:GetCombatTime() < min_time and not combat.is_boss.killed) then @@ -354,13 +349,13 @@ function historico:adicionar (tabela) min_time = combat:GetCombatTime() end end - + if (shorter_combat) then combat_removed = shorter_combat combat_index = shorter_id end end - + if (not combat_removed) then combat_removed = self.tabelas [#self.tabelas] combat_index = #self.tabelas @@ -377,19 +372,19 @@ function historico:adicionar (tabela) jogador:DesregistrarNaTimeMachine() end end - + --remover - _table_remove (self.tabelas, combat_index) - _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED") + tremove(self.tabelas, combat_index) + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end - + --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) + Details:InstanciaCallFunction(Details.AtualizaSegmentos_AfterCombat, self) + --_detalhes:InstanciaCallFunction(_detalhes.AtualizarJanela) end --verifica se tem alguma instancia congelada mostrando o segmento rec�m liberado -function _detalhes:CheckFreeze (instancia, index_liberado, tabela) +function Details:CheckFreeze (instancia, index_liberado, tabela) if (instancia.freezed) then --esta congelada if (instancia.segmento == index_liberado) then instancia.showing = tabela @@ -398,127 +393,126 @@ function _detalhes:CheckFreeze (instancia, index_liberado, tabela) end end -function _detalhes:SetOverallResetOptions (reset_new_boss, reset_new_challenge, reset_on_logoff, reset_new_pvp) +function Details:SetOverallResetOptions (reset_new_boss, reset_new_challenge, reset_on_logoff, reset_new_pvp) if (reset_new_boss == nil) then - reset_new_boss = _detalhes.overall_clear_newboss + reset_new_boss = Details.overall_clear_newboss end if (reset_new_challenge == nil) then - reset_new_challenge = _detalhes.overall_clear_newchallenge + reset_new_challenge = Details.overall_clear_newchallenge end if (reset_on_logoff == nil) then - reset_on_logoff = _detalhes.overall_clear_logout + reset_on_logoff = Details.overall_clear_logout end if (reset_new_pvp == nil) then - reset_new_pvp = _detalhes.overall_clear_pvp + reset_new_pvp = Details.overall_clear_pvp end - - _detalhes.overall_clear_newboss = reset_new_boss - _detalhes.overall_clear_newchallenge = reset_new_challenge - _detalhes.overall_clear_logout = reset_on_logoff - _detalhes.overall_clear_pvp = reset_new_pvp + + Details.overall_clear_newboss = reset_new_boss + Details.overall_clear_newchallenge = reset_new_challenge + Details.overall_clear_logout = reset_on_logoff + Details.overall_clear_pvp = reset_new_pvp end -function historico:resetar_overall() +function segmentClass:resetar_overall() --if (InCombatLockdown()) then - -- _detalhes:Msg (Loc ["STRING_ERASE_IN_COMBAT"]) + -- _detalhes:Msg(Loc ["STRING_ERASE_IN_COMBAT"]) -- _detalhes.schedule_remove_overall = true --else --fecha a janela de informa��es do jogador - _detalhes:FechaJanelaInfo() - - _detalhes.tabela_overall = combate:NovaTabela() - - for index, instancia in ipairs(_detalhes.tabela_instancias) do + Details:FechaJanelaInfo() + + Details.tabela_overall = combatClass:NovaTabela() + + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa and instancia.segmento == -1) then instancia:InstanceReset() instancia:ReajustaGump() end end - - if (_detalhes.schedule_add_to_overall) then --deprecated - wipe (_detalhes.schedule_add_to_overall) + + if (Details.schedule_add_to_overall) then --deprecated + wipe (Details.schedule_add_to_overall) end --end - + --stop bar testing if any - _detalhes:StopTestBarUpdate() - - _detalhes:ClockPluginTickOnSegment() + Details:StopTestBarUpdate() + + Details:ClockPluginTickOnSegment() end -function historico:resetar() +function segmentClass:resetar() + if (Details.bosswindow) then + Details.bosswindow:Reset() + end - if (_detalhes.bosswindow) then - _detalhes.bosswindow:Reset() - end - --stop bar testing if any - _detalhes:StopTestBarUpdate() - - if (_detalhes.tabela_vigente.verifica_combate) then --finaliza a checagem se esta ou n�o no combate - _detalhes:CancelTimer (_detalhes.tabela_vigente.verifica_combate) + Details:StopTestBarUpdate() + + if (Details.tabela_vigente.verifica_combate) then --finaliza a checagem se esta ou n�o no combate + Details:CancelTimer(Details.tabela_vigente.verifica_combate) end - - _detalhes.last_closed_combat = nil - + + Details.last_closed_combat = nil + --remove mythic dungeon schedules if any - _detalhes.schedule_mythicdungeon_trash_merge = nil - _detalhes.schedule_mythicdungeon_endtrash_merge = nil - _detalhes.schedule_mythicdungeon_overallrun_merge = nil - + Details.schedule_mythicdungeon_trash_merge = nil + Details.schedule_mythicdungeon_endtrash_merge = nil + Details.schedule_mythicdungeon_overallrun_merge = nil + --clear other schedules - _detalhes.schedule_flag_boss_components = nil - _detalhes.schedule_store_boss_encounter = nil + Details.schedule_flag_boss_components = nil + Details.schedule_store_boss_encounter = nil --_detalhes.schedule_remove_overall = nil - + --fecha a janela de informa��es do jogador - _detalhes:FechaJanelaInfo() - + Details:FechaJanelaInfo() + --empty temporary tables - _detalhes.atributo_damage:ClearTempTables() - - for _, combate in ipairs(_detalhes.tabela_historico.tabelas) do - _table_wipe (combate) + Details.atributo_damage:ClearTempTables() + + for _, combate in ipairs(Details.tabela_historico.tabelas) do + wipe(combate) end - _table_wipe (_detalhes.tabela_vigente) - _table_wipe (_detalhes.tabela_overall) - _table_wipe (_detalhes.spellcache) - - if (_detalhes.schedule_add_to_overall) then --deprecated - wipe (_detalhes.schedule_add_to_overall) + wipe(Details.tabela_vigente) + wipe(Details.tabela_overall) + wipe(Details.spellcache) + + if (Details.schedule_add_to_overall) then --deprecated + wipe (Details.schedule_add_to_overall) end - - _detalhes:LimparPets() - _detalhes:ResetSpecCache (true) --for�ar - + + Details:LimparPets() + Details:ResetSpecCache (true) --for�ar + -- novo container de historico - _detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova + Details.tabela_historico = segmentClass:NovoHistorico() --joga fora a tabela antiga e cria uma nova --novo container para armazenar pets - _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() - _detalhes:UpdateContainerCombatentes() - _detalhes.container_pets:BuscarPets() + Details.tabela_pets = Details.container_pets:NovoContainer() + Details:UpdateContainerCombatentes() + Details.container_pets:BuscarPets() -- nova tabela do overall e current - _detalhes.tabela_overall = combate:NovaTabela() --joga fora a tabela antiga e cria uma nova + Details.tabela_overall = combatClass:NovaTabela() --joga fora a tabela antiga e cria uma nova -- cria nova tabela do combate atual - _detalhes.tabela_vigente = combate:NovaTabela (nil, _detalhes.tabela_overall) - + Details.tabela_vigente = combatClass:NovaTabela (nil, Details.tabela_overall) + --marca o addon como fora de combate - _detalhes.in_combat = false + Details.in_combat = false --zera o contador de combates - _detalhes:NumeroCombate (0) - + Details:NumeroCombate (0) + --limpa o cache de magias - _detalhes:ClearSpellCache() - + Details:ClearSpellCache() + --limpa a tabela de escudos - _table_wipe (_detalhes.escudos) - + wipe(Details.escudos) + --reinicia a time machine timeMachine:Reiniciar() - - _table_wipe (_detalhes.cache_damage_group) - _table_wipe (_detalhes.cache_healing_group) - _detalhes:UpdateParserGears() + + wipe(Details.cache_damage_group) + wipe(Details.cache_healing_group) + Details:UpdateParserGears() if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then --workarround for the "script run too long" issue while outside the combat lockdown @@ -527,45 +521,44 @@ function historico:resetar() end local successful, errortext = pcall (cleargarbage) if (not successful) then - _detalhes:Msg ("couldn't call collectgarbage()") + Details:Msg("couldn't call collectgarbage()") end else - _detalhes.schedule_hard_garbage_collect = true + Details.schedule_hard_garbage_collect = true end - - _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:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") - - _detalhes:RefreshMainWindow(-1) --atualiza todas as instancias - - _detalhes:SendEvent("DETAILS_DATA_RESET", nil, nil) - + + Details:InstanciaCallFunction(Details.AtualizaSegmentos) -- atualiza o instancia.showing para as novas tabelas criadas + Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) -- verifica se precisa zerar as tabela da janela solo mode + Details:InstanciaCallFunction(Details.ResetaGump) --_detalhes:ResetaGump ("de todas as instancias") + Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") + + Details:RefreshMainWindow(-1) --atualiza todas as instancias + + Details:SendEvent("DETAILS_DATA_RESET", nil, nil) end -function _detalhes.refresh:r_historico (este_historico) - _setmetatable (este_historico, historico) +function Details.refresh:r_historico (este_historico) + setmetatable(este_historico, segmentClass) --este_historico.__index = historico end --[[ elseif (_detalhes.trash_concatenate) then - + if (true) then return 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 if (_detalhes.debug) then - detalhes:Msg ("(debug) concatenating two trash segments.") + detalhes:Msg("(debug) concatenating two trash segments.") end - + _segundo_combate = _segundo_combate + _terceiro_combate _detalhes.tabela_overall = _detalhes.tabela_overall - _terceiro_combate - + _segundo_combate.is_trash = true --verificar novamente a time machine @@ -580,7 +573,7 @@ end end end --remover - _table_remove (self.tabelas, 3) + _table_remove(self.tabelas, 3) _detalhes:SendEvent("DETAILS_DATA_SEGMENTREMOVED", nil, nil) end end diff --git a/classes/container_spells.lua b/classes/container_spells.lua index fd2b1dc0..37a11520 100644 --- a/classes/container_spells.lua +++ b/classes/container_spells.lua @@ -39,7 +39,7 @@ local _ _ActorTable = {} } - _setmetatable (_newContainer, container_habilidades) + _setmetatable(_newContainer, container_habilidades) return _newContainer end @@ -101,7 +101,7 @@ local _ function _detalhes.refresh:r_container_habilidades (container, shadow) --reconstr�i meta e indexes - _setmetatable (container, _detalhes.container_habilidades) + _setmetatable(container, _detalhes.container_habilidades) container.__index = _detalhes.container_habilidades local func_criacao = container_habilidades:FuncaoDeCriacao (container.tipo) container.funcao_de_criacao = func_criacao diff --git a/classes/custom_damagedone.lua b/classes/custom_damagedone.lua index 25ba6f55..14a3de7a 100644 --- a/classes/custom_damagedone.lua +++ b/classes/custom_damagedone.lua @@ -22,14 +22,14 @@ local _table_sort = table.sort --lua local local _table_insert = table.insert --lua local local _table_size = table.getn --lua local local _setmetatable = setmetatable --lua local -local _ipairs = ipairs --lua local +local ipairs = ipairs --lua local local _pairs = pairs --lua local local _rawget= rawget --lua local local _math_min = math.min --lua local local _math_max = math.max --lua local local _bit_band = bit.band --lua local local _unpack = unpack --lua local -local _type = type --lua local +local type = type --lua local local _GetSpellInfo = _detalhes.getspellinfo -- api local local _IsInRaid = IsInRaid -- api local @@ -59,7 +59,7 @@ local temp_table = {} local target_func = function(main_table) local i = 1 - for name, amount in _pairs (main_table) do + for name, amount in _pairs(main_table) do local t = temp_table [i] if (not t) then t = {"", 0} @@ -75,7 +75,7 @@ end local spells_used_func = function(main_table, target) local i = 1 - for spellid, spell_table in _pairs (main_table) do + for spellid, spell_table in _pairs(main_table) do local target_amount = spell_table.targets [target] if (target_amount) then local t = temp_table [i] @@ -117,14 +117,14 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst local this_actor = combat (1, targetname) if (this_actor) then - for name, _ in _pairs (this_actor.damage_from) do + for name, _ in _pairs(this_actor.damage_from) do local aggressor = combat (1, name) if (aggressor) then local spell = aggressor.spells._ActorTable [spellid] if (spell) then local on_me = spell.targets [targetname] if (on_me) then - GameCooltip:AddLine (aggressor.nome, FormatTooltipNumber (_, on_me)) + GameCooltip:AddLine(aggressor.nome, FormatTooltipNumber (_, on_me)) _detalhes:AddTooltipBackgroundStatusbar() end end @@ -135,12 +135,12 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst return else local name, _, icon = _GetSpellInfo(spellid) - GameCooltip:AddLine (name) + GameCooltip:AddLine(name) GameCooltip:AddIcon (icon, 1, 1, 14, 14) - GameCooltip:AddLine (Loc ["STRING_DAMAGE"] .. ": ", spell.total) - GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter) - GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) + GameCooltip:AddLine(Loc ["STRING_DAMAGE"] .. ": ", spell.total) + GameCooltip:AddLine(Loc ["STRING_HITS"] .. ": ", spell.counter) + GameCooltip:AddLine(Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) end elseif (target) then @@ -154,7 +154,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst break end - GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(t[1], FormatTooltipNumber (_, t[2])) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\FriendsFrame\StatusIcon-Offline]], 1, 1, 14, 14) end @@ -172,7 +172,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst end if (roster [t[1]]) then - GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(t[1], FormatTooltipNumber (_, t[2])) _detalhes:AddTooltipBackgroundStatusbar() end end @@ -180,7 +180,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst elseif (target == "[player]") then local target_amount = actor.targets [_detalhes.playername] if (target_amount) then - GameCooltip:AddLine (targetactor.nome, FormatTooltipNumber (_, target_amount)) + GameCooltip:AddLine(targetactor.nome, FormatTooltipNumber (_, target_amount)) _detalhes:AddTooltipBackgroundStatusbar() end else @@ -194,7 +194,7 @@ function atributo_custom:damagedoneTooltip (actor, target, spellid, combat, inst end local name, _, icon = _GetSpellInfo(t[1]) - GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(name, FormatTooltipNumber (_, t[2])) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon (icon, 1, 1, 14, 14) end @@ -219,7 +219,7 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins if (spell) then if (target) then if (target == "[all]") then - for target_name, amount in _pairs (spell.targets) do + for target_name, amount in _pairs(spell.targets) do --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 @@ -236,7 +236,7 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins elseif (target == "[raid]") then local roster = combat.raid_roster - for target_name, amount in _pairs (spell.targets) do + for target_name, amount in _pairs(spell.targets) do if (roster [target_name]) then --add amount instance_container:AddValue (combat (1, target_name), amount, true) @@ -289,14 +289,14 @@ function atributo_custom:damagedone (actor, source, target, spellid, combat, ins if (target == "[all]") then local total = 0 - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do total = total + amount end return total elseif (target == "[raid]") then local total = 0 - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do if (combat.raid_roster [target_name]) then total = total + amount end diff --git a/classes/custom_healingdone.lua b/classes/custom_healingdone.lua index c22f3d4b..f3a11a03 100644 --- a/classes/custom_healingdone.lua +++ b/classes/custom_healingdone.lua @@ -15,14 +15,14 @@ local _table_insert = table.insert --lua local local _table_size = table.getn --lua local local _setmetatable = setmetatable --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _rawget= rawget --lua local local _math_min = math.min --lua local local _math_max = math.max --lua local local _bit_band = bit.band --lua local local _unpack = unpack --lua local - local _type = type --lua local + local type = type --lua local local _GetSpellInfo = _detalhes.getspellinfo -- api local local _IsInRaid = IsInRaid -- api local @@ -52,7 +52,7 @@ local target_func = function(main_table) local i = 1 - for name, amount in _pairs (main_table) do + for name, amount in _pairs(main_table) do local t = temp_table [i] if (not t) then t = {"", 0} @@ -68,7 +68,7 @@ local spells_used_func = function(main_table, target) local i = 1 - for spellid, spell_table in _pairs (main_table) do + for spellid, spell_table in _pairs(main_table) do local target_amount = spell_table.targets [target] if (target_amount) then local t = temp_table [i] @@ -111,14 +111,14 @@ local this_actor = combat (2, targetname) if (this_actor) then - for name, _ in _pairs (this_actor.healing_from) do + for name, _ in _pairs(this_actor.healing_from) do local healer = combat (2, name) if (healer) then local spell = healer.spells._ActorTable [spellid] if (spell) then local on_me = spell.targets [targetname] if (on_me) then - GameCooltip:AddLine (healer.nome, FormatTooltipNumber (_, on_me)) + GameCooltip:AddLine(healer.nome, FormatTooltipNumber (_, on_me)) end end end @@ -128,12 +128,12 @@ return else local name, _, icon = _GetSpellInfo(spellid) - GameCooltip:AddLine (name) + GameCooltip:AddLine(name) GameCooltip:AddIcon (icon, 1, 1, 14, 14) - GameCooltip:AddLine (Loc ["STRING_HEAL"] .. ": ", spell.total) - GameCooltip:AddLine (Loc ["STRING_HITS"] .. ": ", spell.counter) - GameCooltip:AddLine (Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) + GameCooltip:AddLine(Loc ["STRING_HEAL"] .. ": ", spell.total) + GameCooltip:AddLine(Loc ["STRING_HITS"] .. ": ", spell.counter) + GameCooltip:AddLine(Loc ["STRING_CRITICAL_HITS"] .. ": ", spell.c_amt) end elseif (target) then @@ -147,7 +147,7 @@ break end - GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(t[1], FormatTooltipNumber (_, t[2])) _detalhes:AddTooltipBackgroundStatusbar() GameCooltip:AddIcon ([[Interface\FriendsFrame\StatusIcon-Offline]], 1, 1, 14, 14) end @@ -165,14 +165,14 @@ end if (roster [t[1]]) then - GameCooltip:AddLine (t[1], FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(t[1], FormatTooltipNumber (_, t[2])) end end elseif (target == "[player]") then local target_amount = actor.targets [_detalhes.playername] if (target_amount) then - GameCooltip:AddLine (targetactor.nome, FormatTooltipNumber (_, target_amount)) + GameCooltip:AddLine(targetactor.nome, FormatTooltipNumber (_, target_amount)) end else @@ -187,7 +187,7 @@ end local name, _, icon = _GetSpellInfo(t[1]) - GameCooltip:AddLine (name, FormatTooltipNumber (_, t[2])) + GameCooltip:AddLine(name, FormatTooltipNumber (_, t[2])) GameCooltip:AddIcon (icon, 1, 1, 14, 14) end end @@ -208,7 +208,7 @@ if (spell) then if (target) then if (target == "[all]") then - for target_name, amount in _pairs (spell.targets) do + for target_name, amount in _pairs(spell.targets) do --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 @@ -225,7 +225,7 @@ elseif (target == "[raid]") then local roster = combat.raid_roster - for target_name, amount in _pairs (spell.targets) do + for target_name, amount in _pairs(spell.targets) do if (roster [target_name]) then --add amount instance_container:AddValue (combat (1, target_name), amount, true) @@ -278,14 +278,14 @@ if (target == "[all]") then local total = 0 - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do total = total + amount end return total elseif (target == "[raid]") then local total = 0 - for target_name, amount in _pairs (actor.targets) do + for target_name, amount in _pairs(actor.targets) do if (combat.raid_roster [target_name]) then total = total + amount end diff --git a/classes/include_instance.lua b/classes/include_instance.lua index 09fd06d8..a5b8ea31 100644 --- a/classes/include_instance.lua +++ b/classes/include_instance.lua @@ -13,7 +13,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 - self [key] = Details.CopyTable (value) + self [key] = Details.CopyTable(value) else self [key] = value end @@ -60,7 +60,7 @@ 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 - self [key] = Details.CopyTable (value) + self [key] = Details.CopyTable(value) else self [key] = value end @@ -78,7 +78,7 @@ function _detalhes:LoadInstanceConfig() for key, value in pairs(_detalhes.instance_defaults) do if (self [key] == nil) then if (type(value) == "table") then - self [key] = Details.CopyTable (_detalhes.instance_defaults [key]) + self [key] = Details.CopyTable(_detalhes.instance_defaults [key]) else self [key] = value end @@ -87,7 +87,7 @@ function _detalhes:LoadInstanceConfig() for key2, value2 in pairs(value) do if (self [key] [key2] == nil) then if (type(value2) == "table") then - self [key] [key2] = Details.CopyTable (_detalhes.instance_defaults [key] [key2]) + self [key] [key2] = Details.CopyTable(_detalhes.instance_defaults [key] [key2]) else self [key] [key2] = value2 end diff --git a/core/control.lua b/core/control.lua index aba9094c..e14a8965 100644 --- a/core/control.lua +++ b/core/control.lua @@ -1,57 +1,52 @@ - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local _tempo = time() local _ - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers - - local _math_floor = math.floor --lua local local _math_max = math.max --lua local local ipairs = ipairs --lua local local pairs = pairs --lua local - local _table_wipe = table.wipe --lua local - local _bit_band = bit.band --lua local - - local _GetInstanceInfo = GetInstanceInfo --wow api local - local _UnitExists = UnitExists --wow api local - local _UnitGUID = UnitGUID --wow api local - local _UnitName = UnitName --wow api local - local _GetTime = GetTime - - local _IsAltKeyDown = IsAltKeyDown - local _IsShiftKeyDown = IsShiftKeyDown - local _IsControlKeyDown = IsControlKeyDown - + local wipe = table.wipe --lua local + local bitBand = bit.band --lua local + + local GetInstanceInfo = GetInstanceInfo --wow api local + local UnitExists = UnitExists --wow api local + local UnitGUID = UnitGUID --wow api local + local GetTime = GetTime + + local IsAltKeyDown = IsAltKeyDown + local IsShiftKeyDown = IsShiftKeyDown + local IsControlKeyDown = IsControlKeyDown + local atributo_damage = Details.atributo_damage --details local local atributo_heal = Details.atributo_heal --details local local atributo_energy = Details.atributo_energy --details local local atributo_misc = Details.atributo_misc --details local local atributo_custom = Details.atributo_custom --details local local info = Details.playerDetailWindow --details local - + local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --constants - local modo_GROUP = Details.modos.group local modo_ALL = Details.modos.all local class_type_dano = Details.atributos.dano local OBJECT_TYPE_PETS = 0x00003000 - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --details api functions --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 ZoneName, InstanceType, DifficultyID, _, _, _, _, ZoneMapID = GetInstanceInfo() 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:GetBossNames (Details.zone_id)) then @@ -61,41 +56,41 @@ return Loc ["STRING_SEGMENT_TRASH"] end end - - 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 + + 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 bitBand (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 else local _target_actor = Details.tabela_vigente (class_type_dano, name) - if (_target_actor and _target_actor.grupo) then + if (_target_actor and _target_actor.grupo) then return actor.nome end end end 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 (actor.grupo and not actor.owner) then - for target_name, _ in pairs(actor.targets) do + for target_name, _ in pairs(actor.targets) do return target_name end end - + end - + return Loc ["STRING_UNKNOW"] end - + -- try get the current encounter name during the encounter - + local boss_found_not_registered = function(t, ZoneName, ZoneMapID, DifficultyID) - + local boss_table = { index = 0, name = t[1], @@ -103,32 +98,32 @@ zone = ZoneName, mapid = ZoneMapID, diff = DifficultyID, - diff_string = select (4, GetInstanceInfo()), + diff_string = select(4, GetInstanceInfo()), ej_instance_id = t[5], id = t[2], bossimage = t[4], } - + Details.tabela_vigente.is_boss = boss_table end - + local boss_found = function(index, name, zone, mapid, diff, encounterid) - + local mapID = C_Map.GetBestMapForUnit ("player") local ejid if (mapID) then ejid = DetailsFramework.EncounterJournal.EJ_GetInstanceForMap (mapID) end - + if (not mapID) then - --print ("Details! exeption handled: zone has no map") + --print("Details! exeption handled: zone has no map") return end - + if (ejid == 0) then ejid = Details:GetInstanceEJID() end - + local boss_table = { index = index, name = name, @@ -136,17 +131,17 @@ zone = zone, mapid = mapid, diff = diff, - diff_string = select (4, GetInstanceInfo()), + diff_string = select(4, GetInstanceInfo()), ej_instance_id = ejid, id = encounterid, } - + if (not Details:IsRaidRegistered (mapid) and Details.zone_type == "raid") 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 @@ -160,36 +155,36 @@ end Details.tabela_vigente.is_boss = boss_table - + if (Details.in_combat and not Details.leaving_combat) then - + --catch boss function if any local bossFunction, bossFunctionType = Details:GetBossFunction (ZoneMapID, BossIndex) if (bossFunction) then - if (_bit_band (bossFunctionType, 0x1) ~= 0) then --realtime + if (bitBand (bossFunctionType, 0x1) ~= 0) then --realtime Details.bossFunction = bossFunction - Details.tabela_vigente.bossFunction = Details:ScheduleTimer ("bossFunction", 1) + Details.tabela_vigente.bossFunction = Details:ScheduleTimer("bossFunction", 1) end end - + if (Details.zone_type ~= "raid") then local endType, endData = Details:GetEncounterEnd (ZoneMapID, BossIndex) if (endType and endData) then - + if (Details.debug) then 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 (Details.debug) then 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 @@ -201,46 +196,46 @@ end end end - + --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:CheckFor_SuppressedWindowsOnEncounterFound() end - + return boss_table end - + function Details:ReadBossFrames() - + if (Details.tabela_vigente.is_boss) then return --no need to check end - + if (Details.encounter_table.name) then local encounter_table = Details.encounter_table return boss_found (encounter_table.index, encounter_table.name, encounter_table.zone, encounter_table.mapid, encounter_table.diff, encounter_table.id) end - - for index = 1, 5, 1 do - if (_UnitExists ("boss"..index)) then - local guid = _UnitGUID ("boss"..index) + + for index = 1, 5, 1 do + if (UnitExists ("boss"..index)) then + local guid = UnitGUID("boss"..index) if (guid) then local serial = Details:GetNpcIdFromGuid (guid) if (serial) then - - local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo() - + + local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = GetInstanceInfo() + local BossIds = Details:GetBossIds (ZoneMapID) if (BossIds) then local BossIndex = BossIds [serial] - if (BossIndex) then + if (BossIndex) then if (Details.debug) then Details:Msg("(debug) boss found:",Details:GetBossName (ZoneMapID, BossIndex)) end - + return boss_found (BossIndex, Details:GetBossName (ZoneMapID, BossIndex), ZoneName, ZoneMapID, DifficultyID) end end @@ -248,8 +243,8 @@ end end end - end - + end + --try to get the encounter name after the encounter (can be called during the combat as well) function Details:FindBoss (noJournalSearch) @@ -257,16 +252,16 @@ local encounter_table = Details.encounter_table return boss_found (encounter_table.index, encounter_table.name, encounter_table.zone, encounter_table.mapid, encounter_table.diff, encounter_table.id) end - - local ZoneName, InstanceType, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo() + + local ZoneName, InstanceType, DifficultyID, _, _, _, _, ZoneMapID = GetInstanceInfo() local BossIds = Details:GetBossIds (ZoneMapID) - + if (BossIds) then local BossIndex = nil 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 @@ -280,9 +275,9 @@ end end end - + noJournalSearch = true --disabling the scan on encounter journal - + if (not noJournalSearch) then local in_instance = IsInInstance() --garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then @@ -290,7 +285,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 @@ -317,58 +312,58 @@ if (Details.debug) then 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) + --print(from) end - if (not Details.tabela_historico.tabelas[1]) then + 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 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 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 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.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 - Details.tabela_vigente.verifica_combate = Details:ScheduleRepeatingTimer ("EstaEmCombate", 1) - + Details.tabela_vigente.verifica_combate = Details:ScheduleRepeatingTimer ("EstaEmCombate", 1) + Details:ClearCCPetsBlackList() - - _table_wipe (Details.encounter_end_table) - - _table_wipe (Details.pets_ignored) - _table_wipe (Details.pets_no_owner) + + wipe(Details.encounter_end_table) + + wipe(Details.pets_ignored) + wipe(Details.pets_no_owner) Details.container_pets:BuscarPets() - - _table_wipe (Details.cache_damage_group) - _table_wipe (Details.cache_healing_group) + + wipe(Details.cache_damage_group) + wipe(Details.cache_healing_group) Details:UpdateParserGears() - + --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 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 @@ -376,20 +371,20 @@ 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 (Details.EncounterInformation [Details.zone_id]) then - Details:ScheduleTimer ("ReadBossFrames", 1) - Details:ScheduleTimer ("ReadBossFrames", 30) + 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 - Details:InstanciaCallFunction (Details.TrocaSegmentoAtual, Details.tabela_vigente.is_boss and true) - + Details:InstanciaCallFunction(Details.TrocaSegmentoAtual, Details.tabela_vigente.is_boss and true) + --clear hosts and make the cloud capture stuff Details.host_of = nil - Details.host_by = nil - + Details.host_by = nil + if (Details.in_group and Details.cloud_capture) then if (Details:IsInInstance() or Details.debug) then if (not Details:CaptureIsAllEnabled()) then @@ -408,33 +403,33 @@ -- 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 + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then instancia:CheckSwitchOnCombatStart (true) end end - - Details:InstanceCall (Details.CheckPsUpdate) - + + Details:InstanceCall(Details.CheckPsUpdate) + --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) 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) end - + Details:CheckSwitchToCurrent() Details:CheckForTextTimeCounter (true) - + --stop bar testing if any Details:StopTestBarUpdate() end - + function Details:DelayedSyncAlert() local lower_instance = Details:GetLowerInstanceNumber() if (lower_instance) then @@ -446,53 +441,53 @@ end end end - + 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 Details:SendCharacterData() end end - + function Details:EndCombat() return Details:SairDoCombate() end - + -- ~end ~leave 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 "") end - + --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 Details.last_closed_combat = Details.tabela_vigente - + --if (Details.statistics) then -- for k, v in pairs(Details.statistics) do - -- print (k, v) + -- print(k, v) -- end --end - + Details.leaving_combat = true Details.last_combat_time = _tempo - + Details:CatchRaidBuffUptime ("BUFF_UPTIME_OUT") Details:CatchRaidDebuffUptime ("DEBUFF_UPTIME_OUT") Details:CloseEnemyDebuffsUptime() - + --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 (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 Details:FindBoss() - + --still didn't find the boss if (not Details.tabela_vigente.is_boss) then - local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo() + local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = GetInstanceInfo() local findboss = Details:GetRaidBossFindFunction (ZoneMapID) if (findboss) then local BossIndex = findboss() @@ -502,50 +497,50 @@ end end end - + if (Details.tabela_vigente.bossFunction) then - Details:CancelTimer (Details.tabela_vigente.bossFunction) + Details:CancelTimer(Details.tabela_vigente.bossFunction) Details.tabela_vigente.bossFunction = nil end --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) + if (Details.tabela_vigente.verifica_combate) then + Details:CancelTimer(Details.tabela_vigente.verifica_combate) Details.tabela_vigente.verifica_combate = nil end --lock timers - Details.tabela_vigente:TravarTempos() - + Details.tabela_vigente:TravarTempos() + --get waste shields if (Details.close_shields) then Details:CloseShields (Details.tabela_vigente) end - + --salva hora, minuto, segundo do fim da luta - Details.tabela_vigente:seta_data (Details._detalhes_props.DATA_TYPE_END) + Details.tabela_vigente:seta_data (Details._detalhes_props.DATA_TYPE_END) Details.tabela_vigente:seta_tempo_decorrido() - + --drop last events table to garbage collector Details.tabela_vigente.player_last_events = {} - + --flag instance type - local _, InstanceType = _GetInstanceInfo() + local _, InstanceType = GetInstanceInfo() Details.tabela_vigente.instance_type = InstanceType - - if (not Details.tabela_vigente.is_boss and from_encounter_end and type (from_encounter_end) == "table") then - local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack (from_encounter_end) + + if (not Details.tabela_vigente.is_boss and from_encounter_end and type(from_encounter_end) == "table") then + local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack(from_encounter_end) if (encounterID) then local ZoneName, InstanceType, DifficultyID, DifficultyName, _, _, _, ZoneMapID = GetInstanceInfo() - + local mapID = C_Map.GetBestMapForUnit ("player") - + if (not mapID) then mapID = 0 end - + local ejid = DetailsFramework.EncounterJournal.EJ_GetInstanceForMap (mapID) - + if (ejid == 0) then ejid = Details:GetInstanceEJID() end @@ -563,25 +558,25 @@ id = encounterID, } end - 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 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 - C_Timer.After (1, Details.ScheduleSyncPlayerActorData) - + C_Timer.After(1, Details.ScheduleSyncPlayerActorData) + --if this segment isn't a boss fight if (not Details.tabela_vigente.is_boss) then if (Details.tabela_vigente.is_pvp or Details.tabela_vigente.is_arena) then Details:FlagActorsOnPvPCombat() end - + if (Details.tabela_vigente.is_arena) then Details.tabela_vigente.enemy = "[" .. ARENA .. "] " .. Details.tabela_vigente.is_arena.name end @@ -612,42 +607,42 @@ end end end - + if (not Details.tabela_vigente.enemy) then local enemy = Details:FindEnemy() - + if (enemy and Details.debug) then 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:EqualizeActorsSchedule (Details.host_of) end - + --verifica memoria Details:FlagActorsOnCommonFight() --fight_component --Details:CheckMemoryAfterCombat() -- 7.2.5 is doing some weird errors even out of combat else - + --this segment is a boss fight if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then - + else --Details.schedule_flag_boss_components = true end - + --calling here without checking for combat since the does not ran too long for scripts Details:FlagActorsOnBossFight() - + local boss_id = Details.encounter_table.id if (bossKilled) then Details.tabela_vigente.is_boss.killed = true - + --add to storage if (not InCombatLockdown() and not UnitAffectingCombat ("player") and not Details.logoff_saving_data) then local successful, errortext = pcall (Details.Database.StoreEncounter) @@ -657,9 +652,9 @@ else Details.schedule_store_boss_encounter = true end - + Details:SendEvent("COMBAT_BOSS_DEFEATED", nil, Details.tabela_vigente) - + Details:CheckFor_TrashSuppressionOnEncounterEnd() else Details:SendEvent("COMBAT_BOSS_WIPE", nil, Details.tabela_vigente) @@ -673,24 +668,24 @@ else Details.schedule_store_boss_encounter_wipe = true end - + end --if (Details:GetBossDetails (Details.tabela_vigente.is_boss.mapid, Details.tabela_vigente.is_boss.index) or ) then - + Details.tabela_vigente.is_boss.index = Details.tabela_vigente.is_boss.index or 1 - + Details.tabela_vigente.enemy = Details.tabela_vigente.is_boss.encounter if (Details.tabela_vigente.instance_type == "raid") then - + Details.last_encounter2 = Details.last_encounter Details.last_encounter = Details.tabela_vigente.is_boss.name if (Details.pre_pot_used) then - Details.last_combat_pre_pot_used = Details.CopyTable (Details.pre_pot_used) + Details.last_combat_pre_pot_used = Details.CopyTable(Details.pre_pot_used) end - + if (Details.pre_pot_used and Details.announce_prepots.enabled) then Details:Msg(Details.pre_pot_used or "") Details.pre_pot_used = nil @@ -707,7 +702,7 @@ --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 (bitBand (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 @@ -716,27 +711,27 @@ end end end - + if (Details.tabela_vigente.instance_type == "raid") then --schedule captures off - + Details:CaptureSet (false, "damage", false, 15) Details:CaptureSet (false, "energy", false, 15) Details:CaptureSet (false, "aura", false, 15) Details:CaptureSet (false, "energy", false, 15) Details:CaptureSet (false, "spellcast", false, 15) - + if (Details.debug) then Details:Msg("(debug) freezing parser for 15 seconds.") end end - + --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) + Details:ScheduleTimer("DelayedSyncAlert", 3) end - + --else -- if (Details.debug) then -- Details:EqualizeActorsSchedule (Details.host_of) @@ -748,68 +743,68 @@ --debuffs need a checkup, not well functional right now Details.CloseSoloDebuffs() end - + local tempo_do_combate = Details.tabela_vigente:GetCombatTime() local invalid_combat - + local zoneName, zoneType = GetInstanceInfo() if (not Details.tabela_vigente.discard_segment and (zoneType == "none" or tempo_do_combate >= Details.minimum_combat_time or not Details.tabela_historico.tabelas[1])) then Details.tabela_historico:adicionar (Details.tabela_vigente) --move a tabela atual para dentro do hist�rico --8.0.1 miss data isn't required at the moment, spells like akari's soul has been removed from the game --Details:CanSendMissData() - + if (Details.tabela_vigente.is_boss) then if (IsInRaid()) then local cleuID = Details.tabela_vigente.is_boss.id local diff = Details.tabela_vigente.is_boss.diff if (cleuID and diff == 16) then -- 16 mythic local raidData = Details.raid_data - + --get or build mythic raid data table local mythicRaidData = raidData.mythic_raid_data if (not mythicRaidData) then mythicRaidData = {} raidData.mythic_raid_data = mythicRaidData end - + --get or build a table for this cleuID mythicRaidData [cleuID] = mythicRaidData [cleuID] or {wipes = 0, kills = 0, best_try = 1, longest = 0, try_history = {}} local cleuIDData = mythicRaidData [cleuID] - + --store encounter data for plugins and weakauras if (Details.tabela_vigente:GetCombatTime() > cleuIDData.longest) then cleuIDData.longest = Details.tabela_vigente:GetCombatTime() end - + if (Details.tabela_vigente.is_boss.killed) then cleuIDData.kills = cleuIDData.kills + 1 cleuIDData.best_try = 0 tinsert(cleuIDData.try_history, {0, Details.tabela_vigente:GetCombatTime()}) - --print ("KILL", "best try", cleuIDData.best_try, "amt kills", cleuIDData.kills, "wipes", cleuIDData.wipes, "longest", cleuIDData.longest) + --print("KILL", "best try", cleuIDData.best_try, "amt kills", cleuIDData.kills, "wipes", cleuIDData.wipes, "longest", cleuIDData.longest) else cleuIDData.wipes = cleuIDData.wipes + 1 if (Details.boss1_health_percent and Details.boss1_health_percent < cleuIDData.best_try) then cleuIDData.best_try = Details.boss1_health_percent tinsert(cleuIDData.try_history, {Details.boss1_health_percent, Details.tabela_vigente:GetCombatTime()}) end - --print ("WIPE", "best try", cleuIDData.best_try, "amt kills", cleuIDData.kills, "wipes", cleuIDData.wipes, "longest", cleuIDData.longest) + --print("WIPE", "best try", cleuIDData.best_try, "amt kills", cleuIDData.kills, "wipes", cleuIDData.wipes, "longest", cleuIDData.longest) end end end -- end - + --the combat is valid, see if the user is sharing data with somebody if (Details.shareData) then local zipData = Details:CompressData (Details.tabela_vigente, "comm") if (zipData) then - print ("has zip data") + print("has zip data") end end - + else invalid_combat = Details.tabela_vigente - + --tutorial about the combat time < then 'minimum_combat_time' local hasSeenTutorial = Details:GetTutorialCVar("MIN_COMBAT_TIME") if (not hasSeenTutorial) then @@ -822,7 +817,7 @@ end end end - + --in case of a forced discard segment, just check a second time if we have a previous combat. if (not Details.tabela_historico.tabelas[1]) then Details.tabela_vigente = Details.tabela_vigente @@ -832,23 +827,23 @@ if (Details.tabela_vigente:GetStartTime() == 0) then --Details.tabela_vigente.start_time = Details._tempo - Details.tabela_vigente:SetStartTime (_GetTime()) + Details.tabela_vigente:SetStartTime (GetTime()) --Details.tabela_vigente.end_time = Details._tempo - Details.tabela_vigente:SetEndTime (_GetTime()) + Details.tabela_vigente:SetEndTime (GetTime()) end - + Details.tabela_vigente.resincked = true - + --tabela foi descartada, precisa atualizar os baseframes // precisa atualizer todos ou apenas o overall? - Details:InstanciaCallFunction (Details.AtualizarJanela) - + 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 - + Details.SoloTables.CombatID = Details.SoloTables.CombatIDLast - + else if (Details.RefreshSolo) then Details:RefreshSolo() @@ -857,58 +852,58 @@ end end end - + Details:NumeroCombate (-1) end - + Details.host_of = nil Details.host_by = nil - + if (Details.cloud_process) then - Details:CancelTimer (Details.cloud_process) + Details:CancelTimer(Details.cloud_process) end - + Details.in_combat = false Details.leaving_combat = false - + Details:OnCombatPhaseChanged() - _table_wipe (Details.tabela_vigente.PhaseData.damage_section) - _table_wipe (Details.tabela_vigente.PhaseData.heal_section) - - _table_wipe (Details.cache_damage_group) - _table_wipe (Details.cache_healing_group) - + wipe(Details.tabela_vigente.PhaseData.damage_section) + wipe(Details.tabela_vigente.PhaseData.heal_section) + + wipe(Details.cache_damage_group) + wipe(Details.cache_healing_group) + Details:UpdateParserGears() - + --hide / alpha in combat - for index, instancia in ipairs(Details.tabela_instancias) do + for index, instancia in ipairs(Details.tabela_instancias) do if (instancia.ativa) then if (instancia.auto_switch_to_old) then instancia:CheckSwitchOnCombatEnd() end end end - + Details.pre_pot_used = nil - + --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) + wipe(Details.encounter_table) else if (Details.debug) then Details:Msg("(debug) in argus encounter, cannot wipe the encounter table.") end end - Details:InstanceCall (Details.CheckPsUpdate) - + Details:InstanceCall(Details.CheckPsUpdate) + if (invalid_combat) then Details:SendEvent("COMBAT_INVALID") Details:SendEvent("COMBAT_PLAYER_LEAVE", nil, invalid_combat) else Details:SendEvent("COMBAT_PLAYER_LEAVE", nil, Details.tabela_vigente) end - + Details:CheckForTextTimeCounter() Details.StoreSpells() Details:RunScheduledEventsAfterCombat() @@ -919,14 +914,14 @@ for i = 1, aliados-1 do local role = UnitGroupRolesAssigned and UnitGroupRolesAssigned("party" .. i) or "DAMAGER" if (role ~= "NONE" and UnitExists("party" .. i)) then - local name = GetUnitName ("party" .. i, true) + local name = GetUnitName("party" .. i, true) Details.arena_table [name] = {role = role} end end - + local role = UnitGroupRolesAssigned and UnitGroupRolesAssigned("player") or "DAMAGER" if (role ~= "NONE") then - local name = GetUnitName ("player", true) + local name = GetUnitName("player", true) Details.arena_table [name] = {role = role} end @@ -955,57 +950,57 @@ end local string_arena_enemyteam_damage = [[ - local combat = Details:GetCombat ("current") + local combat = Details:GetCombat("current") local total = 0 - + for _, actor in combat[1]:ListActors() do if (actor.arena_enemy) then total = total + actor.total end end - + return total ]] - + local string_arena_myteam_damage = [[ - local combat = Details:GetCombat ("current") + local combat = Details:GetCombat("current") local total = 0 - + for _, actor in combat[1]:ListActors() do if (actor.arena_ally) then total = total + actor.total end end - + return total ]] - + local string_arena_enemyteam_heal = [[ - local combat = Details:GetCombat ("current") + local combat = Details:GetCombat("current") local total = 0 - + for _, actor in combat[2]:ListActors() do if (actor.arena_enemy) then total = total + actor.total end end - + return total ]] local string_arena_myteam_heal = [[ - local combat = Details:GetCombat ("current") + local combat = Details:GetCombat("current") local total = 0 - + for _, actor in combat[2]:ListActors() do if (actor.arena_ally) then total = total + actor.total end end - + return total ]] - + function Details:CreateArenaSegment() Details:GetPlayersInArena() @@ -1064,38 +1059,38 @@ if (Details.debug) then Details:Msg("(debug) the player EnteredInArena().") end - + Details.arena_begun = false Details:GetPlayersInArena() end - + function Details:LeftArena() if (Details.debug) then Details:Msg("(debug) player LeftArena().") end - + Details.is_in_arena = false Details.arena_begun = false - + if (Details.start_arena) then - Details:CancelTimer (Details.start_arena, true) + Details:CancelTimer(Details.start_arena, true) end - + Details:TimeDataUnregister ("Your Team Damage") Details:TimeDataUnregister ("Enemy Team Damage") - + Details:TimeDataUnregister ("Your Team Healing") Details:TimeDataUnregister ("Enemy Team Healing") - + Details:SendEvent("COMBAT_ARENA_END") end - + local validSpells = { [220893] = {class = "ROGUE", spec = 261, maxPercent = 0.075, container = 1, commID = "MISSDATA_ROGUE_SOULRIP"}, --[11366] = {class = "MAGE", spec = 63, maxPercent = 0.9, container = 1, commID = "MISSDATA_ROGUE_SOULRIP"}, } - + function Details:CanSendMissData() if (not IsInRaid() and not IsInGroup()) then return @@ -1116,7 +1111,7 @@ end return false end - + function Details:SendMissData (spellID, containerType, commID) local combat = Details.tabela_vigente if (combat) then @@ -1130,24 +1125,24 @@ [3] = spell.total, [4] = spell.counter } - + if (Details.debug) then Details:Msg("(debug) sending miss data packet:", spellID, containerType, commID) end - + Details:SendRaidOrPartyData (commID, data) end end end end - + function Details.HandleMissData (playerName, data) local combat = Details.tabela_vigente - + if (Details.debug) then 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 @@ -1157,7 +1152,7 @@ local damageActor = combat (containerType, playerName) if (damageActor) then local spellID = data[2] --a spellID has been passed? - if (not spellID or type (spellID) ~= "number") then + if (not spellID or type(spellID) ~= "number") then return end @@ -1173,7 +1168,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 @@ -1189,9 +1184,9 @@ spellObject.total = total spellObject.counter = counter damageActor.total = damageActor.total + difference - + combat [containerType].need_refresh = true - + if (Details.debug) then Details:Msg("(debug) miss data successful added from:", playerName, data [2], "difference:", difference) end @@ -1201,43 +1196,43 @@ end end end - + function Details:MakeEqualizeOnActor (player, realm, receivedActor) - + if (true) then --disabled for testing return end - - local combat = Details:GetCombat ("current") - local damage, heal, energy, misc = Details:GetAllActors ("current", player) - + + local combat = Details:GetCombat("current") + local damage, heal, energy, misc = Details:GetAllActors("current", player) + if (not damage and not heal and not energy and not misc) then - + --try adding server name - damage, heal, energy, misc = Details:GetAllActors ("current", player.."-"..realm) - + 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 - + local actorName - + if (realm ~= GetRealmName()) then actorName = player.."-"..realm else actorName = player end - + local guid = Details:FindGUIDFromName (player) - + -- 0x512 normal party -- 0x514 normal raid - + if (guid) then damage = combat [1]:PegarCombatente (guid, actorName, 0x514, true) heal = combat [2]:PegarCombatente (guid, actorName, 0x514, true) energy = combat [3]:PegarCombatente (guid, actorName, 0x514, true) misc = combat [4]:PegarCombatente (guid, actorName, 0x514, true) - + if (Details.debug) then Details:Msg("(debug) equalize received actor:", actorName, damage, heal) end @@ -1248,12 +1243,12 @@ end end end - + combat[1].need_refresh = true combat[2].need_refresh = true combat[3].need_refresh = true combat[4].need_refresh = true - + if (damage) then if (damage.total < receivedActor [1][1]) then if (Details.debug) then @@ -1268,7 +1263,7 @@ damage.friendlyfire_total = receivedActor [1][3] end end - + if (heal) then if (heal.total < receivedActor [2][1]) then heal.total = receivedActor [2][1] @@ -1280,7 +1275,7 @@ heal.healing_taken = receivedActor [2][3] end end - + if (energy) then if (energy.mana and (receivedActor [3][1] > 0 and energy.mana < receivedActor [3][1])) then energy.mana = receivedActor [3][1] @@ -1295,7 +1290,7 @@ energy.runepower = receivedActor [3][4] end end - + if (misc) then if (misc.interrupt and (receivedActor [4][1] > 0 and misc.interrupt < receivedActor [4][1])) then misc.interrupt = receivedActor [4][1] @@ -1305,12 +1300,12 @@ end end end - + function Details:EqualizePets() --check for pets without owner - for _, actor in ipairs(Details.tabela_vigente[1]._ActorTable) do + 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 + 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 if (not actor.owner and not Details.tabela_pets.pets [actor.serial]) then Details:SendPetOwnerRequest (actor.serial, actor.nome) @@ -1318,68 +1313,68 @@ end end end - + function Details:EqualizeActorsSchedule (host_of) - + --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) + wipe(Details.sent_pets) Details.sent_pets.n = time() end - + --pet equilize disabled on details 1.4.0 - --Details:ScheduleTimer ("EqualizePets", 1+math.random()) + --Details:ScheduleTimer("EqualizePets", 1+math.random()) --do not equilize if there is any disabled capture --if (Details:CaptureIsAllEnabled()) then - Details:ScheduleTimer ("EqualizeActors", 2+math.random()+math.random() , host_of) + Details:ScheduleTimer("EqualizeActors", 2+math.random()+math.random() , host_of) --end end - + 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 return end - + if (Details.debug) then Details:Msg("(debug) sending equilize actor data") end - + local damage, heal, energy, misc - + if (host_of) then - damage, heal, energy, misc = Details:GetAllActors ("current", host_of) + damage, heal, energy, misc = Details:GetAllActors("current", host_of) else - damage, heal, energy, misc = Details:GetAllActors ("current", Details.playername) + damage, heal, energy, misc = Details:GetAllActors("current", Details.playername) end - + if (damage) then damage = {damage.total or 0, damage.damage_taken or 0, damage.friendlyfire_total or 0} else damage = {0, 0, 0} end - + if (heal) then heal = {heal.total or 0, heal.totalover or 0, heal.healing_taken or 0} else heal = {0, 0, 0} end - + if (energy) then energy = {energy.mana or 0, energy.e_rage or 0, energy.e_energy or 0, energy.runepower or 0} else energy = {0, 0, 0, 0} end - + if (misc) then misc = {misc.interrupt or 0, misc.dispell or 0} else misc = {0, 0} end - + local data = {damage, heal, energy, misc} --envia os dados do proprio host pra ele antes @@ -1389,25 +1384,25 @@ else Details:SendRaidData (Details.network.ids.CLOUD_EQUALIZE, data) end - + 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 end - + local fight_component = function(energy_container, misc_container, name) local on_energy = energy_container._ActorTable [energy_container._NameIndexTable [name]] if (on_energy) then @@ -1418,27 +1413,27 @@ on_misc.fight_component = true end end - + function Details:FlagActorsOnCommonFight() - + local damage_container = Details.tabela_vigente [1] local healing_container = Details.tabela_vigente [2] local energy_container = Details.tabela_vigente [3] local misc_container = Details.tabela_vigente [4] - + local mythicDungeonRun = Details.tabela_vigente.is_mythic_dungeon_segment - - for class_type, container in ipairs({damage_container, healing_container}) do - - for _, actor in ipairs(container._ActorTable) do - + + for class_type, container in ipairs({damage_container, healing_container}) do + + for _, actor in ipairs(container._ActorTable) do + if (mythicDungeonRun) then actor.fight_component = true end - + if (actor.grupo) then if (class_type == 1 or class_type == 2) then - for target_name, amount in pairs(actor.targets) do + for target_name, amount in pairs(actor.targets) do local target_object = container._ActorTable [container._NameIndexTable [target_name]] if (target_object) then target_object.fight_component = true @@ -1446,7 +1441,7 @@ end end if (class_type == 1) then - for damager_actor, _ in pairs(actor.damage_from) do + for damager_actor, _ in pairs(actor.damage_from) do local target_object = container._ActorTable [container._NameIndexTable [damager_actor]] if (target_object) then target_object.fight_component = true @@ -1454,7 +1449,7 @@ end end elseif (class_type == 2) then - for healer_actor, _ in pairs(actor.healing_from) do + for healer_actor, _ in pairs(actor.healing_from) do local target_object = container._ActorTable [container._NameIndexTable [healer_actor]] if (target_object) then target_object.fight_component = true @@ -1465,7 +1460,7 @@ end end end - + end end @@ -1483,11 +1478,11 @@ function Details:PostponeInstanceToCurrent (instance) if ( - not instance.last_interaction or + not instance.last_interaction or ( (instance.ativa) and - (instance.last_interaction+3 < _tempo) and - (not DetailsReportWindow or not DetailsReportWindow:IsShown()) and + (instance.last_interaction+3 < _tempo) and + (not DetailsReportWindow or not DetailsReportWindow:IsShown()) and (not Details.playerDetailWindow:IsShown()) ) ) then @@ -1501,28 +1496,28 @@ if (instance.is_interacting and instance.last_interaction < _tempo) then instance.last_interaction = _tempo end - instance._postponing_current = Details:ScheduleTimer ("PostponeInstanceToCurrent", 1, instance) + instance._postponing_current = Details:ScheduleTimer("PostponeInstanceToCurrent", 1, instance) end - + function Details:TrocaSegmentoAtual (instancia, is_encounter) if (instancia.segmento == 0 and instancia.baseframe and instancia.ativa) then - + if (not is_encounter) then if (instancia.is_interacting) then if (not instancia.last_interaction or instancia.last_interaction < _tempo) then instancia.last_interaction = _tempo or time() end end - + if ((instancia.last_interaction and (instancia.last_interaction+3 > Details._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (Details.playerDetailWindow:IsShown())) then --postpone - instancia._postponing_current = Details:ScheduleTimer ("PostponeInstanceToCurrent", 1, instancia) + instancia._postponing_current = Details:ScheduleTimer("PostponeInstanceToCurrent", 1, instancia) return end end - - --print ("==> Changing the Segment now! - control.lua 1220") - + + --print("==> Changing the Segment now! - control.lua 1220") + instancia.last_interaction = _tempo - 4 --pode setar, completou o ciclo instancia._postponing_current = nil instancia.showing = Details.tabela_vigente @@ -1530,7 +1525,7 @@ Details.FadeHandler.Fader(instancia, "in", nil, "barras") end end - + function Details:SetTrashSuppression (n) assert (type(n) == "number", "SetTrashSuppression expects a number on index 1.") if (n < 0) then @@ -1551,13 +1546,13 @@ end end function Details:SetTrashSuppressionAfterEncounter() - Details:InstanceCall ("CheckFor_EnabledTrashSuppression") + Details:InstanceCall("CheckFor_EnabledTrashSuppression") end 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. - Details:ScheduleTimer ("SetTrashSuppressionAfterEncounter", 3) + Details:ScheduleTimer("SetTrashSuppressionAfterEncounter", 3) end end @@ -1578,40 +1573,40 @@ local avatarTexCoord = {0, 1, 0, 1} local backgroundColor = {0, 0, 0, 0.6} local avatarTextColor = {1, 1, 1, 1} - + function Details:AddTooltipReportLineText() GameCooltip:AddLine (Loc ["STRING_CLICK_REPORT_LINE1"], Loc ["STRING_CLICK_REPORT_LINE2"]) GameCooltip:AddStatusBar (100, 1, 0, 0, 0, 0.8) end - + function Details:AddTooltipBackgroundStatusbar (side, value, useSpark) Details.tooltip.background [4] = 0.8 Details.tooltip.icon_size.W = Details.tooltip.line_height Details.tooltip.icon_size.H = Details.tooltip.line_height - + value = value or 100 - + if (not side) then - local r, g, b, a = unpack (Details.tooltip.background) + local r, g, b, a = unpack(Details.tooltip.background) GameCooltip:AddStatusBar (value, 1, r, g, b, a, useSpark, {value = 100, color = {.21, .21, .21, 0.8}, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) - + else - GameCooltip:AddStatusBar (value, 2, unpack (Details.tooltip.background)) + GameCooltip:AddStatusBar (value, 2, unpack(Details.tooltip.background)) end end - + function Details:AddTooltipHeaderStatusbar (r, g, b, a) - local r, g, b, a, statusbarGlow, backgroundBar = unpack (Details.tooltip.header_statusbar) + local r, g, b, a, statusbarGlow, backgroundBar = unpack(Details.tooltip.header_statusbar) GameCooltip:AddStatusBar (100, 1, r, g, b, a, statusbarGlow, backgroundBar, "Skyline") end - + -- /run local a,b=Details.tooltip.header_statusbar,0.3;a[1]=b;a[2]=b;a[3]=b;a[4]=0.8; - + function Details:AddTooltipSpellHeaderText (headerText, headerColor, amount, iconTexture, L, R, T, B, separator) if (separator and separator == true) then GameCooltip:AddLine ("", "", nil, nil, 1, 1, 1, 1, 8) - + return end @@ -1625,9 +1620,9 @@ GameCooltip:AddIcon (iconTexture, 1, 1, 14, 14, L or 0, R or 1, T or 0, B or 1) end end - + local bgColor, borderColor = {0, 0, 0, 0.8}, {0, 0, 0, 0} --{0.37, 0.37, 0.37, .75}, {.30, .30, .30, .3} - + function Details:FormatCooltipForSpells() local GameCooltip = GameCooltip @@ -1635,13 +1630,13 @@ GameCooltip:SetType ("tooltip") 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("LeftBorderSize", -5) GameCooltip:SetOption("RightBorderSize", 5) GameCooltip:SetOption("RightTextMargin", 0) @@ -1658,26 +1653,26 @@ local GameCooltip = GameCooltip Details:FormatCooltipForSpells() GameCooltip:SetOption("MinWidth", _math_max (230, self.baseframe:GetWidth()*0.98)) - + local myPoint = Details.tooltip.anchor_point local anchorPoint = Details.tooltip.anchor_relative local x_Offset = Details.tooltip.anchor_offset[1] local y_Offset = Details.tooltip.anchor_offset[2] - + if (Details.tooltip.anchored_to == 1) then - + GameCooltip:SetHost (frame, myPoint, anchorPoint, x_Offset, y_Offset) else GameCooltip:SetHost (DetailsTooltipAnchor, myPoint, anchorPoint, x_Offset, y_Offset) end end - + 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 @@ -1694,11 +1689,11 @@ elseif (objeto.boss_debuff) then 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 - + if (t) then - + if (objeto.serial and objeto.serial ~= "") then local avatar = NickTag:GetNicknameTable (objeto.serial, true) if (avatar and not Details.ignore_nicktag) then @@ -1719,33 +1714,33 @@ GameCooltip:ShowCooltip() end end - + function Details.gump:UpdateTooltip (whichRowLine, esta_barra, instancia) - if (_IsShiftKeyDown()) then + if (IsShiftKeyDown()) then return instancia:MontaTooltip(esta_barra, whichRowLine, "shift") - elseif (_IsControlKeyDown()) then + elseif (IsControlKeyDown()) then return instancia:MontaTooltip(esta_barra, whichRowLine, "ctrl") - elseif (_IsAltKeyDown()) then + elseif (IsAltKeyDown()) then return instancia:MontaTooltip(esta_barra, whichRowLine, "alt") else return instancia:MontaTooltip(esta_barra, whichRowLine) end end - + function Details:EndRefresh (instancia, total, combatTable, showing) Details:EsconderBarrasNaoUsadas (instancia, showing) 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) + --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") 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 @@ -1783,7 +1778,7 @@ --else --combatTable[self.atributo].need_refresh = false end - + if (self.atributo == 1) then --damage return atributo_damage:RefreshWindow(self, combatTable, forcar, nil, need_refresh) @@ -1805,17 +1800,17 @@ function Details:ForceRefresh() self:RefreshMainWindow(true) end - + function Details:RefreshMainWindow(instance, forceRefresh) if (not instance or type(instance) == "boolean") then forceRefresh = instance instance = self end - + if (not forceRefresh) then Details.LastUpdateTick = Details._tempo end - + if (instance == -1) then --update for index, instance in ipairs(Details.tabela_instancias) do @@ -1826,7 +1821,7 @@ end end end - + --flag windows as no need update next tick for index, instance in ipairs(Details.tabela_instancias) do if (instance.ativa and instance.showing) then @@ -1844,16 +1839,16 @@ return info.jogador:MontaInfo() end end - + return - + else if (not instance.ativa) then --print("instance not actived", instance.RefreshMainWindow, 1+nil) return end end - + if (instance.modo == modo_ALL or instance.modo == modo_GROUP) then --print("updating all instances...") return instance:RefreshAllMainWindows (forceRefresh) @@ -1894,11 +1889,11 @@ 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"]) + local no = Details.gump:CreateButton(panel, function() panel:Hide() end, 90, 20, Loc ["STRING_NO"]) 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"]) + 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:InstallCustomTexture (nil, nil, nil, nil, true) end @@ -1909,10 +1904,10 @@ function Details:CheckForAutoErase (mapid) if (Details.last_instance_id ~= mapid) then Details.tabela_historico:resetar_overall() - + if (Details.segments_auto_erase == 2) then --ask - Details:ScheduleTimer ("AutoEraseConfirm", 1) + Details:ScheduleTimer("AutoEraseConfirm", 1) elseif (Details.segments_auto_erase == 3) then --erase Details.tabela_historico:resetar() @@ -1921,14 +1916,14 @@ if (_tempo > Details.last_instance_time + 21600) then --6 hours if (Details.segments_auto_erase == 2) then --ask - Details:ScheduleTimer ("AutoEraseConfirm", 1) + Details:ScheduleTimer("AutoEraseConfirm", 1) elseif (Details.segments_auto_erase == 3) then --erase Details.tabela_historico:resetar() end end end - + Details.last_instance_id = mapid Details.last_instance_time = _tempo --Details.last_instance_time = 0 --debug @@ -1936,5 +1931,5 @@ function Details:UpdateControl() _tempo = Details._tempo - end + end diff --git a/core/gears.lua b/core/gears.lua index f5481806..b8055a41 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -1,5 +1,5 @@ local _detalhes = _G._detalhes -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local UnitName = UnitName local UnitGUID = UnitGUID @@ -137,7 +137,7 @@ end end end if (is_startup) then - return _detalhes.chat_embed:ScheduleTimer ("DelayedChatEmbed", 5) + return _detalhes.chat_embed:ScheduleTimer("DelayedChatEmbed", 5) end local tabname = _detalhes.chat_tab_embed.tab_name @@ -330,7 +330,7 @@ end function _detalhes:SetDeathLogLimit (limit) - if (limit and type (limit) == "number" and limit >= 8) then + if (limit and type(limit) == "number" and limit >= 8) then _detalhes.deadlog_events = limit local combat = _detalhes.tabela_vigente @@ -432,7 +432,7 @@ function _detalhes:ResetSpecCache (forced) if (type(my_spec) == "number") then local spec_number = DetailsFramework.GetSpecializationInfo (my_spec) if (type(spec_number) == "number") then - local pguid = UnitGUID (_detalhes.playername) + local pguid = UnitGUID(_detalhes.playername) if (pguid) then _detalhes.cached_specs [pguid] = spec_number end @@ -448,7 +448,7 @@ function _detalhes:ResetSpecCache (forced) local c_combat_dmg = _detalhes.tabela_vigente [1] local c_combat_heal = _detalhes.tabela_vigente [2] for i = 1, GetNumGroupMembers(), 1 do - local name = GetUnitName ("raid" .. i, true) + local name = GetUnitName("raid" .. i, true) local index = c_combat_dmg._NameIndexTable [name] if (index) then local actor = c_combat_dmg._ActorTable [index] @@ -532,9 +532,9 @@ _detalhes.PerformanceIcons = { function _detalhes:CheckForPerformanceProfile() - local type = _detalhes:GetPerformanceRaidType() + local performanceType = _detalhes:GetPerformanceRaidType() - local profile = _detalhes.performance_profiles [type] + local profile = _detalhes.performance_profiles [performanceType] if (profile and profile.enabled) then _detalhes:SetWindowUpdateSpeed(profile.update_speed, true) @@ -545,12 +545,12 @@ function _detalhes:CheckForPerformanceProfile() _detalhes:CaptureSet(profile.miscdata, "miscdata") _detalhes:CaptureSet(profile.aura, "aura") - if (not _detalhes.performance_profile_lastenabled or _detalhes.performance_profile_lastenabled ~= type) then - _detalhes:InstanceAlert (Loc ["STRING_OPTIONS_PERFORMANCE_PROFILE_LOAD"] .. type, {_detalhes.PerformanceIcons [type].icon, 14, 14, false, 0, 1, 0, 1, unpack (_detalhes.PerformanceIcons [type].color)} , 5, {_detalhes.empty_function}) + if (not _detalhes.performance_profile_lastenabled or _detalhes.performance_profile_lastenabled ~= performanceType) then + _detalhes:InstanceAlert (Loc ["STRING_OPTIONS_PERFORMANCE_PROFILE_LOAD"] .. performanceType, {_detalhes.PerformanceIcons [performanceType].icon, 14, 14, false, 0, 1, 0, 1, unpack(_detalhes.PerformanceIcons [performanceType].color)} , 5, {_detalhes.empty_function}) end - _detalhes.performance_profile_enabled = type - _detalhes.performance_profile_lastenabled = type + _detalhes.performance_profile_enabled = performanceType + _detalhes.performance_profile_lastenabled = performanceType else _detalhes:SetWindowUpdateSpeed(_detalhes.update_speed) _detalhes:SetUseAnimations(_detalhes.use_row_animations) @@ -653,11 +653,11 @@ function _detalhes:RegisterBackgroundTask (name, func, priority, ...) background_tasks [name].func = func background_tasks [name].priority = priority background_tasks [name].args = {...} - background_tasks [name].args_amt = select ("#", ...) + background_tasks [name].args_amt = select("#", ...) background_tasks [name].object = self return else - background_tasks [name] = {func = func, lastexec = time(), priority = priority, nextexec = time() + task_timers [priority] * 60, args = {...}, args_amt = select ("#", ...), object = self} + background_tasks [name] = {func = func, lastexec = time(), priority = priority, nextexec = time() + task_timers [priority] * 60, args = {...}, args_amt = select("#", ...), object = self} end end @@ -675,9 +675,9 @@ function _detalhes:DoBackgroundTasks() for taskName, taskTable in pairs(background_tasks) do if (t > taskTable.nextexec) then if (type(taskTable.func) == "string") then - taskTable.object [taskTable.func] (taskTable.object, unpack (taskTable.args, 1, taskTable.args_amt)) + taskTable.object [taskTable.func] (taskTable.object, unpack(taskTable.args, 1, taskTable.args_amt)) else - taskTable.func (unpack (taskTable.args, 1, taskTable.args_amt)) + taskTable.func (unpack(taskTable.args, 1, taskTable.args_amt)) end taskTable.nextexec = random (30, 120) + t + (task_timers [taskTable.priority] * 60) @@ -725,7 +725,7 @@ function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name) return end - if (guild_name and type (guild_name) == "boolean") then + if (guild_name and type(guild_name) == "boolean") then guild_name = GetGuildInfo ("player") end @@ -761,7 +761,7 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role, dps, guil if (not guild_name) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) GetBestFromGuild() guild name invalid.") + _detalhes:Msg("(debug) GetBestFromGuild() guild name invalid.") end return end @@ -831,7 +831,7 @@ function _detalhes.storage:GetPlayerGuildRank (diff, encounter_id, role, playern if (not guild_name) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) GetBestFromGuild() guild name invalid.") + _detalhes:Msg("(debug) GetBestFromGuild() guild name invalid.") end return end @@ -1046,7 +1046,7 @@ function _detalhes.storage:GetIDsToGuildSync() end if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] sending " .. #IDs .. " IDs.") + _detalhes:Msg("(debug) [RoS-EncounterSync] sending " .. #IDs .. " IDs.") end return IDs @@ -1063,7 +1063,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList) if (type(IDsList) ~= "table") then if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] RoC IDsList isn't a table.") + _detalhes:Msg("(debug) [RoS-EncounterSync] RoC IDsList isn't a table.") end return end @@ -1085,7 +1085,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList) end if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoC-EncounterSync] RoS found " .. #RequestIDs .. " encounters out dated.") + _detalhes:Msg("(debug) [RoC-EncounterSync] RoS found " .. #RequestIDs .. " encounters out dated.") end return RequestIDs @@ -1101,7 +1101,7 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) if (type(IDsList) ~= "table") then if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] IDsList isn't a table.") + _detalhes:Msg("(debug) [RoS-EncounterSync] IDsList isn't a table.") end return end @@ -1114,7 +1114,7 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) local MaxAmount = 0 if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] the client requested " .. #IDsList .. " encounters.") + _detalhes:Msg("(debug) [RoS-EncounterSync] the client requested " .. #IDsList .. " encounters.") end for index, ID in ipairs(IDsList) do @@ -1148,7 +1148,7 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList) end if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] sending " .. AmtToSend .. " encounters.") + _detalhes:Msg("(debug) [RoS-EncounterSync] sending " .. AmtToSend .. " encounters.") end return EncounterList @@ -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 + 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 @@ -1189,17 +1189,17 @@ function _detalhes.storage:AddGuildSyncData (data, source) AddedAmount = AddedAmount + 1 else if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] received a duplicated encounter table.") + _detalhes:Msg("(debug) [RoS-EncounterSync] received a duplicated encounter table.") end end else if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] received an old tier encounter.") + _detalhes:Msg("(debug) [RoS-EncounterSync] received an old tier encounter.") end end else if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] received an invalid encounter table.") + _detalhes:Msg("(debug) [RoS-EncounterSync] received an invalid encounter table.") end end end @@ -1209,7 +1209,7 @@ function _detalhes.storage:AddGuildSyncData (data, source) end if (_detalhes.debug) then - _detalhes:Msg ("(debug) [RoS-EncounterSync] added " .. AddedAmount .. " to database.") + _detalhes:Msg("(debug) [RoS-EncounterSync] added " .. AddedAmount .. " to database.") end if (_G.DetailsRaidHistoryWindow and _G.DetailsRaidHistoryWindow:IsShown()) then @@ -1379,7 +1379,7 @@ end function _detalhes.ScheduleLoadStorage() if (InCombatLockdown() or UnitAffectingCombat ("player")) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! storage scheduled to load (player in combat).") + print("|cFFFFFF00Details! storage scheduled to load (player in combat).") end _detalhes.schedule_storage_load = true return @@ -1388,7 +1388,7 @@ function _detalhes.ScheduleLoadStorage() local loaded, reason = LoadAddOn ("Details_DataStorage") if (not loaded) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.") + print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.") end return end @@ -1401,11 +1401,11 @@ function _detalhes.ScheduleLoadStorage() _detalhes.schedule_storage_load = nil _detalhes.StorageLoaded = true if (_detalhes.debug) then - print ("|cFFFFFF00Details! storage loaded.") + print("|cFFFFFF00Details! storage loaded.") end else if (_detalhes.debug) then - print ("|cFFFFFF00Details! fail to load storage, scheduled once again.") + print("|cFFFFFF00Details! fail to load storage, scheduled once again.") end _detalhes.schedule_storage_load = true end @@ -1423,7 +1423,7 @@ function _detalhes.OpenStorage() --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.") + print("|cFFFFFF00Details! Storage|r: can't load storage due to combat.") end return false end @@ -1431,7 +1431,7 @@ function _detalhes.OpenStorage() local loaded, reason = LoadAddOn ("Details_DataStorage") if (not loaded) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.") + print("|cFFFFFF00Details! Storage|r: can't load storage, may be the addon is disabled.") end return end @@ -1456,7 +1456,7 @@ function Details.Database.LoadDB() local loaded, reason = LoadAddOn("Details_DataStorage") if (not loaded) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") + print("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") end return end @@ -1469,13 +1469,13 @@ function Details.Database.LoadDB() db = _detalhes:CreateStorageDB() if (not db) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") + print("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") end return end elseif (not db) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") + print("|cFFFFFF00Details! Storage|r: can't save the encounter, couldn't load DataStorage, may be the addon is disabled.") end return end @@ -1500,7 +1500,7 @@ function Details.Database.StoreWipe(combat) if (not combat) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: combat not found.") + print("|cFFFFFF00Details! Storage|r: combat not found.") end return end @@ -1511,7 +1511,7 @@ function Details.Database.StoreWipe(combat) if (not store_instances [mapID]) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: instance not allowed.") + print("|cFFFFFF00Details! Storage|r: instance not allowed.") end return end @@ -1521,7 +1521,7 @@ function Details.Database.StoreWipe(combat) if (not encounter_id) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: encounter ID not found.") + print("|cFFFFFF00Details! Storage|r: encounter ID not found.") end return end @@ -1571,7 +1571,7 @@ function Details.Database.StoreEncounter(combat) if (not combat) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: combat not found.") + print("|cFFFFFF00Details! Storage|r: combat not found.") end return end @@ -1582,7 +1582,7 @@ function Details.Database.StoreEncounter(combat) if (not store_instances [mapID]) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: instance not allowed.") + print("|cFFFFFF00Details! Storage|r: instance not allowed.") end return end @@ -1592,7 +1592,7 @@ function Details.Database.StoreEncounter(combat) if (not encounter_id) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: encounter ID not found.") + print("|cFFFFFF00Details! Storage|r: encounter ID not found.") end return end @@ -1682,13 +1682,13 @@ function Details.Database.StoreEncounter(combat) if (match < raidSize * 0.75 and not storageDebug) then if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") + print("|cFFFFFF00Details! Storage|r: can't save the encounter, need at least 75% of players be from your guild.") end return end else if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: player isn't in a guild.") + print("|cFFFFFF00Details! Storage|r: player isn't in a guild.") end return end @@ -1714,7 +1714,7 @@ function Details.Database.StoreEncounter(combat) for i = 1, GetNumGroupMembers() do - local role = UnitGroupRolesAssigned ("raid" .. i) + local role = UnitGroupRolesAssigned("raid" .. i) if (UnitIsInMyGuild ("raid" .. i)) then if (role == "DAMAGER" or role == "TANK") then @@ -1727,8 +1727,8 @@ function Details.Database.StoreEncounter(combat) local damage_actor = damage_container_pool [damage_container_hash [player_name]] if (damage_actor) then - local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) - this_combat_data.damage [player_name] = {floor (damage_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} + local guid = UnitGUID(player_name) or UnitGUID(UnitName ("raid" .. i)) + this_combat_data.damage [player_name] = {floor(damage_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} end elseif (role == "HEALER") then local player_name, player_realm = UnitName ("raid" .. i) @@ -1740,8 +1740,8 @@ function Details.Database.StoreEncounter(combat) local heal_actor = healing_container_pool [healing_container_hash [player_name]] if (heal_actor) then - local guid = UnitGUID (player_name) or UnitGUID (UnitName ("raid" .. i)) - this_combat_data.healing [player_name] = {floor (heal_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} + local guid = UnitGUID(player_name) or UnitGUID(UnitName ("raid" .. i)) + this_combat_data.healing [player_name] = {floor(heal_actor.total), _detalhes.item_level_pool [guid] and _detalhes.item_level_pool [guid].ilvl or 0, class or 0} end end end @@ -1750,10 +1750,10 @@ function Details.Database.StoreEncounter(combat) --add the encounter data tinsert(encounter_database, this_combat_data) if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: combat data added to encounter database.") + print("|cFFFFFF00Details! Storage|r: combat data added to encounter database.") end - local myrole = UnitGroupRolesAssigned ("player") + local myrole = UnitGroupRolesAssigned("player") 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 @@ -1769,11 +1769,11 @@ function Details.Database.StoreEncounter(combat) if (myBestDps > d_one) then if (not _detalhes.deny_score_messages) then - print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:ToK2 (d_one), _detalhes:ToK2 (myBestDps), onencounter.date, mybest[2])) + print(Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:ToK2 (d_one), _detalhes:ToK2 (myBestDps), onencounter.date, mybest[2])) end else if (not _detalhes.deny_score_messages) then - print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:ToK2 (d_one))) + print(Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:ToK2 (d_one))) end end end @@ -1782,7 +1782,7 @@ function Details.Database.StoreEncounter(combat) if (lower_instance) then local instance = _detalhes:GetInstance(lower_instance) if (instance) then - local my_role = UnitGroupRolesAssigned ("player") + local my_role = UnitGroupRolesAssigned("player") if (my_role == "TANK") then my_role = "DAMAGER" end @@ -1798,7 +1798,7 @@ function Details.Database.StoreEncounter(combat) end else if (_detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: raid difficulty must be heroic or mythic.") + print("|cFFFFFF00Details! Storage|r: raid difficulty must be heroic or mythic.") end end end @@ -1821,7 +1821,7 @@ local inspecting = {} ilvl_core.forced_inspects = {} function ilvl_core:HasQueuedInspec (unitName) - local guid = UnitGUID (unitName) + local guid = UnitGUID(unitName) if (guid) then return ilvl_core.forced_inspects [guid] end @@ -1849,7 +1849,7 @@ function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel talents = talents .. talentsSelected [i] .. "," end end - _detalhes:Msg ("(debug) Received PlayerInfo Data: " .. (player or "Invalid Player Name") .. " | " .. (itemLevel or "Invalid Item Level") .. " | " .. (currentSpec or "Invalid Spec") .. " | " .. talents .. " | " .. (serialNumber or "Invalid Serial")) + _detalhes:Msg("(debug) Received PlayerInfo Data: " .. (player or "Invalid Player Name") .. " | " .. (itemLevel or "Invalid Item Level") .. " | " .. (currentSpec or "Invalid Spec") .. " | " .. talents .. " | " .. (serialNumber or "Invalid Serial")) end if (not player) then @@ -1931,16 +1931,16 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) end local average = item_level / item_amount - --print (UnitName (unitid), "ILVL:", average, unitid, "items:", item_amount) + --print(UnitName (unitid), "ILVL:", average, unitid, "items:", item_amount) --register if (average > 0) then if (shout) then - _detalhes:Msg (UnitName(unitid) .. " item level: " .. average) + _detalhes:Msg(UnitName(unitid) .. " item level: " .. average) end if (average > MIN_ILEVEL_TO_STORE) then - local name = _detalhes:GetCLName (unitid) + local name = _detalhes:GetCLName(unitid) _detalhes.item_level_pool [guid] = {name = name, ilvl = average, time = time()} end end @@ -1971,7 +1971,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) if (talents [1]) then _detalhes.cached_talents [guid] = talents Details:SendEvent("UNIT_TALENTS", nil, unitid, talents, guid) - --print (UnitName (unitid), "talents:", unpack (talents)) + --print(UnitName (unitid), "talents:", unpack(talents)) end end -------------------------------------------------------------------------------------------------------- @@ -1980,7 +1980,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) 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) + _detalhes:Msg("Error on QueryInspect callback: " .. errortext) end end ilvl_core.forced_inspects [guid] = nil @@ -1993,33 +1993,33 @@ end _detalhes.ilevel.CalcItemLevel = ilvl_core.CalcItemLevel inspect_frame:SetScript("OnEvent", function(self, event, ...) - local guid = select (1, ...) + local guid = select(1, ...) if (inspecting [guid]) then local unitid, cancel_tread = inspecting [guid] [1], inspecting [guid] [2] inspecting [guid] = nil ilvl_core.amt_inspecting = ilvl_core.amt_inspecting - 1 - ilvl_core:CancelTimer (cancel_tread) + ilvl_core:CancelTimer(cancel_tread) --do inspect stuff if (unitid) then local t = {unitid, guid} - --ilvl_core:ScheduleTimer ("CalcItemLevel", 0.5, t) - ilvl_core:ScheduleTimer ("CalcItemLevel", 0.5, t) - ilvl_core:ScheduleTimer ("CalcItemLevel", 2, t) - ilvl_core:ScheduleTimer ("CalcItemLevel", 4, t) - ilvl_core:ScheduleTimer ("CalcItemLevel", 8, t) + --ilvl_core:ScheduleTimer("CalcItemLevel", 0.5, t) + ilvl_core:ScheduleTimer("CalcItemLevel", 0.5, t) + ilvl_core:ScheduleTimer("CalcItemLevel", 2, t) + ilvl_core:ScheduleTimer("CalcItemLevel", 4, t) + ilvl_core:ScheduleTimer("CalcItemLevel", 8, t) end else if (IsInRaid()) then --get the unitID local serial = ... - if (serial and type (serial) == "string") then + if (serial and type(serial) == "string") then for i = 1, GetNumGroupMembers() do - if (UnitGUID ("raid" .. i) == serial) then - ilvl_core:ScheduleTimer ("CalcItemLevel", 2, {"raid" .. i, serial}) - ilvl_core:ScheduleTimer ("CalcItemLevel", 4, {"raid" .. i, serial}) + if (UnitGUID("raid" .. i) == serial) then + ilvl_core:ScheduleTimer("CalcItemLevel", 2, {"raid" .. i, serial}) + ilvl_core:ScheduleTimer("CalcItemLevel", 4, {"raid" .. i, serial}) end end end @@ -2033,7 +2033,7 @@ function ilvl_core:InspectTimeOut (guid) end function ilvl_core:ReGetItemLevel (t) - local unitid, guid, is_forced, try_number = unpack (t) + local unitid, guid, is_forced, try_number = unpack(t) return ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number) end @@ -2057,12 +2057,12 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number) else try_number = try_number + 1 end - ilvl_core:ScheduleTimer ("ReGetItemLevel", 3, {unitid, guid, is_forced, try_number}) + ilvl_core:ScheduleTimer("ReGetItemLevel", 3, {unitid, guid, is_forced, try_number}) end return end - inspecting [guid] = {unitid, ilvl_core:ScheduleTimer ("InspectTimeOut", 12, guid)} + inspecting [guid] = {unitid, ilvl_core:ScheduleTimer("InspectTimeOut", 12, guid)} ilvl_core.amt_inspecting = ilvl_core.amt_inspecting + 1 --NotifyInspect (unitid) @@ -2072,17 +2072,17 @@ local NotifyInspectHook = function(unitid) local unit = unitid:gsub ("%d+", "") if ((IsInRaid() or IsInGroup()) and (_detalhes:GetZoneType() == "raid" or _detalhes:GetZoneType() == "party")) then - local guid = UnitGUID (unitid) - local name = _detalhes:GetCLName (unitid) + local guid = UnitGUID(unitid) + local name = _detalhes:GetCLName(unitid) if (guid and name and not inspecting [guid]) then for i = 1, GetNumGroupMembers() do - if (name == _detalhes:GetCLName (unit .. i)) then + if (name == _detalhes:GetCLName(unit .. i)) then unitid = unit .. i break end end - inspecting [guid] = {unitid, ilvl_core:ScheduleTimer ("InspectTimeOut", 12, guid)} + inspecting [guid] = {unitid, ilvl_core:ScheduleTimer("InspectTimeOut", 12, guid)} ilvl_core.amt_inspecting = ilvl_core.amt_inspecting + 1 end end @@ -2094,7 +2094,7 @@ function ilvl_core:Reset() ilvl_core.amt_inspecting = 0 for guid, t in pairs(inspecting) do - ilvl_core:CancelTimer (t[2]) + ilvl_core:CancelTimer(t[2]) inspecting [guid] = nil end end @@ -2109,14 +2109,14 @@ function ilvl_core:QueryInspect (unitName, callback, param1) if (IsInRaid()) then for i = 1, GetNumGroupMembers() do - if (GetUnitName ("raid" .. i, true) == unitName) then + if (GetUnitName("raid" .. i, true) == unitName) then unitid = "raid" .. i break end end elseif (IsInGroup()) then for i = 1, GetNumGroupMembers()-1 do - if (GetUnitName ("party" .. i, true) == unitName) then + if (GetUnitName("party" .. i, true) == unitName) then unitid = "party" .. i break end @@ -2129,7 +2129,7 @@ function ilvl_core:QueryInspect (unitName, callback, param1) return false end - local guid = UnitGUID (unitid) + local guid = UnitGUID(unitid) if (not guid) then return false elseif (ilvl_core.forced_inspects [guid]) then @@ -2144,9 +2144,9 @@ function ilvl_core:QueryInspect (unitName, callback, param1) ilvl_core:GetItemLevel (unitid, guid, true) if (ilvl_core.clear_queued_list) then - ilvl_core:CancelTimer (ilvl_core.clear_queued_list) + ilvl_core:CancelTimer(ilvl_core.clear_queued_list) end - ilvl_core.clear_queued_list = ilvl_core:ScheduleTimer ("ClearQueryInspectQueue", 60) + ilvl_core.clear_queued_list = ilvl_core:ScheduleTimer("ClearQueryInspectQueue", 60) return true end @@ -2180,7 +2180,7 @@ function ilvl_core:Loop() return end - local guid = UnitGUID (unitid) + local guid = UnitGUID(unitid) if (not guid) then ilvl_core.raid_id = ilvl_core.raid_id + 1 return @@ -2203,7 +2203,7 @@ end function ilvl_core:EnterCombat() if (ilvl_core.loop_process) then - ilvl_core:CancelTimer (ilvl_core.loop_process) + ilvl_core:CancelTimer(ilvl_core.loop_process) ilvl_core.loop_process = nil end end @@ -2247,7 +2247,7 @@ end function ilvl_core:OnLeave() if (ilvl_core.loop_process) then - ilvl_core:CancelTimer (ilvl_core.loop_process) + ilvl_core:CancelTimer(ilvl_core.loop_process) ilvl_core.loop_process = nil end end @@ -2267,7 +2267,7 @@ function _detalhes.ilevel:TrackItemLevel (bool) else _detalhes.track_item_level = false if (ilvl_core.loop_process) then - ilvl_core:CancelTimer (ilvl_core.loop_process) + ilvl_core:CancelTimer(ilvl_core.loop_process) ilvl_core.loop_process = nil end end @@ -2387,7 +2387,7 @@ if (DetailsFramework.IsWotLKWow()) then talentWatchClassic.cooldown = 0 - C_Timer.NewTicker (600, function() + C_Timer.NewTicker(600, function() Details:GetOldSchoolTalentInformation() end) @@ -2428,7 +2428,7 @@ if (DetailsFramework.IsWotLKWow()) then for talentIndex = 1, MAX_NUM_TALENTS do if (talentIndex <= numTalents) then local name, iconTexture, tier, column, rank, maxRank, isExceptional, available = GetTalentInfo (i, talentIndex) - if (name and rank and type (rank) == "number") then + if (name and rank and type(rank) == "number") then --send the specID instead of the specName local specID = Details.textureToSpec [fileName] tinsert(talentsSelected, {iconTexture, rank, tier, column, i, specID, maxRank}) @@ -2454,20 +2454,20 @@ if (DetailsFramework.IsWotLKWow()) then Details.playerClassicSpec.talents = talentsSelected --cache the player specId - _detalhes.cached_specs [UnitGUID ("player")] = Details.playerClassicSpec.specs + _detalhes.cached_specs [UnitGUID("player")] = Details.playerClassicSpec.specs --cache the player talents - _detalhes.cached_talents [UnitGUID ("player")] = talentsSelected + _detalhes.cached_talents [UnitGUID("player")] = talentsSelected local role = Details:GetRoleFromSpec(Details.playerClassicSpec.specs, UnitGUID("player")) if (Details.playerClassicSpec.specs == 103) then if (role == "TANK") then Details.playerClassicSpec.specs = 104 - _detalhes.cached_specs [UnitGUID ("player")] = Details.playerClassicSpec.specs + _detalhes.cached_specs [UnitGUID("player")] = Details.playerClassicSpec.specs end end - _detalhes.cached_roles[UnitGUID ("player")] = role + _detalhes.cached_roles[UnitGUID("player")] = role --gear status local item_amount = 16 @@ -2512,13 +2512,13 @@ if (DetailsFramework.IsWotLKWow()) then if (IsInRaid()) then _detalhes:SendRaidData(DETAILS_PREFIX_TBC_DATA, compressedData) if (_detalhes.debug) then - _detalhes:Msg ("(debug) sent talents data to Raid") + _detalhes:Msg("(debug) sent talents data to Raid") end elseif (IsInGroup()) then _detalhes:SendPartyData(DETAILS_PREFIX_TBC_DATA, compressedData) if (_detalhes.debug) then - _detalhes:Msg ("(debug) sent talents data to Party") + _detalhes:Msg("(debug) sent talents data to Party") end end end @@ -2583,7 +2583,7 @@ if (DetailsFramework.IsWotLKWow()) then if (talents) then local tankTalents = 0 for i = 1, #talents do - local iconTexture, rank, tier, column = unpack (talents [i]) + local iconTexture, rank, tier, column = unpack(talents [i]) if (tier == 2) then if (column == 1 and rank == 5) then tankTalents = tankTalents + 5 diff --git a/core/meta.lua b/core/meta.lua index 80ba51e7..aea4f91f 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -7,7 +7,7 @@ --local pointers local _ local _pairs = pairs --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _rawget = rawget --lua local local _setmetatable = setmetatable --lua local local _table_remove = table.remove --lua local @@ -52,7 +52,7 @@ --reaplica as tabelas no overall function _detalhes:RestauraOverallMetaTables() - local is_in_instance = select (1, IsInInstance()) + local is_in_instance = select(1, IsInInstance()) local combate = _detalhes.tabela_overall combate.overall_refreshed = true @@ -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,8 +101,8 @@ end end - 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 if (esta_classe.ownerName) then --nome do owner esta_classe.owner = combate (class_type, esta_classe.ownerName) end @@ -130,7 +130,7 @@ local tabelas_do_historico = _detalhes.tabela_historico.tabelas --atalho --recupera meta function - for _, combat_table in _ipairs(tabelas_do_historico) do + for _, combat_table in ipairs(tabelas_do_historico) do combat_table.__call = _detalhes.call_combate end @@ -148,11 +148,11 @@ combate_overall.end_time = GetTime() end - local is_in_instance = select (1, IsInInstance()) + local is_in_instance = select(1, IsInInstance()) --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 @@ -181,7 +181,7 @@ combate_overall.segments_added =combate_overall.segments_added or {} local date_start, date_end = combate:GetDate() - tinsert(combate_overall.segments_added, {name = combate:GetCombatName (true), elapsed = combate:GetCombatTime(), clock = date_start}) + tinsert(combate_overall.segments_added, {name = combate:GetCombatName(true), elapsed = combate:GetCombatTime(), clock = date_start}) end @@ -199,8 +199,8 @@ --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 @@ -247,8 +247,8 @@ end --reconstr�i a tabela dos pets - 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 if (esta_classe.ownerName) then --nome do owner esta_classe.owner = combate (class_type, esta_classe.ownerName) end @@ -277,7 +277,7 @@ function _detalhes:DoInstanceCleanup() --normal instances - for _, esta_instancia in _ipairs(_detalhes.tabela_instancias) do + for _, esta_instancia in ipairs(_detalhes.tabela_instancias) do if (esta_instancia.StatusBar.left) then esta_instancia.StatusBarSaved = { @@ -330,7 +330,7 @@ end --unused instances - for _, esta_instancia in _ipairs(_detalhes.unused_instances) do + for _, esta_instancia in ipairs(_detalhes.unused_instances) do if (esta_instancia.StatusBar.left) then esta_instancia.StatusBarSaved = { @@ -389,16 +389,16 @@ 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 end if (overall_added) then - tremove (combats, #combats) + tremove(combats, #combats) 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 @@ -432,7 +432,7 @@ end if (overall_added) then - tremove (combats, #combats) + tremove(combats, #combats) end end @@ -444,15 +444,15 @@ 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 if (overall_added) then - tremove (combats, #combats) + tremove(combats, #combats) end end @@ -464,14 +464,14 @@ 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 if (overall_added) then - tremove (combats, #combats) + tremove(combats, #combats) end end @@ -519,7 +519,7 @@ _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 @@ -550,7 +550,7 @@ end if (can_erase) then - _table_remove (conteudo, _iter.index) + _table_remove(conteudo, _iter.index) _iter.cleaned = _iter.cleaned + 1 _iter.data = conteudo [_iter.index] else @@ -567,11 +567,11 @@ 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 if (_detalhes.clear_graphic) then @@ -596,7 +596,7 @@ 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 @@ -687,7 +687,7 @@ end end - _table_remove (conteudo, _iter.index) + _table_remove(conteudo, _iter.index) _iter.cleaned = _iter.cleaned + 1 _iter.data = conteudo [_iter.index] else @@ -759,7 +759,7 @@ UpdateAddOnMemoryUsage() local memory = GetAddOnMemoryUsage ("Details") if (_detalhes.debug) then - _detalhes:Msg ("(debug) checking memory periodically. Using: ",math.floor (memory)) + _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 @@ -773,14 +773,14 @@ if (_detalhes.ultima_coleta + _detalhes.intervalo_coleta > _detalhes._tempo + 1) then return elseif (_detalhes.in_combat or _InCombatLockdown() or _detalhes:IsInInstance()) then - _detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5) + _detalhes:ScheduleTimer("IniciarColetaDeLixo", 5) return end else if (type(forcar) ~= "boolean") then if (forcar == 1) then if (_detalhes.in_combat or _InCombatLockdown()) then - _detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5, forcar) + _detalhes:ScheduleTimer("IniciarColetaDeLixo", 5, forcar) return end end @@ -789,9 +789,9 @@ if (_detalhes.debug) then if (forcar) then - _detalhes:Msg ("(debug) collecting garbage with forced state: ", forcar) + _detalhes:Msg("(debug) collecting garbage with forced state: ", forcar) else - _detalhes:Msg ("(debug) collecting garbage.") + _detalhes:Msg("(debug) collecting garbage.") end end @@ -801,9 +801,9 @@ _detalhes:ClearParserCache() --limpa barras que n�o est�o sendo usadas nas inst�ncias. - for index, instancia in _ipairs(_detalhes.tabela_instancias) do + 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 @@ -821,14 +821,14 @@ --refresh nas janelas if (limpados > 0) then - _detalhes:InstanciaCallFunction (_detalhes.reset_window) + _detalhes:InstanciaCallFunction(_detalhes.reset_window) end _detalhes:ManutencaoTimeMachine() --print cache states --if (_detalhes.debug) then - -- _detalhes:Msg ("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc) + -- _detalhes:Msg("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc) --end --elimina pets antigos @@ -841,7 +841,7 @@ _detalhes:ResetSpecCache() --wipa container de escudos - _table_wipe (_detalhes.escudos) + _table_wipe(_detalhes.escudos) _detalhes.ultima_coleta = _detalhes._tempo @@ -849,7 +849,7 @@ collectgarbage() UpdateAddOnMemoryUsage() --local memory2 = GetAddOnMemoryUsage ("Details") - --_detalhes:Msg ("(debug) memory before: "..memory.." memory after: "..memory2) + --_detalhes:Msg("(debug) memory before: "..memory.." memory after: "..memory2) end end @@ -903,7 +903,7 @@ _actor:DesregistrarNaTimeMachine() end - _table_remove (conteudo, _iter.index) + _table_remove(conteudo, _iter.index) _iter.data = conteudo [_iter.index] else _iter.index = _iter.index + 1 @@ -913,7 +913,7 @@ end --if (_detalhes.debug) then - -- _detalhes:Msg ("- garbage collect:", tipo, "actors removed:",_iter.cleaned) + -- _detalhes:Msg("- garbage collect:", tipo, "actors removed:",_iter.cleaned) --end if (_iter.cleaned > 0) then @@ -927,14 +927,14 @@ --Combate overall function _detalhes:ColetarLixo (tipo, lastevent) - --print ("fazendo coleta...") + --print("fazendo coleta...") local _tempo = _time() local limpados = 0 --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 @@ -942,7 +942,7 @@ 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 + for _, _combate in ipairs(tabelas_de_combate) do limpados = limpados + FazColeta (_combate, tipo, lastevent) end @@ -969,7 +969,7 @@ --apaga a refer�ncia deste jogador na tabela overall _iter.cleaned = _iter.cleaned+1 - _table_remove (conteudo, _iter.index) + _table_remove(conteudo, _iter.index) _iter.data = conteudo [_iter.index] else @@ -987,7 +987,7 @@ end if (limpados > 0) then - _detalhes:InstanciaCallFunction (_detalhes.ScheduleUpdate) + _detalhes:InstanciaCallFunction(_detalhes.ScheduleUpdate) _detalhes:RefreshMainWindow(-1) end diff --git a/core/parser.lua b/core/parser.lua index ca4d8efb..c00dd6f6 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _tempo = time() local _ local DetailsFramework = DetailsFramework @@ -21,16 +21,16 @@ local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned local _GetTime = GetTime local _tonumber = tonumber - + local _CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo local _table_insert = table.insert --lua local local _select = select --lua local local _bit_band = bit.band --lua local local _math_floor = math.floor --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local - local _type = type --lua local + local type = type --lua local local _math_ceil = math.ceil --lua local local _table_wipe = table.wipe --lua local local _strsplit = strsplit @@ -43,17 +43,17 @@ local cc_spell_list = DetailsFramework.CrowdControlSpells local container_habilidades = _detalhes.container_habilidades --details local - + --localize the cooldown table from the framework local defensive_cooldowns = DetailsFramework.CooldownsAllDeffensive - + local spell_damage_func = _detalhes.habilidade_dano.Add --details local local spell_damageMiss_func = _detalhes.habilidade_dano.AddMiss --details local local spell_heal_func = _detalhes.habilidade_cura.Add --details local 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 @@ -70,26 +70,26 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --cache --damage - local damage_cache = setmetatable ({}, _detalhes.weaktable) - local damage_cache_pets = setmetatable ({}, _detalhes.weaktable) - local damage_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) + local damage_cache = setmetatable({}, _detalhes.weaktable) + local damage_cache_pets = setmetatable({}, _detalhes.weaktable) + local damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable) --heaing - local healing_cache = setmetatable ({}, _detalhes.weaktable) + local healing_cache = setmetatable({}, _detalhes.weaktable) local banned_healing_spells = { [326514] = true, --remove on 10.0 - Forgeborne Reveries - necrolords ability } --energy - local energy_cache = setmetatable ({}, _detalhes.weaktable) + local energy_cache = setmetatable({}, _detalhes.weaktable) --misc - local misc_cache = setmetatable ({}, _detalhes.weaktable) - local misc_cache_pets = setmetatable ({}, _detalhes.weaktable) - local misc_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) + local misc_cache = setmetatable({}, _detalhes.weaktable) + local misc_cache_pets = setmetatable({}, _detalhes.weaktable) + local misc_cache_petsOwners = setmetatable({}, _detalhes.weaktable) --party & raid members - local raid_members_cache = setmetatable ({}, _detalhes.weaktable) + local raid_members_cache = setmetatable({}, _detalhes.weaktable) --tanks - local tanks_members_cache = setmetatable ({}, _detalhes.weaktable) + local tanks_members_cache = setmetatable({}, _detalhes.weaktable) --auto regen - local auto_regen_cache = setmetatable ({}, _detalhes.weaktable) + local auto_regen_cache = setmetatable({}, _detalhes.weaktable) --bitfield swap cache local bitfield_swap_cache = {} --damage and heal last events @@ -126,7 +126,7 @@ local reflection_dispelid = { --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) @@ -139,7 +139,7 @@ [124255] = true, --monk stagger [196917] = true, --paladin light of the martyr [217979] = true, --warlock health funnel - + --bugged spells [315197] = true, --thing from beyond grand delusions --this corruption when reflected causes insane amounts of damage to the thing from beyond @@ -261,7 +261,7 @@ [199667] = 199658, --warrior whirlwind [199852] = 199658, --warrior whirlwind [199851] = 199658, --warrior whirlwind - + [222031] = 199547, --deamonhunter ChaosStrike [200685] = 199552, --deamonhunter Blade Dance [210155] = 210153, --deamonhunter Death Sweep @@ -269,20 +269,20 @@ [187727] = 178741, --deamonhunter Immolation Aura [201789] = 201628, --deamonhunter Fury of the Illidari [225921] = 225919, --deamonhunter Fracture talent - + [205164] = 205165, --death knight Crystalline Swords - + [193315] = 197834, --rogue Saber Slash [202822] = 202823, --rogue greed [280720] = 282449, --rogue Secret Technique [280719] = 282449, --rogue Secret Technique [27576] = 5374, --rogue mutilate - + [233496] = 233490, --warlock Unstable Affliction [233497] = 233490, --warlock Unstable Affliction [233498] = 233490, --warlock Unstable Affliction [233499] = 233490, --warlock Unstable Affliction - + [261947] = 261977, --monk fist of the white tiger talent [32175] = 17364, -- shaman Stormstrike (from Turkar on github) @@ -347,7 +347,7 @@ [169429] = true, [169428] = true, [169430] = true, - + [189706] = true, --Chaotic Essence from Fated Affix --Remove on 10.0 } @@ -426,53 +426,53 @@ --expose the ignore spells table to external scripts _detalhes.SpellsToIgnore = damage_spells_to_ignore - + --is parser allowed to replace spellIDs? local is_using_spellId_override = false --is this a timewalking exp? local is_classic_exp = DetailsFramework.IsClassicWow() local is_timewalk_exp = DetailsFramework.IsTimewalkWoW() - + --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 local _in_combat = false local _current_encounter_id local _is_storing_cleu = false local _in_resting_zone = false - + --deathlog local _death_event_amt = 16 - + --map type local _is_in_instance = false - + --hooks local _hook_cooldowns = false local _hook_deaths = false local _hook_battleress = false local _hook_interrupt = false - + local _hook_cooldowns_container = _detalhes.hooks ["HOOK_COOLDOWN"] local _hook_deaths_container = _detalhes.hooks ["HOOK_DEATH"] local _hook_battleress_container = _detalhes.hooks ["HOOK_BATTLERESS"] local _hook_interrupt_container = _detalhes.hooks ["HOOK_INTERRUPT"] - + --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 ["141264"] = true, --trash - ["134034"] = true, --boss room + ["134034"] = true, --boss room ["138323"] = true, ["141265"] = true, } - + --regen overflow local auto_regen_power_specs = { [103] = Enum.PowerType.Energy, --druid feral @@ -559,14 +559,14 @@ 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) --- /run local f=CreateFrame("frame");f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");f:SetScript("OnEvent", function(self, ...) print (...) end) +-- /run local f=CreateFrame("frame");f:RegisterAllEvents();f:SetScript("OnEvent", function(self, ...)print(...);end) +-- /run local f=CreateFrame("frame");f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");f:SetScript("OnEvent", function(self, ...) print(...) end) -- /run local f=CreateFrame("frame");f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");f:SetScript("OnE - --- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent", function(self, ...)print (...);end) --- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(6, ...);if (a=="")then print (...) end end) --- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print (a);if (a=="SPELL_CAST_SUCCESS")then print (...) end end) - + +-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent", function(self, ...)print(...);end) +-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(6, ...);if (a=="")then print(...) end end) +-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print(a);if (a=="SPELL_CAST_SUCCESS")then print(...) end end) + local who_aggro = function(self) if ((_detalhes.LastPullMsg or 0) + 30 > time()) then _detalhes.WhoAggroTimer = nil @@ -576,52 +576,52 @@ local hitLine = self.HitBy or "|cFFFFBB00First Hit|r: *?*" local targetLine = "" - + for i = 1, 5 do local boss = UnitExists ("boss" .. i) if (boss) then local target = UnitName ("boss" .. i .. "target") - if (target and type (target) == "string") then + if (target and type(target) == "string") then targetLine = " |cFFFFBB00Boss First Target|r: " .. target break end end end - - _detalhes:Msg (hitLine .. targetLine) + + _detalhes:Msg(hitLine .. targetLine) _detalhes.WhoAggroTimer = nil end - + 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 - + local encounterID = self.Boss local diff = self.Diff - + if (diff == 15 or diff == 16) then - + 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. value, rank, combatTime = lastRecordFound.value, lastRecordFound.rank, lastRecordFound.combatTime else local db = _detalhes.GetStorage() - - local role = _UnitGroupRolesAssigned ("player") + + local role = _UnitGroupRolesAssigned("player") local isDamage = (role == "DAMAGER") or (role == "TANK") --or true local bestRank, encounterTable = _detalhes.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true) - + if (bestRank) then local playerTable, onEncounter, rankPosition = _detalhes.storage:GetPlayerGuildRank (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true) value = bestRank[1] or 0 rank = rankPosition or 0 combatTime = encounterTable.elapsed - + --if found the result, cache the values so no need to search again next pull lastRecordFound.value = value lastRecordFound.rank = rank @@ -637,19 +637,19 @@ lastRecordFound.diff = diff end 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 - + end - + 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) ------------------------------------------------------------------------------------------------ @@ -664,14 +664,14 @@ if (not alvo_name) then --no target name, just quit return - + elseif (not who_name) then --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 if (damage_spells_to_ignore [spellid]) then return @@ -730,19 +730,19 @@ --extend the duration of the timer to catch the rare channelling spells reflection_events[who_serial][spellid].time = time - + --crediting the source of the reflection aura who_serial = reflection.who_serial who_name = reflection.who_name who_flags = reflection.who_flags - + --data of the aura that caused the reflection --print("2", spellid, GetSpellInfo(spellid)) isreflected = spellid --which spell was reflected spellid = reflection.spellid --which spell made the reflection spellname = reflection.spellname spelltype = reflection.spelltype - + 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 @@ -777,7 +777,7 @@ --Jailer if (_current_encounter_id == 2537) then - + end --npcId check for ignored npcs @@ -785,7 +785,7 @@ --target if (not npcId) then - npcId = _tonumber(_select (6, _strsplit ("-", alvo_serial)) or 0) + npcId = _tonumber(_select(6, _strsplit ("-", alvo_serial)) or 0) npcid_cache[alvo_serial] = npcId end @@ -880,7 +880,7 @@ --source npcId = npcid_cache[who_serial] if (not npcId) then - npcId = _tonumber(_select (6, _strsplit ("-", who_serial)) or 0) + npcId = _tonumber(_select(6, _strsplit ("-", who_serial)) or 0) npcid_cache[who_serial] = npcId end if (ignored_npcids[npcId]) then @@ -910,11 +910,11 @@ --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 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 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) @@ -931,12 +931,12 @@ ------------------------------------------------------------------------------------------------ --check if need start an combat - + if (not _in_combat) then --~startcombat ~combatstart if ( token ~= "SPELL_PERIODIC_DAMAGE" and ( (who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0 and _UnitAffectingCombat (who_name) ) - or + or (alvo_flags and _bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 and _UnitAffectingCombat (alvo_name) ) or (not _detalhes.in_group and who_flags and _bit_band (who_flags, AFFILIATION_GROUP) ~= 0) @@ -950,11 +950,11 @@ else link = GetSpellLink(spellid) end - + if (_detalhes.WhoAggroTimer) then _detalhes.WhoAggroTimer:Cancel() end - _detalhes.WhoAggroTimer = C_Timer.NewTimer (0.5, who_aggro) + _detalhes.WhoAggroTimer = C_Timer.NewTimer(0.5, who_aggro) _detalhes.WhoAggroTimer.HitBy = "|cFFFFFF00First Hit|r: " .. (link or "") .. " from " .. (who_name or "Unknown") end _detalhes:EntrarEmCombate (who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) @@ -974,21 +974,21 @@ end end end - + --[[statistics]]-- _detalhes.statistics.damage_calls = _detalhes.statistics.damage_calls + 1 - + _current_damage_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors - + --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 este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - + if (meu_dono) then --� um pet if (who_serial ~= "") then damage_cache_pets [who_serial] = este_jogador @@ -1008,12 +1008,12 @@ local _, _, icon = _GetSpellInfo(spellid or 1) este_jogador.spellicon = icon else - --_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name) + --_detalhes:Msg("Unknown actor with unknown serial ", spellname, who_name) end end end end - + elseif (meu_dono) then --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" @@ -1029,10 +1029,10 @@ --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 jogador_alvo, alvo_dono, alvo_name = _current_damage_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) - + if (alvo_dono) then if (alvo_serial ~= "") then damage_cache_pets [alvo_serial] = jogador_alvo @@ -1047,11 +1047,11 @@ damage_cache [alvo_serial] = jogador_alvo end end - + elseif (alvo_dono) then --� um pet alvo_name = alvo_name .. " <" .. alvo_dono.nome .. ">" - + end if (not jogador_alvo) then @@ -1059,10 +1059,10 @@ Details:Msg("D! Report 0x885488", alvo_name, instanceName, instanceId, damage_cache[alvo_serial] and "true") return end - + --last event este_jogador.last_event = _tempo - + ------------------------------------------------------------------------------------------------ --group checks and avoidance @@ -1086,11 +1086,11 @@ amount = newDamage 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 --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 if (jogador_alvo.arena_enemy) then @@ -1099,7 +1099,7 @@ --record avoidance only for tank actors if (tanks_members_cache [alvo_serial]) then - + --monk's stagger if (jogador_alvo.classe == "MONK") then if (absorbed) then @@ -1116,38 +1116,38 @@ end end end - + --avoidance local avoidance = jogador_alvo.avoidance if (not avoidance) then jogador_alvo.avoidance = _detalhes:CreateActorAvoidanceTable() avoidance = jogador_alvo.avoidance end - + local overall = avoidance.overall - + local mob = avoidance [who_name] if (not mob) then --if isn't in the table, build on the fly mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob - end - + end + 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 ["HITS"] = overall ["HITS"] + 1 mob ["HITS"] = mob ["HITS"] + 1 end - + if (blocked and blocked > 0) then overall ["BLOCKED_HITS"] = overall ["BLOCKED_HITS"] + 1 mob ["BLOCKED_HITS"] = mob ["BLOCKED_HITS"] + 1 overall ["BLOCKED_AMT"] = overall ["BLOCKED_AMT"] + blocked mob ["BLOCKED_AMT"] = mob ["BLOCKED_AMT"] + blocked end - + --absorbs status if (absorbed) then --aqui pode ser apenas absorb parcial @@ -1167,17 +1167,17 @@ mob ["FULL_HIT_AMT"] = mob ["FULL_HIT_AMT"] + amount end end - + --record death log local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 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 @@ -1209,9 +1209,9 @@ this_event [10] = overkill this_event [11] = critical this_event [12] = crushing - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else @@ -1219,14 +1219,14 @@ end end end - + ------------------------------------------------------------------------------------------------ --time start if (not este_jogador.dps_started) then - + este_jogador:Iniciar (true) --registra na timemachine - + if (meu_dono and not meu_dono.dps_started) then meu_dono:Iniciar (true) if (meu_dono.end_time) then @@ -1236,7 +1236,7 @@ meu_dono.start_time = _tempo end end - + if (este_jogador.end_time) then este_jogador.end_time = nil else @@ -1255,11 +1255,11 @@ end end end - + ------------------------------------------------------------------------------------------------ --firendly fire ~friendlyfire local is_friendly_fire = false - + if (_is_in_instance) then if (bitfield_swap_cache [who_serial] or meu_dono and bitfield_swap_cache [meu_dono.serial]) then if (jogador_alvo.grupo or alvo_dono and alvo_dono.grupo) then @@ -1290,18 +1290,18 @@ is_friendly_fire = true end 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 local t = last_events_cache[alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable(alvo_name) end - + 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 @@ -1313,7 +1313,7 @@ this_event [9] = true this_event [10] = overkill i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else @@ -1322,14 +1322,14 @@ end este_jogador.friendlyfire_total = este_jogador.friendlyfire_total + amount - + local friend = este_jogador.friendlyfire [alvo_name] or este_jogador:CreateFFTable (alvo_name) friend.total = friend.total + amount 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 @@ -1340,9 +1340,9 @@ return true else _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 @@ -1350,39 +1350,39 @@ jogador_alvo.damage_from [who_name] = true end end - + ------------------------------------------------------------------------------------------------ --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 - + --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 meu_dono.raid_targets [alvo_flags2] = (meu_dono.raid_targets [alvo_flags2] or 0) + amount end end - + --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 este_jogador.total = este_jogador.total + amount - + --actor without pets este_jogador.total_without_pet = este_jogador.total_without_pet + amount - + --actor targets este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + amount - + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then @@ -1396,26 +1396,26 @@ spell.isReflection = true end end - + if (_is_storing_cleu) then _current_combat_cleu_events [_current_combat_cleu_events.n] = {_tempo, _token_ids [token] or 0, who_name, alvo_name or "", spellid, amount} _current_combat_cleu_events.n = _current_combat_cleu_events.n + 1 end - + return spell_damage_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, resisted, blocked, absorbed, critical, glacing, token, isoffhand, isreflected) end - + 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 - - + + --tag the container to refresh _current_damage_container.need_refresh = true - + --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 este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) if (meu_dono) then --� um pet @@ -1440,25 +1440,25 @@ end end end - + elseif (meu_dono) then --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" end - + --last event este_jogador.last_event = _tempo - + --amount amount = (amount or 0) local total_amount = amount + (absorbed or 0) - + --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 este_jogador.damage_from [who_name] = true end - + --friendly fire --total este_jogador.friendlyfire_total = este_jogador.friendlyfire_total + amount @@ -1469,19 +1469,19 @@ --record death log local t = last_events_cache [who_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (who_name) end - + local i = t.n - + local this_event = t [i] - + if (not this_event) then - return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) + 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 @@ -1492,40 +1492,40 @@ this_event [8] = school this_event [9] = true --friendly fire this_event [10] = overkill - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i - end - + end + --avoidance local avoidance = este_jogador.avoidance if (not avoidance) then este_jogador.avoidance = _detalhes:CreateActorAvoidanceTable() avoidance = este_jogador.avoidance end - + local overall = avoidance.overall - + local mob = avoidance [who_name] if (not mob) then --if isn't in the table, build on the fly mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob - end - + end + 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 mob ["BLOCKED_HITS"] = mob ["BLOCKED_HITS"] + 1 overall ["BLOCKED_AMT"] = overall ["BLOCKED_AMT"] + blocked mob ["BLOCKED_AMT"] = mob ["BLOCKED_AMT"] + blocked end - + --absorbs status if (absorbed) then --aqui pode ser apenas absorb parcial @@ -1544,40 +1544,40 @@ mob ["FULL_HIT"] = mob ["FULL_HIT"] + 1 mob ["FULL_HIT_AMT"] = mob ["FULL_HIT_AMT"] + amount end - + end - + --special rule for LOTM function 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) - + if (absorbed) then amount = absorbed + (amount or 0) end - + local healingActor = healing_cache [who_serial] if (healingActor and healingActor.spells) then healingActor.total = healingActor.total - (amount or 0) - + local spellTable = healingActor.spells:GetSpell (183998) if (spellTable) then spellTable.anti_heal = (spellTable.anti_heal or 0) + amount end end - + local t = last_events_cache [who_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (who_name) end - + local i = t.n - + local this_event = t [i] - + if (not this_event) then - return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) + 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 @@ -1588,15 +1588,15 @@ this_event [8] = school this_event [9] = true --friendly fire this_event [10] = overkill - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i - end - + end + local damageActor = damage_cache [who_serial] if (damageActor) then --damage taken @@ -1604,7 +1604,7 @@ if (not damageActor.damage_from [who_name]) then --adiciona a pool de dano tomado de quem damageActor.damage_from [who_name] = true end - + --friendly fire damageActor.friendlyfire_total = damageActor.friendlyfire_total + amount local friend = damageActor.friendlyfire [who_name] or damageActor:CreateFFTable (who_name) @@ -1612,17 +1612,17 @@ friend.spells [spellid] = (friend.spells [spellid] or 0) + amount end end - + --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 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 - + este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) - + if (meu_dono) then --� um pet if (who_serial ~= "") then damage_cache_pets [who_serial] = este_jogador @@ -1642,24 +1642,24 @@ local _, _, icon = _GetSpellInfo(spellid or 1) este_jogador.spellicon = icon else - --_detalhes:Msg ("Unknown actor with unknown serial ", spellname, who_name) + --_detalhes:Msg("Unknown actor with unknown serial ", spellname, who_name) end end end end - + elseif (meu_dono) then --� um pet who_name = who_name .. " <" .. meu_dono.nome .. ">" end - + --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 - + jogador_alvo, alvo_dono, alvo_name = _current_damage_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) - + if (alvo_dono) then if (alvo_serial ~= "") then damage_cache_pets [alvo_serial] = jogador_alvo @@ -1674,30 +1674,30 @@ damage_cache [alvo_serial] = jogador_alvo end end - + elseif (alvo_dono) then --� um pet alvo_name = alvo_name .. " <" .. alvo_dono.nome .. ">" end - + --last event este_jogador.last_event = _tempo - + --record death log local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + local i = t.n - + local this_event = t [i] - + if (not this_event) then - return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) + 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 @@ -1708,15 +1708,15 @@ this_event [8] = spelltype or school this_event [9] = false this_event [10] = overkill - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i end - + end --extra attacks @@ -1740,7 +1740,7 @@ spell.extra["extra_attack"] = (spell.extra["extra_attack"] or 0) + 1 end - + --function parser:swingmissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, missType, isOffHand, amountMissed) function parser:swingmissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1 return parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, "Corpo-a-Corpo", 00000001, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1 @@ -1759,21 +1759,21 @@ if (not alvo_name) then --no target name, just quit return - + elseif (not who_name) then --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" end - + ------------------------------------------------------------------------------------------------ --get actors --todo tbc seems to not have misses? need further investigation - --print ("MISS", "|", missType, "|", isOffHand, "|", amountMissed, "|", arg1) - --print (missType, who_name, spellname, amountMissed) - - + --print("MISS", "|", missType, "|", isOffHand, "|", amountMissed, "|", arg1) + --print(missType, who_name, spellname, amountMissed) + + --'misser' local este_jogador = damage_cache [who_serial] if (not este_jogador) then @@ -1784,23 +1784,23 @@ 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 - + local TargetActor = damage_cache [alvo_serial] if (TargetActor) then - + local avoidance = TargetActor.avoidance - + if (not avoidance) then TargetActor.avoidance = _detalhes:CreateActorAvoidanceTable() avoidance = TargetActor.avoidance end local missTable = avoidance.overall [missType] - + if (missTable) then --overall local overall = avoidance.overall @@ -1812,45 +1812,45 @@ mob = _detalhes:CreateActorAvoidanceTable (true) avoidance [who_name] = mob end - + mob [missType] = mob [missType] + 1 - + if (missType == "ABSORB") then --full 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 ["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) end - + end end end - + ------------------------------------------------------------------------------------------------ --amount add - + if (missType == "ABSORB") then - + if (token == "SWING_MISSED") then este_jogador.totalabsorbed = este_jogador.totalabsorbed + amountMissed return parser:swing ("SWING_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amountMissed, -1, 1, nil, nil, nil, false, false, false, false) - + elseif (token == "RANGE_MISSED") then este_jogador.totalabsorbed = este_jogador.totalabsorbed + amountMissed return parser:range ("RANGE_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false) - + else este_jogador.totalabsorbed = este_jogador.totalabsorbed + amountMissed return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false) - + end - + ------------------------------------------------------------------------------------------------ --spell reflection elseif (missType == "REFLECT" and reflection_auras[alvo_serial]) then --~reflect @@ -1874,7 +1874,7 @@ if (damage) then --damage ocurred first, so we have its data local amount = reflection_damage[who_serial][spellid].amount - + local isreflected = spellid --which spell was reflected alvo_serial = reflection.who_serial alvo_name = reflection.who_name @@ -1884,7 +1884,7 @@ 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 - + 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 @@ -1904,7 +1904,7 @@ if (is_using_spellId_override) then spellid = override_spellId [spellid] or spellid end - + --actor spells table local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then @@ -1914,28 +1914,28 @@ _detalhes.spell_school_cache [spellname] = spelltype end end - return spell_damageMiss_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, missType) + return spell_damageMiss_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, missType) end - + end - + ----------------------------------------------------------------------------------------------------------------------------------------- --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) - + --[[statistics]]-- _detalhes.statistics.pets_summons = _detalhes.statistics.pets_summons + 1 if (not _detalhes.capture_real ["damage"] and not _detalhes.capture_real ["heal"]) then return end - + if (not who_name) then who_name = "[*] " .. spellName end - local npcId = _tonumber(_select (6, _strsplit ("-", alvo_serial)) or 0) + local npcId = _tonumber(_select(6, _strsplit ("-", alvo_serial)) or 0) --kel'thuzad encounter --remove on 10.0 if (npcId == 176703) then --kelthuzad @@ -1959,23 +1959,23 @@ --rename monk's "Storm, Earth, and Fire" adds --desligado pois poderia estar causando problemas - if (npcId == 69792) then + if (npcId == 69792) then --alvo_name = "Earth Spirit" elseif (npcId == 69791) then --alvo_name = "Fire Spirit" end - + --pet summon another pet local sou_pet = container_pets [who_serial] if (sou_pet) then --okey, ja � um pet who_name, who_serial, who_flags = sou_pet[1], sou_pet[2], sou_pet[3] end - + local alvo_pet = container_pets [alvo_serial] if (alvo_pet) then who_name, who_serial, who_flags = alvo_pet[1], alvo_pet[2], alvo_pet[3] end - + _detalhes.tabela_pets:Adicionar (alvo_serial, alvo_name, alvo_flags, who_serial, who_name, who_flags) return end @@ -1991,20 +1991,20 @@ [20711] = true, -- Spirit of Redemption (Priest) [184553] = true, --Soul Capacitor } - + local ignored_overheal = { --during refresh, some shield does not replace the old value for the new one [47753] = true, -- Divine Aegis [86273] = true, -- Illuminated Healing [114908] = true, --Spirit Shell [152118] = true, --Clarity of Will } - + function parser:heal_denied (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellidAbsorb, spellnameAbsorb, spellschoolAbsorb, serialHealer, nameHealer, flagsHealer, flags2Healer, spellidHeal, spellnameHeal, typeHeal, amountDenied) - + if (not _in_combat) then return end - + --check invalid serial against pets if (who_serial == "") then if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --� um pet @@ -2016,24 +2016,24 @@ if (not who_name) then who_name = "[*] " .. (spellnameHeal or "--unknown spell--") end - + --no target, just ignore if (not alvo_name) then return end - + --if no spellid if (not spellidAbsorb) then spellidAbsorb = 1 spellnameAbsorb = "unknown" spellschoolAbsorb = 1 end - + if (is_using_spellId_override) then spellidAbsorb = override_spellId [spellidAbsorb] or spellidAbsorb spellidHeal = override_spellId [spellidHeal] or spellidHeal end - + ------------------------------------------------------------------------------------------------ --get actors @@ -2044,7 +2044,7 @@ healing_cache [who_serial] = este_jogador end end - + local jogador_alvo, alvo_dono = healing_cache [alvo_serial] if (not jogador_alvo) then jogador_alvo, alvo_dono, alvo_name = _current_heal_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) @@ -2052,11 +2052,11 @@ healing_cache [alvo_serial] = jogador_alvo end end - + este_jogador.last_event = _tempo ------------------------------------------------ - + este_jogador.totaldenied = este_jogador.totaldenied + amountDenied --actor spells table @@ -2067,12 +2067,12 @@ _detalhes.spell_school_cache [spellnameAbsorb] = spellschoolAbsorb or 1 end end - + --return spell:Add (alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, absorbed, critical, overhealing) return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, amountDenied, spellidHeal, token, nameHealer, overhealing) end - + function parser:heal_absorb (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spellschool, owner_serial, owner_name, owner_flags, owner_flags2, shieldid, shieldname, shieldtype, amount) --[[statistics]]-- _detalhes.statistics.absorbs_calls = _detalhes.statistics.absorbs_calls + 1 @@ -2098,7 +2098,7 @@ return else --retail - if (_type(shieldname) == "boolean") then + if (type(shieldname) == "boolean") then owner_serial, owner_name, owner_flags, owner_flags2, shieldid, shieldname, shieldtype, amount = spellid, spellname, spellschool, owner_serial, owner_name, owner_flags, owner_flags2, shieldid end end @@ -2125,24 +2125,24 @@ end end end - + --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 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 - + --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 if (who_serial == "") then if (who_flags and _bit_band (who_flags, OBJECT_TYPE_PETS) ~= 0) then --� um pet @@ -2166,7 +2166,7 @@ if (banned_healing_spells[spellid]) then return end - + if (is_classic_exp) then spellid = spellname end @@ -2175,22 +2175,22 @@ 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 - + if (is_using_spellId_override) then spellid = override_spellId [spellid] or spellid end --sanguine ichor mythic dungeon affix (heal enemies) - if (spellid == SPELLID_SANGUINE_HEAL) then + if (spellid == SPELLID_SANGUINE_HEAL) then who_name = Details.SanguineHealActorName who_flags = 0x518 who_serial = "Creature-0-3134-2289-28065-" .. SPELLID_SANGUINE_HEAL .. "-000164C698" end - + --[[statistics]]-- _detalhes.statistics.heal_calls = _detalhes.statistics.heal_calls + 1 - + local cura_efetiva = absorbed - if (is_shield) then + if (is_shield) then --o shield ja passa o numero exato da cura e o overheal cura_efetiva = amount else @@ -2216,7 +2216,7 @@ end --life bloom explosion (second part of the heal) - elseif (spellid == SPELLID_DRUID_LIFEBLOOM_HEAL) then + elseif (spellid == SPELLID_DRUID_LIFEBLOOM_HEAL) then TBC_LifeBloomLatestHeal = cura_efetiva return @@ -2242,7 +2242,7 @@ end _current_heal_container.need_refresh = true - + if (spellid == SPELLID_KYRIAN_DRUID_HEAL) then local ownerTable = druid_kyrian_bounds[who_name] if (ownerTable) then @@ -2268,7 +2268,7 @@ healing_cache [alvo_serial] = jogador_alvo end end - + este_jogador.last_event = _tempo @@ -2279,37 +2279,37 @@ este_jogador.grupo = true elseif (_bit_band (alvo_flags, REACTION_FRIENDLY) == 0 and not _detalhes.is_in_arena and not _detalhes.is_in_battleground) then - if (not este_jogador.heal_enemy [spellid]) then + if (not este_jogador.heal_enemy [spellid]) then este_jogador.heal_enemy [spellid] = cura_efetiva else este_jogador.heal_enemy [spellid] = este_jogador.heal_enemy [spellid] + cura_efetiva end - + este_jogador.heal_enemy_amt = este_jogador.heal_enemy_amt + cura_efetiva - + return - end - + end + ------------------------------------------------------------------------------------------------ --group checks - if (este_jogador.grupo and not jogador_alvo.arena_enemy) then + if (este_jogador.grupo and not jogador_alvo.arena_enemy) then --_current_combat.totals_grupo[2] = _current_combat.totals_grupo[2] + cura_efetiva _current_gtotal [2] = _current_gtotal [2] + cura_efetiva end - + if (jogador_alvo.grupo) then if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + local i = t.n - + 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 @@ -2334,25 +2334,25 @@ this_event [6] = who_name --source name this_event [7] = is_shield this_event [8] = absorbed - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i end end - + end ------------------------------------------------------------------------------------------------ --timer - + if (not este_jogador.iniciar_hps) then - + este_jogador:Iniciar (true) --inicia o hps do jogador - + if (meu_dono and not meu_dono.iniciar_hps) then meu_dono:Iniciar (true) if (meu_dono.end_time) then @@ -2362,7 +2362,7 @@ meu_dono.start_time = _tempo end end - + if (este_jogador.end_time) then --o combate terminou, reabrir o tempo este_jogador.end_time = nil else @@ -2373,19 +2373,19 @@ ------------------------------------------------------------------------------------------------ --add amount - + --actor target - + if (cura_efetiva > 0) then - + --combat total _current_total [2] = _current_total [2] + cura_efetiva - + --actor healing amount - este_jogador.total = este_jogador.total + cura_efetiva + este_jogador.total = este_jogador.total + cura_efetiva este_jogador.total_without_pet = este_jogador.total_without_pet + cura_efetiva - - --healing taken + + --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 @@ -2401,19 +2401,19 @@ 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 este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + cura_efetiva end - + if (meu_dono) then meu_dono.last_event = _tempo end - + if (overhealing > 0) then este_jogador.totalover = este_jogador.totalover + overhealing este_jogador.targets_overheal [alvo_name] = (este_jogador.targets_overheal [alvo_name] or 0) + overhealing - + if (meu_dono) then meu_dono.totalover = meu_dono.totalover + overhealing end @@ -2430,12 +2430,12 @@ _detalhes.spell_school_cache [spellname] = spelltype or school end end - + if (_is_storing_cleu) then _current_combat_cleu_events [_current_combat_cleu_events.n] = {_tempo, _token_ids [token] or 0, who_name, alvo_name or "", spellid, amount} _current_combat_cleu_events.n = _current_combat_cleu_events.n + 1 end - + if (is_shield) then --return spell:Add (alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true) return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true) @@ -2446,7 +2446,7 @@ end 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 local este_jogador, meu_dono = healing_cache [who_serial] if (not este_jogador) then --pode ser um desconhecido ou um pet @@ -2463,19 +2463,19 @@ healing_cache [alvo_serial] = jogador_alvo end end - - este_jogador.last_event = _tempo + + este_jogador.last_event = _tempo local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + local i = t.n - + 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 @@ -2484,24 +2484,24 @@ this_event [6] = who_name --source name this_event [7] = is_shield this_event [8] = absorbed - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i end - + local spell = este_jogador.spells._ActorTable [spellid] if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) spell.neutral = true end - + return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, absorbed + amount - overhealing, who_name, absorbed, critical, overhealing, nil) end - + ----------------------------------------------------------------------------------------------------------------------------------------- --BUFFS & DEBUFFS search key: ~buff ~aura ~shield | ----------------------------------------------------------------------------------------------------------------------------------------- @@ -2512,13 +2512,13 @@ if (not alvo_name) then alvo_name = "[*] Unknown shield target" - elseif (not who_name) then + elseif (not who_name) then --no actor name, use spell name instead who_name = "[*] " .. spellname who_flags = 0xa48 who_serial = "" - end - + end + ------------------------------------------------------------------------------------------------ --spell reflection if (reflection_spellid[spellid]) then --~reflect @@ -2541,7 +2541,7 @@ if (tipo == "BUFF") then ------------------------------------------------------------------------------------------------ --buff uptime - + if (LIB_OPEN_RAID_BLOODLUST and LIB_OPEN_RAID_BLOODLUST[spellid]) then if (_detalhes.playername == alvo_name) then _current_combat.bloodlust = _current_combat.bloodlust or {} @@ -2555,11 +2555,11 @@ ignore_death [who_name] = true --end) return - + elseif (spellid == SPELLID_MONK_GUARD) then --BfA monk talent monk_guard_talent [who_serial] = amount - + elseif (spellid == SPELLID_NECROMANCER_CHEAT_DEATH) then necro_cheat_deaths[who_serial] = true end @@ -2580,7 +2580,7 @@ if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then --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 --um pet colocando uma aura do dono parser:add_buff_uptime (token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_IN") @@ -2589,15 +2589,15 @@ parser:add_buff_uptime(token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_IN") end end - + ------------------------------------------------------------------------------------------------ --healing done absorbs if (absorb_spell_list [spellid] and _recording_healing and amount) then - if (not escudo [alvo_name]) then + if (not escudo [alvo_name]) then escudo [alvo_name] = {} escudo [alvo_name] [spellid] = {} escudo [alvo_name] [spellid] [who_name] = amount - elseif (not escudo [alvo_name] [spellid]) then + elseif (not escudo [alvo_name] [spellid]) then escudo [alvo_name] [spellid] = {} escudo [alvo_name] [spellid] [who_name] = amount else @@ -2625,7 +2625,7 @@ TBC_JudgementOfLightCache[alvo_name] = {who_serial, who_name, who_flags} end end - + ------------------------------------------------------------------------------------------------ --spell reflection if (who_serial == alvo_serial and not reflection_ignore[spellid]) then @@ -2634,7 +2634,7 @@ reflection_debuffs[who_serial] = reflection_debuffs[who_serial] or {} reflection_debuffs[who_serial][spellid] = true end - + if (spellid == SPELLID_BARGAST_DEBUFF) then --REMOVE ON 10.0 bargastBuffs[alvo_serial] = (bargastBuffs[alvo_serial] or 0) + 1 end @@ -2644,24 +2644,24 @@ ------------------------------------------------------------------------------------------------ --buff uptime if (_recording_buffs_and_debuffs) then - + if (cc_spell_list [spellid]) then parser:add_cc_done (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) end - + if ((bitfield_debuffs[spellname] or bitfield_debuffs[spellid]) and raid_members_cache[alvo_serial]) then bitfield_swap_cache[alvo_serial] = true end - + if (raid_members_cache [who_serial]) then --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 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 - + if (_recording_ability_with_buffs) then if (who_name == _detalhes.playername) then @@ -2671,9 +2671,9 @@ SoloDebuffUptime = {} _current_combat.SoloDebuffUptime = SoloDebuffUptime end - + local ThisDebuff = SoloDebuffUptime [spellid] - + if (not ThisDebuff) then ThisDebuff = {name = spellname, duration = 0, start = _tempo, castedAmt = 1, refreshAmt = 0, droppedAmt = 0, Active = true} SoloDebuffUptime [spellid] = ThisDebuff @@ -2682,64 +2682,64 @@ ThisDebuff.start = _tempo ThisDebuff.Active = true end - + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (not SoloDebuffPower) then SoloDebuffPower = {} _current_combat.SoloDebuffPower = SoloDebuffPower end - + local ThisDebuff = SoloDebuffPower [spellid] if (not ThisDebuff) then ThisDebuff = {} SoloDebuffPower [spellid] = ThisDebuff end - + local ThisDebuffOnTarget = ThisDebuff [alvo_serial] - + local base, posBuff, negBuff = UnitAttackPower ("player") local AttackPower = base+posBuff+negBuff local base, posBuff, negBuff = UnitRangedAttackPower ("player") local RangedAttackPower = base+posBuff+negBuff local SpellPower = GetSpellBonusDamage (3) - + --record buffs active on player when the debuff was applied local BuffsOn = {} - for BuffName, BuffTable in _pairs (_detalhes.Buffs.BuffsTable) do + for BuffName, BuffTable in _pairs(_detalhes.Buffs.BuffsTable) do if (BuffTable.active) then BuffsOn [#BuffsOn+1] = BuffName end end - + if (not ThisDebuffOnTarget) then --apply - ThisDebuff [alvo_serial] = {power = math.max (AttackPower, RangedAttackPower, SpellPower), onTarget = true, buffs = BuffsOn} + ThisDebuff [alvo_serial] = {power = math.max(AttackPower, RangedAttackPower, SpellPower), onTarget = true, buffs = BuffsOn} else --re applying - ThisDebuff [alvo_serial].power = math.max (AttackPower, RangedAttackPower, SpellPower) + 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") - + end end end end end - + -- ~crowd control ~ccdone 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 - + _current_misc_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors - + --main actor local este_jogador, meu_dono = misc_cache [who_name] if (not este_jogador) then --pode ser um desconhecido ou um pet @@ -2748,58 +2748,58 @@ misc_cache [who_name] = este_jogador end end - + ------------------------------------------------------------------------------------------------ --build containers on the fly - + if (not este_jogador.cc_done) then este_jogador.cc_done = _detalhes:GetOrderNumber() este_jogador.cc_done_spells = container_habilidades:NovoContainer (container_misc) este_jogador.cc_done_targets = {} - end + end ------------------------------------------------------------------------------------------------ --add amount - + --update last event este_jogador.last_event = _tempo - + --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 local spell = este_jogador.cc_done_spells._ActorTable [spellid] if (not spell) then spell = este_jogador.cc_done_spells:PegaHabilidade (spellid, true) end - + spell.targets [alvo_name] = (spell.targets [alvo_name] or 0) + 1 spell.counter = spell.counter + 1 - + --add the crowd control for the pet owner if (meu_dono) then - + if (not meu_dono.cc_done) then meu_dono.cc_done = _detalhes:GetOrderNumber() meu_dono.cc_done_spells = container_habilidades:NovoContainer (container_misc) meu_dono.cc_done_targets = {} end - + --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 local spell = meu_dono.cc_done_spells._ActorTable [spellid] if (not spell) then spell = meu_dono.cc_done_spells:PegaHabilidade (spellid, true) end - + spell.targets [alvo_name] = (spell.targets [alvo_name] or 0) + 1 spell.counter = spell.counter + 1 end - + --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 @@ -2822,7 +2822,7 @@ --handle shields if (tipo == "BUFF") then - + ------------------------------------------------------------------------------------------------ --buff uptime if (_recording_buffs_and_debuffs) then @@ -2846,16 +2846,16 @@ escudo [alvo_name][spellid][who_name] = amount -- refresh j� vem o valor atualizado return end - + --escudo antigo � dropado, novo � posto local overheal = escudo [alvo_name][spellid][who_name] escudo [alvo_name][spellid][who_name] = amount - + if (overheal > 0) then 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 (overheal), 0, nil, true) end end - + --buff refresh if (isTBC) then if (SHAMAN_EARTHSHIELD_BUFF[spellid]) then @@ -2871,7 +2871,7 @@ elseif (_recording_self_buffs) then if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --foi colocado pelo player - + local bufftable = _detalhes.Buffs.BuffsTable [spellname] if (bufftable) then return bufftable:UpdateBuff ("refresh") @@ -2914,10 +2914,10 @@ 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 - + if (_recording_ability_with_buffs) then if (who_name == _detalhes.playername) then - + --record debuff uptime local SoloDebuffUptime = _current_combat.SoloDebuffUptime if (SoloDebuffUptime) then @@ -2926,12 +2926,12 @@ ThisDebuff.refreshAmt = ThisDebuff.refreshAmt + 1 ThisDebuff.duration = ThisDebuff.duration + (_tempo - ThisDebuff.start) ThisDebuff.start = _tempo - + --send event for plugins _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end - + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (SoloDebuffPower) then @@ -2944,23 +2944,23 @@ local base, posBuff, negBuff = UnitRangedAttackPower ("player") local RangedAttackPower = base+posBuff+negBuff local SpellPower = GetSpellBonusDamage (3) - + local BuffsOn = {} - for BuffName, BuffTable in _pairs (_detalhes.Buffs.BuffsTable) do + for BuffName, BuffTable in _pairs(_detalhes.Buffs.BuffsTable) do if (BuffTable.active) then BuffsOn [#BuffsOn+1] = BuffName end end - - ThisDebuff [alvo_serial].power = math.max (AttackPower, RangedAttackPower, SpellPower) + + ThisDebuff [alvo_serial].power = math.max(AttackPower, RangedAttackPower, SpellPower) ThisDebuff [alvo_serial].buffs = BuffsOn - + --send event for plugins _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end end end - + end end end @@ -2972,7 +2972,7 @@ ------------------------------------------------------------------------------------------------ --handle shields - + if (tipo == "BUFF") then ------------------------------------------------------------------------------------------------ @@ -2989,14 +2989,14 @@ parser:add_buff_uptime(token, time, alvo_serial, alvo_name, alvo_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, "BUFF_UPTIME_OUT") end end - + if (spellid == SPELLID_MONK_GUARD) then --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) end - + elseif (spellid == SPELLID_NECROMANCER_CHEAT_DEATH) then --remove on 10.0 necro_cheat_deaths[who_serial] = nil end @@ -3022,7 +3022,7 @@ if (spellid == SPELLID_KYRIAN_DRUID and alvo_name) then druid_kyrian_bounds[alvo_name] = nil end - + ------------------------------------------------------------------------------------------------ --healing done (shields) if (absorb_spell_list [spellid] and _recording_healing) then @@ -3030,7 +3030,7 @@ if (escudo [alvo_name] and escudo [alvo_name][spellid] and escudo [alvo_name][spellid][who_name]) then if (amount) then - -- o amount � o que sobrou do escudo + -- o amount � o que sobrou do escudo --local overheal = escudo [alvo_name][spellid][who_name] --usando o 'amount' passado pela função --overheal não esta dando refresh quando um valor é adicionado ao escudo escudo [alvo_name][spellid][who_name] = 0 @@ -3046,25 +3046,25 @@ escudo [alvo_name][spellid][who_name] = 0 end - + ------------------------------------------------------------------------------------------------ --recording buffs elseif (_recording_self_buffs) then if (who_name == _detalhes.playername or alvo_name == _detalhes.playername) then --foi colocado pelo player - + local bufftable = _detalhes.Buffs.BuffsTable [spellname] if (bufftable) then return bufftable:UpdateBuff ("remove") else return false - end - end + end + end end ------------------------------------------------------------------------------------------------ --recording debuffs applied by player elseif (tipo == "DEBUFF") then - + --Eye of Corruption 8.3 REMOVE ON 9.0 if (spellid == 315161) then local enemyName = GetSpellInfo(315161) @@ -3076,7 +3076,7 @@ TBC_JudgementOfLightCache[alvo_name] = nil end end - + ------------------------------------------------------------------------------------------------ --spell reflection if (reflection_dispels[alvo_serial] and reflection_dispels[alvo_serial][spellid]) then @@ -3099,7 +3099,7 @@ reflection_dispels[alvo_serial] = nil end end - + ------------------------------------------------------------------------------------------------ --spell reflection if (reflection_debuffs[who_serial] and reflection_debuffs[who_serial][spellid]) then @@ -3110,7 +3110,7 @@ reflection_debuffs[who_serial] = nil end end - + if (_in_combat) then ------------------------------------------------------------------------------------------------ --buff uptime @@ -3122,15 +3122,15 @@ 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 - + if ((bitfield_debuffs[spellname] or bitfield_debuffs[spellid]) and alvo_serial) then bitfield_swap_cache[alvo_serial] = nil end - + if (_recording_ability_with_buffs) then - + if (who_name == _detalhes.playername) then - + --record debuff uptime local SoloDebuffUptime = _current_combat.SoloDebuffUptime local sendevent = false @@ -3144,7 +3144,7 @@ sendevent = true end end - + --record debuff spell and attack power local SoloDebuffPower = _current_combat.SoloDebuffPower if (SoloDebuffPower) then @@ -3154,7 +3154,7 @@ sendevent = true end end - + if (sendevent) then _detalhes:SendEvent("BUFF_UPDATE_DEBUFFPOWER") end @@ -3169,7 +3169,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------- 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 return @@ -3177,7 +3177,7 @@ --no actor name, use spell name instead who_name = "[*] "..spellname end - + ------------------------------------------------------------------------------------------------ --get actors --nome do debuff ser� usado para armazenar o nome do ator @@ -3186,10 +3186,10 @@ este_jogador = _current_misc_container:PegarCombatente (who_serial, spellname, who_flags, true) misc_cache [spellname] = este_jogador end - + ------------------------------------------------------------------------------------------------ --build containers on the fly - + if (not este_jogador.debuff_uptime) then este_jogador.boss_debuff = true este_jogador.damage_twin = who_name @@ -3199,20 +3199,20 @@ este_jogador.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) este_jogador.debuff_uptime_targets = {} end - + ------------------------------------------------------------------------------------------------ --add amount - + --update last event este_jogador.last_event = _tempo - + --actor target local este_alvo = este_jogador.debuff_uptime_targets [alvo_name] if (not este_alvo) then este_alvo = _detalhes.atributo_misc:CreateBuffTargetObject() este_jogador.debuff_uptime_targets [alvo_name] = este_alvo end - + if (in_out == "DEBUFF_UPTIME_IN") then este_alvo.actived = true este_alvo.activedamt = este_alvo.activedamt + 1 @@ -3221,24 +3221,24 @@ este_jogador.debuff_uptime = este_jogador.debuff_uptime + _tempo - este_alvo.actived_at end este_alvo.actived_at = _tempo - + --death log --record death log if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + local i = t.n - + local this_event = t [i] - + if (not this_event) then - return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) + 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 [3] = 1 @@ -3249,16 +3249,16 @@ this_event [8] = false this_event [9] = false this_event [10] = false - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i - end + end end - + elseif (in_out == "DEBUFF_UPTIME_REFRESH") then if (este_alvo.actived_at and este_alvo.actived) then este_alvo.uptime = este_alvo.uptime + _tempo - este_alvo.actived_at @@ -3266,28 +3266,28 @@ end este_alvo.actived_at = _tempo este_alvo.actived = true - + --death log - + --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 if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0 local t = last_events_cache [alvo_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + local i = t.n - + local this_event = t [i] - + if (not this_event) then - return print ("Parser Event Error -> Set to 16 DeathLogs and /reload", i, _death_event_amt) + 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 [3] = stack_amount or 1 @@ -3298,24 +3298,24 @@ this_event [8] = false this_event [9] = false this_event [10] = false - + i = i + 1 - + if (i == _death_event_amt+1) then t.n = 1 else t.n = i end end - + 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 end - + este_alvo.activedamt = este_alvo.activedamt - 1 - + if (este_alvo.activedamt == 0) then este_alvo.actived = false este_alvo.actived_at = nil @@ -3329,9 +3329,9 @@ 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 - + _current_misc_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors local este_jogador = misc_cache [who_name] @@ -3339,19 +3339,19 @@ 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 - + if (not este_jogador.debuff_uptime) then este_jogador.debuff_uptime = 0 este_jogador.debuff_uptime_spells = container_habilidades:NovoContainer (container_misc) este_jogador.debuff_uptime_targets = {} end - + ------------------------------------------------------------------------------------------------ --add amount - + --update last event este_jogador.last_event = _tempo @@ -3361,16 +3361,16 @@ spell = este_jogador.debuff_uptime_spells:PegaHabilidade (spellid, true, "DEBUFF_UPTIME") end return spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out) - + end 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 - + _current_misc_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors local este_jogador = misc_cache [who_name] @@ -3378,19 +3378,19 @@ 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 - + if (not este_jogador.buff_uptime) then este_jogador.buff_uptime = 0 este_jogador.buff_uptime_spells = container_habilidades:NovoContainer (container_misc) este_jogador.buff_uptime_targets = {} - end + end ------------------------------------------------------------------------------------------------ --add amount - + --update last event este_jogador.last_event = _tempo @@ -3400,7 +3400,7 @@ spell = este_jogador.buff_uptime_spells:PegaHabilidade (spellid, true, "BUFF_UPTIME") end return spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, este_jogador, "BUFF_OR_DEBUFF", in_out) - + end ----------------------------------------------------------------------------------------------------------------------------------------- @@ -3435,7 +3435,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_ENERGY] = true, [SPELL_POWER_RUNIC_POWER] = true, } - + local resource_types = { [SPELL_POWER_INSANITY] = true, --shadow priest [SPELL_POWER_CHI] = true, --monk @@ -3449,7 +3449,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_ARCANE_CHARGES] = true, --mage [SPELL_POWER_FURY] = true, --warrior demonhunter dps } - + local resource_power_type = { [SPELL_POWER_COMBO_POINTS2] = SPELL_POWER_ENERGY, --combo points [SPELL_POWER_SOUL_SHARDS] = SPELL_POWER_MANA, --warlock @@ -3463,7 +3463,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_ARCANE_CHARGES] = SPELL_POWER_MANA, --mage [SPELL_POWER_FURY] = SPELL_POWER_RAGE, --warrior } - + _detalhes.resource_strings = { [SPELL_POWER_COMBO_POINTS2] = "Combo Point", [SPELL_POWER_SOUL_SHARDS] = "Soul Shard", @@ -3477,7 +3477,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_ARCANE_CHARGES] = "Arcane Charge", [SPELL_POWER_FURY] = "Rage", } - + _detalhes.resource_icons = { [SPELL_POWER_COMBO_POINTS2] = {file = [[Interface\PLAYERFRAME\ClassOverlayComboPoints]], coords = {58/128, 74/128, 25/64, 39/64}}, [SPELL_POWER_SOUL_SHARDS] = {file = [[Interface\PLAYERFRAME\UI-WARLOCKSHARD]], coords = {3/64, 17/64, 2/128, 16/128}}, @@ -3491,16 +3491,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 [SPELL_POWER_ARCANE_CHARGES] = {file = [[Interface\PLAYERFRAME\MageArcaneCharges]], coords = {68/256, 90/256, 68/128, 91/128}}, [SPELL_POWER_FURY] = {file = [[Interface\PLAYERFRAME\UI-PlayerFrame-Deathknight-Blood-On]], coords = {0, 1, 0, 1}}, } - + local AlternatePowerEnableFrame = CreateFrame("frame") local AlternatePowerMonitorFrame = CreateFrame("frame") - + AlternatePowerEnableFrame:RegisterEvent ("UNIT_POWER_BAR_SHOW") --AlternatePowerEnableFrame:RegisterEvent ("UNIT_POWER_BAR_HIDE") AlternatePowerEnableFrame:RegisterEvent ("ENCOUNTER_END") --AlternatePowerEnableFrame:RegisterEvent ("PLAYER_REGEN_ENABLED") AlternatePowerEnableFrame.IsRunning = false - + AlternatePowerEnableFrame:SetScript("OnEvent", function(self, event) if (event == "UNIT_POWER_BAR_SHOW") then AlternatePowerMonitorFrame:RegisterEvent ("UNIT_POWER_UPDATE") -- 8.0 @@ -3513,7 +3513,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 AlternatePowerMonitorFrame:SetScript("OnEvent", function(self, event, unitID, powerType) if (powerType == "ALTERNATE") then - local actorName = _detalhes:GetCLName (unitID) + local actorName = _detalhes:GetCLName(unitID) if (actorName) then local power = _current_combat.alternate_power [actorName] if (not power) then @@ -3527,14 +3527,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --main actor local este_jogador = energy_cache [actorName] 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) + este_jogador, meu_dono, actorName = _current_energy_container:PegarCombatente (UnitGUID(unitID), actorName, 0x514, true) energy_cache [actorName] = este_jogador end este_jogador.alternatepower = este_jogador.alternatepower + addPower - + _current_energy_container.need_refresh = true end - + power.last = currentPower or 0 end end @@ -3544,11 +3544,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not _in_combat) then return end - - for playerName, powerType in _pairs (auto_regen_cache) do + + for playerName, powerType in _pairs(auto_regen_cache) do local currentPower = UnitPower (playerName, powerType) or 0 local maxPower = UnitPowerMax (playerName, powerType) or 1 - + if (currentPower == maxPower) then --power overflow local energyObject = energy_cache [playerName] @@ -3558,10 +3558,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + -- ~energy ~resource 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 if (not who_name) then @@ -3572,23 +3572,23 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ------------------------------------------------------------------------------------------------ --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 local is_resource, resource_amount, resource_id = resource_power_type [powertype], amount, powertype - + --check if is valid if (not energy_types [powertype] and not is_resource) then return - + elseif (is_resource) then powertype = is_resource amount = 0 end - + overpower = overpower or 0 - + --[[statistics]]-- _detalhes.statistics.energy_calls = _detalhes.statistics.energy_calls + 1 _current_energy_container.need_refresh = true @@ -3608,11 +3608,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 energy_cache [who_name] = este_jogador end end - + if (not este_jogador.powertype) then este_jogador.powertype = powertype end - + --target local jogador_alvo, alvo_dono = energy_cache [alvo_name] if (not jogador_alvo) then @@ -3625,38 +3625,38 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 energy_cache [alvo_name] = jogador_alvo end end - + if (jogador_alvo.powertype ~= este_jogador.powertype) then - --print ("error: different power types: who -> ", este_jogador.powertype, " target -> ", jogador_alvo.powertype) + --print("error: different power types: who -> ", este_jogador.powertype, " target -> ", jogador_alvo.powertype) return end - + este_jogador.last_event = _tempo - + ------------------------------------------------------------------------------------------------ --amount add - + if (not is_resource) then - + --amount = amount - overpower - + --add to targets este_jogador.targets [alvo_name] = (este_jogador.targets [alvo_name] or 0) + amount - + --add to combat total _current_total [3] [powertype] = _current_total [3] [powertype] + amount - - if (este_jogador.grupo) then + + if (este_jogador.grupo) then _current_gtotal [3] [powertype] = _current_gtotal [3] [powertype] + amount end --regen produced amount este_jogador.total = este_jogador.total + amount este_jogador.totalover = este_jogador.totalover + overpower - + --target regenerated amount jogador_alvo.received = jogador_alvo.received + amount - + --owner if (meu_dono) then meu_dono.total = meu_dono.total + amount @@ -3667,10 +3667,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not spell) then spell = este_jogador.spells:PegaHabilidade (spellid, true, token) end - + --return spell:Add (alvo_serial, alvo_name, alvo_flags, amount, who_name, powertype) return spell_energy_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, powertype, overpower) - + else --is a resource este_jogador.resource = este_jogador.resource + resource_amount @@ -3679,21 +3679,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - + ----------------------------------------------------------------------------------------------------------------------------------------- --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 - + _current_misc_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors - + --main actor local este_jogador, meu_dono = misc_cache [who_name] if (not este_jogador) then --pode ser um desconhecido ou um pet @@ -3702,7 +3702,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 misc_cache [who_name] = este_jogador end end - + ------------------------------------------------------------------------------------------------ --build containers on the fly if (not este_jogador.cooldowns_defensive) then @@ -3710,7 +3710,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.cooldowns_defensive_targets = {} este_jogador.cooldowns_defensive_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades end - + ------------------------------------------------------------------------------------------------ --add amount @@ -3719,12 +3719,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --combat totals _current_total [4].cooldowns_defensive = _current_total [4].cooldowns_defensive + 1 - + if (este_jogador.grupo) then _current_gtotal [4].cooldowns_defensive = _current_gtotal [4].cooldowns_defensive + 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 damage_actor = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) @@ -3735,37 +3735,37 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --last events local t = last_events_cache [who_name] - + if (not t) then t = _current_combat:CreateLastEventsTable (who_name) end - + 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 - + i = i + 1 if (i == _death_event_amt+1) then t.n = 1 else t.n = i end - + este_jogador.last_cooldown = {time, spellid} - + end - + end - + --update last event este_jogador.last_event = _tempo - + --actor targets este_jogador.cooldowns_defensive_targets [alvo_name] = (este_jogador.cooldowns_defensive_targets [alvo_name] or 0) + 1 @@ -3774,17 +3774,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 + 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 - + return spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, "BUFF_OR_DEBUFF", "COOLDOWN") end - + --serach key: ~interrupts 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) @@ -3806,7 +3806,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (TrackerCleuDB and TrackerCleuDB.honey_pot) then TrackerCleuDB.honey_pot[spellid] = true end - + _current_misc_container.need_refresh = true ------------------------------------------------------------------------------------------------ @@ -3820,17 +3820,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 misc_cache [who_name] = este_jogador end end - + ------------------------------------------------------------------------------------------------ --build containers on the fly - + if (not este_jogador.interrupt) then este_jogador.interrupt = _detalhes:GetOrderNumber(who_name) este_jogador.interrupt_targets = {} este_jogador.interrupt_spells = container_habilidades:NovoContainer (container_misc) este_jogador.interrompeu_oque = {} end - + ------------------------------------------------------------------------------------------------ --add amount @@ -3839,7 +3839,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --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 @@ -3859,57 +3859,57 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 if (meu_dono) then - + if (not meu_dono.interrupt) then meu_dono.interrupt = _detalhes:GetOrderNumber(who_name) meu_dono.interrupt_targets = {} meu_dono.interrupt_spells = container_habilidades:NovoContainer (container_misc) meu_dono.interrompeu_oque = {} end - + -- adiciona ao total meu_dono.interrupt = meu_dono.interrupt + 1 - + -- adiciona aos alvos meu_dono.interrupt_targets [alvo_name] = (meu_dono.interrupt_targets [alvo_name] or 0) + 1 - + -- update last event meu_dono.last_event = _tempo - + -- spells interrupted meu_dono.interrompeu_oque [extraSpellID] = (meu_dono.interrompeu_oque [extraSpellID] or 0) + 1 - + --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 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 end end - + --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 - + --only capture if is in combat if (not _in_combat) then return end - + if (not who_name) then who_name = "[*] " .. spellname end @@ -3923,20 +3923,20 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --get actors --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] - + if (not este_jogador) then - + este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (who_serial, who_name, who_flags, true) - + if (meu_dono) then --� um pet if (who_serial ~= "") then misc_cache_pets [who_serial] = este_jogador misc_cache_petsOwners [who_serial] = meu_dono end - + --conferir se o dono j� esta no cache if (not misc_cache [meu_dono.serial] and meu_dono.serial ~= "") then misc_cache [meu_dono.serial] = meu_dono @@ -3947,7 +3947,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + ------------------------------------------------------------------------------------------------ --build containers on the fly local spell_cast = este_jogador.spell_cast @@ -3956,10 +3956,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 else spell_cast [spellid] = (spell_cast [spellid] or 0) + 1 end - + ------------------------------------------------------------------------------------------------ --record cooldowns cast which can't track with buff applyed. - + --foi um jogador que castou if (raid_members_cache [who_serial]) then --check if is a cooldown :D @@ -3968,17 +3968,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not alvo_name) then if (DetailsFramework.CooldownsDeffense [spellid]) then alvo_name = who_name - + elseif (DetailsFramework.CooldownsRaid [spellid]) then alvo_name = Loc ["STRING_RAID_WIDE"] - + else alvo_name = "--x--x--" end end return parser:add_defensive_cooldown (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname) end - + else --enemy successful casts (not interrupted) if (_bit_band (who_flags, 0x00000040) ~= 0 and who_name) then --byte 2 = 4 (enemy) @@ -3988,7 +3988,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) end - if (este_jogador) then + if (este_jogador) then --actor spells table local spell = este_jogador.spells._ActorTable [spellid] --line where the actor was nil if (not spell) then @@ -4001,13 +4001,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - + --serach key: ~dispell 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 - + --esta dando erro onde o nome � NIL, fazendo um fix para isso if (not who_name) then who_name = "[*] "..extraSpellName @@ -4015,9 +4015,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not alvo_name) then alvo_name = "[*] "..spellid end - + _current_misc_container.need_refresh = true - + ------------------------------------------------------------------------------------------------ --get actors] local este_jogador, meu_dono = misc_cache [who_name] @@ -4038,7 +4038,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.dispell_spells = container_habilidades:NovoContainer (container_misc) este_jogador.dispell_oque = {} end - + ------------------------------------------------------------------------------------------------ --spell reflection if (reflection_dispelid[spellid]) then @@ -4063,19 +4063,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --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 este_jogador.dispell = este_jogador.dispell + 1 - + --dispell what if (extraSpellID) then este_jogador.dispell_oque [extraSpellID] = (este_jogador.dispell_oque [extraSpellID] or 0) + 1 end - + --actor targets este_jogador.dispell_targets [alvo_name] = (este_jogador.dispell_targets [alvo_name] or 0) + 1 @@ -4085,7 +4085,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 if (meu_dono) then if (not meu_dono.dispell) then @@ -4094,7 +4094,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 meu_dono.dispell_spells = container_habilidades:NovoContainer (container_misc) meu_dono.dispell_oque = {} end - + meu_dono.dispell = meu_dono.dispell + 1 meu_dono.dispell_targets [alvo_name] = (meu_dono.dispell_targets [alvo_name] or 0) + 1 @@ -4116,7 +4116,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_bit_band (who_flags, AFFILIATION_GROUP) == 0) then return end - + --do not register ress if not in combat if (not Details.in_combat) then return @@ -4144,7 +4144,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.ress_targets = {} este_jogador.ress_spells = container_habilidades:NovoContainer (container_misc) --cria o container das habilidades usadas para interromper end - + ------------------------------------------------------------------------------------------------ --add amount @@ -4153,50 +4153,50 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --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 + end --add ress amount este_jogador.ress = este_jogador.ress + 1 - + --add battle ress - if (_UnitAffectingCombat (who_name)) then + if (_UnitAffectingCombat (who_name)) then --procura a �ltima morte do alvo na tabela do combate: - for i = 1, #_current_combat.last_events_tables do + 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 end - - if (not jaTem) then + + if (not jaTem) then _table_insert (_current_combat.last_events_tables [i] [1], 1, { 2, - spellid, - 1, - time, - _UnitHealth (alvo_name), - who_name + spellid, + 1, + time, + _UnitHealth (alvo_name), + who_name }) break end end 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 - + end + --actor targets este_jogador.ress_targets [alvo_name] = (este_jogador.ress_targets [alvo_name] or 0) + 1 @@ -4214,14 +4214,14 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ------------------------------------------------------------------------------------------------ --early checks and fixes if (not cc_spell_list [spellid]) then - return - --print ("NO CC:", spellid, spellname, extraSpellID, extraSpellName) + return + --print("NO CC:", spellid, spellname, extraSpellID, extraSpellName) end if (_bit_band (who_flags, AFFILIATION_GROUP) == 0) then return end - + if (not spellname) then spellname = "Melee" end @@ -4229,7 +4229,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not alvo_name) then --no target name, just quit return - + elseif (not who_name) then --no actor name, use spell name instead who_name = "[*] " .. spellname @@ -4249,10 +4249,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 misc_cache [who_name] = este_jogador end end - + ------------------------------------------------------------------------------------------------ --build containers on the fly - + if (not este_jogador.cc_break) then --constr�i aqui a tabela dele este_jogador.cc_break = _detalhes:GetOrderNumber(who_name) @@ -4260,7 +4260,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 este_jogador.cc_break_spells = container_habilidades:NovoContainer (container_misc) este_jogador.cc_break_oque = {} end - + ------------------------------------------------------------------------------------------------ --add amount @@ -4272,7 +4272,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (este_jogador.grupo) then _current_combat.totals_grupo[4].cc_break = _current_combat.totals_grupo[4].cc_break+1 - end + end --add amount este_jogador.cc_break = este_jogador.cc_break + 1 @@ -4296,19 +4296,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ------------------------------------------------------------------------------------------------ --early checks and fixes - + if (not alvo_name) then return end ------------------------------------------------------------------------------------------------ --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 - + --rules for specific encounters if (_current_encounter_id == 2412) then --The Council of Blood --REMOVE ON v10.0 @@ -4338,7 +4338,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local bossName = _G.UnitName(unitId) local bossSerial = _G.UnitGUID(unitId) - if (bossHealth and bossHealth > 100000) then + if (bossHealth and bossHealth > 100000) then if (bossSerial) then local bossNpcId = Details:GetNpcIdFromGuid(bossSerial) if (bossNpcId and bossNpcId ~= bossDeadNpcId) then @@ -4354,26 +4354,26 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --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 end - + if (not _current_combat.frags [alvo_name]) then _current_combat.frags [alvo_name] = 1 else _current_combat.frags [alvo_name] = _current_combat.frags [alvo_name] + 1 end - + _current_combat.frags_need_refresh = true --player death elseif (not UnitIsFeignDeath (alvo_name)) then if ( --player in your group - (_bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 or (damageActor and damageActor.grupo)) and + (_bit_band (alvo_flags, AFFILIATION_GROUP) ~= 0 or (damageActor and damageActor.grupo)) and --must be a player - _bit_band (alvo_flags, OBJECT_TYPE_PLAYER) ~= 0 and + _bit_band (alvo_flags, OBJECT_TYPE_PLAYER) ~= 0 and --must be in combat _in_combat ) then @@ -4384,11 +4384,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end _current_misc_container.need_refresh = true - + --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 local thisPlayer, meu_dono = misc_cache [alvo_name] if (not thisPlayer) then --pode ser um desconhecido ou um pet @@ -4400,15 +4400,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --objeto da morte local esta_morte = {} - + --add events local t = last_events_cache [alvo_name] if (not t) then t = _current_combat:CreateLastEventsTable (alvo_name) end - + --lesses index = older / higher index = newer - + local last_index = t.n --or 'next index' if (last_index < _death_event_amt+1 and not t[last_index][4]) then for i = 1, last_index-1 do @@ -4428,7 +4428,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + 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 @@ -4448,10 +4448,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 maxHealth if (thisPlayer.arena_enemy) then --this is an arena enemy, get the heal with the unit Id @@ -4477,32 +4477,32 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --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 - _detalhes:Msg ("error occurred on a death hook function:", errortext) + _detalhes:Msg("error occurred on a death hook function:", errortext) end end end --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 + if (mythicLevel and type(mythicLevel) == "number" and mythicLevel >= 2) then --several checks to be future proof --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 --first copy the table local overallDeathTable = DetailsFramework.table.copy({}, t) - + --get the elapsed time local timeElapsed = _GetTime() - _detalhes.tabela_overall:GetStartTime() local minutos, segundos = _math_floor(timeElapsed/60), _math_floor(timeElapsed%60) - + overallDeathTable [6] = minutos.."m "..segundos.."s" overallDeathTable.dead_at = timeElapsed - + _table_insert(_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable) end end @@ -4514,9 +4514,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end function parser:environment (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, env_type, amount) - + local spelid - + if (env_type == "Falling") then who_name = ENVIRONMENTAL_FALLING_NAME spelid = 3 @@ -4536,13 +4536,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 who_name = ENVIRONMENTAL_SLIME_NAME 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 end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --core - + function parser:WipeSourceCache() wipe (monk_guard_talent) end @@ -4559,23 +4559,23 @@ 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 end return true end - + function _detalhes:CaptureIsEnabled (capture) if (_detalhes.capture_real [capture]) then return true end return false 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 @@ -4583,7 +4583,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + function _detalhes:CaptureGet (capture_type) return _detalhes.capture_real [capture_type] end @@ -4593,7 +4593,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (on_off == nil) then on_off = _detalhes.capture_real [capture_type] end - + if (real) then --hard switch _detalhes.capture_real [capture_type] = on_off @@ -4603,31 +4603,31 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.capture_current [capture_type] = on_off if (time) then local schedule_id = math.random (1, 10000000) - local new_schedule = _detalhes:ScheduleTimer ("CaptureTimeout", time, {capture_type, schedule_id}) + local new_schedule = _detalhes:ScheduleTimer("CaptureTimeout", time, {capture_type, schedule_id}) tinsert(_detalhes.capture_schedules, {new_schedule, schedule_id}) end end - + _detalhes:CaptureRefresh() end function _detalhes:CancelAllCaptureSchedules() for i = 1, #_detalhes.capture_schedules do - local schedule_table, schedule_id = unpack (_detalhes.capture_schedules[i]) - _detalhes:CancelTimer (schedule_table) + local schedule_table, schedule_id = unpack(_detalhes.capture_schedules[i]) + _detalhes:CancelTimer(schedule_table) end - _table_wipe (_detalhes.capture_schedules) + _table_wipe(_detalhes.capture_schedules) end - + function _detalhes:CaptureTimeout (table) - local capture_type, schedule_id = unpack (table) + local capture_type, schedule_id = unpack(table) _detalhes.capture_current [capture_type] = _detalhes.capture_real [capture_type] _detalhes:CaptureRefresh() - + for index, table in ipairs(_detalhes.capture_schedules) do local id = table [2] if (schedule_id == id) then - tremove (_detalhes.capture_schedules, index) + tremove(_detalhes.capture_schedules, index) break end end @@ -4636,7 +4636,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes:CaptureDisable (capture_type) capture_type = string.lower (capture_type) - + if (capture_type == "damage") then token_list ["SPELL_PERIODIC_DAMAGE"] = nil token_list ["SPELL_EXTRA_ATTACKS"] = nil @@ -4653,28 +4653,28 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 token_list ["DAMAGE_SHIELD_MISSED"] = nil token_list ["ENVIRONMENTAL_DAMAGE"] = nil token_list ["SPELL_BUILDING_DAMAGE"] = nil - + elseif (capture_type == "heal") then token_list ["SPELL_HEAL"] = nil token_list ["SPELL_PERIODIC_HEAL"] = nil token_list ["SPELL_HEAL_ABSORBED"] = nil token_list ["SPELL_ABSORBED"] = nil _recording_healing = false - + elseif (capture_type == "aura") then token_list ["SPELL_AURA_APPLIED"] = parser.buff token_list ["SPELL_AURA_REMOVED"] = parser.unbuff token_list ["SPELL_AURA_REFRESH"] = parser.buff_refresh token_list ["SPELL_AURA_APPLIED_DOSE"] = parser.buff_refresh _recording_buffs_and_debuffs = false - + elseif (capture_type == "energy") then token_list ["SPELL_ENERGIZE"] = nil token_list ["SPELL_PERIODIC_ENERGIZE"] = nil - + elseif (capture_type == "spellcast") then token_list ["SPELL_CAST_SUCCESS"] = nil - + elseif (capture_type == "miscdata") then -- dispell token_list ["SPELL_DISPEL"] = nil @@ -4689,7 +4689,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- dead token_list ["UNIT_DIED"] = nil token_list ["UNIT_DESTROYED"] = nil - + end end @@ -4699,7 +4699,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --SPELL_PERIODIC_LEECH --need research --SPELL_DISPEL_FAILED --need research --SPELL_BUILDING_HEAL --need research - + function _detalhes:CaptureEnable (capture_type) capture_type = string.lower (capture_type) @@ -4756,7 +4756,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- dead token_list ["UNIT_DIED"] = parser.dead token_list ["UNIT_DESTROYED"] = parser.dead - + end end @@ -4783,7 +4783,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ["interrupt"] = parser.interrupt, ["dead"] = parser.dead, } - + function parser:SetParserFunction (token, func) if (parser.original_functions [token]) then if (type(func) == "function") then @@ -4793,10 +4793,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end parser:RefreshFunctions() else - return _detalhes:Msg ("Invalid Token for SetParserFunction.") + return _detalhes:Msg("Invalid Token for SetParserFunction.") end end - + local all_parser_tokens = { ["SPELL_PERIODIC_DAMAGE"] = "spell_dmg", ["SPELL_EXTRA_ATTACKS"] = "spell_dmg_extra_attacks", @@ -4825,7 +4825,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ["SPELL_AURA_APPLIED_DOSE"] = "buff_refresh", ["SPELL_ENERGIZE"] = "energize", ["SPELL_PERIODIC_ENERGIZE"] = "energize", - + ["SPELL_CAST_SUCCESS"] = "spellcast", ["SPELL_DISPEL"] = "dispell", ["SPELL_STOLEN"] = "dispell", @@ -4836,7 +4836,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ["UNIT_DIED"] = "dead", ["UNIT_DESTROYED"] = "dead", } - + function parser:RefreshFunctions() for CLUE_ID, token in pairs(all_parser_tokens) do if (token_list [CLUE_ID]) then --not disabled @@ -4844,47 +4844,47 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + function _detalhes:CallWipe (from_slash) if (_detalhes.wipe_called) then if (from_slash) then - return _detalhes:Msg (Loc ["STRING_WIPE_ERROR1"]) + return _detalhes:Msg(Loc ["STRING_WIPE_ERROR1"]) else return end elseif (not _detalhes.encounter_table.id) then if (from_slash) then - return _detalhes:Msg (Loc ["STRING_WIPE_ERROR2"]) + return _detalhes:Msg(Loc ["STRING_WIPE_ERROR2"]) else return end end - + local eTable = _detalhes.encounter_table - + --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 _detalhes.wipe_called = true - + --cancel the on going captures schedules _detalhes:CancelAllCaptureSchedules() - + --disable it _detalhes:CaptureSet (false, "damage", false) _detalhes:CaptureSet (false, "energy", false) _detalhes:CaptureSet (false, "aura", false) _detalhes:CaptureSet (false, "energy", false) _detalhes:CaptureSet (false, "spellcast", false) - + if (from_slash) then if (UnitIsGroupLeader ("player")) then _detalhes:SendHomeRaidData ("WI") end end - + local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then lower_instance = _detalhes:GetInstance(lower_instance) @@ -4892,7 +4892,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end else if (from_slash) then - return _detalhes:Msg (Loc ["STRING_WIPE_ERROR3"]) + return _detalhes:Msg(Loc ["STRING_WIPE_ERROR3"]) else return end @@ -4902,7 +4902,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 -- PARSER --serach key: ~parser ~events ~start ~inicio - + function _detalhes:FlagCurrentCombat() if (_detalhes.is_in_battleground) then _detalhes.tabela_vigente.pvp = true @@ -4912,7 +4912,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.tabela_vigente.is_arena = {name = _detalhes.zone_name, zone = _detalhes.zone_name, mapid = _detalhes.zone_id} end end - + function _detalhes:GetZoneType() return _detalhes.zone_type end @@ -4920,22 +4920,22 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...) return Details.Schedules.After(1, Details.Check_ZONE_CHANGED_NEW_AREA) end - + --~zone ~area function _detalhes:Check_ZONE_CHANGED_NEW_AREA() local zoneName, zoneType, _, _, _, _, _, zoneMapID = GetInstanceInfo() - + _detalhes.zone_type = zoneType _detalhes.zone_id = zoneMapID _detalhes.zone_name = zoneName _in_resting_zone = IsResting() - + parser:WipeSourceCache() - + _is_in_instance = false - + if (zoneType == "party" or zoneType == "raid") then _is_in_instance = true @@ -4944,24 +4944,24 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details:Msg("and if you wanna help, you may post them on Details! discord as well.") end end - + if (_detalhes.last_zone_type ~= zoneType) then _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 end end - + _detalhes.time_type = _detalhes.time_type_original - + if (_detalhes.debug) then - _detalhes:Msg ("(debug) zone change:", _detalhes.zone_name, "is a", _detalhes.zone_type, "zone.") + _detalhes:Msg("(debug) zone change:", _detalhes.zone_name, "is a", _detalhes.zone_type, "zone.") end - + if (_detalhes.is_in_arena and zoneType ~= "arena") then _detalhes:LeftArena() end @@ -4972,29 +4972,29 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.is_in_battleground = nil _detalhes.time_type = _detalhes.time_type_original end - + if (zoneType == "pvp") then --battlegrounds if (_detalhes.debug) then - _detalhes:Msg ("(debug) zone type is now 'pvp'.") + _detalhes:Msg("(debug) zone type is now 'pvp'.") end if(not _detalhes.is_in_battleground and _detalhes.overall_clear_pvp) then _detalhes.tabela_historico:resetar_overall() end - + _detalhes.is_in_battleground = true - + if (_in_combat and not _current_combat.pvp) then _detalhes:SairDoCombate() end - + if (not _in_combat) then _detalhes:EntrarEmCombate() end - + _current_combat.pvp = true _current_combat.is_pvp = {name = zoneName, mapid = zoneMapID} - + if (_detalhes.use_battleground_server_parser) then if (_detalhes.time_type == 1) then _detalhes.time_type_original = 1 @@ -5009,18 +5009,18 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end Details.lastBattlegroundStartTime = GetTime() - + elseif (zoneType == "arena") then - + if (_detalhes.debug) then - _detalhes:Msg ("(debug) zone type is now 'arena'.") + _detalhes:Msg("(debug) zone type is now 'arena'.") end - + if (_detalhes.force_activity_time_pvp) then _detalhes.time_type_original = _detalhes.time_type _detalhes.time_type = 1 end - + if (not _detalhes.is_in_arena) then if (_detalhes.overall_clear_pvp) then _detalhes.tabela_historico:resetar_overall() @@ -5030,15 +5030,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 wipe (_detalhes.cached_specs) end end - + _detalhes.is_in_arena = true _detalhes:EnteredInArena() - + else local inInstance = IsInInstance() 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 (zoneType == "raid") then if (_detalhes.InstancesToStoreData [zoneMapID]) then @@ -5046,35 +5046,35 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - + if (_detalhes:IsInInstance()) then _detalhes.last_instance = zoneMapID end - - --if (_current_combat.pvp) then + + --if (_current_combat.pvp) then -- _current_combat.pvp = false --end end - - _detalhes:DispatchAutoRunCode ("on_zonechanged") - - _detalhes:SchedulePetUpdate (7) + + _detalhes:DispatchAutoRunCode("on_zonechanged") + + _detalhes:SchedulePetUpdate(7) _detalhes:CheckForPerformanceProfile() end - + function _detalhes.parser_functions:PLAYER_ENTERING_WORLD () return _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA() end - + -- ~encounter --ENCOUNTER START function _detalhes.parser_functions:ENCOUNTER_START(...) if (_detalhes.debug) then - _detalhes:Msg ("(debug) |cFFFFFF00ENCOUNTER_START|r event triggered.") + _detalhes:Msg("(debug) |cFFFFFF00ENCOUNTER_START|r event triggered.") end - + _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 if (_detalhes.latest_ENCOUNTER_END + 10 > _GetTime()) then return @@ -5084,32 +5084,32 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 - - local encounterID, encounterName, difficultyID, raidSize = _select (1, ...) + + local encounterID, encounterName, difficultyID, raidSize = _select(1, ...) local zoneName, _, _, _, _, _, _, zoneMapID = GetInstanceInfo() if (_detalhes.InstancesToStoreData[zoneMapID]) then Details.current_exp_raid_encounters[encounterID] = true end - + if (not _detalhes.WhoAggroTimer and _detalhes.announce_firsthit.enabled) then - _detalhes.WhoAggroTimer = C_Timer.NewTimer (0.5, who_aggro) + _detalhes.WhoAggroTimer = C_Timer.NewTimer(0.5, who_aggro) end - + if (IsInGuild() and IsInRaid() and _detalhes.announce_damagerecord.enabled and _detalhes.StorageLoaded) then - _detalhes.TellDamageRecord = C_Timer.NewTimer (0.6, _detalhes.PrintEncounterRecord) + _detalhes.TellDamageRecord = C_Timer.NewTimer(0.6, _detalhes.PrintEncounterRecord) _detalhes.TellDamageRecord.Boss = encounterID _detalhes.TellDamageRecord.Diff = difficultyID end _current_encounter_id = encounterID _detalhes.boss1_health_percent = 1 - + local dbm_mod, dbm_time = _detalhes.encounter_table.DBM_Mod, _detalhes.encounter_table.DBM_ModTime - _table_wipe (_detalhes.encounter_table) - + _table_wipe(_detalhes.encounter_table) + _detalhes.encounter_table.phase = 1 - + --remove on 10.0 --if (encounterID == 2430) then --Painsmith Raznal spikeball_damage_cache = { @@ -5129,11 +5129,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.encounter_table.size = raidSize _detalhes.encounter_table.zone = zoneName _detalhes.encounter_table.mapid = zoneMapID - + if (dbm_mod and dbm_time == time()) then --pode ser time() � usado no start pra saber se foi no mesmo segundo. _detalhes.encounter_table.DBM_Mod = dbm_mod end - + local encounter_start_table = _detalhes:GetEncounterStartInfo (zoneMapID, encounterID) if (encounter_start_table) then if (encounter_start_table.delay) then @@ -5157,35 +5157,35 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (encounter_table) then _detalhes.encounter_table.index = boss_index end - + _detalhes:SendEvent("COMBAT_ENCOUNTER_START", nil, ...) end - + --ENCOUNRTER_END function _detalhes.parser_functions:ENCOUNTER_END (...) - + if (_detalhes.debug) then - _detalhes:Msg ("(debug) |cFFFFFF00ENCOUNTER_END|r event triggered.") + _detalhes:Msg("(debug) |cFFFFFF00ENCOUNTER_END|r event triggered.") end - + _current_encounter_id = nil - + 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.") + _detalhes:Msg("(debug) the zone type is 'party', ignoring ENCOUNTER_END.") end end - - local encounterID, encounterName, difficultyID, raidSize, endStatus = _select (1, ...) - + + local encounterID, encounterName, difficultyID, raidSize, endStatus = _select(1, ...) + if (not _detalhes.encounter_table.start) then Details:Msg("encounter table without start time.") return end - + _detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0 if (_detalhes.latest_ENCOUNTER_END + 15 > _GetTime()) then return @@ -5193,9 +5193,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.latest_ENCOUNTER_END = _GetTime() _detalhes.encounter_table ["end"] = _GetTime() -- 0.351 - + local _, _, _, _, _, _, _, zoneMapID = GetInstanceInfo() - + if (_in_combat) then if (endStatus == 1) then _detalhes.encounter_table.kill = true @@ -5213,12 +5213,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end _detalhes:SendEvent("COMBAT_ENCOUNTER_END", nil, ...) - - _table_wipe (_detalhes.encounter_table) - _table_wipe (bargastBuffs) --remove on 10.0 - _table_wipe (necro_cheat_deaths) --remove on 10.0 - _table_wipe (dk_pets_cache.army) - _table_wipe (dk_pets_cache.apoc) + + _table_wipe(_detalhes.encounter_table) + _table_wipe(bargastBuffs) --remove on 10.0 + _table_wipe(necro_cheat_deaths) --remove on 10.0 + _table_wipe(dk_pets_cache.army) + _table_wipe(dk_pets_cache.apoc) --remove on 10.0 spikeball from painsmith spikeball_damage_cache = { @@ -5228,10 +5228,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 return true end - + function _detalhes.parser_functions:UNIT_PET (...) _detalhes.container_pets:Unpet (...) - _detalhes:SchedulePetUpdate (1) + _detalhes:SchedulePetUpdate(1) end function _detalhes.parser_functions:PLAYER_REGEN_DISABLED (...) @@ -5241,34 +5241,34 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end _detalhes:EntrarEmCombate() end - + if (not _detalhes:CaptureGet ("damage")) then _detalhes:EntrarEmCombate() end - + --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 + + 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 - - _detalhes:DispatchAutoRunCode ("on_entercombat") - + + _detalhes:DispatchAutoRunCode("on_entercombat") + _detalhes.tabela_vigente.CombatStartedAt = GetTime() end - + --in case the player left the raid during the encounter local check_for_encounter_end = function() if (not _current_encounter_id) then return end - + if (IsInRaid()) then --raid local inCombat = false @@ -5278,11 +5278,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 break end end - + if (not inCombat) then _current_encounter_id = nil end - + elseif (IsInGroup()) then --party (dungeon) local inCombat = false @@ -5292,24 +5292,24 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 break end end - + if (not inCombat) then _current_encounter_id = nil end - + else _current_encounter_id = nil end end - + --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 - _detalhes:Msg ("(debug) running scheduled events after combat end.") + _detalhes:Msg("(debug) running scheduled events after combat end.") end - + TBC_JudgementOfLightCache = { _damageCache = {} } @@ -5319,13 +5319,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.schedule_storage_load = nil _detalhes.ScheduleLoadStorage() end - + --store a boss encounter when out of combat since it might need to load the storage if (_detalhes.schedule_store_boss_encounter) then if (not _detalhes.logoff_saving_data) then local successful, errortext = pcall (Details.Database.StoreEncounter) if (not successful) then - _detalhes:Msg ("error occurred on Details.Database.StoreEncounter():", errortext) + _detalhes:Msg("error occurred on Details.Database.StoreEncounter():", errortext) end end _detalhes.schedule_store_boss_encounter = nil @@ -5335,78 +5335,78 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (not _detalhes.logoff_saving_data) then local successful, errortext = pcall (Details.Database.StoreWipe) if (not successful) then - _detalhes:Msg ("error occurred on Details.Database.StoreWipe():", errortext) + _detalhes:Msg("error occurred on Details.Database.StoreWipe():", errortext) end end Details.schedule_store_boss_encounter_wipe = nil end - + --when a large amount of data has been removed and the player is in combat, schedule to run the hard garbage collector (the blizzard one, not the details! internal) if (_detalhes.schedule_hard_garbage_collect) then if (_detalhes.debug) then - _detalhes:Msg ("(debug) found schedule collectgarbage().") + _detalhes:Msg("(debug) found schedule collectgarbage().") end _detalhes.schedule_hard_garbage_collect = false collectgarbage() end - - for index, instancia in ipairs(_detalhes.tabela_instancias) do + + 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 - + if (not OnRegenEnabled) then - _table_wipe (bitfield_swap_cache) - _detalhes:DispatchAutoRunCode ("on_leavecombat") + _table_wipe(bitfield_swap_cache) + _detalhes:DispatchAutoRunCode("on_leavecombat") end - + if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --code too old and I don't have documentation for it if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop) then _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Stop() end end - + --[=[ code maintenance: disabled deprecated code Feb 2022 --deprecated shcedules do if (_detalhes.schedule_add_to_overall and #_detalhes.schedule_add_to_overall > 0) then --deprecated (combat are now added immediatelly since there's no script run too long) if (_detalhes.debug) then - _detalhes:Msg ("(debug) adding ", #_detalhes.schedule_add_to_overall, "combats in queue to overall data.") + _detalhes:Msg("(debug) adding ", #_detalhes.schedule_add_to_overall, "combats in queue to overall data.") end - + for i = #_detalhes.schedule_add_to_overall, 1, -1 do - local CombatToAdd = tremove (_detalhes.schedule_add_to_overall, i) + local CombatToAdd = tremove(_detalhes.schedule_add_to_overall, i) if (CombatToAdd) then _detalhes.historico:adicionar_overall (CombatToAdd) end end end - + if (_detalhes.schedule_mythicdungeon_trash_merge) then --deprecated (combat are now added immediatelly since there's no script run too long) _detalhes.schedule_mythicdungeon_trash_merge = nil DetailsMythicPlusFrame.MergeTrashCleanup (true) end - + if (_detalhes.schedule_mythicdungeon_endtrash_merge) then --deprecated (combat are now added immediatelly since there's no script run too long) _detalhes.schedule_mythicdungeon_endtrash_merge = nil DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() end - + if (_detalhes.schedule_mythicdungeon_overallrun_merge) then --deprecated (combat are now added immediatelly since there's no script run too long) _detalhes.schedule_mythicdungeon_overallrun_merge = nil DetailsMythicPlusFrame.MergeSegmentsOnEnd() end - + if (_detalhes.schedule_flag_boss_components) then --deprecated (combat are now added immediatelly since there's no script run too long) _detalhes.schedule_flag_boss_components = false _detalhes:FlagActorsOnBossFight() end - + if (_detalhes.schedule_remove_overall) then --deprecated (combat are now added immediatelly since there's no script run too long) if (_detalhes.debug) then - _detalhes:Msg ("(debug) found schedule overall data clean up.") + _detalhes:Msg("(debug) found schedule overall data clean up.") end _detalhes.schedule_remove_overall = false _detalhes.tabela_historico:resetar_overall() @@ -5419,7 +5419,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes:CaptureSet (nil, "aura", true) _detalhes:CaptureSet (nil, "energy", true) _detalhes:CaptureSet (nil, "spellcast", true) - + _detalhes:CaptureSet (false, "damage", false, 10) _detalhes:CaptureSet (false, "energy", false, 10) _detalhes:CaptureSet (false, "aura", false, 10) @@ -5432,36 +5432,34 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end - - function _detalhes.parser_functions:CHALLENGE_MODE_START (...) + + function _detalhes.parser_functions:CHALLENGE_MODE_START(...) --send mythic dungeon start event + print("parser event", "CHALLENGE_MODE_START", ...) local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() if (difficultyID == 8) then _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_START") end - end - - function _detalhes.parser_functions:CHALLENGE_MODE_COMPLETED (...) + + function _detalhes.parser_functions:CHALLENGE_MODE_COMPLETED(...) --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") end - end - function _detalhes.parser_functions:PLAYER_REGEN_ENABLED (...) - + function _detalhes.parser_functions:PLAYER_REGEN_ENABLED(...) if (_detalhes.debug) then - _detalhes:Msg ("(debug) |cFFFFFF00PLAYER_REGEN_ENABLED|r event triggered.") + _detalhes:Msg("(debug) |cFFFFFF00PLAYER_REGEN_ENABLED|r event triggered.") + + print("combat lockdown:", InCombatLockdown()) + print("affecting combat:", UnitAffectingCombat ("player")) - print ("combat lockdown:", InCombatLockdown()) - print ("affecting combat:", UnitAffectingCombat ("player")) - if (_current_encounter_id and IsInInstance()) then - print ("has a encounter ID") - print ("player is dead:", UnitHealth ("player") < 1) + print("has a encounter ID") + print("player is dead:", UnitHealth ("player") < 1) end end @@ -5469,18 +5467,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.LatestCombatDone = GetTime() _detalhes.tabela_vigente.CombatEndedAt = GetTime() _detalhes.tabela_vigente.TotalElapsedCombatTime = _detalhes.tabela_vigente.CombatEndedAt - (_detalhes.tabela_vigente.CombatStartedAt or 0) - - -- - C_Timer.After (10, check_for_encounter_end) + + C_Timer.After(10, check_for_encounter_end) --playing alone, just finish the combat right now - if (not _IsInGroup() and not IsInRaid()) then + if (not _IsInGroup() and not IsInRaid()) then _detalhes.tabela_vigente.playing_solo = true _detalhes:SairDoCombate() - + else --is in a raid or party group - C_Timer.After (1, function() + C_Timer.After(1, function() local inCombat if (IsInRaid()) then --raid @@ -5491,11 +5488,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 break end end - + if (not inCombat) then _detalhes:RunScheduledEventsAfterCombat (true) end - + elseif (IsInGroup()) then --party (dungeon) local inCombat = false @@ -5505,97 +5502,97 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 break end end - + if (not inCombat) then _detalhes:RunScheduledEventsAfterCombat (true) end end end) end - end - + function _detalhes.parser_functions:PLAYER_TALENT_UPDATE() if (IsInGroup() or IsInRaid()) then if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then _detalhes.SendTalentTimer:Cancel() end - _detalhes.SendTalentTimer = C_Timer.NewTimer (11, function() + _detalhes.SendTalentTimer = C_Timer.NewTimer(11, function() _detalhes:SendCharacterData() end) end end - + function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED() - --some parts of details! does call this function, check first for past expansions if (DetailsFramework.IsTimewalkWoW()) then return end - + local specIndex = DetailsFramework.GetSpecialization() if (specIndex) then local specID = DetailsFramework.GetSpecializationInfo (specIndex) if (specID and specID ~= 0) then - local guid = UnitGUID ("player") + local guid = UnitGUID("player") if (guid) then _detalhes.cached_specs [guid] = specID end end end - + if (IsInGroup() or IsInRaid()) then if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then _detalhes.SendTalentTimer:Cancel() end - _detalhes.SendTalentTimer = C_Timer.NewTimer (11, function() + _detalhes.SendTalentTimer = C_Timer.NewTimer(11, function() _detalhes:SendCharacterData() end) end end - + --this is mostly triggered when the player enters in a dual against another player - function _detalhes.parser_functions:UNIT_FACTION (unit) - + 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 return end - + --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) + local serial = UnitGUID(unit) --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) - + 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 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) + 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 enemyPlayer1.grupo = true enemyPlayer1.enemy = true + if (IsInGroup()) then --broadcast the enemy to group members so they can "watch" the damage - end end + if (enemyPlayer2) then enemyPlayer2.grupo = true enemyPlayer2.enemy = true end + if (enemyPlayer3) then enemyPlayer3.grupo = true enemyPlayer3.enemy = true end + if (enemyPlayer4) then enemyPlayer4.grupo = true enemyPlayer4.enemy = true @@ -5604,81 +5601,83 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - - function _detalhes.parser_functions:ROLE_CHANGED_INFORM (...) - if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned ("player")) then + + function _detalhes.parser_functions:ROLE_CHANGED_INFORM(...) + if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then _detalhes:CheckSwitchOnLogon (true) - _detalhes.last_assigned_role = _UnitGroupRolesAssigned ("player") + _detalhes.last_assigned_role = _UnitGroupRolesAssigned("player") end end - - function _detalhes.parser_functions:PLAYER_ROLES_ASSIGNED (...) - if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned ("player")) then + + function _detalhes.parser_functions:PLAYER_ROLES_ASSIGNED(...) + if (_detalhes.last_assigned_role ~= _UnitGroupRolesAssigned("player")) then _detalhes:CheckSwitchOnLogon (true) - _detalhes.last_assigned_role = _UnitGroupRolesAssigned ("player") + _detalhes.last_assigned_role = _UnitGroupRolesAssigned("player") end end - + function _detalhes:InGroup() return _detalhes.in_group end - function _detalhes.parser_functions:GROUP_ROSTER_UPDATE (...) + + function _detalhes.parser_functions:GROUP_ROSTER_UPDATE(...) if (not _detalhes.in_group) then _detalhes.in_group = IsInGroup() or IsInRaid() + if (_detalhes.in_group) then --entrou num grupo _detalhes:IniciarColetaDeLixo (true) _detalhes:WipePets() - _detalhes:SchedulePetUpdate (1) - _detalhes:InstanceCall (_detalhes.AdjustAlphaByContext) - + _detalhes:SchedulePetUpdate(1) + _detalhes:InstanceCall(_detalhes.AdjustAlphaByContext) + _detalhes:CheckSwitchOnLogon() _detalhes:CheckVersion() _detalhes:SendEvent("GROUP_ONENTER") - - _detalhes:DispatchAutoRunCode ("on_groupchange") - + + _detalhes:DispatchAutoRunCode("on_groupchange") + wipe (_detalhes.trusted_characters) - C_Timer.After (5, _detalhes.ScheduleSyncPlayerActorData) + C_Timer.After(5, _detalhes.ScheduleSyncPlayerActorData) end - + else _detalhes.in_group = IsInGroup() or IsInRaid() - + if (not _detalhes.in_group) then --saiu do grupo - _detalhes:IniciarColetaDeLixo (true) + _detalhes:IniciarColetaDeLixo(true) _detalhes:WipePets() - _detalhes:SchedulePetUpdate (1) - _table_wipe (_detalhes.details_users) - _detalhes:InstanceCall (_detalhes.AdjustAlphaByContext) + _detalhes:SchedulePetUpdate(1) + _table_wipe(_detalhes.details_users) + _detalhes:InstanceCall(_detalhes.AdjustAlphaByContext) _detalhes:CheckSwitchOnLogon() _detalhes:SendEvent("GROUP_ONLEAVE") - - _detalhes:DispatchAutoRunCode ("on_groupchange") - + + _detalhes:DispatchAutoRunCode("on_groupchange") + wipe (_detalhes.trusted_characters) + else --ainda esta no grupo - _detalhes:SchedulePetUpdate (2) - + _detalhes:SchedulePetUpdate(2) + --send char data if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange:IsCancelled()) then return end - _detalhes.SendCharDataOnGroupChange = C_Timer.NewTimer (11, function() + + _detalhes.SendCharDataOnGroupChange = C_Timer.NewTimer(11, function() _detalhes:SendCharacterData() _detalhes.SendCharDataOnGroupChange = nil end) - end end - - _detalhes:SchedulePetUpdate (6) + + _detalhes:SchedulePetUpdate(6) end function _detalhes.parser_functions:START_TIMER(...) --~timer - if (_detalhes.debug) then _detalhes:Msg("(debug) found a timer.") end @@ -5688,19 +5687,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 --check if the player is inside an arena if (zoneType == "arena") then if (_detalhes.debug) then - _detalhes:Msg ("(debug) timer is an arena countdown.") + _detalhes:Msg("(debug) timer is an arena countdown.") end - _detalhes:StartArenaSegment (...) - + _detalhes:StartArenaSegment(...) + --check if the player is inside a battleground elseif (zoneType == "battleground") then if (Details.debug) then Details:Msg("(debug) timer is a battleground countdown.") end - - local _, timeSeconds = select (1, ...) - + + local _, timeSeconds = select(1, ...) + if (Details.start_battleground) then Details.Schedules.Cancel(Details.start_battleground) end @@ -5710,7 +5709,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details.Schedules.SetName(Details.start_battleground, "Battleground Start Timer") end end - + function Details:CreateBattlegroundSegment() if (_in_combat) then _detalhes.tabela_vigente.discard_segment = true @@ -5722,47 +5721,48 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (Details.debug) then Details:Msg("(debug) a battleground has started.") - end + end end - -- ~load + --~load local start_details = function() if (not _detalhes.gump) then --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.") - + return end - + --cooltip if (not _G.GameCooltip) then _detalhes.popup = _G.GameCooltip else _detalhes.popup = _G.GameCooltip end - + --check group _detalhes.in_group = IsInGroup() or IsInRaid() - + --write into details object all basic keys and default profile _detalhes:ApplyBasicKeys() --check if is first run, update keys for character and global data _detalhes:LoadGlobalAndCharacterData() - + --details updated and not reopened the game client if (_detalhes.FILEBROKEN) then return end - + --load all the saved combats _detalhes:LoadCombatTables() + --load the profiles _detalhes:LoadConfig() - + _detalhes:UpdateParserGears() --load auto run code @@ -5774,61 +5774,61 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function Details.IsLoaded() return Details.isLoaded end - - function _detalhes.parser_functions:ADDON_LOADED (...) - local addon_name = _select (1, ...) + + function _detalhes.parser_functions:ADDON_LOADED(...) + local addon_name = _select(1, ...) if (addon_name == "Details") then start_details() - end + end end - + local playerLogin = CreateFrame("frame") playerLogin:RegisterEvent("PLAYER_LOGIN") playerLogin:SetScript("OnEvent", function() Details:StartMeUp() end) - - function _detalhes.parser_functions:PET_BATTLE_OPENING_START (...) + + 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.") + _detalhes:Msg("(debug) hidding windows for Pet Battle.") end - instance:SetWindowAlphaForCombat (true, true, 0) + instance:SetWindowAlphaForCombat(true, true, 0) end end end - - function _detalhes.parser_functions:PET_BATTLE_CLOSE (...) + + 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().") + _detalhes:Msg("(debug) Pet Battle finished, calling AdjustAlphaByContext().") end instance:AdjustAlphaByContext(true) end end end - - function _detalhes.parser_functions:UNIT_NAME_UPDATE (...) - _detalhes:SchedulePetUpdate (5) + + function _detalhes.parser_functions:UNIT_NAME_UPDATE(...) + _detalhes:SchedulePetUpdate(5) end - + local parser_functions = _detalhes.parser_functions - - function _detalhes:OnEvent (evento, ...) - local func = parser_functions [evento] + + function _detalhes:OnEvent(event, ...) + local func = parser_functions[event] if (func) then - return func (nil, ...) + return func(nil, ...) end end _detalhes.listener:SetScript("OnEvent", _detalhes.OnEvent) --logout function ~save ~logout - + local saver = CreateFrame("frame", nil, UIParent) saver:RegisterEvent ("PLAYER_LOGOUT") saver:SetScript("OnEvent", function(...) @@ -5886,107 +5886,105 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end --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" - xpcall (_detalhes.SairDoCombate, saver_error) - _detalhes.can_panic_mode = true - end - - if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and _detalhes.tabela_instancias and getmetatable (_detalhes.tabela_instancias[1])) then - tinsert(_detalhes_global.exit_log, "4 - Reversing switches.") - currentStep = "Check Switch on Logon" - xpcall (_detalhes.CheckSwitchOnLogon, saver_error) - end - - if (_detalhes.wipe_full_config) then - tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.") - _detalhes_global = nil - _detalhes_database = nil - return - end - - --save the config - tinsert(_detalhes_global.exit_log, "6 - Saving Config.") - currentStep = "Saving Config" - xpcall (_detalhes.SaveConfig, saver_error) + if (_detalhes.in_combat and _detalhes.tabela_vigente) then + tinsert(_detalhes_global.exit_log, "3 - Leaving current combat.") + currentStep = "Leaving Current Combat" + xpcall (_detalhes.SairDoCombate, saver_error) + _detalhes.can_panic_mode = true + end - tinsert(_detalhes_global.exit_log, "7 - Saving Profiles.") - currentStep = "Saving Profile" - xpcall (_detalhes.SaveProfile, saver_error) + if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and _detalhes.tabela_instancias and getmetatable (_detalhes.tabela_instancias[1])) then + tinsert(_detalhes_global.exit_log, "4 - Reversing switches.") + currentStep = "Check Switch on Logon" + xpcall (_detalhes.CheckSwitchOnLogon, saver_error) + end - --save the nicktag cache - tinsert(_detalhes_global.exit_log, "8 - Saving nicktag cache.") + if (_detalhes.wipe_full_config) then + tinsert(_detalhes_global.exit_log, "5 - Is a full config wipe.") + _detalhes_global = nil + _detalhes_database = nil + return + end - local saveNicktabCache = function() - _detalhes_database.nick_tag_cache = Details.CopyTable(_detalhes_database.nick_tag_cache) - end - xpcall (saveNicktabCache, saver_error) + --save the config + tinsert(_detalhes_global.exit_log, "6 - Saving Config.") + currentStep = "Saving Config" + xpcall (_detalhes.SaveConfig, saver_error) + + tinsert(_detalhes_global.exit_log, "7 - Saving Profiles.") + currentStep = "Saving Profile" + xpcall (_detalhes.SaveProfile, saver_error) + + --save the nicktag cache + tinsert(_detalhes_global.exit_log, "8 - Saving nicktag cache.") + + local saveNicktabCache = function() + _detalhes_database.nick_tag_cache = Details.CopyTable(_detalhes_database.nick_tag_cache) + end + xpcall (saveNicktabCache, saver_error) end) - - --end - + -- ~parserstart ~startparser ~cleu function _detalhes.OnParserEvent() local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = _CombatLogGetCurrentEventInfo() - - local funcao = token_list [token] - if (funcao) then - return funcao (nil, token, time, who_serial, who_name, who_flags, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + + local func = token_list[token] + if (func) then + return func(nil, token, time, who_serial, who_name, who_flags, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) else return end end - + _detalhes.parser_frame:SetScript("OnEvent", _detalhes.OnParserEvent) function _detalhes:UpdateParser() _tempo = _detalhes._tempo end + function _detalhes:UpdatePetsOnParser() container_pets = _detalhes.tabela_pets.pets end function _detalhes:PrintParserCacheIndexes() - local amount = 0 - for n, nn in pairs(damage_cache) do + for n, nn in pairs(damage_cache) do amount = amount + 1 end - print ("parser damage_cache", amount) - - amount = 0 - for n, nn in pairs(damage_cache_pets) do - amount = amount + 1 - end - print ("parser damage_cache_pets", amount) - - amount = 0 - for n, nn in pairs(damage_cache_petsOwners) do - amount = amount + 1 - end - print ("parser damage_cache_petsOwners", amount) - - amount = 0 - for n, nn in pairs(healing_cache) do - amount = amount + 1 - end - print ("parser healing_cache", amount) - - amount = 0 - for n, nn in pairs(energy_cache) do - amount = amount + 1 - end - print ("parser energy_cache", amount) + print("parser damage_cache", amount) amount = 0 - for n, nn in pairs(misc_cache) do + for n, nn in pairs(damage_cache_pets) do amount = amount + 1 end - print ("parser misc_cache", amount) - print ("group damage", #_detalhes.cache_damage_group) - print ("group damage", #_detalhes.cache_healing_group) + print("parser damage_cache_pets", amount) + + amount = 0 + for n, nn in pairs(damage_cache_petsOwners) do + amount = amount + 1 + end + print("parser damage_cache_petsOwners", amount) + + amount = 0 + for n, nn in pairs(healing_cache) do + amount = amount + 1 + end + print("parser healing_cache", amount) + + amount = 0 + for n, nn in pairs(energy_cache) do + amount = amount + 1 + end + print("parser energy_cache", amount) + + amount = 0 + for n, nn in pairs(misc_cache) do + amount = amount + 1 + end + print("parser misc_cache", amount) + print("group damage", #_detalhes.cache_damage_group) + print("group damage", #_detalhes.cache_healing_group) end function _detalhes:GetActorsOnDamageCache() @@ -5995,144 +5993,143 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes:GetActorsOnHealingCache() return _detalhes.cache_healing_group end - - function _detalhes:ClearParserCache() - - _table_wipe (damage_cache) - _table_wipe (damage_cache_pets) - _table_wipe (damage_cache_petsOwners) - _table_wipe (healing_cache) - _table_wipe (energy_cache) - _table_wipe (misc_cache) - _table_wipe (misc_cache_pets) - _table_wipe (misc_cache_petsOwners) - _table_wipe (npcid_cache) - - _table_wipe (ignore_death) - - _table_wipe (reflection_damage) - _table_wipe (reflection_debuffs) - _table_wipe (reflection_events) - _table_wipe (reflection_auras) - _table_wipe (reflection_dispels) - _table_wipe (dk_pets_cache.army) - _table_wipe (dk_pets_cache.apoc) - - damage_cache = setmetatable ({}, _detalhes.weaktable) - damage_cache_pets = setmetatable ({}, _detalhes.weaktable) - damage_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) - - healing_cache = setmetatable ({}, _detalhes.weaktable) - - energy_cache = setmetatable ({}, _detalhes.weaktable) - - misc_cache = setmetatable ({}, _detalhes.weaktable) - misc_cache_pets = setmetatable ({}, _detalhes.weaktable) - misc_cache_petsOwners = setmetatable ({}, _detalhes.weaktable) + function _detalhes:ClearParserCache() + _table_wipe(damage_cache) + _table_wipe(damage_cache_pets) + _table_wipe(damage_cache_petsOwners) + _table_wipe(healing_cache) + _table_wipe(energy_cache) + _table_wipe(misc_cache) + _table_wipe(misc_cache_pets) + _table_wipe(misc_cache_petsOwners) + _table_wipe(npcid_cache) + + _table_wipe(ignore_death) + + _table_wipe(reflection_damage) + _table_wipe(reflection_debuffs) + _table_wipe(reflection_events) + _table_wipe(reflection_auras) + _table_wipe(reflection_dispels) + + _table_wipe(dk_pets_cache.army) + _table_wipe(dk_pets_cache.apoc) + + damage_cache = setmetatable({}, _detalhes.weaktable) + damage_cache_pets = setmetatable({}, _detalhes.weaktable) + damage_cache_petsOwners = setmetatable({}, _detalhes.weaktable) + + healing_cache = setmetatable({}, _detalhes.weaktable) + + energy_cache = setmetatable({}, _detalhes.weaktable) + + misc_cache = setmetatable({}, _detalhes.weaktable) + misc_cache_pets = setmetatable({}, _detalhes.weaktable) + misc_cache_petsOwners = setmetatable({}, _detalhes.weaktable) end - - function parser:RevomeActorFromCache (actor_serial, actor_name) + + function parser:RevomeActorFromCache(actor_serial, actor_name) if (actor_name) then - damage_cache [actor_name] = nil - damage_cache_pets [actor_name] = nil - damage_cache_petsOwners [actor_name] = nil - healing_cache [actor_serial] = nil - energy_cache [actor_name] = nil - misc_cache [actor_name] = nil - misc_cache_pets [actor_name] = nil - misc_cache_petsOwners [actor_name] = nil + damage_cache[actor_name] = nil + damage_cache_pets[actor_name] = nil + damage_cache_petsOwners[actor_name] = nil + healing_cache[actor_serial] = nil + energy_cache[actor_name] = nil + misc_cache[actor_name] = nil + misc_cache_pets[actor_name] = nil + misc_cache_petsOwners[actor_name] = nil end + if (actor_serial) then - damage_cache [actor_serial] = nil - damage_cache_pets [actor_serial] = nil - damage_cache_petsOwners [actor_serial] = nil - healing_cache [actor_serial] = nil - energy_cache [actor_serial] = nil - misc_cache [actor_serial] = nil - misc_cache_pets [actor_serial] = nil - misc_cache_petsOwners [actor_serial] = nil + damage_cache[actor_serial] = nil + damage_cache_pets[actor_serial] = nil + damage_cache_petsOwners[actor_serial] = nil + healing_cache[actor_serial] = nil + energy_cache[actor_serial] = nil + misc_cache[actor_serial] = nil + misc_cache_pets[actor_serial] = nil + misc_cache_petsOwners[actor_serial] = nil end end function _detalhes:UptadeRaidMembersCache() - - _table_wipe (raid_members_cache) - _table_wipe (tanks_members_cache) - _table_wipe (auto_regen_cache) - _table_wipe (bitfield_swap_cache) - + _table_wipe(raid_members_cache) + _table_wipe(tanks_members_cache) + _table_wipe(auto_regen_cache) + _table_wipe(bitfield_swap_cache) + local roster = _detalhes.tabela_vigente.raid_roster - + if (_IsInRaid()) then - for i = 1, _GetNumGroupMembers() do - local name = GetUnitName ("raid"..i, true) - - raid_members_cache [_UnitGUID ("raid"..i)] = true - roster [name] = true - - local role = _UnitGroupRolesAssigned (name) + for i = 1, _GetNumGroupMembers() do + local name = GetUnitName("raid"..i, true) + + raid_members_cache[_UnitGUID("raid"..i)] = true + roster[name] = true + + local role = _UnitGroupRolesAssigned(name) if (role == "TANK") then - tanks_members_cache [_UnitGUID ("raid"..i)] = true + tanks_members_cache[_UnitGUID("raid"..i)] = true end - - if (auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("raid" .. i)]]) then - auto_regen_cache [name] = auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("raid" .. i)]] + + if (auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("raid" .. i)]]) then + auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("raid" .. i)]] end end - + elseif (_IsInGroup()) then --party - for i = 1, _GetNumGroupMembers()-1 do - local name = GetUnitName ("party"..i, true) - - raid_members_cache [_UnitGUID ("party"..i)] = true - roster [name] = true - - local role = _UnitGroupRolesAssigned (name) + for i = 1, _GetNumGroupMembers()-1 do + local name = GetUnitName("party"..i, true) + + raid_members_cache[_UnitGUID("party"..i)] = true + roster[name] = true + + local role = _UnitGroupRolesAssigned(name) if (role == "TANK") then - tanks_members_cache [_UnitGUID ("party"..i)] = true + tanks_members_cache[_UnitGUID("party"..i)] = true end - - if (auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("party" .. i)]]) then - auto_regen_cache [name] = auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("party" .. i)]] + + if (auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("party" .. i)]]) then + auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("party" .. i)]] end end - + --player - local name = GetUnitName ("player", true) - - raid_members_cache [_UnitGUID ("player")] = true - roster [name] = true - - local role = _UnitGroupRolesAssigned (name) + local name = GetUnitName("player", true) + + raid_members_cache[_UnitGUID("player")] = true + roster[name] = true + + local role = _UnitGroupRolesAssigned(name) if (role == "TANK") then - tanks_members_cache [_UnitGUID ("player")] = true + tanks_members_cache[_UnitGUID("player")] = true end - - if (auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("player")]]) then - auto_regen_cache [name] = auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("player")]] + + if (auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("player")]]) then + auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("player")]] end else - local name = GetUnitName ("player", true) - - raid_members_cache [_UnitGUID ("player")] = true - roster [name] = true - - local role = _UnitGroupRolesAssigned (name) + local name = GetUnitName("player", true) + + raid_members_cache[_UnitGUID("player")] = true + roster[name] = true + + local role = _UnitGroupRolesAssigned(name) if (role == "TANK") then - tanks_members_cache [_UnitGUID ("player")] = true + tanks_members_cache[_UnitGUID("player")] = true else local spec = DetailsFramework.GetSpecialization() if (spec and spec ~= 0) then if (DetailsFramework.GetSpecializationRole (spec) == "TANK") then - tanks_members_cache [_UnitGUID ("player")] = true + tanks_members_cache[_UnitGUID("player")] = true end end end - - if (auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("player")]]) then - auto_regen_cache [name] = auto_regen_power_specs [_detalhes.cached_specs [_UnitGUID ("player")]] + + if (auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("player")]]) then + auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[_UnitGUID("player")]] end end @@ -6145,45 +6142,43 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end) _detalhes.tabela_vigente.raid_roster_indexed = orderNames - + if (_detalhes.iam_a_tank) then - tanks_members_cache [_UnitGUID ("player")] = true + tanks_members_cache[_UnitGUID("player")] = true end end - function _detalhes:IsATank (playerguid) - return tanks_members_cache [playerguid] + function _detalhes:IsATank(playerguid) + return tanks_members_cache[playerguid] end - - function _detalhes:IsInCache (playerguid) - return raid_members_cache [playerguid] + + function _detalhes:IsInCache(playerguid) + return raid_members_cache[playerguid] end function _detalhes:GetParserPlayerCache() return raid_members_cache end - + --serach key: ~cache function _detalhes:UpdateParserGears() - --refresh combat tables _current_combat = _detalhes.tabela_vigente _current_combat_cleu_events = _current_combat and _current_combat.cleu_events - + --last events pointer last_events_cache = _current_combat.player_last_events _death_event_amt = _detalhes.deadlog_events - + --refresh total containers _current_total = _current_combat.totals _current_gtotal = _current_combat.totals_grupo - - --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 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 _recording_self_buffs = _detalhes.RecordPlayerSelfBuffs --_recording_healing = _detalhes.RecordHealingDone @@ -6192,10 +6187,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _in_combat = _detalhes.in_combat _table_wipe(ignored_npcids) + --fill it with the default npcs ignored for npcId in pairs(_detalhes.default_ignored_npcs) do ignored_npcids[npcId] = true end + --fill it with the npcs the user ignored for npcId in pairs(_detalhes.npcid_ignored) do ignored_npcids[npcId] = true @@ -6203,7 +6200,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_in_combat) then if (not _auto_regen_thread or _auto_regen_thread:IsCancelled()) then - _auto_regen_thread = C_Timer.NewTicker (AUTO_REGEN_PRECISION / 10, regen_power_overflow_check) + _auto_regen_thread = C_Timer.NewTicker(AUTO_REGEN_PRECISION / 10, regen_power_overflow_check) end else if (_auto_regen_thread and not _auto_regen_thread:IsCancelled()) then @@ -6211,42 +6208,42 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _auto_regen_thread = nil end end - - if (_detalhes.hooks ["HOOK_COOLDOWN"].enabled) then + + if (_detalhes.hooks["HOOK_COOLDOWN"].enabled) then _hook_cooldowns = true else _hook_cooldowns = false end - - if (_detalhes.hooks ["HOOK_DEATH"].enabled) then + + if (_detalhes.hooks["HOOK_DEATH"].enabled) then _hook_deaths = true else _hook_deaths = false end - - if (_detalhes.hooks ["HOOK_BATTLERESS"].enabled) then + + if (_detalhes.hooks["HOOK_BATTLERESS"].enabled) then _hook_battleress = true else _hook_battleress = false end - - if (_detalhes.hooks ["HOOK_INTERRUPT"].enabled) then + + if (_detalhes.hooks["HOOK_INTERRUPT"].enabled) then _hook_interrupt = true else _hook_interrupt = false end - + is_using_spellId_override = _detalhes.override_spellids - + return _detalhes:ClearParserCache() end function _detalhes.DumpIgnoredNpcs() return ignored_npcids end - - - + + + --serach key: ~api ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --details api functions @@ -6260,16 +6257,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 function _detalhes:IsInCombat() return _in_combat end - + function _detalhes:IsInEncounter() return _detalhes.encounter_table.id and true or false end --get combat - function _detalhes:GetCombat (_combat) + function _detalhes:GetCombat(_combat) if (not _combat) then return _current_combat - elseif (_type(_combat) == "number") then + + elseif (type(_combat) == "number") then if (_combat == -1) then --overall return _detalhes.tabela_overall elseif (_combat == 0) then --current @@ -6277,71 +6275,71 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 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 return _current_combat end end - + return nil end - - function _detalhes:GetAllActors (_combat, _actorname) - return _detalhes:GetActor (_combat, 1, _actorname), _detalhes:GetActor (_combat, 2, _actorname), _detalhes:GetActor (_combat, 3, _actorname), _detalhes:GetActor (_combat, 4, _actorname) - end - - --get player - function _detalhes:GetPlayer (_actorname, _combat, _attribute) - return _detalhes:GetActor (_combat, _attribute, _actorname) - end - - --get an actor - function _detalhes:GetActor (_combat, _attribute, _actorname) + function _detalhes:GetAllActors(_combat, _actorname) + return _detalhes:GetActor(_combat, 1, _actorname), _detalhes:GetActor(_combat, 2, _actorname), _detalhes:GetActor(_combat, 3, _actorname), _detalhes:GetActor(_combat, 4, _actorname) + end + + --get player + function _detalhes:GetPlayer(_actorname, _combat, _attribute) + return _detalhes:GetActor(_combat, _attribute, _actorname) + end + + --get an actor + function _detalhes:GetActor(_combat, _attribute, _actorname) if (not _combat) then _combat = "current" --current combat end - + if (not _attribute) then _attribute = 1 --damage end - + if (not _actorname) then _actorname = _detalhes.playername end - + if (_combat == 0 or _combat == "current") then - local actor = _detalhes.tabela_vigente (_attribute, _actorname) + local actor = _detalhes.tabela_vigente(_attribute, _actorname) if (actor) then return actor else - return nil --_detalhes:NewError ("Current combat doesn't have an actor called ".. _actorname) + return nil end - + elseif (_combat == -1 or _combat == "overall") then - local actor = _detalhes.tabela_overall (_attribute, _actorname) + local actor = _detalhes.tabela_overall(_attribute, _actorname) if (actor) then return actor else - return nil --_detalhes:NewError ("Combat overall doesn't have an actor called ".. _actorname) + return nil end - + elseif (type(_combat) == "number") then - local _combatOnHistoryTables = _detalhes.tabela_historico.tabelas [_combat] + local _combatOnHistoryTables = _detalhes.tabela_historico.tabelas[_combat] if (_combatOnHistoryTables) then - local actor = _combatOnHistoryTables (_attribute, _actorname) + local actor = _combatOnHistoryTables(_attribute, _actorname) if (actor) then return actor else - return nil --_detalhes:NewError ("Combat ".. _combat .." doesn't have an actor called ".. _actorname) + return nil end else - return nil --_detalhes:NewError ("Combat ".._combat.." not found.") + return nil end else - return nil --_detalhes:NewError ("Couldn't find a combat object for passed parameters") + return nil end end @@ -6351,11 +6349,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.pvp_parser_frame:SetScript("OnEvent", function(self, event) self:ReadPvPData() end) - + function _detalhes:BgScoreUpdate() RequestBattlefieldScoreData() end - + --start the virtual parser function _detalhes.pvp_parser_frame:StartBgUpdater() _detalhes.pvp_parser_frame:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") @@ -6363,17 +6361,18 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (_detalhes.pvp_parser_frame.ticker) then Details.Schedules.Cancel(_detalhes.pvp_parser_frame.ticker) end + _detalhes.pvp_parser_frame.ticker = Details.Schedules.NewTicker(10, Details.BgScoreUpdate) Details.Schedules.SetName(_detalhes.pvp_parser_frame.ticker, "Battleground Updater") end - + --stop the virtual parser function _detalhes.pvp_parser_frame:StopBgUpdater() _detalhes.pvp_parser_frame:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") Details.Schedules.Cancel(_detalhes.pvp_parser_frame.ticker) _detalhes.pvp_parser_frame.ticker = nil end - + function _detalhes.pvp_parser_frame:ReadPvPData() local players = GetNumBattlefieldScores() @@ -6384,7 +6383,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 else name, killingBlows, honorableKills, deaths, honorGained, faction, race, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec = GetBattlefieldScore(i) end - + --damage done local actor = _detalhes.tabela_vigente(1, name) if (actor) then @@ -6393,9 +6392,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end actor.total = damageDone actor.classe = classToken or "UNKNOW" - - elseif (name ~= "Unknown" and type (name) == "string" and string.len (name) > 1) then - local guid = _UnitGUID (name) + + elseif (name ~= "Unknown" and type(name) == "string" and string.len(name) > 1) then + local guid = _UnitGUID(name) if (guid) then local flag if (_detalhes.faction_id == faction) then --is from the same faction @@ -6403,17 +6402,18 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 else flag = 0x548 end + actor = _current_damage_container:PegarCombatente (guid, name, flag, true) actor.total = _detalhes:GetOrderNumber() actor.classe = classToken or "UNKNOW" - + if (flag == 0x548) then --oponent actor.enemy = true end end end - + --healing done local actor = _detalhes.tabela_vigente(2, name) if (actor) then @@ -6422,10 +6422,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end actor.total = healingDone actor.classe = classToken or "UNKNOW" - - elseif (name ~= "Unknown" and type (name) == "string" and string.len (name) > 1) then - --elseif (name ~= "Unknown") then - local guid = _UnitGUID (name) + + elseif (name ~= "Unknown" and type(name) == "string" and string.len(name) > 1) then + local guid = _UnitGUID(name) if (guid) then local flag if (_detalhes.faction_id == faction) then --is from the same faction @@ -6433,10 +6432,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 else flag = 0x548 end + actor = _current_heal_container:PegarCombatente (guid, name, flag, true) actor.total = _detalhes:GetOrderNumber() actor.classe = classToken or "UNKNOW" - + if (flag == 0x548) then --oponent actor.enemy = true @@ -6444,4 +6444,4 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end end - end + end \ No newline at end of file diff --git a/core/plugins.lua b/core/plugins.lua index d837781a..d0cc79d4 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _detalhes = _G._detalhes local PixelUtil = PixelUtil or DFPixelUtil @@ -94,14 +94,14 @@ for key, value in pairs(default) do if (type(value) == "table") then if (type(current [key]) ~= "table") then - current [key] = Details.CopyTable (value) + current [key] = Details.CopyTable(value) else _detalhes:CheckDefaultTable (current [key], value) end 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 @@ -111,7 +111,7 @@ function _detalhes:InstallPlugin (PluginType, PluginName, PluginIcon, PluginObject, PluginAbsoluteName, MinVersion, Author, Version, DefaultSavedTable) if (MinVersion and MinVersion > _detalhes.realversion) then - print (PluginName, Loc ["STRING_TOOOLD"]) + print(PluginName, Loc ["STRING_TOOOLD"]) return _detalhes:NewError ("Details version is out of date.") end @@ -136,7 +136,7 @@ end if (_G [PluginAbsoluteName]) then - print (Loc ["STRING_PLUGIN_NAMEALREADYTAKEN"] .. ": " .. PluginName .. " name: " .. PluginAbsoluteName) + print(Loc ["STRING_PLUGIN_NAMEALREADYTAKEN"] .. ": " .. PluginName .. " name: " .. PluginAbsoluteName) return else _G [PluginAbsoluteName] = PluginObject @@ -192,7 +192,7 @@ _detalhes.PluginCount.RAID = _detalhes.PluginCount.RAID + 1 - _detalhes:InstanceCall ("RaidPluginInstalled", PluginAbsoluteName) + _detalhes:InstanceCall("RaidPluginInstalled", PluginAbsoluteName) elseif (PluginType == "TOOLBAR") then @@ -249,7 +249,7 @@ local OnDisableFunction = function(self) _detalhes:SendEvent("HIDE", self.__parent) - if (bit.band (self.__parent.__options, DETAILSPLUGIN_ALWAYSENABLED) == 0) then + if (bit.band(self.__parent.__options, DETAILSPLUGIN_ALWAYSENABLED) == 0) then self.__parent.Enabled = false end end @@ -263,13 +263,13 @@ end local temp_event_function = function() - print ("=====================") - print ("Hello There plugin developer!") - print ("Please make sure you are declaring") - print ("A member called 'OnDetailsEvent' on your plugin object") - print ("With a function to receive the events like bellow:") - print ("function PluginObject:OnDetailsEvent (event, ...) end") - print ("Thank You Sir!===================") + print("=====================") + print("Hello There plugin developer!") + print("Please make sure you are declaring") + print("A member called 'OnDetailsEvent' on your plugin object") + print("With a function to receive the events like bellow:") + print("function PluginObject:OnDetailsEvent (event, ...) end") + print("Thank You Sir!===================") end local register_event_func = function(self, event) @@ -300,12 +300,12 @@ end) Frame:SetFrameStrata("HIGH") - Frame:SetFrameLevel (6) + Frame:SetFrameLevel(6) Frame:Hide() Frame.__parent = NewPlugin - if (bit.band (PluginOptions, DETAILSPLUGIN_ALWAYSENABLED) ~= 0) then + if (bit.band(PluginOptions, DETAILSPLUGIN_ALWAYSENABLED) ~= 0) then NewPlugin.Enabled = true else NewPlugin.Enabled = false @@ -324,7 +324,7 @@ --temporary details event function NewPlugin.OnDetailsEvent = temp_event_function - setmetatable (NewPlugin, _detalhes) + setmetatable(NewPlugin, _detalhes) return NewPlugin end @@ -357,8 +357,8 @@ end end) - options_frame:SetMovable (true) - options_frame:EnableMouse (true) + options_frame:SetMovable(true) + options_frame:EnableMouse(true) options_frame:SetFrameStrata("DIALOG") options_frame:SetToplevel (true) @@ -395,8 +395,8 @@ end end) - options_frame:SetMovable (true) - options_frame:EnableMouse (true) + options_frame:SetMovable(true) + options_frame:EnableMouse(true) options_frame:SetFrameStrata("DIALOG") options_frame:SetToplevel (true) @@ -409,12 +409,12 @@ insets = {left = 1, right = 1, top = 1, bottom = 1}}) options_frame:SetBackdropColor(0, 0, 0, .7) - Details.gump:ApplyStandardBackdrop (options_frame) + 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:SetAlpha (.25) + bigdog:SetAlpha(.25) return options_frame end @@ -423,8 +423,8 @@ function _detalhes:CreatePluginWindowContainer() local f = CreateFrame("frame", "DetailsPluginContainerWindow", UIParent,"BackdropTemplate") - f:EnableMouse (true) - f:SetMovable (true) + 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) @@ -452,27 +452,26 @@ --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) + 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") - _detalhes:FormatBackground (menuBackground) - local menuBackgroundTexture = menuBackground:CreateTexture("$parentBackgroundTexture", "background", nil, -2) - menuBackgroundTexture:SetAllPoints() - menuBackgroundTexture:SetColorTexture(0.2, 0.2, 0.2, .5) - + local menuBackground = CreateFrame("frame", "$parentMenuFrame", f, "BackdropTemplate") + DetailsFramework:ApplyStandardBackdrop(menuBackground) + --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) + statusBar:SetAlpha(1) + + DetailsFramework:BuildStatusbarAuthorInfo(statusBar) + DetailsFramework:ApplyStandardBackdrop(statusBar) + local extraDarkTexture = statusBar:CreateTexture(nil, "background") extraDarkTexture:SetAllPoints() extraDarkTexture:SetColorTexture(.2, .2, .2, .8) @@ -480,7 +479,7 @@ -- 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) + right_click_to_back:SetAlpha(.4) --point menuBackground:SetPoint("topright", f, "topleft", -2, 0) @@ -489,7 +488,7 @@ 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:SetAlpha (0.3) + 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") @@ -529,13 +528,13 @@ --scripts f:SetScript("OnShow", function() --check if the window isn't out of screen - C_Timer.After (1, function() + 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) - LibWindow.SavePosition (f) - _detalhes:Msg ("detected options panel out of screen, position has reset") + LibWindow.SavePosition(f) + _detalhes:Msg("detected options panel out of screen, position has reset") end end) end) @@ -553,7 +552,7 @@ f.Debug = false function f.DebugMsg (...) if (f.Debug) then - print ("[Details! Debug]", ...) + print("[Details! Debug]", ...) end end @@ -588,7 +587,7 @@ --re set the point of the frame within the main plugin window f.RefreshFrame (pluginObject.__var_Frame) - C_Timer.After (0.016, function() + C_Timer.After(0.016, function() f.RefreshFrame (pluginObject.__var_Frame) end) @@ -603,10 +602,10 @@ if (button.PluginAbsName == pluginAbsName) then --emphatizate this button - button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE")) + button:SetTemplate(_detalhes.gump:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE")) else --make this button regular - button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + button:SetTemplate(_detalhes.gump:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) end end @@ -618,13 +617,13 @@ function f.CreatePluginMenuButton (pluginObject, isUtility) --create the button - local newButton = _detalhes.gump:CreateButton (f, f.OnMenuClick, f.MenuButtonWidth, f.MenuButtonHeight, pluginObject.__name, pluginObject.real_name, true) + 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 - newButton:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + newButton:SetTemplate(_detalhes.gump:GetTemplate("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) newButton:SetText(pluginObject.__name) newButton.textsize = 10 @@ -642,7 +641,7 @@ end function f.RefreshFrame (frame) - frame:EnableMouse (false) + frame:EnableMouse(false) frame:SetSize(f.FrameWidth, f.FrameHeight) frame:SetScript("OnMouseDown", nil) frame:SetScript("OnMouseUp", nil) diff --git a/core/plugins_raid.lua b/core/plugins_raid.lua index 1d2afd91..9dc688cb 100644 --- a/core/plugins_raid.lua +++ b/core/plugins_raid.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -40,10 +40,10 @@ function _detalhes:RaidPluginInstalled (plugin_name) if (self.waiting_raid_plugin) then - --print (self.meu_id, 2, self.last_raid_plugin, " == ", plugin_name) + --print(self.meu_id, 2, self.last_raid_plugin, " == ", plugin_name) if (self.last_raid_plugin == plugin_name) then if (self.waiting_pid) then - self:CancelTimer (self.waiting_pid, true) + self:CancelTimer(self.waiting_pid, true) end self:CancelWaitForPlugin() _detalhes.RaidTables:EnableRaidMode (self, plugin_name) @@ -107,7 +107,7 @@ --last check if the name is okey if (self:IsAvailable (plugin_name, instance)) then - self:switch (nil, plugin_name, instance) + self:switch(nil, plugin_name, instance) if (from_mode_menu) then --refresh @@ -161,7 +161,7 @@ ---------------- - function _detalhes.RaidTables:switch (_, plugin_name, instance) + function _detalhes.RaidTables:switch(_, plugin_name, instance) local update_menu = false if (not self) then --came from cooltip @@ -214,7 +214,7 @@ plugin_object.instance_id = instance:GetId() plugin_object.Frame:SetPoint("TOPLEFT", instance.bgframe) plugin_object.Frame:Show() - instance:ChangeIcon (plugin_object.__icon)--; print (instance:GetId(),"icon",plugin_object.__icon) + instance:ChangeIcon (plugin_object.__icon)--; print(instance:GetId(),"icon",plugin_object.__icon) _detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo) if (update_menu) then @@ -270,7 +270,7 @@ SendChatMessage (msg, channel, nil, towho) elseif (channel == "PRINT") then - print (msg) + print(msg) else --say channel? if (IsInInstance()) then --patch 80205 cannot use 'say' channel outside instances @@ -366,7 +366,7 @@ if (second < 10) then second = "0" .. second end - local msg = "|cFFFFFF00[|r".. minute .. ":" .. second .. "|cFFFFFF00]|r Interrupt: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r)" + local msg = "|cFFFFFF00[|r".. minute .. ":" .. second .. "|cFFFFFF00]|r Interrupt: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName(who_name) .. "|r)" _detalhes:SendMsgToChannel (msg, "PRINT") end @@ -471,7 +471,7 @@ if (class2) then local coords = CLASS_ICON_TCOORDS [class2] class_color2 = " -> |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class2].colorStr - alvo_name = _detalhes:GetOnlyName (alvo_name) + alvo_name = _detalhes:GetOnlyName(alvo_name) else alvo_name = "" end @@ -486,7 +486,7 @@ if (second < 10) then second = "0" .. second end - msg = "|cFF8F8FFF[|r".. minute .. ":" .. second .. "|cFF8F8FFF]|r Cooldown: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r" .. class_color2 .. alvo_name .. "|r)" + msg = "|cFF8F8FFF[|r".. minute .. ":" .. second .. "|cFF8F8FFF]|r Cooldown: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName(who_name) .. "|r" .. class_color2 .. alvo_name .. "|r)" _detalhes:SendMsgToChannel (msg, "PRINT") @@ -544,7 +544,7 @@ end local only_first = _detalhes.announce_deaths.only_first - --_detalhes:GetCombat ("current"):GetDeaths() is the same thing, but, it's faster without using the API. + --_detalhes:GetCombat("current"):GetDeaths() is the same thing, but, it's faster without using the API. if (zone == "raid" and not _detalhes.tabela_vigente.is_boss) then return end @@ -552,7 +552,7 @@ return end - alvo_name = _detalhes:GetOnlyName (alvo_name) + alvo_name = _detalhes:GetOnlyName(alvo_name) local msg if (where == 4) then --observer diff --git a/core/plugins_solo.lua b/core/plugins_solo.lua index 419a2a37..22115d0d 100644 --- a/core/plugins_solo.lua +++ b/core/plugins_solo.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers @@ -39,7 +39,7 @@ 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 = gump:CreateSimplePanel(button, 296, 60, "", plugin.real_name .. "CloseConfirmation") button.close_confirmation:SetPoint("center", frame, 0, 0) _G [button.close_confirmation:GetName() .. "TitleBar"]:Hide() local fade_background = button.close_confirmation:CreateTexture(nil, "background") @@ -60,8 +60,8 @@ instance.baseframe.cabecalho.modo_selecao:GetScript("OnEnter")(instance.baseframe.cabecalho.modo_selecao) end - local close_window = gump:NewButton(button.close_confirmation, nil, "$parentCloseWindowButton", "CloseWindowButton", 140, 20, close_func, nil, nil, nil, Loc ["STRING_MENU_CLOSE_INSTANCE"], 1, gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) - local back_to_group_and_raid = gump:NewButton(button.close_confirmation, nil, "$parentBackToGroupButton", "BackToGroupButton", 140, 20, group_func, nil, nil, nil, Loc ["STRING_SWITCH_TO"] .. ": " .. Loc ["STRING_MODE_GROUP"], 2, gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + local close_window = gump:NewButton(button.close_confirmation, nil, "$parentCloseWindowButton", "CloseWindowButton", 140, 20, close_func, nil, nil, nil, Loc ["STRING_MENU_CLOSE_INSTANCE"], 1, gump:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + local back_to_group_and_raid = gump:NewButton(button.close_confirmation, nil, "$parentBackToGroupButton", "BackToGroupButton", 140, 20, group_func, nil, nil, nil, Loc ["STRING_SWITCH_TO"] .. ": " .. Loc ["STRING_MODE_GROUP"], 2, gump:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) 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) @@ -77,7 +77,7 @@ button:SetWidth(20) button:SetHeight(20) - --button:GetNormalTexture():SetDesaturated (true) + --button:GetNormalTexture():SetDesaturated(true) return button end @@ -138,13 +138,13 @@ if (not _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode]) then _detalhes.SoloTables.Mode = first_enabled_plugin_index end - _detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode) + _detalhes.SoloTables:switch(nil, _detalhes.SoloTables.Mode) end else - --print ("--------------------------------") - --print (debugstack()) + --print("--------------------------------") + --print(debugstack()) if (_detalhes.PluginCount.SOLO > 0) then local solo_frame = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame @@ -198,7 +198,7 @@ instance:SoloMode (true) - _detalhes.SoloTables:switch (nil, plugin_name) + _detalhes.SoloTables:switch(nil, plugin_name) end --Build Solo Mode Tables and Functions @@ -215,7 +215,7 @@ return _detalhes.SoloTables.Mode end - function _detalhes.SoloTables:switch (_, _switchTo) + function _detalhes.SoloTables:switch(_, _switchTo) --just hide all if (not _switchTo) then @@ -257,7 +257,7 @@ _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:SetFrameLevel (20) + _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetFrameLevel(20) _detalhes.SoloTables.instancia:ChangeIcon (_detalhes.SoloTables.Menu [_detalhes.SoloTables.Mode] [2]) @@ -276,7 +276,7 @@ return end - for SpellId, DebuffTable in _pairs (SoloDebuffUptime) do + 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.start = nil @@ -290,7 +290,7 @@ --reset bufftables _detalhes.SoloTables.SoloBuffUptime = _detalhes.SoloTables.SoloBuffUptime or {} - for spellname, BuffTable in _pairs (_detalhes.SoloTables.SoloBuffUptime) do + for spellname, BuffTable in _pairs(_detalhes.SoloTables.SoloBuffUptime) do --local BuffEntryTable = _detalhes.SoloTables.BuffTextEntry [BuffTable.tableIndex] if (BuffTable.Active) then @@ -314,7 +314,7 @@ for buffIndex = 1, 41 do local name = _UnitAura ("player", buffIndex) if (name) then - for index, BuffName in _pairs (_detalhes.SoloTables.BuffsTableNameCache) do + for index, BuffName in _pairs(_detalhes.SoloTables.BuffsTableNameCache) do if (BuffName == name) then local BuffObject = _detalhes.SoloTables.SoloBuffUptime [name] if (not BuffObject) then @@ -334,7 +334,7 @@ if (instancia.modo == modo_alone) then - --print ("arrumando a instancia "..instancia.meu_id) + --print("arrumando a instancia "..instancia.meu_id) if (instancia.iniciada) then _detalhes:AlteraModo (instancia, modo_grupo) instancia:SoloMode (false) diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 056ad78a..41ed41ec 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") local DEFAULT_CHILD_WIDTH = 60 @@ -16,7 +16,7 @@ --local pointers local _math_floor = math.floor --api local - local _ipairs = ipairs --api local + local ipairs = ipairs --api local local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned @@ -47,13 +47,13 @@ function _detalhes.StatusBar:LockDisplays (instance, locked) if (instance.StatusBar.center and instance.StatusBar.left and instance.StatusBar.right) then if (locked) then - instance.StatusBar.center.frame:EnableMouse (false) - instance.StatusBar.left.frame:EnableMouse (false) - instance.StatusBar.right.frame:EnableMouse (false) + instance.StatusBar.center.frame:EnableMouse(false) + instance.StatusBar.left.frame:EnableMouse(false) + instance.StatusBar.right.frame:EnableMouse(false) else - instance.StatusBar.center.frame:EnableMouse (true) - instance.StatusBar.left.frame:EnableMouse (true) - instance.StatusBar.right.frame:EnableMouse (true) + instance.StatusBar.center.frame:EnableMouse(true) + instance.StatusBar.left.frame:EnableMouse(true) + instance.StatusBar.right.frame:EnableMouse(true) end end end @@ -176,7 +176,7 @@ --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 @@ -211,7 +211,7 @@ local byuser = false if (type(index) == "table") then - index, current_child, anchor = unpack (index) + index, current_child, anchor = unpack(index) byuser = true end @@ -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 @@ -256,13 +256,13 @@ instance.StatusBar [anchor] = chosenChild --copia os atributos do current para o chosen - local options_current = Details.CopyTable (current_child.options) + local options_current = Details.CopyTable(current_child.options) if (chosenChild.anchor) then --o widget escolhido ja estava sendo mostrado... -- copia os atributos do chosen para o current - current_child.options = Details.CopyTable (chosenChild.options) + current_child.options = Details.CopyTable(chosenChild.options) instance.StatusBar [chosenChild.anchor] = current_child end @@ -337,7 +337,7 @@ if (mouse == "LeftButton") then if (not frame.child.Setup) then - print (Loc ["STRING_STATUSBAR_NOOPTIONS"]) + print(Loc ["STRING_STATUSBAR_NOOPTIONS"]) return end frame.child:Setup() @@ -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] @@ -435,13 +435,13 @@ ChoosePlugin (nil, nil, right_index, instance.StatusBar.right, "right") if (instance.StatusBarSaved.options and instance.StatusBarSaved.options [left]) then - instance.StatusBar.left.options = Details.CopyTable (instance.StatusBarSaved.options [left]) + instance.StatusBar.left.options = Details.CopyTable(instance.StatusBarSaved.options [left]) end if (instance.StatusBarSaved.options and instance.StatusBarSaved.options [center]) then - instance.StatusBar.center.options = Details.CopyTable (instance.StatusBarSaved.options [center]) + instance.StatusBar.center.options = Details.CopyTable(instance.StatusBarSaved.options [center]) end if (instance.StatusBarSaved.options and instance.StatusBarSaved.options [right]) then - instance.StatusBar.right.options = Details.CopyTable (instance.StatusBarSaved.options [right]) + instance.StatusBar.right.options = Details.CopyTable(instance.StatusBarSaved.options [right]) end _detalhes.StatusBar:ApplyOptions (instance.StatusBar.left, "textcolor") @@ -469,9 +469,9 @@ --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) + --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") @@ -491,7 +491,7 @@ local _table = {} --treat as a class - setmetatable (_table, mainObject) + setmetatable(_table, mainObject) --default members _table.instance = instance @@ -504,7 +504,7 @@ if (not _table.options) then _table.options = { textStyle = 2, - textColor = {unpack (DEFAULT_CHILD_FONTCOLOR)}, + textColor = {unpack(DEFAULT_CHILD_FONTCOLOR)}, textSize = DEFAULT_CHILD_FONTSIZE, textAlign = 0, textXMod = 0, @@ -598,7 +598,7 @@ end end else - if (child [option] and type (child [option]) == "function") then + if (child [option] and type(child [option]) == "function") then child [option] (nil, child, value) end end @@ -615,7 +615,7 @@ do -- 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,9 +624,9 @@ 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) + _detalhes:CancelTimer(child.tick) child.tick = nil end end @@ -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,7 +643,7 @@ 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") end @@ -701,7 +701,7 @@ do -- _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 - print (install.errortext) + print(install.errortext) return end @@ -741,7 +741,7 @@ do 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 @@ -759,7 +759,7 @@ do if (child.options.segmentType == 1) then child.text:SetText(Loc ["STRING_CURRENT"]) else - local name = _detalhes.tabela_vigente:GetCombatName (true) + local name = _detalhes.tabela_vigente:GetCombatName(true) if (name and name ~= Loc ["STRING_UNKNOW"]) then if (child.options.segmentType == 2) then @@ -770,7 +770,7 @@ do else child.text:SetText(Loc ["STRING_CURRENT"]) if (_detalhes.in_combat and PSegment.can_schedule <= 2) then - PSegment:ScheduleTimer ("SchduleGetName", 2) + PSegment:ScheduleTimer("SchduleGetName", 2) PSegment.can_schedule = PSegment.can_schedule + 1 return end @@ -783,7 +783,7 @@ do child.text:SetText(Loc ["STRING_FIGHTNUMBER"] .. child.instance.segmento) else - local name = child.instance.showing:GetCombatName (true) + local name = child.instance.showing:GetCombatName(true) if (name ~= Loc ["STRING_UNKNOW"]) then if (child.options.segmentType == 2) then child.text:SetText(name) @@ -855,7 +855,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -881,7 +881,7 @@ 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) @@ -903,7 +903,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -929,7 +929,7 @@ do end --leave combat function Clock:PlayerLeaveCombat() - _detalhes:CancelTimer (Clock.tick) + _detalhes:CancelTimer(Clock.tick) end function _detalhes:ClockPluginTickOnSegment() @@ -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 @@ -966,7 +966,7 @@ do getSegment = getSegment+1 end - local lastFight = _detalhes:GetCombat (getSegment) + local lastFight = _detalhes:GetCombat(getSegment) local currentCombatTime = instance.showing:GetCombatTime() if (lastFight) then @@ -983,7 +983,7 @@ 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") end @@ -1061,7 +1061,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1080,7 +1080,7 @@ do local _UnitDetailedThreatSituation = UnitDetailedThreatSituation --wow api local _cstr = string.format --lua api - local _math_abs = math.abs --lua api + local abs = math.abs --lua api --Create the plugin Object local Threat = _detalhes:NewPluginObject ("Details_TargetThreat", DETAILSPLUGIN_ALWAYSENABLED, "STATUSBAR") @@ -1092,7 +1092,7 @@ do Threat.isTank = nil function Threat:PlayerEnterCombat() - local role = UnitGroupRolesAssigned ("player") + local role = UnitGroupRolesAssigned("player") if (role == "TANK") then Threat.isTank = true else @@ -1102,11 +1102,11 @@ do end function Threat:PlayerLeaveCombat() - _detalhes:CancelTimer (Threat.tick) + _detalhes:CancelTimer(Threat.tick) 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 @@ -1115,9 +1115,9 @@ do if (threatpct) then child.text:SetText(_math_floor(threatpct).."%") if (Threat.isTank) then - child.text:SetTextColor (_math_abs (threatpct-100)*0.01, threatpct*0.01, 0, 1) + child.text:SetTextColor (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) + child.text:SetTextColor (threatpct*0.01, abs(threatpct-100)*0.01, 0, 1) end else child.text:SetText("0%") @@ -1149,7 +1149,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1175,7 +1175,7 @@ do end function PFps:OnDisable() - self:CancelTimer (self.srt, true) + self:CancelTimer(self.srt, true) end function PFps:OnEnable() @@ -1192,7 +1192,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1214,7 +1214,7 @@ do end function PLatency:OnDisable() - self:CancelTimer (self.srt, true) + self:CancelTimer(self.srt, true) end function PLatency:OnEnable() @@ -1231,7 +1231,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1263,7 +1263,7 @@ do if (items == 0) then self.text:SetText(Loc ["STRING_UPTADING"]) - return self:ScheduleTimer ("UpdateDurability", 5, self) + return self:ScheduleTimer("UpdateDurability", 5, self) end percent = percent / items @@ -1311,7 +1311,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1329,7 +1329,7 @@ do 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() @@ -1360,7 +1360,7 @@ do myframe.widget:RegisterEvent ("PLAYER_ENTERING_WORLD") myframe.widget:SetScript("OnEvent", function(event) if (event == "PLAYER_ENTERING_WORLD") then - return PGold:ScheduleTimer ("GoldPluginTick", 10) + return PGold:ScheduleTimer("GoldPluginTick", 10) end PGold:GoldPluginTick() end) @@ -1371,7 +1371,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1398,7 +1398,7 @@ do end function PTime:OnDisable() - self:CancelTimer (self.srt, true) + self:CancelTimer(self.srt, true) end function PTime:OnEnable() @@ -1456,7 +1456,7 @@ do --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 - print (install.errortext) + print(install.errortext) return end @@ -1464,7 +1464,7 @@ end ---------default options panel ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -local window = _detalhes.gump:NewPanel (UIParent, nil, "DetailsStatusBarOptions", nil, 300, 180) +local window = _detalhes.gump:NewPanel(UIParent, nil, "DetailsStatusBarOptions", nil, 300, 180) tinsert(UISpecialFrames, "DetailsStatusBarOptions") window:SetPoint("center", UIParent, "center") window.locked = false @@ -1477,7 +1477,7 @@ 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) -local extraWindow = _detalhes.gump:NewPanel (window, nil, "DetailsStatusBarOptions2", "extra", 300, 180) +local extraWindow = _detalhes.gump:NewPanel(window, nil, "DetailsStatusBarOptions2", "extra", 300, 180) extraWindow:SetPoint("left", window, "right") extraWindow.close_with_right = true extraWindow.locked = false @@ -1498,13 +1498,13 @@ end) window.instance.StatusBar.center.options.textStyle = style window.instance.StatusBar.right.options.textStyle = style - if (window.instance.StatusBar.left.Refresh and type (window.instance.StatusBar.left.Refresh) == "function") then + if (window.instance.StatusBar.left.Refresh and type(window.instance.StatusBar.left.Refresh) == "function") then window.instance.StatusBar.left:Refresh (window.instance.StatusBar.left) end - if (window.instance.StatusBar.center.Refresh and type (window.instance.StatusBar.center.Refresh) == "function") then + if (window.instance.StatusBar.center.Refresh and type(window.instance.StatusBar.center.Refresh) == "function") then window.instance.StatusBar.center:Refresh (window.instance.StatusBar.center) end - if (window.instance.StatusBar.right.Refresh and type (window.instance.StatusBar.right.Refresh) == "function") then + if (window.instance.StatusBar.right.Refresh and type(window.instance.StatusBar.right.Refresh) == "function") then window.instance.StatusBar.right:Refresh (window.instance.StatusBar.right) end @@ -1530,7 +1530,7 @@ end) _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textcolor", color) end local canceledColor = function() - local r, g, b, a = unpack (ColorPickerFrame.previousValues) + local r, g, b, a = unpack(ColorPickerFrame.previousValues) window.textcolortexture:SetTexture(r, g, b, a) local color = {r, g, b, a} _detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textcolor", color) @@ -1544,7 +1544,7 @@ end) ColorPickerFrame.hasOpacity = false ColorPickerFrame.previousValues = window.child.options.textColor ColorPickerFrame:SetParent(window.widget) - ColorPickerFrame:SetColorRGB (unpack (window.child.options.textColor)) + ColorPickerFrame:SetColorRGB (unpack(window.child.options.textColor)) ColorPickerFrame:Show() end diff --git a/core/plugins_toolbar.lua b/core/plugins_toolbar.lua index bd186b54..f6c6c722 100644 --- a/core/plugins_toolbar.lua +++ b/core/plugins_toolbar.lua @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local _ @@ -90,7 +90,7 @@ if (instance.auto_hide_menu.left and not instance.is_interacting) then instance:ToolbarMenuButtons() - Button:SetAlpha (0) + Button:SetAlpha(0) return end @@ -203,9 +203,9 @@ end _detalhes:SetFontFace (f.desc, _detalhes.font_faces.menus) --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) + f.background:SetTexCoord (unpack(_detalhes.tooltip.menus_bg_coords)) + f.background:SetVertexColor(unpack(_detalhes.tooltip.menus_bg_color)) + --f.background:SetDesaturated(true) f.BackdropTable.bgFile = _detalhes.tooltip_backdrop.bgFile f.BackdropTable.edgeFile = [[Interface\Buttons\WHITE8X8]] --_detalhes.tooltip_backdrop.edgeFile diff --git a/core/timemachine.lua b/core/timemachine.lua index 46bde8db..6464eb63 100644 --- a/core/timemachine.lua +++ b/core/timemachine.lua @@ -8,7 +8,7 @@ --local pointers local _table_insert = table.insert --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _math_floor = math.floor --lua local local _time = time --lua local @@ -27,8 +27,8 @@ 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 tipo, tabela in _pairs(self.tabelas) 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 @@ -46,8 +46,8 @@ end local calc_for_pve = function(self) - for tipo, tabela in _pairs (self.tabelas) do - for nome, jogador in _ipairs(tabela) do + for tipo, tabela in _pairs(self.tabelas) 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 @@ -82,7 +82,7 @@ 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 @@ -93,7 +93,7 @@ self.ligada = false self.tabelas = nil if (self.atualizador) then - self:CancelTimer (self.atualizador) + self:CancelTimer(self.atualizador) self.atualizador = nil end end @@ -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 @@ -145,7 +145,7 @@ timeMachine.tabelas [tipo] = t if (_detalhes.debug) then - --_detalhes:Msg ("timemachine r"..removed.."| e"..#t.."| t"..tipo) + --_detalhes:Msg("timemachine r"..removed.."| e"..#t.."| t"..tipo) end end end @@ -257,6 +257,6 @@ end function _detalhes:PrintTimeMachineIndexes() - print ("timemachine damage", #timeMachine.tabelas [1]) - print ("timemachine heal", #timeMachine.tabelas [2]) + print("timemachine damage", #timeMachine.tabelas [1]) + print("timemachine heal", #timeMachine.tabelas [2]) end diff --git a/core/util.lua b/core/util.lua index b1673aff..26bc5521 100644 --- a/core/util.lua +++ b/core/util.lua @@ -1,13 +1,14 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers local upper = string.upper --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _math_floor = math.floor --lua local local _math_max = math.max --lua local @@ -22,7 +23,7 @@ local _strsplit = strsplit local _pcall = pcall local _GetTime = GetTime - + local _IsInRaid = IsInRaid --wow api local local _IsInGroup = IsInGroup --wow api local local _GetNumGroupMembers = GetNumGroupMembers --wow api local @@ -38,7 +39,7 @@ frames = {} } - + --fade in is hidding the frame, it is the opposite of the stardard local fadeINFinishedCallback = function(frame) if (frame.fading_in) then @@ -176,7 +177,7 @@ --hide all instanceBars on all instances if (frame == "all") then - for _, instancia in _ipairs(_detalhes.tabela_instancias) do + for _, instancia in ipairs(_detalhes.tabela_instancias) do if (hideType == "barras") then for i = 1, instancia.rows_created do local instanceBar = instancia.barras[i] @@ -185,7 +186,7 @@ end end return - + elseif (upper(animationType) == "IN") then --hide the frame --check if already hidden @@ -195,7 +196,7 @@ elseif (frame.fading_in) then return end - + --cancel face out animation if exists if (frame.fading_out) then frame.fading_out = false @@ -209,15 +210,15 @@ 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 frame.fading_in = false end - + frame:Show() startFadeOUTAnimation(frame, speed, frame:GetAlpha(), 1.0) frame.fading_out = true - + elseif (animationType == 0) then --force show the frame frame.hidden = false frame.faded = false @@ -226,7 +227,7 @@ cancelFadeAnimation(frame) --cancel any ongoing animation frame:Show() frame:SetAlpha(1) - + elseif (animationType == 1) then --force hide the frame frame.hidden = true frame.faded = true @@ -235,7 +236,7 @@ cancelFadeAnimation(frame) --cancel any ongoing animation frame:SetAlpha(0) frame:Hide() - + elseif (animationType == -1) then --just fade to zero without hidding the frame --check already hidden if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then @@ -244,7 +245,7 @@ elseif (frame.fading_in) then return end - + if (frame.fading_out) then frame.fading_out = false end @@ -256,7 +257,7 @@ local value = speed local currentApha = frame:GetAlpha() frame:Show() - + if (currentApha < value) then if (frame.fading_in) then frame.fading_in = false @@ -290,13 +291,13 @@ --get the npc id from guid function _detalhes:GetNpcIdFromGuid (guid) - local NpcId = _select ( 6, _strsplit ( "-", guid ) ) + local NpcId = _select( 6, _strsplit ( "-", guid ) ) if (NpcId) then return _tonumber ( NpcId ) end return 0 end - + function _detalhes:GetSourceFromNpcId (npcId) for index, container in ipairs(_detalhes.tabela_vigente) do if (index <= 4) then @@ -321,7 +322,7 @@ end return end - + function _detalhes:UnpackDeathTable (t) local deathevents = t[1] local deathtime = t[2] @@ -331,35 +332,35 @@ local deathtimestring = t[6] local lastcooldown = t.last_cooldown local deathcombattime = t.dead_at - + return playername, playerclass, deathtime, deathcombattime, deathtimestring, playermaxhealth, deathevents, lastcooldown end --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 - --return byte1 + _math_abs (_string_byte (name, 1)-91)/10000 + --local byte1 = abs(_string_byte (name, 2)-91)/1000000 + --return byte1 + abs(_string_byte (name, 1)-91)/10000 return _math_random (1000, 9000) / 1000000 end - - --/script print (tonumber (4/1000000)) - 4e-006 + + --/script print(tonumber (4/1000000)) - 4e-006 --0.000004 --set all table keys to lower local temptable = {} function _detalhes:LowerizeKeys (_table) - for key, value in _pairs (_table) do + for key, value in _pairs(_table) do temptable [string.lower (key)] = value end temptable, _table = table.wipe (_table), temptable return _table end - + _detalhes.ToKFunctions = {} - + --krKR by @yuk6196 (http://wow.curseforge.com/profiles/yuk6196) function _detalhes:UseEastAsianNumericalSystem() - + --try to auto detect the language local symbol_1K, symbol_10K, symbol_1B if (LibStub("AceLocale-3.0"):NewLocale ("Details", "koKR")) then --Korea @@ -369,19 +370,19 @@ elseif (LibStub("AceLocale-3.0"):NewLocale ("Details", "zhTW")) then --Taiwan 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" - + --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 if (_detalhes.numerical_system_symbols ~= "auto") then local locale = string.lower (_detalhes.numerical_system_symbols) - + if (locale == "kr") then symbol_1K, symbol_10K, symbol_1B = "천", "만", "억" elseif (locale == "cn") then @@ -390,13 +391,13 @@ symbol_1K, symbol_10K, symbol_1B = "千", "萬", "億" end 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. symbol_1K, symbol_10K, symbol_1B = "千", "万", "亿" end - + function _detalhes:ToK (numero) if (numero > 100000000) then return _string_format ("%.2f", numero/100000000) .. symbol_1B @@ -422,7 +423,7 @@ end return _string_format ("%.1f", numero) end - + --short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 100000000) then @@ -445,7 +446,7 @@ end return _string_format ("%.0f", numero) end - + function _detalhes:ToK2Min (numero) if (numero > 99999999) then return _string_format ("%.2f", numero/100000000) .. symbol_1B @@ -460,7 +461,7 @@ end return _string_format ("%.1f", numero) end - + --short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 100000000) then @@ -472,7 +473,7 @@ end return _string_format ("%.0f", numero) end - + --short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 100000000) then @@ -484,7 +485,7 @@ end return numero end - + function _detalhes:Format (n, custom) n = _math_floor(n) if (custom) then @@ -501,12 +502,12 @@ return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] (nil, n) end end - + --no changes function _detalhes:NoToK (numero) return _math_floor(numero) end - + -- thanks http://richard.warburton.it function _detalhes:comma_value (n) if (not n) then return "0" end @@ -521,9 +522,9 @@ local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end - + wipe (_detalhes.ToKFunctions) - + tinsert(_detalhes.ToKFunctions, _detalhes.NoToK) tinsert(_detalhes.ToKFunctions, _detalhes.ToK) tinsert(_detalhes.ToKFunctions, _detalhes.ToK2) @@ -532,9 +533,9 @@ tinsert(_detalhes.ToKFunctions, _detalhes.ToK2Min) tinsert(_detalhes.ToKFunctions, _detalhes.ToK0Min) tinsert(_detalhes.ToKFunctions, _detalhes.comma_value) - - end - + + end + function _detalhes:UseWestNumericalSystem() --short numbers function _detalhes:ToK (numero) @@ -545,10 +546,10 @@ elseif (numero > 999) then return _string_format ("%.1f", numero/1000) .. "K" end - + return _string_format ("%.0f", numero) end - + function _detalhes:ToK2 (numero) if (numero > 999999999) then return format ("%.2f", numero/1000000000) .. "B" @@ -559,10 +560,10 @@ elseif (numero > 999) then return _string_format ("%.1f", (numero/1000)) .. "K" end - + return _string_format ("%.0f", numero) end - + --short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 999999999) then @@ -572,20 +573,20 @@ elseif (numero > 1000) then return _string_format ("%.0f", numero/1000) .. "K" end - + return _string_format ("%.0f", numero) end - + function _detalhes:ToKMin (numero) if (numero > 1000000) then return _string_format ("%.2f", numero/1000000) .. "m" elseif (numero > 1000) then return _string_format ("%.1f", numero/1000) .. "k" end - + return _string_format ("%.0f", numero) end - + function _detalhes:ToK2Min (numero) if (numero > 999999) then return _string_format ("%.2f", numero/1000000) .. "m" @@ -594,10 +595,10 @@ elseif (numero > 999) then return _string_format ("%.1f", (numero/1000)) .. "k" end - + return _string_format ("%.0f", numero) end - + --short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 1000000) then @@ -605,10 +606,10 @@ elseif (numero > 1000) then return _string_format ("%.0f", numero/1000) .. "k" end - + return _string_format ("%.0f", numero) end - + --short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 1000000) then @@ -616,10 +617,10 @@ elseif (numero > 1000) then return _string_format ("%.1f", numero/1000) .. "K" end - + return numero end - + function _detalhes:Format (n, custom) n = _math_floor(n) if (custom) then @@ -634,12 +635,12 @@ return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] (nil, n) end end - + --no changes function _detalhes:NoToK (numero) return _math_floor(numero) end - + -- thanks http://richard.warburton.it function _detalhes:comma_value (n) if (not n) then return "0" end @@ -654,9 +655,9 @@ local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end - + wipe (_detalhes.ToKFunctions) - + tinsert(_detalhes.ToKFunctions, _detalhes.NoToK) tinsert(_detalhes.ToKFunctions, _detalhes.ToK) tinsert(_detalhes.ToKFunctions, _detalhes.ToK2) @@ -665,17 +666,17 @@ tinsert(_detalhes.ToKFunctions, _detalhes.ToK2Min) tinsert(_detalhes.ToKFunctions, _detalhes.ToK0Min) tinsert(_detalhes.ToKFunctions, _detalhes.comma_value) - + -- end - + --load western as default, the proper method is loaded within the profile _detalhes:UseWestNumericalSystem() function _detalhes:GetCurrentToKFunction() return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] end - + ------------------------------------------------------------------------------------------------------------ --numerical system @@ -684,31 +685,31 @@ language = "auto" end _detalhes.numerical_system_symbols = language - _detalhes:Msg ("NumSystem override is now:", language) - + _detalhes:Msg("NumSystem override is now:", language) + _detalhes:SelectNumericalSystem() end - + function _detalhes:GetNumericalSystem() return _detalhes.numerical_system end - + function _detalhes:SelectNumericalSystem (system) - if (not system or type (system) ~= "number") then + if (not system or type(system) ~= "number") then system = _detalhes.numerical_system or 1 end _detalhes.numerical_system = system - + if (system == 1) then _detalhes:UseWestNumericalSystem() elseif (system == 2) then _detalhes:UseEastAsianNumericalSystem() end - + _detalhes:UpdateToKFunctions() end - + function _detalhes:UpdateToKFunctions() _detalhes.atributo_damage:UpdateSelectedToKFunction() _detalhes.atributo_heal:UpdateSelectedToKFunction() @@ -717,16 +718,16 @@ _detalhes.atributo_custom:UpdateSelectedToKFunction() Details:RefreshMainWindow(-1, true) end - + --------end of ToK functions---- --replacing data for custom texts _detalhes.string = {} - + local function_cache = {} local arguments_cache = {} local parameters_cache = {} - + local replace_arg = function(i) return arguments_cache [tonumber(i)] end @@ -736,16 +737,16 @@ if (not func) then func = loadstring (str) if (not func) then - _detalhes:Msg ("|cFFFF9900error compiling script on custom text|r: ", errortext) + _detalhes:Msg("|cFFFF9900error compiling script on custom text|r: ", errortext) return 0 end DetailsFramework:SetEnvironment(func) function_cache [str] = func end - + local okey, value = _pcall (func, parameters_cache [1], parameters_cache [2], parameters_cache [3], parameters_cache [4], arguments_cache[1], arguments_cache[2], arguments_cache[3]) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom text|r:", value) + _detalhes:Msg("|cFFFF9900error on custom text|r:", value) return 0 end return value or 0 @@ -759,14 +760,14 @@ parameters_cache [2] = v5 parameters_cache [3] = v6 parameters_cache [4] = v7 - - return (str:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function)) + + return (str:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function)) end - + --remove a index from a hash table function _detalhes:tableRemove (tabela, indexName) local newtable = {} - for hash, value in _pairs (tabela) do + for hash, value in _pairs(tabela) do if (hash ~= indexName) then newtable [hash] = value end @@ -776,7 +777,7 @@ --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 @@ -794,9 +795,9 @@ end return new end - + _detalhes.table = {} - + function _detalhes.table.reverse (t) local new = {} local index = 1 @@ -807,20 +808,20 @@ return new end --yah, i know - + function _detalhes.table.copy (t1, t2) - for key, value in pairs(t2) do + for key, value in pairs(t2) do if (type(value) == "table") then - t1 [key] = Details.CopyTable (value) + t1 [key] = Details.CopyTable(value) else t1 [key] = value end end return t1 end - + function _detalhes.table.deploy (t1, t2) - for key, value in pairs(t2) do + for key, value in pairs(t2) do if (type(value) == "table") then t1 [key] = t1 [key] or {} _detalhes.table.deploy (t1 [key], t2 [key]) @@ -829,9 +830,9 @@ end end end - + function _detalhes.table.overwrite (t1, t2) - for key, value in pairs(t2) do + for key, value in pairs(t2) do if (type(value) == "table") then t1 [key] = t1 [key] or {} _detalhes.table.overwrite (t1 [key], t2 [key]) @@ -839,35 +840,35 @@ t1 [key] = value end end - end - + end + function _detalhes.table.dump (t, s, deep) if (type(t) == "number") then return t end - + s = s or "" deep = deep or 0 local space = "" for i = 1, deep do space = space .. " " end - + for key, value in pairs(t) do - - local tpe = type (value) - + + local tpe = type(value) + if (type(key) == "function") then key = "#function#" 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 s = s .. space .. "[" .. key .. "] = |cFFa9ffa9table {|r\n" @@ -876,26 +877,26 @@ end s = s .. _detalhes.table.dump (value, nil, deep+1) s = s .. space .. "|cFFa9ffa9}|r\n" - + elseif (tpe == "string") then s = s .. space .. "[\"" .. key .. "\"] = '|cFFfff1c1" .. value .. "|r'\n" - + elseif (tpe == "number") then s = s .. space .. "[\"" .. key .. "\"] = |cFFffc1f4" .. value .. "|r\n" - + elseif (tpe == "function") then s = s .. space .. "|cFFa9a9ff[\"|r" .. key .. "|cFFa9a9ff\"]|r = |cFFa9a9fffunction()|r\n" - + elseif (tpe == "boolean") then s = s .. space .. "[\"" .. key .. "\"] = |cFF99d0ff" .. (value and "true" or "false") .. "|r\n" - + end - + end - + return s end - + function _detalhes:hex (num) local hexstr = '0123456789abcdef' local s = '' @@ -905,12 +906,12 @@ num = math.floor(num / 16) end if s == '' then s = '00' end - if (string.len (s) == 1) then + if (string.len(s) == 1) then s = "0"..s end return s end - + function _detalhes:percent_color (value, inverted) local r, g if (value < 50) then @@ -918,13 +919,13 @@ else r = _math_floor( 255 - (value * 2 - 100) * 255 / 100) end - + if (value > 50) then g = 255 else g = _math_floor( (value * 2) * 255 / 100) end - + if (inverted) then return g/255, r/255, 0 else @@ -936,12 +937,12 @@ -- 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 i = 1, select('#', ...) do + for _, value in ipairs(select(i, ...)) do values[ #values + 1] = value end end - return unpack (values) + return unpack(values) end --trim http://lua-users.org/wiki/StringTrim @@ -949,11 +950,11 @@ local from = s:match"^%s*()" return from > #s and "" or s:match(".*%S", from) end - + -- lua base64 codec (c) 2006-2008 by Alex Kloss - http://www.it-rfc.de - licensed under the terms of the LGPL2 - http://lua-users.org/wiki/BaseSixtyFour do _detalhes._encode = {} - + -- shift left local function lsh (value,shift) return (value*(2^shift)) % 256 @@ -1021,7 +1022,7 @@ end r, g, b, a = gump:ParseColors(r, g, b, a) fontString:SetTextColor (r, g, b, a) end - + --font size function _detalhes:SetFontSize (fontString, ...) local fonte, _, flags = fontString:GetFont() @@ -1040,8 +1041,8 @@ end function _detalhes:GetFontFace (fontString) local fontface = fontString:GetFont() return fontface - end - + end + --font outline function _detalhes:SetFontOutline (fontString, outline) local fonte, size = fontString:GetFont() @@ -1054,7 +1055,7 @@ end outline = "THICKOUTLINE" end end - + if (_detalhes.force_font_outline ~= "") then if (_detalhes.force_font_outline == "OUTLINE") then outline = "OUTLINE" @@ -1067,7 +1068,7 @@ end fontString:SetFont (fonte, size, outline) end - + function _detalhes:UseOutline (outline) outline = outline or "" _detalhes.force_font_outline = outline @@ -1079,7 +1080,7 @@ end end end end - + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --internal functions @@ -1157,19 +1158,19 @@ end for i = 1, _GetNumGroupMembers(), 1 do local this_name, _ = UnitName ("raid"..i) if (this_name == name) then - return UnitGUID ("raid"..i) + return UnitGUID("raid"..i) end end elseif (_IsInGroup()) then for i = 1, _GetNumGroupMembers()-1, 1 do local this_name, _ = UnitName ("party"..i) if (this_name == name) then - return UnitGUID ("party"..i) + return UnitGUID("party"..i) end end end if (UnitName ("player") == name) then - return UnitGUID ("player") + return UnitGUID("player") end return nil end @@ -1190,41 +1191,41 @@ end self.FrameTime = self.FrameTime + elapsed 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 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) elseif (ThisGradient.ObjectType == "texture") then - ThisGradient.Object:SetVertexColor (red_now, green_now, blue_now, alpha_now) + ThisGradient.Object:SetVertexColor(red_now, green_now, blue_now, alpha_now) end - + if (percent == 100) then if (ThisGradient.Func) then local okey, errortext = _pcall (ThisGradient.Func, ThisGradient.FuncParam) if (not okey) then - _detalhes:Msg ("GradientEffect() end function error:", errortext) + _detalhes:Msg("GradientEffect() end function error:", errortext) end end - + ThisGradient.done = true done = true end end end - + if (done) then local _iter = {index = 1, data = self.gradientes [1]} - while (_iter.data) do + while (_iter.data) do if (_iter.data.done) then _iter.data.Object.HaveGradientEffect = false table.remove (self.gradientes, _iter.index) @@ -1234,35 +1235,35 @@ end _iter.data = self.gradientes [_iter.index] end end - + if (#self.gradientes < 1) then self.HaveGradientEffect = false end end end - + if (not self.HaveGradientEffect) then 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) - + EndRed, EndGreen, EndBlue, EndAlpha = unpack(StartGreen) + StartRed, StartGreen, StartBlue, StartAlpha = unpack(StartRed) + elseif (type(StartRed) == "table") then EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction = StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue - StartRed, StartGreen, StartBlue, StartAlpha = unpack (StartRed) - + StartRed, StartGreen, StartBlue, StartAlpha = unpack(StartRed) + elseif (type(EndRed) == "table") then Duration, EndFunction = EndGreen, EndBlue - EndRed, EndGreen, EndBlue, EndAlpha = unpack (EndRed) + EndRed, EndGreen, EndBlue, EndAlpha = unpack(EndRed) end - + if (not EndAlpha) then EndAlpha = 1.0 end @@ -1286,21 +1287,21 @@ end end if (not EndBlue or EndBlue > 1.0) then EndBlue = 1.0 - end - + end + local GradientFrameControl = _detalhes.listener GradientFrameControl.gradientes = GradientFrameControl.gradientes or {} - + for index = 1, #GradientFrameControl.gradientes do if (GradientFrameControl.gradientes[index].Object == Object) then GradientFrameControl.gradientes[index].done = true end end - if (EndFunction and type (EndFunction) == "string") then + if (EndFunction and type(EndFunction) == "string") then EndFunction = loadstring (EndFunction) or false end - + GradientFrameControl.gradientes [#GradientFrameControl.gradientes+1] = { Object = Object, ObjectType = string.lower (ObjectType), @@ -1308,59 +1309,59 @@ end FuncParam = FuncParam, TimeStart = GetTime(), Duration = Duration, - + StartRed = StartRed, StartGreen = StartGreen, StartBlue = StartBlue, StartAlpha = StartAlpha, - + OnePercentRed = StartRed > EndRed and (StartRed - EndRed) / 100 * -1 or (EndRed - StartRed) / 100, OnePercentGreen = StartGreen > EndGreen and (StartGreen - EndGreen) / 100 * -1 or (EndGreen - StartGreen) / 100, OnePercentBlue = StartBlue > EndBlue and (StartBlue - EndBlue) / 100 * -1 or (EndBlue - StartBlue) / 100, OnePercentAlpha = StartAlpha > EndAlpha and (StartAlpha - EndAlpha) / 100 * -1 or (EndAlpha - StartAlpha) /100, } - + Object.HaveGradientEffect = true GradientFrameControl.HaveGradientEffect = true - + if (not GradientFrameControl:GetScript("OnUpdate")) then GradientFrameControl:SetScript("OnUpdate", frame_task) end end - + --work around to solve the UI Frame Flashes local onFinish = function(self) if (self.showWhenDone) then - self.frame:SetAlpha (1) + self.frame:SetAlpha(1) else - self.frame:SetAlpha (0) + self.frame:SetAlpha(0) self.frame:Hide() end - + if (self.onFinishFunc) then self:onFinishFunc (self.frame) end end - + local stop = function(self) local FlashAnimation = self.FlashAnimation FlashAnimation:Stop() end local flash = function(self, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime, loopType) - + local FlashAnimation = self.FlashAnimation - + local fadeIn = FlashAnimation.fadeIn local fadeOut = FlashAnimation.fadeOut - + fadeIn:Stop() fadeOut:Stop() - + fadeIn:SetDuration(fadeInTime or 1) fadeIn:SetEndDelay (flashInHoldTime or 0) - + fadeOut:SetDuration(fadeOutTime or 1) fadeOut:SetEndDelay (flashOutHoldTime or 0) @@ -1368,45 +1369,45 @@ end FlashAnimation.loopTime = FlashAnimation:GetDuration() FlashAnimation.finishAt = GetTime() + flashDuration FlashAnimation.showWhenDone = showWhenDone - + FlashAnimation:SetLooping (loopType or "REPEAT") - + self:Show() - self:SetAlpha (0) + self:SetAlpha(0) FlashAnimation:Play() end - + function gump:CreateFlashAnimation (frame, onFinishFunc, onLoopFunc) - - local FlashAnimation = frame:CreateAnimationGroup() - + + local FlashAnimation = frame:CreateAnimationGroup() + 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:SetOrder (2) FlashAnimation.fadeIn:SetFromAlpha (0) FlashAnimation.fadeIn:SetToAlpha (1) - + frame.FlashAnimation = FlashAnimation FlashAnimation.frame = frame FlashAnimation.onFinishFunc = onFinishFunc - + FlashAnimation:SetScript("OnLoop", onLoopFunc) FlashAnimation:SetScript("OnFinished", onFinish) - + frame.Flash = flash frame.Stop = stop - + end --todo: remove the function creation everytime this function run. - - + + local fade_OUT_finished_func = function(frame) if (frame:IsShown() and frame.fading_out) then frame.hidden = false @@ -1416,13 +1417,13 @@ end frame:SetAlpha(0) end end - + local just_fade_func = function(frame) frame.hidden = false frame.faded = true frame.fading_in = false end - + local anim_OUT_alpha_func = function(frame) frame.fading_out = false end @@ -1431,14 +1432,14 @@ end frame.fading_in = false end - + --this functions should be called anymore function gump:Fade (frame, tipo, velocidade, parametros) 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 (velocidade) then @@ -1473,19 +1474,19 @@ end frame = frame.widget end 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 + 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)) end end end - + elseif (upper (tipo) == "IN") then if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --ja esta escondida @@ -1493,17 +1494,17 @@ end 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 frame.fading_out = false end -- _UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), 0) frame.fading_in = true - + frame.fadeInfo.finishedFunc = fade_IN_finished_func frame.fadeInfo.finishedArg1 = frame - + elseif (upper (tipo) == "OUT") then --aparecer if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --ja esta na tela @@ -1511,41 +1512,41 @@ end 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 frame.fading_in = false end - + frame:Show() -- _UIFrameFadeOut (frame, velocidade, frame:GetAlpha(), 1.0) frame.fading_out = true - + frame.fadeInfo.finishedFunc = fade_OUT_finished_func frame.fadeInfo.finishedArg1 = frame - + elseif (tipo == 0) then --for�a o frame a ser mostrado frame.hidden = false frame.faded = false frame.fading_out = false frame.fading_in = false frame:Show() - frame:SetAlpha (1) - + frame:SetAlpha(1) + elseif (tipo == 1) then --for�a o frame a ser hidado frame.hidden = true frame.faded = true frame.fading_out = false frame.fading_in = false - frame:SetAlpha (0) + 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 return 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 frame.fading_out = false end @@ -1560,7 +1561,7 @@ end local value = velocidade local currentApha = frame:GetAlpha() frame:Show() - + if (currentApha < value) then if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true frame.fading_in = false @@ -1579,7 +1580,7 @@ end end -- _UIFrameFadeIn (frame, 0.3, currentApha, value) frame.fading_in = true - + frame.fadeInfo.finishedFunc = anim_IN_alpha_func frame.fadeInfo.finishedArg1 = frame end @@ -1594,7 +1595,7 @@ end frame.fading_in = false frame.fading_out = false frame:Show() - frame:SetAlpha (velocidade) + frame:SetAlpha(velocidade) end end @@ -1620,7 +1621,7 @@ end function _detalhes:name_space_generic (barra, separador) local texto_direita_tamanho = barra.lineText4:GetStringWidth() local tamanho = barra:GetWidth()-texto_direita_tamanho-16 - if (separador) then + if (separador) then barra.lineText1:SetSize(tamanho+separador, 10) barra.lineText4:SetSize(texto_direita_tamanho+15, 10) else diff --git a/core/windows.lua b/core/windows.lua index ba32673c..5d1031fc 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -1,30 +1,24 @@ - local _detalhes = _G._detalhes + local Details = _G._detalhes local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") local libwindow = LibStub("LibWindow-1.1") - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---local pointers - - local _math_floor = math.floor --lua local - local _type = type --lua local - local _math_abs = math.abs --lua local - local _math_min = math.min - local _math_max = math.max - local _ipairs = ipairs --lua local - - local _UIParent = UIParent --wow api local - - local gump = _detalhes.gump --details local local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---constants +--local pointers + local floor = math.floor --lua local + local type = type --lua local + local abs = math.abs --lua local + local _math_min = math.min + local _math_max = math.max + local ipairs = ipairs --lua local + local gump = Details.gump --details local +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--constants local end_window_spacement = 0 --settings - local animation_speed = 33 local animation_speed_hightravel_trigger = 5 local animation_speed_hightravel_maxspeed = 3 @@ -38,7 +32,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --core - function _detalhes:AnimarSplit (barra, goal) + function Details:AnimarSplit(barra, goal) barra.inicio = barra.split.barra:GetValue() barra.fim = goal barra.proximo_update = 0 @@ -46,7 +40,7 @@ barra:SetScript("OnUpdate", self.FazerAnimacaoSplit) end - function _detalhes:FazerAnimacaoSplit (elapsed) + function Details:FazerAnimacaoSplit(elapsed) local velocidade = 0.8 if (self.fim > self.inicio) then @@ -73,13 +67,9 @@ self.proximo_update = 0 end - - - function _detalhes:PerformAnimations (amt_barras) - + function Details:PerformAnimations(amtLines) 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, amtLines) - 1, 1, -1 do local row = self.barras [i] local row_proxima = self.barras [i-1] @@ -108,7 +98,7 @@ end else if (row.animacao_fim ~= row.animacao_fim2) then - _detalhes:AnimarBarra (row, row.animacao_fim) + Details:AnimarBarra (row, row.animacao_fim) row.animacao_fim2 = row.animacao_fim end end @@ -143,7 +133,7 @@ end else if (row.animacao_fim ~= row.animacao_fim2) then - _detalhes:AnimarBarra (row, row.animacao_fim) + Details:AnimarBarra (row, row.animacao_fim) row.animacao_fim2 = row.animacao_fim end end @@ -202,7 +192,7 @@ animation_func_left = animation_left_simple animation_func_right = animation_right_simple - function _detalhes:AnimarBarra (esta_barra, fim) + function Details:AnimarBarra (esta_barra, fim) esta_barra.inicio = esta_barra.statusbar.value esta_barra.fim = fim esta_barra.tem_animacao = true @@ -214,8 +204,8 @@ end end - function _detalhes:RefreshAnimationFunctions() - if (_detalhes.streamer_config.use_animation_accel) then + function Details:RefreshAnimationFunctions() + if (Details.streamer_config.use_animation_accel) then animation_func_left = animation_left_with_accel animation_func_right = animation_right_with_accel @@ -224,14 +214,14 @@ 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 + animation_speed = Details.animation_speed + animation_speed_hightravel_trigger = Details.animation_speed_triggertravel + animation_speed_hightravel_maxspeed = Details.animation_speed_maxtravel + animation_speed_lowtravel_minspeed = Details.animation_speed_mintravel end --deprecated - function _detalhes:FazerAnimacao_Esquerda (deltaTime) + function Details:FazerAnimacao_Esquerda (deltaTime) self.inicio = self.inicio - (animation_speed * deltaTime) self:SetValue(self.inicio) if (self.inicio-1 <= self.fim) then @@ -239,7 +229,8 @@ self:SetScript("OnUpdate", nil) end end - function _detalhes:FazerAnimacao_Direita (deltaTime) + + function Details:FazerAnimacao_Direita (deltaTime) self.inicio = self.inicio + (animation_speed * deltaTime) self:SetValue(self.inicio) if (self.inicio+0.1 >= self.fim) then @@ -248,7 +239,7 @@ end end - function _detalhes:AtualizaPontos() + function Details:AtualizaPontos() local _x, _y = self:GetPositionOnScreen() if (not _x) then return @@ -287,7 +278,7 @@ --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() + function Details:RestoreLibWindow() local frame = self.baseframe if (frame) then if (self.libwindow.x) then @@ -319,7 +310,7 @@ 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) + --_detalhes:ScheduleTimer("SaveLibWindow", 0.05, self) return end @@ -333,12 +324,12 @@ --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() + function Details:SaveLibWindow() local frame = self.baseframe if (frame) then local left = frame:GetLeft() if (not left) then - return _detalhes:ScheduleTimer ("SaveLibWindow", 0.05, self) + return Details:ScheduleTimer("SaveLibWindow", 0.05, self) end --Details: we are always using UIParent here or the addon break when using Embeds. local parent = UIParent --local parent = frame:GetParent() or nilParent @@ -387,18 +378,17 @@ --end for libwindow-1.1 -------------------------------------------------------------------------------------------------------- - function _detalhes:SaveMainWindowSize() - + function Details:SaveMainWindowSize() local baseframe_width = self.baseframe:GetWidth() if (not baseframe_width) then - return _detalhes:ScheduleTimer ("SaveMainWindowSize", 1, self) + return Details:ScheduleTimer("SaveMainWindowSize", 1, self) end local baseframe_height = self.baseframe:GetHeight() --calc position local _x, _y = self:GetPositionOnScreen() if (not _x) then - return _detalhes:ScheduleTimer ("SaveMainWindowSize", 1, self) + return Details:ScheduleTimer("SaveMainWindowSize", 1, self) end --save the position @@ -442,8 +432,7 @@ return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = _x, y = _y} end - function _detalhes:SaveMainWindowPosition (instance) - + function Details:SaveMainWindowPosition (instance) if (instance) then self = instance end @@ -452,14 +441,14 @@ --get sizes local baseframe_width = self.baseframe:GetWidth() if (not baseframe_width) then - return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) + return Details:ScheduleTimer("SaveMainWindowPosition", 1, self) end local baseframe_height = self.baseframe:GetHeight() --calc position local _x, _y = self:GetPositionOnScreen() if (not _x) then - return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) + return Details:ScheduleTimer("SaveMainWindowPosition", 1, self) end if (self.mostrando ~= "solo") then @@ -505,9 +494,8 @@ 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 + function Details:RestoreMainWindowPosition (pre_defined) + if (not pre_defined and self.libwindow.x and self.mostrando == "normal" and not Details.instances_no_libwindow) then local s = self.window_scale self.baseframe:SetScale(s) self.rowframe:SetScale(s) @@ -525,7 +513,7 @@ self.rowframe:SetScale(s) local _scale = self.baseframe:GetEffectiveScale() - local _UIscale = _UIParent:GetScale() + local _UIscale = UIParent:GetScale() local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale @@ -537,24 +525,22 @@ 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.") + Details: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: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) - + function Details:RestoreMainWindowPositionNoResize (pre_defined, x, y) x = x or 0 y = y or 0 local _scale = self.baseframe:GetEffectiveScale() - local _UIscale = _UIParent:GetScale() + local _UIscale = UIParent:GetScale() local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale @@ -567,11 +553,11 @@ end self.baseframe:ClearAllPoints() - self.baseframe:SetPoint("CENTER", _UIParent, "CENTER", novo_x + x, novo_y + y) + 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() + function Details:CreatePositionTable() local t = {pos_table = true} if (self.libwindow) then @@ -592,7 +578,7 @@ return t end - function _detalhes:RestorePositionFromPositionTable (t) + function Details:RestorePositionFromPositionTable (t) if (not t.pos_table) then return end @@ -613,8 +599,8 @@ return self:RestoreMainWindowPosition() end - function _detalhes:ResetaGump (instancia, tipo, segmento) - if (not instancia or _type(instancia) == "boolean") then + function Details:ResetaGump (instancia, tipo, segmento) + if (not instancia or type(instancia) == "boolean") then segmento = tipo tipo = instancia instancia = self @@ -645,24 +631,22 @@ end instancia.need_rolagem = false instancia.bar_mod = nil - end - function _detalhes:ReajustaGump() - + function Details:ReajustaGump() 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 + 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 ((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()) local mod @@ -676,15 +660,17 @@ end end 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 + 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 + 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 @@ -699,7 +685,7 @@ --reajusta o freeze if (self.freezed) then - _detalhes:Freeze (self) + Details:Freeze (self) end -- -4 difere a precis�o de quando a barra ser� adicionada ou apagada da barra @@ -707,14 +693,14 @@ 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) + T = floor(self.baseframe.BoxBarrasAltura / self.row_height) end --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) + self.rows_fit_in_window = 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 @@ -758,6 +744,7 @@ 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 @@ -794,7 +781,7 @@ 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) + local perdeu = abs(barras_diff) if (fim_iterator == X) then --se o iterator tiver na ultima posi��o perdeu = perdeu - (C - X) @@ -827,6 +814,7 @@ self:EsconderScrollBar() end self.need_rolagem = false + else --ligar ou atualizar a rolagem if (not self.rolagem and not self.baseframe.isStretching) then self:MostrarScrollBar() @@ -841,7 +829,6 @@ local tabela = esta_barra.minha_tabela if (tabela) then --a barra esta mostrando alguma coisa - if (tabela._custom) then tabela (esta_barra, self) elseif (tabela._refresh_window) then @@ -849,7 +836,6 @@ else tabela:RefreshBarra (esta_barra, self, true) end - end whichRowLine = whichRowLine+1 @@ -857,7 +843,6 @@ --for�a o pr�ximo refresh self.showing[self.atributo].need_refresh = true - end end @@ -868,7 +853,7 @@ 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 + Details.cooltip_preset3_backdrop = preset3_backdrop local white_table = {1, 1, 1, 1} local black_table = {0, 0, 0, 1} @@ -876,10 +861,10 @@ 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.cooltip_preset2_backdrop = preset2_backdrop --"Details BarBorder 3" - function _detalhes:CooltipPreset(preset) + function Details:CooltipPreset(preset) local GameCooltip = GameCooltip GameCooltip:Reset() @@ -931,39 +916,37 @@ 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.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"]:InstallCustomTexture() - _detalhes.yesNo ["yes"]:InstallCustomTexture() - _detalhes.yesNo ["yes"]:SetHook("OnMouseUp", function() _detalhes.yesNo:Hide() end) - function _detalhes:Ask (msg, func, ...) - _detalhes.yesNo ["ask"].text = msg + Details.yesNo = Details.gump:NewPanel(UIParent, _, "DetailsYesNoWindow", _, 500, 80) + Details.yesNo:SetPoint("center", UIParent, "center") + Details.gump:NewLabel(Details.yesNo, _, "$parentAsk", "ask", "") + Details.yesNo ["ask"]:SetPoint("center", Details.yesNo, "center", 0, 25) + Details.yesNo ["ask"]:SetWidth(480) + Details.yesNo ["ask"]:SetJustifyH("center") + Details.yesNo ["ask"]:SetHeight(22) + Details.gump:NewButton(Details.yesNo, _, "$parentNo", "no", 100, 30, function() Details.yesNo:Hide() end, nil, nil, nil, Loc ["STRING_NO"]) + Details.gump:NewButton(Details.yesNo, _, "$parentYes", "yes", 100, 30, nil, nil, nil, nil, Loc ["STRING_YES"]) + Details.yesNo ["no"]:SetPoint(10, -45) + Details.yesNo ["yes"]:SetPoint(390, -45) + Details.yesNo ["no"]:InstallCustomTexture() + Details.yesNo ["yes"]:InstallCustomTexture() + Details.yesNo ["yes"]:SetHook("OnMouseUp", function() Details.yesNo:Hide() end) + function Details:Ask (msg, func, ...) + Details.yesNo ["ask"].text = msg local p1, p2 = ... - _detalhes.yesNo ["yes"]:SetClickFunction(func, p1, p2) - _detalhes.yesNo:Show() + Details.yesNo ["yes"]:SetClickFunction(func, p1, p2) + Details.yesNo:Show() end - _detalhes.yesNo:Hide() + Details.yesNo:Hide() end --cria o frame de wait for plugin - function _detalhes:CreateWaitForPlugin() - + function Details:CreateWaitForPlugin() local WaitForPluginFrame = CreateFrame("frame", "DetailsWaitForPluginFrame" .. self.meu_id, UIParent,"BackdropTemplate") local WaitTexture = WaitForPluginFrame:CreateTexture(nil, "overlay") WaitTexture:SetTexture("Interface\\CHARACTERFRAME\\Disconnect-Icon") @@ -981,7 +964,7 @@ --RotateAnimGroup:SetLooping ("repeat") rotate:SetTarget(WaitTexture) - local bgpanel = gump:NewPanel (WaitForPluginFrame, WaitForPluginFrame, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false) + 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) @@ -997,11 +980,10 @@ 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) + -- self.waiting_pid = self:ScheduleTimer("ExecDelayedPlugin1", 5, self) --end WaitForPluginFrame:SetParent(self.baseframe) @@ -1010,7 +992,7 @@ bgpanel:SetPoint("topleft", self.baseframe, 0, 0) bgpanel:SetPoint("bottomright", self.baseframe, 0, 0) - --local size = math.max (self.baseframe:GetHeight()* 0.35, 100) + --local size = math.max(self.baseframe:GetHeight()* 0.35, 100) --WaitForPluginFrame.wheel:SetWidth(size) --WaitForPluginFrame.wheel:SetHeight(size) WaitForPluginFrame:Show() @@ -1020,7 +1002,7 @@ self.waiting_raid_plugin = true - self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self) + self.waiting_pid = self:ScheduleTimer("ExecDelayedPlugin1", 5, self) end function self:CancelWaitForPlugin() @@ -1040,11 +1022,11 @@ label:Hide() bgpanel:Hide() - if (self.meu_id == _detalhes.solo) then - _detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode) + if (self.meu_id == Details.solo) then + Details.SoloTables:switch(nil, Details.SoloTables.Mode) - elseif (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then - _detalhes.RaidTables:EnableRaidMode (self) + elseif (self.modo == Details._detalhes_props["MODO_RAID"]) then + Details.RaidTables:EnableRaidMode (self) end end @@ -1064,7 +1046,7 @@ rotate:SetDuration(60) RotateAnimGroup:SetLooping ("repeat") - local bgpanel = gump:NewPanel (UIParent, UIParent, "DetailsWaitFrameBG", nil, 120, 30, false, false, false) + 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) @@ -1077,17 +1059,16 @@ WaitForPluginFrame:Hide() - function _detalhes:WaitForSoloPlugin (instancia) - + function Details:WaitForSoloPlugin(instancia) instancia:ChangeIcon ([[Interface\GossipFrame\ActiveQuestIcon]]) if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == instancia.baseframe) then - return _detalhes:ScheduleTimer ("ExecDelayedPlugin", 5, instancia) + return Details:ScheduleTimer("ExecDelayedPlugin", 5, instancia) end WaitForPluginFrame:SetParent(instancia.baseframe) WaitForPluginFrame:SetAllPoints(instancia.baseframe) - local size = math.max (instancia.baseframe:GetHeight()* 0.35, 100) + local size = math.max(instancia.baseframe:GetHeight()* 0.35, 100) WaitForPluginFrame.wheel:SetWidth(size) WaitForPluginFrame.wheel:SetHeight(size) WaitForPluginFrame:Show() @@ -1095,39 +1076,37 @@ bgpanel:Show() RotateAnimGroup:Play() - return _detalhes:ScheduleTimer ("ExecDelayedPlugin", 5, instancia) + return Details:ScheduleTimer("ExecDelayedPlugin", 5, instancia) end - function _detalhes:CancelWaitForPlugin() + function Details:CancelWaitForPlugin() RotateAnimGroup:Stop() WaitForPluginFrame:Hide() label:Hide() bgpanel:Hide() end - function _detalhes:ExecDelayedPlugin (instancia) + function Details:ExecDelayedPlugin(instancia) RotateAnimGroup:Stop() WaitForPluginFrame:Hide() label:Hide() bgpanel:Hide() - if (instancia.meu_id == _detalhes.solo) then - _detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode) + if (instancia.meu_id == Details.solo) then + Details.SoloTables:switch(nil, Details.SoloTables.Mode) - elseif (instancia.meu_id == _detalhes.raid) then - _detalhes.RaidTables:switch (nil, _detalhes.RaidTables.Mode) + elseif (instancia.meu_id == Details.raid) then + Details.RaidTables:switch(nil, Details.RaidTables.Mode) end end end - --feedback window - function _detalhes:OpenFeedbackWindow() - + function Details:OpenFeedbackWindow() if (not _G.DetailsFeedbackPanel) then - gump:CreateSimplePanel (UIParent, 340, 300, Loc ["STRING_FEEDBACK_SEND_FEEDBACK"], "DetailsFeedbackPanel") + 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"]) @@ -1136,9 +1115,9 @@ 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:SetDesaturated(true) + curse:SetDesaturated(true) + mmoc:SetDesaturated(true) wowi:SetPoint("topleft", panel, "topleft", 17, -100) curse:SetPoint("topleft", panel, "topleft", 17, -160) @@ -1166,40 +1145,40 @@ mmoc_desc:SetPoint("topleft", mmoc_title, "bottomleft", 0, -1) local on_enter = function(self, capsule) - capsule.image:SetDesaturated (false) + capsule.image:SetDesaturated(false) end local on_leave = function(self, capsule) - capsule.image:SetDesaturated (true) + 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]]) + Details: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]]) + Details: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]]) + Details: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) + local wowi_button = gump:CreateButton(panel, on_click, 103, 34, "", 1) 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) - local curse_button = gump:CreateButton (panel, on_click, 103, 34, "", 2) + local curse_button = gump:CreateButton(panel, on_click, 103, 34, "", 2) 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) - local mmoc_button = gump:CreateButton (panel, on_click, 103, 34, "", 3) + local mmoc_button = gump:CreateButton(panel, on_click, 103, 34, "", 3) mmoc_button:SetPoint("topleft", mmoc, "topleft", -1, 0) mmoc_button:InstallCustomTexture (nil, nil, nil, nil, true) mmoc_button.image = mmoc @@ -1209,10 +1188,8 @@ end _G.DetailsFeedbackPanel:Show() - end - --interface menu local f = CreateFrame("frame", "DetailsInterfaceOptionsPanel", UIParent,"BackdropTemplate") f.name = "Details" @@ -1230,36 +1207,37 @@ f.options_button:SetHeight(170) f.options_button:SetWidth(170) f.options_button:SetScript("OnClick", function(self) - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() if (not lower_instance) then --no window opened? - local instance1 = _detalhes.tabela_instancias [1] + local instance1 = Details.tabela_instancias [1] if (instance1) then instance1:Enable() - return _detalhes:OpenOptionsWindow (instance1) + return Details:OpenOptionsWindow (instance1) else - instance1 = _detalhes:CriarInstancia (_, true) + instance1 = Details:CriarInstancia(_, true) if (instance1) then - return _detalhes:OpenOptionsWindow (instance1) + return Details:OpenOptionsWindow (instance1) else - _detalhes:Msg ("couldn't open options panel: no window available.") + Details:Msg("couldn't open options panel: no window available.") end end end - _detalhes:OpenOptionsWindow (_detalhes:GetInstance(lower_instance)) + Details:OpenOptionsWindow (Details: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) - _detalhes:CriarInstancia (_, true) + Details:CriarInstancia(_, true) end) --update details version window - function _detalhes:OpenUpdateWindow() + function Details:OpenUpdateWindow() if (not _G.DetailsUpdateDialog) then local updatewindow_frame = CreateFrame("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate") @@ -1283,7 +1261,7 @@ 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) + local editbox = Details.gump:NewTextEntry(updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14) editbox:SetPoint(20, -136) editbox:SetAutoFocus (false) editbox:SetHook("OnEditFocusGained", function() @@ -1313,25 +1291,23 @@ editbox:ClearFocus() end) - function _detalhes:UpdateDialogSetFocus() + function Details:UpdateDialogSetFocus() DetailsUpdateDialog:Show() DetailsUpdateDialogTextEntry.MyObject:SetFocus() DetailsUpdateDialogTextEntry.MyObject:HighlightText() end - _detalhes:ScheduleTimer ("UpdateDialogSetFocus", 1) + Details:ScheduleTimer("UpdateDialogSetFocus", 1) end end --minimap icon and hotcorner - function _detalhes:RegisterMinimap() - - local LDB = LibStub ("LibDataBroker-1.1", true) - local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) + function Details: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]], @@ -1340,14 +1316,13 @@ HotCornerIgnore = true, OnClick = function(self, button) - if (button == "LeftButton") then if (IsControlKeyDown()) then - _detalhes:ToggleWindows() + Details:ToggleWindows() return end --1 = open options panel - if (_detalhes.minimap.onclick_what_todo == 1) then + if (Details.minimap.onclick_what_todo == 1) then if (_G.DetailsOptionsWindow) then if (_G.DetailsOptionsWindow:IsShown()) then @@ -1356,27 +1331,27 @@ end end - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() if (not lower_instance) then - local instance = _detalhes:GetInstance(1) - _detalhes.CriarInstancia (_, _, 1) - _detalhes:OpenOptionsWindow (instance) + local instance = Details:GetInstance(1) + Details.CriarInstancia (_, _, 1) + Details:OpenOptionsWindow (instance) else - _detalhes:OpenOptionsWindow (_detalhes:GetInstance(lower_instance)) + Details:OpenOptionsWindow (Details:GetInstance(lower_instance)) end --2 = reset data - elseif (_detalhes.minimap.onclick_what_todo == 2) then - _detalhes.tabela_historico:resetar() + elseif (Details.minimap.onclick_what_todo == 2) then + Details.tabela_historico:resetar() --3 = show hide windows - elseif (_detalhes.minimap.onclick_what_todo == 3) then - local opened = _detalhes:GetOpenedWindowsAmount() + elseif (Details.minimap.onclick_what_todo == 3) then + local opened = Details:GetOpenedWindowsAmount() if (opened == 0) then - _detalhes:ReabrirTodasInstancias() + Details:ReabrirTodasInstancias() else - _detalhes:ShutDownAllInstances() + Details:ShutDownAllInstances() end end @@ -1399,40 +1374,40 @@ --GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10) --reset - GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_ERASE_DATA"], nil, true) + GameCooltip:AddMenu (1, Details.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") + GameCooltip:AddLine("$div") --nova instancia - GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_NEWWINDOW"], nil, true) + GameCooltip:AddMenu (1, Details.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 - GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true) + GameCooltip:AddMenu (1, Details.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 - GameCooltip:AddMenu (1, _detalhes.ShutDownAllInstances, true, nil, nil, Loc ["STRING_MINIMAPMENU_CLOSEALL"], nil, true) + GameCooltip:AddMenu (1, Details.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") + GameCooltip:AddLine("$div") --lock - GameCooltip:AddMenu (1, _detalhes.TravasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_LOCK"], nil, true) + GameCooltip:AddMenu (1, Details.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:AddMenu (1, Details.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") + GameCooltip:AddLine("$div") --disable minimap icon local disable_minimap = function() - _detalhes.minimap.hide = not value + Details.minimap.hide = not value - LDBIcon:Refresh ("Details", _detalhes.minimap) - if (_detalhes.minimap.hide) then + LDBIcon:Refresh ("Details", Details.minimap) + if (Details.minimap.hide) then LDBIcon:Hide ("Details") else LDBIcon:Show ("Details") @@ -1443,7 +1418,7 @@ -- - GameCooltip:SetBackdrop(1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) + GameCooltip:SetBackdrop(1, Details.tooltip_backdrop, nil, Details.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") @@ -1453,16 +1428,16 @@ end end, OnTooltipShow = function(tooltip) - tooltip:AddLine ("Details!", 1, 1, 1) - if (_detalhes.minimap.onclick_what_todo == 1) then - tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP1"]) - elseif (_detalhes.minimap.onclick_what_todo == 2) then - tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP11"]) - elseif (_detalhes.minimap.onclick_what_todo == 3) then - tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP12"]) + tooltip:AddLine("Details!", 1, 1, 1) + if (Details.minimap.onclick_what_todo == 1) then + tooltip:AddLine(Loc ["STRING_MINIMAP_TOOLTIP1"]) + elseif (Details.minimap.onclick_what_todo == 2) then + tooltip:AddLine(Loc ["STRING_MINIMAP_TOOLTIP11"]) + elseif (Details.minimap.onclick_what_todo == 3) then + tooltip:AddLine(Loc ["STRING_MINIMAP_TOOLTIP12"]) end - tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP2"]) - tooltip:AddLine ("|cFFCFCFCFctrl + left click|r: show/hide windows") + tooltip:AddLine(Loc ["STRING_MINIMAP_TOOLTIP2"]) + tooltip:AddLine("|cFFCFCFCFctrl + left click|r: show/hide windows") end, }) @@ -1470,51 +1445,50 @@ LDBIcon:Register ("Details", databroker, self.minimap) end - _detalhes.databroker = databroker - + Details.databroker = databroker end end - function _detalhes:DoRegisterHotCorner() + function Details:DoRegisterHotCorner() --register lib-hotcorners local on_click_on_hotcorner_button = function(frame, button) - if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then - local lower_instance = _detalhes:GetLowerInstanceNumber() + if (Details.hotcorner_topleft.onclick_what_todo == 1) then + local lower_instance = Details:GetLowerInstanceNumber() if (not lower_instance) then - local instance = _detalhes:GetInstance(1) - _detalhes.CriarInstancia (_, _, 1) - _detalhes:OpenOptionsWindow (instance) + local instance = Details:GetInstance(1) + Details.CriarInstancia (_, _, 1) + Details:OpenOptionsWindow (instance) else - _detalhes:OpenOptionsWindow (_detalhes:GetInstance(lower_instance)) + Details:OpenOptionsWindow (Details:GetInstance(lower_instance)) end - elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then - _detalhes.tabela_historico:resetar() + elseif (Details.hotcorner_topleft.onclick_what_todo == 2) then + Details.tabela_historico:resetar() end end local quickclick_func1 = function(frame, button) - _detalhes.tabela_historico:resetar() + Details.tabela_historico:resetar() end local quickclick_func2 = function(frame, button) - local lower_instance = _detalhes:GetLowerInstanceNumber() + local lower_instance = Details:GetLowerInstanceNumber() if (not lower_instance) then - local instance = _detalhes:GetInstance(1) - _detalhes.CriarInstancia (_, _, 1) - _detalhes:OpenOptionsWindow (instance) + local instance = Details:GetInstance(1) + Details.CriarInstancia (_, _, 1) + Details:OpenOptionsWindow (instance) else - _detalhes:OpenOptionsWindow (_detalhes:GetInstance(lower_instance)) + Details:OpenOptionsWindow (Details: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) + GameTooltip:AddLine("Details!", 1, 1, 1, 1) + if (Details.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) + elseif (Details.hotcorner_topleft.onclick_what_todo == 2) then + GameTooltip:AddLine("|cFF00FF00Left Click:|r clear all segments.", 1, 1, 1, 1) end end @@ -1526,7 +1500,7 @@ --corner "TOPLEFT", --config table - _detalhes.hotcorner_topleft, + Details.hotcorner_topleft, --frame _G name "DetailsLeftCornerButton", --icon @@ -1555,8 +1529,8 @@ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~API -function _detalhes:InitializeAPIWindow() - local DetailsAPI2Frame = gump:CreateSimplePanel (UIParent, 700, 480, "Details! API", "DetailsAPI2Frame") +function Details:InitializeAPIWindow() + local DetailsAPI2Frame = gump:CreateSimplePanel(UIParent, 700, 480, "Details! API", "DetailsAPI2Frame") DetailsAPI2Frame.Frame = DetailsAPI2Frame DetailsAPI2Frame.__name = "API" DetailsAPI2Frame.real_name = "DETAILS_APIWINDOW" @@ -1566,11 +1540,11 @@ function _detalhes:InitializeAPIWindow() DetailsPluginContainerWindow.EmbedPlugin(DetailsAPI2Frame, DetailsAPI2Frame, true) function DetailsAPI2Frame.RefreshWindow() - _detalhes.OpenAPI() + Details.OpenAPI() end end -function _detalhes.OpenAPI() +function Details.OpenAPI() --create the window if not loaded yet Details:CreateAPI2Frame() @@ -1579,75 +1553,73 @@ function _detalhes.OpenAPI() DetailsPluginContainerWindow.OpenPlugin(DetailsAPI2Frame) end - - function Details:LoadFramesForBroadcastTools() --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 not loaded, load it + if (Details.event_tracker.enabled and not Details.Broadcaster_EventTrackerLoaded) then + Details:CreateEventTrackerFrame(UIParent, "DetailsEventTracker") + end - --if enabled and loaded, refresh and show - if (_detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then - _detalhes:UpdateEventTrackerFrame() - _G.DetailsEventTracker:Show() - end + --if enabled and loaded, refresh and show + if (Details.event_tracker.enabled and Details.Broadcaster_EventTrackerLoaded) then + Details:UpdateEventTrackerFrame() + _G.DetailsEventTracker:Show() + end - --if not enabled but loaded, hide it - if (not _detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then - _G.DetailsEventTracker:Hide() - end + --if not enabled but loaded, hide it + if (not Details.event_tracker.enabled and Details.Broadcaster_EventTrackerLoaded) then + _G.DetailsEventTracker:Hide() + end --current dps - local bIsEnabled = _detalhes.realtime_dps_meter.enabled and (_detalhes.realtime_dps_meter.arena_enabled or _detalhes.realtime_dps_meter.mythic_dungeon_enabled) + local bIsEnabled = Details.realtime_dps_meter.enabled and (Details.realtime_dps_meter.arena_enabled or Details.realtime_dps_meter.mythic_dungeon_enabled) - --if enabled and not loaded, load it - if (bIsEnabled and not _detalhes.Broadcaster_CurrentDpsLoaded) then - Details:CreateCurrentDpsFrame(UIParent, "DetailsCurrentDpsMeter") - end + --if enabled and not loaded, load it + if (bIsEnabled and not Details.Broadcaster_CurrentDpsLoaded) then + Details:CreateCurrentDpsFrame(UIParent, "DetailsCurrentDpsMeter") + end - --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 - _G.DetailsCurrentDpsMeter:StartForMythicDungeon() - end - end - - 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 - _G.DetailsCurrentDpsMeter:StartForArenaMatch() - end + --if enabled, check if can show + if (bIsEnabled and Details.Broadcaster_CurrentDpsLoaded) then + if (Details.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 + _G.DetailsCurrentDpsMeter:StartForMythicDungeon() end end - --if not enabled but loaded, hide it - if (not bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then - _G.DetailsCurrentDpsMeter:Hide() + if (Details.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 + _G.DetailsCurrentDpsMeter:StartForArenaMatch() + end end + end + + --if not enabled but loaded, hide it + if (not bIsEnabled and Details.Broadcaster_CurrentDpsLoaded) then + _G.DetailsCurrentDpsMeter:Hide() + end 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) +function Details:FormatBackground(frame) --deprecated I guess + frame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + frame:SetBackdropColor(.5, .5, .5, .5) + frame:SetBackdropBorderColor(0, 0, 0, 1) - if (not f.__background) then - f.__background = f:CreateTexture(nil, "background") + if (not frame.__background) then + frame.__background = frame:CreateTexture(nil, "background") end - 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) - f.__background:SetHorizTile (true) - f.__background:SetAllPoints() + frame.__background:SetTexture([[Interface\AddOns\Details\images\background]], true) + frame.__background:SetAlpha(0.7) + frame.__background:SetVertexColor(0.27, 0.27, 0.27) + frame.__background:SetVertTile(true) + frame.__background:SetHorizTile(true) + frame.__background:SetAllPoints() end diff --git a/frames/anime.lua b/frames/anime.lua index a0600ca0..5f0163d1 100644 --- a/frames/anime.lua +++ b/frames/anime.lua @@ -103,7 +103,7 @@ function _detalhes.PlayBestDamageOnGuild (damage) BaseTexture:SetDrawLayer ("ARTWORK", -5) BaseTexture:SetPoint("center", DetailsNewDamageRecord, "center", 0, 0) BaseTexture:SetSize(256, 64) - BaseTexture:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) + BaseTexture:SetVertexColor(0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) --animations for BaseTexture @@ -131,13 +131,13 @@ function _detalhes.PlayBestDamageOnGuild (damage) BigFlash:SetDrawLayer ("OVERLAY", 0) BigFlash:SetPoint("center", DetailsNewDamageRecord, "center", -2, 2) BigFlash:SetSize(314, 100) - BigFlash:SetDesaturated (false) + BigFlash:SetDesaturated(false) BigFlash:SetTexCoord (0.0010000000149012, 0.77400001525879, 0.0010000000149012, 0.65800003051758) if (0 ~= 0) then BigFlash:SetRotation (0) end - BigFlash:SetVertexColor (0.96470373868942, 0.98823314905167, 0.99999779462814, 0.99999779462814) - BigFlash:SetAlpha (1) + BigFlash:SetVertexColor(0.96470373868942, 0.98823314905167, 0.99999779462814, 0.99999779462814) + BigFlash:SetAlpha(1) BigFlash:SetBlendMode("ADD") --animations for BigFlash @@ -166,13 +166,13 @@ function _detalhes.PlayBestDamageOnGuild (damage) FlashSwipe:SetDrawLayer ("OVERLAY", 7) FlashSwipe:SetPoint("center", DetailsNewDamageRecord, "center", -99, 0) FlashSwipe:SetSize(100, 57) - FlashSwipe:SetDesaturated (false) + FlashSwipe:SetDesaturated(false) FlashSwipe:SetTexCoord (0.78199996948242, 0.91900001525879, 0.0010000000149012, 0.2760000038147) if (0 ~= 0) then FlashSwipe:SetRotation (0) end - FlashSwipe:SetVertexColor (0.86666476726532, 0.54117530584335, 0, 0.99999779462814) - FlashSwipe:SetAlpha (1) + FlashSwipe:SetVertexColor(0.86666476726532, 0.54117530584335, 0, 0.99999779462814) + FlashSwipe:SetAlpha(1) FlashSwipe:SetBlendMode("ADD") --animations for FlashSwipe @@ -208,13 +208,13 @@ function _detalhes.PlayBestDamageOnGuild (damage) Portrait:SetDrawLayer ("OVERLAY", -5) Portrait:SetPoint("center", DetailsNewDamageRecord, "center", 3, 0) Portrait:SetSize(246, 44) - Portrait:SetDesaturated (false) + Portrait:SetDesaturated(false) Portrait:SetTexCoord (0.051753740310669, 0.81701484680176, 0.086334381103516, 0.25102617263794) if (0 ~= 0) then Portrait:SetRotation (0) end - Portrait:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) - Portrait:SetAlpha (1) + Portrait:SetVertexColor(0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) + Portrait:SetAlpha(1) Portrait:SetBlendMode("BLEND") --animations for Portrait @@ -259,13 +259,13 @@ function _detalhes.PlayBestDamageOnGuild (damage) DamageIcon:SetDrawLayer ("OVERLAY", 2) DamageIcon:SetPoint("center", DetailsNewDamageRecord, "center", -97, 1) DamageIcon:SetSize(32, 32) - DamageIcon:SetDesaturated (false) + DamageIcon:SetDesaturated(false) DamageIcon:SetTexCoord (0.27200000762939, 0.51899997711182, 0.25837841033936, 0.51399997711182) if (0 ~= 0) then DamageIcon:SetRotation (0) end - DamageIcon:SetVertexColor (0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) - DamageIcon:SetAlpha (1) + DamageIcon:SetVertexColor(0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814) + DamageIcon:SetAlpha(1) DamageIcon:SetBlendMode("BLEND") --animations for DamageIcon @@ -296,7 +296,7 @@ function _detalhes.PlayBestDamageOnGuild (damage) NewDamageRecord:SetPoint("center", DetailsNewDamageRecord, "center", 18, 7) NewDamageRecord:SetSize(181, 20) NewDamageRecord:SetTextColor (1, 1, 1) - NewDamageRecord:SetAlpha (1) + NewDamageRecord:SetAlpha(1) NewDamageRecord:SetJustifyH("CENTER") --animations for NewDamageRecord @@ -335,7 +335,7 @@ function _detalhes.PlayBestDamageOnGuild (damage) DamageAmount:SetPoint("center", DetailsNewDamageRecord, "center", 18, -7) DamageAmount:SetSize(100, 20) DamageAmount:SetTextColor (1, 1, 1) - DamageAmount:SetAlpha (1) + DamageAmount:SetAlpha(1) DamageAmount:SetJustifyH("CENTER") --animations for DamageAmount diff --git a/frames/fw_mods.lua b/frames/fw_mods.lua index 49589f0a..9f8dd55a 100644 --- a/frames/fw_mods.lua +++ b/frames/fw_mods.lua @@ -28,7 +28,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color) end if (color) then - newFontString:SetTextColor (unpack (color)) + newFontString:SetTextColor (unpack(color)) end newFontString:SetJustifyH("LEFT") @@ -78,7 +78,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para 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: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") @@ -189,7 +189,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para GameCooltip:Reset() GameCooltip:SetType ("tooltip") GameCooltip:SetColor ("main", "transparent") - GameCooltip:AddLine (new_button.tooltip) + GameCooltip:AddLine(new_button.tooltip) GameCooltip:SetOwner(new_button) GameCooltip:ShowCooltip() end @@ -270,7 +270,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, editbox:SetWidth(w) editbox:SetHeight(h) editbox:SetJustifyH("CENTER") - editbox:EnableMouse (true) + editbox:EnableMouse(true) editbox:SetBackdrop(EditBoxBackdrop) editbox:SetBackdropColor(0, 0, 0, 0.5) editbox:SetBackdropBorderColor(0.3, 0.3, 0.30, 0.80) @@ -374,7 +374,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h, GameCooltip:Reset() GameCooltip:SetType ("tooltip") GameCooltip:SetColor ("main", "transparent") - GameCooltip:AddLine (editbox.tooltip) + GameCooltip:AddLine(editbox.tooltip) GameCooltip:SetOwner(editbox) GameCooltip:ShowCooltip() end @@ -690,7 +690,7 @@ function gump:NewScrollBar2 (master, slave, x, y) self.scrollMax = slave:GetHeight()-master:GetHeight() if (self.scrollMax > 0) then - slider_gump:SetMinMaxValues (0, self.scrollMax) + slider_gump:SetMinMaxValues(0, self.scrollMax) if (not slider_gump.ativo) then slider_gump:Enable() slider_gump.ativo = true diff --git a/frames/window_api.lua b/frames/window_api.lua index 6e6af672..ca73c8f3 100644 --- a/frames/window_api.lua +++ b/frames/window_api.lua @@ -24,12 +24,12 @@ function Details:CreateAPI2Frame() local parametersAmount = 10 local returnAmount = 10 - --local Api2Frame = DetailsFramework:CreateSimplePanel (UIParent, panelWidth, panelHeight, "Details! API 2.0", "DetailsAPI2Frame") + --local Api2Frame = DetailsFramework:CreateSimplePanel(UIParent, panelWidth, panelHeight, "Details! API 2.0", "DetailsAPI2Frame") local Api2Frame = _G.DetailsAPI2Frame Api2Frame:SetFrameStrata("FULLSCREEN") Api2Frame:SetPoint("center") - DetailsFramework:ApplyStandardBackdrop (Api2Frame, false, 1.2) + DetailsFramework:ApplyStandardBackdrop(Api2Frame, false, 1.2) --store local apiFunctionNames = {} @@ -134,9 +134,9 @@ function Details:CreateAPI2Frame() 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 @@ -152,7 +152,7 @@ function Details:CreateAPI2Frame() Api2Frame.scrollMenu = api2ScrollMenu local lineOnEnter = function(self) - self:SetBackdropColor(unpack (backdropColorOnEnter)) + self:SetBackdropColor(unpack(backdropColorOnEnter)) local apiName = apiFunctionNames [self.index] if (not apiName) then @@ -167,15 +167,15 @@ function Details:CreateAPI2Frame() GameCooltip2:Preset(2) GameCooltip2:SetOwner(self, "left", "right", 2, 0) - GameCooltip2:AddLine (apiInfo.desc) + GameCooltip2:AddLine(apiInfo.desc) GameCooltip2:ShowCooltip() end 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() @@ -193,7 +193,7 @@ function Details:CreateAPI2Frame() line:SetScript("OnLeave", lineOnLeave) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (backdropColor)) + line:SetBackdropColor(unpack(backdropColor)) line.text = DetailsFramework:CreateLabel(line) line.text:SetPoint("left", line, "left", 2, 0) @@ -221,7 +221,7 @@ function Details:CreateAPI2Frame() 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:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX")) + Api2Frame.ApiCopy:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX")) --parameters local parametersYStart = yStart - 110 @@ -235,7 +235,7 @@ function Details:CreateAPI2Frame() 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: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") @@ -254,14 +254,14 @@ function Details:CreateAPI2Frame() if (not apiInfo) then return end - GameCooltip2:AddLine (apiInfo.parameters [self.index].desc) + 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 @@ -271,7 +271,7 @@ function Details:CreateAPI2Frame() 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:SetBackdropColor(unpack(backdropColor)) f:Hide() f.name = DetailsFramework:CreateLabel(f) @@ -301,17 +301,17 @@ function Details:CreateAPI2Frame() 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: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 @@ -321,7 +321,7 @@ function Details:CreateAPI2Frame() 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:SetBackdropColor(unpack(backdropColor)) f:Hide() f.name = DetailsFramework:CreateLabel(f) diff --git a/frames/window_benchmark.lua b/frames/window_benchmark.lua index c6ec39af..10837e54 100644 --- a/frames/window_benchmark.lua +++ b/frames/window_benchmark.lua @@ -20,18 +20,18 @@ local libwindow = LibStub("LibWindow-1.1") f:SetSize(800, 600) f:SetPoint("left", UIParent, "left") f:SetFrameStrata("LOW") - f:EnableMouse (true) - f:SetMovable (true) + 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) --register to libwindow - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.benchmark_db.frame) - LibWindow.RestorePosition (f) - LibWindow.MakeDraggable (f) - LibWindow.SavePosition (f) + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(f, _detalhes.benchmark_db.frame) + LibWindow.RestorePosition(f) + LibWindow.MakeDraggable(f) + LibWindow.SavePosition(f) --titlebar f.TitleBar = CreateFrame("frame", "$parentTitleBar", f,"BackdropTemplate") @@ -52,7 +52,7 @@ local libwindow = LibStub("LibWindow-1.1") 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:SetAlpha(0.7) f.Close:SetScript("OnClick", function() f:Hide() end) --title @@ -106,11 +106,11 @@ local libwindow = LibStub("LibWindow-1.1") end end) - local normal_text_template = DF:GetTemplate ("font", "DETAILS_BENCHMARK_NORMAL") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local normal_text_template = DF:GetTemplate("font", "DETAILS_BENCHMARK_NORMAL") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") --locations f.FrameLocations = { @@ -127,8 +127,8 @@ local libwindow = LibStub("LibWindow-1.1") --declaration local summaryFrame = CreateFrame("frame", "$parentSummaryFrame", f,"BackdropTemplate") - summaryFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.summary)) - summaryFrame:SetSize(unpack (f.FrameSizes.default)) + 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) @@ -209,8 +209,8 @@ local libwindow = LibStub("LibWindow-1.1") --declaration local spellsFrame = CreateFrame("frame", "$parentSpellsFrame", f,"BackdropTemplate") - spellsFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.spells)) - spellsFrame:SetSize(unpack (f.FrameSizes.default)) + 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) @@ -228,8 +228,8 @@ local libwindow = LibStub("LibWindow-1.1") --declaration local aurasFrame = CreateFrame("frame", "$parentAurasFrame", f,"BackdropTemplate") - aurasFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.auras)) - aurasFrame:SetSize(unpack (f.FrameSizes.default)) + 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) @@ -245,8 +245,8 @@ local libwindow = LibStub("LibWindow-1.1") --declaration local historyFrame = CreateFrame("frame", "$parentHistoryFrame", f,"BackdropTemplate") - historyFrame:SetPoint("topleft", f, "topleft", unpack (f.FrameLocations.history)) - historyFrame:SetSize(unpack (f.FrameSizes.default)) + 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) diff --git a/frames/window_bookmark.lua b/frames/window_bookmark.lua index 2d721747..16f6eb99 100644 --- a/frames/window_bookmark.lua +++ b/frames/window_bookmark.lua @@ -8,7 +8,7 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") function Details:OpenBookmarkConfig() if (not _G.DetailsBookmarkManager) then - DF:CreateSimplePanel (UIParent, 465, 460, Loc ["STRING_OPTIONS_MANAGE_BOOKMARKS"], "DetailsBookmarkManager") + DF:CreateSimplePanel(UIParent, 465, 460, Loc ["STRING_OPTIONS_MANAGE_BOOKMARKS"], "DetailsBookmarkManager") local panel = _G.DetailsBookmarkManager DF:ApplyStandardBackdrop(panel) panel:SetBackdropColor(.1, .1, .1, .9) @@ -62,7 +62,7 @@ function Details:OpenBookmarkConfig() end for i = 1, 40 do - local clear = DF:CreateButton (panel, clear_func, 16, 16, nil, i, nil, [[Interface\Glues\LOGIN\Glues-CheckBox-Check]]) + 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 @@ -72,7 +72,7 @@ function Details:OpenBookmarkConfig() clear:SetPoint(250, (( o*10 ) * -1) - 35) --right end - local set = DF:CreateButton (panel, set_att, 16, 16, nil, i) + 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) @@ -81,13 +81,13 @@ function Details:OpenBookmarkConfig() set:SetHook("OnLeave", set_onleave) --set:InstallCustomTexture (nil, nil, nil, nil, true) - set:SetTemplate (DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + set:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) - local bg_texture = DF:CreateImage (set, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "background") + local bg_texture = DF:CreateImage(set, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "background") bg_texture:SetAllPoints() set.bg = bg_texture - local icon = DF:CreateImage (set, nil, 16, 16, nil, nil, "icon") + local icon = DF:CreateImage(set, nil, 16, 16, nil, nil, "icon") icon:SetPoint("left", clear, "right", 4, 0) local label = DF:CreateLabel(set, "") @@ -112,12 +112,12 @@ function Details:OpenBookmarkConfig() this_block.label.text = "-- x -- x --" this_block.icon.texture = "Interface\\ICONS\\Ability_DualWield" this_block.icon.texcoord = normal_coords - this_block.bg:SetVertexColor (.4, .1, .1, .12) + this_block.bg:SetVertexColor(.4, .1, .1, .12) else this_block.label.text = CustomObject.name this_block.icon.texture = CustomObject.icon this_block.icon.texcoord = normal_coords - this_block.bg:SetVertexColor (.4, .4, .4, .6) + this_block.bg:SetVertexColor(.4, .4, .4, .6) end else bookmark.atributo = bookmark.atributo or 1 @@ -125,16 +125,16 @@ function Details:OpenBookmarkConfig() this_block.label.text = Details.sub_atributos [bookmark.atributo] and Details.sub_atributos [bookmark.atributo].lista [bookmark.sub_atributo] this_block.icon.texture = Details.sub_atributos [bookmark.atributo] and Details.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [1] this_block.icon.texcoord = Details.sub_atributos [bookmark.atributo] and Details.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [2] - this_block.bg:SetVertexColor (.4, .4, .4, .6) + this_block.bg:SetVertexColor(.4, .4, .4, .6) end - this_block.button:SetAlpha (1) + this_block.button:SetAlpha(1) else this_block.label.text = "-- x -- x --" this_block.icon.texture = [[Interface\AddOns\Details\images\icons]] this_block.icon.texcoord = unknown_coords - this_block.bg:SetVertexColor (.1, .1, .1, .12) - this_block.button:SetAlpha (0.3) + this_block.bg:SetVertexColor(.1, .1, .1, .12) + this_block.button:SetAlpha(0.3) end end end diff --git a/frames/window_brokertexteditor.lua b/frames/window_brokertexteditor.lua index 0065b872..0aaec0a8 100644 --- a/frames/window_brokertexteditor.lua +++ b/frames/window_brokertexteditor.lua @@ -56,7 +56,7 @@ function Details:OpenBrokerTextEditor() local d = DF:NewDropDown (panel, _, "$parentTextOptionsDropdown", "TextOptionsDropdown", 150, 20, buildAddMenu, 1) d:SetPoint("topright", panel, "topright", -12, -25) - d:SetTemplate(DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + d:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) local optiontable = {"{dmg}", "{dps}", "{dpos}", "{ddiff}", "{heal}", "{hps}", "{hpos}", "{hdiff}", "{time}"} @@ -65,7 +65,7 @@ function Details:OpenBrokerTextEditor() end, nil, nil, nil, "<-") add_button:SetPoint("right", d, "left", -2, 0) - add_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + add_button:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6 @@ -181,7 +181,7 @@ function Details:OpenBrokerTextEditor() 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")) + color_button:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) local done = function() local text = panel.editbox:GetText() @@ -197,17 +197,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:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + 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) reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"] reset_button:SetPoint("topright", panel, "topright", -100, -152) - reset_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + 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) cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] cancel_button:SetPoint("topright", panel, "topright", -100, -174) - cancel_button:SetTemplate(DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + cancel_button:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end diff --git a/frames/window_cdtracker.lua b/frames/window_cdtracker.lua index a967ce10..1307132a 100644 --- a/frames/window_cdtracker.lua +++ b/frames/window_cdtracker.lua @@ -369,11 +369,11 @@ end --enabled with a toggle button --execute to reset position --misc configs - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local generalOptions = { {--enable ocd diff --git a/frames/window_classcolor.lua b/frames/window_classcolor.lua index 5a565395..6de7f12b 100644 --- a/frames/window_classcolor.lua +++ b/frames/window_classcolor.lua @@ -7,7 +7,7 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") --config class colors function Details:OpenClassColorsConfig() if (not _G.DetailsClassColorManager) then - DF:CreateSimplePanel (UIParent, 300, 425, Loc ["STRING_OPTIONS_CLASSCOLOR_MODIFY"], "DetailsClassColorManager") + DF:CreateSimplePanel(UIParent, 300, 425, Loc ["STRING_OPTIONS_CLASSCOLOR_MODIFY"], "DetailsClassColorManager") local panel = _G.DetailsClassColorManager DF:ApplyStandardBackdrop(panel) @@ -15,12 +15,12 @@ function Details:OpenClassColorsConfig() local upper_panel = CreateFrame("frame", nil, panel,"BackdropTemplate") upper_panel:SetAllPoints(panel) - upper_panel:SetFrameLevel (panel:GetFrameLevel()+3) + upper_panel:SetFrameLevel(panel:GetFrameLevel()+3) local y = -50 local callback = function(button, r, g, b, a, self) - self.MyObject.my_texture:SetVertexColor (r, g, b) + self.MyObject.my_texture:SetVertexColor(r, g, b) Details.class_colors [self.MyObject.my_class][1] = r Details.class_colors [self.MyObject.my_class][2] = g Details.class_colors [self.MyObject.my_class][3] = b @@ -29,14 +29,14 @@ function Details:OpenClassColorsConfig() local set_color = function(self, button, class, index) local current_class_color = Details.class_colors [class] - local r, g, b = unpack (current_class_color) + local r, g, b = unpack(current_class_color) DF:ColorPick (self, r, g, b, 1, callback) end local reset_color = function(self, button, class, index) local color_table = RAID_CLASS_COLORS [class] local r, g, b = color_table.r, color_table.g, color_table.b - self.MyObject.my_texture:SetVertexColor (r, g, b) + self.MyObject.my_texture:SetVertexColor(r, g, b) Details.class_colors [self.MyObject.my_class][1] = r Details.class_colors [self.MyObject.my_class][2] = g Details.class_colors [self.MyObject.my_class][3] = b @@ -45,7 +45,7 @@ function Details:OpenClassColorsConfig() local on_enter = function(self, capsule) --Details:CooltipPreset(1) - --GameCooltip:AddLine ("right click to reset") + --GameCooltip:AddLine("right click to reset") --GameCooltip:Show (self) end local on_leave = function(self, capsule) @@ -62,7 +62,7 @@ function Details:OpenClassColorsConfig() panel.buttons = {} for index, className in ipairs(CLASS_SORT_ORDER) do - local icon = DF:CreateImage (upper_panel, [[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]], 32, 32, nil, CLASS_ICON_TCOORDS [className], "icon_" .. className) + local icon = DF:CreateImage(upper_panel, [[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]], 32, 32, nil, CLASS_ICON_TCOORDS [className], "icon_" .. className) if (index%2 ~= 0) then icon:SetPoint(10, y) @@ -77,7 +77,7 @@ function Details:OpenClassColorsConfig() local button = DF:CreateButton(panel, set_color, 135, 30, className, className, index) button:SetPoint("left", icon, "right", -32, 0) button:InstallCustomTexture(nil, nil, nil, nil, true) - button:SetFrameLevel (panel:GetFrameLevel()+1) + button:SetFrameLevel(panel:GetFrameLevel()+1) button.text_overlay:ClearAllPoints() button.text_overlay:SetPoint("left", icon.widget, "right", 2, 0) @@ -102,7 +102,7 @@ function Details:OpenClassColorsConfig() num = math.floor(num / 16) end if s == '' then s = '00' end - if (string.len (s) == 1) then + if (string.len(s) == 1) then s = "0"..s end return s @@ -185,11 +185,11 @@ function Details:OpenClassColorsConfig() } --templates - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") DetailsFramework:BuildMenu(panel, deathLogOptions, 5, -285, 700, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) @@ -198,7 +198,7 @@ function Details:OpenClassColorsConfig() end for class, button in pairs(_G.DetailsClassColorManager.buttons) do - button.my_texture:SetVertexColor (unpack (Details.class_colors [class])) + button.my_texture:SetVertexColor(unpack(Details.class_colors [class])) end diff --git a/frames/window_copy.lua b/frames/window_copy.lua index 14279b7e..e77688ca 100644 --- a/frames/window_copy.lua +++ b/frames/window_copy.lua @@ -14,7 +14,7 @@ do panel:SetPoint("center", UIParent, "center") panel.locked = false panel:SetToplevel (true) - panel:SetMovable (true) + panel:SetMovable(true) panel:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return @@ -40,7 +40,7 @@ do --panel.TitleText:SetText("Paste & Copy") --10.0 fuck --panel.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]]) - DetailsFrameWork:NewTextEntry (panel, _, "$parentTextEntry", "text", 476, 14) + 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) diff --git a/frames/window_currentdps.lua b/frames/window_currentdps.lua index 27fb9bac..f3be4dad 100644 --- a/frames/window_currentdps.lua +++ b/frames/window_currentdps.lua @@ -16,7 +16,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) local DF = _detalhes.gump - local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions") + 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) @@ -24,16 +24,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) --scale bar local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame) - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.options_frame) - LibWindow.MakeDraggable (f) - LibWindow.RestorePosition (f) + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(f, _detalhes.realtime_dps_meter.options_frame) + LibWindow.MakeDraggable(f) + LibWindow.RestorePosition(f) - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") --status bar local statusBar = DF:CreateStatusBar(f) @@ -94,7 +94,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) --options table local options = { - {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")}, --enabled { type = "toggle", @@ -200,7 +200,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) --[=[ {type = "breakline"}, - {type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")}, --arenas { type = "toggle", @@ -226,7 +226,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) --]=] {type = "breakline"}, - {type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")}, --font size { type = "range", @@ -301,7 +301,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel) --reopen the options panel if (f.FromOptionsPanel) then - C_Timer.After (0.2, function() + C_Timer.After(0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) end) end @@ -343,9 +343,9 @@ function Details:CreateCurrentDpsFrame(parent, name) 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:EnableMouse (true) - f:SetMovable (true) + f:SetBackdropColor(unpack(_detalhes.realtime_dps_meter.frame_settings.backdrop_color)) + f:EnableMouse(true) + f:SetMovable(true) f:SetClampedToScreen (true) f.movemeLabel = f:CreateFontString(nil, "overlay", "GameFontNormal") @@ -367,10 +367,10 @@ function Details:CreateCurrentDpsFrame(parent, name) f.PlayerTeam = 0 - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings) - LibWindow.MakeDraggable (f) - LibWindow.RestorePosition (f) + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(f, _detalhes.realtime_dps_meter.frame_settings) + LibWindow.MakeDraggable(f) + LibWindow.RestorePosition(f) local lockCallback = function() local f = _G.DetailsCurrentDpsMeter @@ -470,8 +470,8 @@ function Details:CreateCurrentDpsFrame(parent, name) DF:SetFontSize (TitleString, 9) 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: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) @@ -489,11 +489,11 @@ function Details:CreateCurrentDpsFrame(parent, name) yellow_team_color = Details.class_colors.ARENA_YELLOW if (f.PlayerTeam == 0) then - labelPlayerTeam:SetTextColor (unpack (yellow_team_color)) - labelYellowTeam:SetTextColor (unpack (green_team_color)) + labelPlayerTeam:SetTextColor (unpack(yellow_team_color)) + labelYellowTeam:SetTextColor (unpack(green_team_color)) else - labelPlayerTeam:SetTextColor (unpack (green_team_color)) - labelYellowTeam:SetTextColor (unpack (yellow_team_color)) + labelPlayerTeam:SetTextColor (unpack(green_team_color)) + labelYellowTeam:SetTextColor (unpack(yellow_team_color)) end end @@ -632,20 +632,20 @@ function Details:CreateCurrentDpsFrame(parent, name) --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) + 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)) + 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) --frame is locked if (_detalhes.realtime_dps_meter.frame_settings.locked) then - f:EnableMouse (false) + f:EnableMouse(false) else - f:EnableMouse (true) + f:EnableMouse(true) end --frame can show title @@ -725,19 +725,19 @@ function Details:CreateCurrentDpsFrame(parent, name) f.YellowDamage = f.YellowDamage + yellowDamageDone --remove player team damage - local removedDamage = tremove (f.PlayerTeamBuffer, f.MaxBufferIndex+1) + local removedDamage = tremove(f.PlayerTeamBuffer, f.MaxBufferIndex+1) if (removedDamage) then f.PlayerTeamDamage = f.PlayerTeamDamage - removedDamage --be save - f.PlayerTeamDamage = max (0, f.PlayerTeamDamage) + f.PlayerTeamDamage = max(0, f.PlayerTeamDamage) end --remove yellow damage - local removedDamage = tremove (f.YellowTeamBuffer, f.MaxBufferIndex+1) + local removedDamage = tremove(f.YellowTeamBuffer, f.MaxBufferIndex+1) if (removedDamage) then f.YellowDamage = f.YellowDamage - removedDamage --be save - f.YellowDamage = max (0, f.YellowDamage) + f.YellowDamage = max(0, f.YellowDamage) end self.NextScreenUpdate = self.NextScreenUpdate - time_fraction --always 0.1 @@ -772,8 +772,8 @@ function Details:CreateCurrentDpsFrame(parent, name) end else --not in use, player team is forced to 0 - dpsBarFrame:SetLeftColor(unpack (yellow_team_color)) - dpsBarFrame:SetRightColor(unpack (green_team_color)) + dpsBarFrame:SetLeftColor(unpack(yellow_team_color)) + dpsBarFrame:SetRightColor(unpack(green_team_color)) end if (Details.realtime_dps_meter.frame_settings.locked) then @@ -820,12 +820,12 @@ function Details:CreateCurrentDpsFrame(parent, name) f.GroupTotalDamage = f.GroupTotalDamage + groupDamageDoneOnThisTick --cicle buffer removing the last index and subtract its damage - local removedDamage = tremove (f.GroupBuffer, f.MaxBufferIndex+1) + local removedDamage = tremove(f.GroupBuffer, f.MaxBufferIndex+1) if (removedDamage) then --remove the value from the total damage f.GroupTotalDamage = f.GroupTotalDamage - removedDamage --be save - f.GroupTotalDamage = max (0, f.GroupTotalDamage) + f.GroupTotalDamage = max(0, f.GroupTotalDamage) end self.NextScreenUpdate = self.NextScreenUpdate - time_fraction @@ -936,8 +936,8 @@ function DetailsTestSplitBar() local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") barFrame.splitBar:SetTexture(SharedMedia:Fetch("statusbar", "Details Flat")) - barFrame.splitBar:SetLeftColor(unpack (green_team_color)) - barFrame.splitBar:SetRightColor(unpack (yellow_team_color)) + barFrame.splitBar:SetLeftColor(unpack(green_team_color)) + barFrame.splitBar:SetRightColor(unpack(yellow_team_color)) --test the splitbar local loopTime = 0.1 diff --git a/frames/window_custom.lua b/frames/window_custom.lua index 4ad19acc..70fff812 100644 --- a/frames/window_custom.lua +++ b/frames/window_custom.lua @@ -4,9 +4,9 @@ local gump = _detalhes.gump local _ - local AceComm = LibStub ("AceComm-3.0") - local AceSerializer = LibStub ("AceSerializer-3.0") - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local AceComm = LibStub("AceComm-3.0") + local AceSerializer = LibStub("AceSerializer-3.0") + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --local pointers @@ -15,7 +15,7 @@ local _cstr = string.format --lua local local _math_ceil = math.ceil --lua local local _math_floor = math.floor --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local local _pairs = pairs --lua local local _string_lower = string.lower --lua local local _table_sort = table.sort --lua local @@ -28,7 +28,7 @@ local _GetTime = GetTime --api local local _GetCursorPosition = GetCursorPosition --api local local _GameTooltip = GameTooltip --api local - local _UIParent = UIParent --api local + local UIParent = UIParent --api local local _GetScreenWidth = GetScreenWidth --api local local _GetScreenHeight = GetScreenHeight --api local local _IsAltKeyDown = IsAltKeyDown --api local @@ -53,8 +53,8 @@ local CONST_EDITBOX_BUTTON_WIDTH = 80 local CONST_EDITBOX_BUTTON_HEIGHT = 20 - local CONST_BUTTON_TEMPLATE = gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") - local CONST_TEXTENTRY_TEMPLATE = gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local CONST_BUTTON_TEMPLATE = gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") + local CONST_TEXTENTRY_TEMPLATE = gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") gump:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS", { @@ -89,11 +89,11 @@ 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") - local CONST_CODETEXTENTRYBUTTON_TEMPLATE = gump:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON") - local CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE = gump:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS") - local CONST_REGULAR_BUTTON_TEMPLATE = gump:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON") + local CONST_CODETEXTENTRY_TEMPLATE = gump:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX") + local CONST_CODETEXTENTRYEXPANDED_TEMPLATE = gump:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED") + local CONST_CODETEXTENTRYBUTTON_TEMPLATE = gump:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON") + local CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE = gump:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS") + local CONST_REGULAR_BUTTON_TEMPLATE = gump:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON") local atributos = _detalhes.atributos local sub_atributos = _detalhes.sub_atributos @@ -169,8 +169,8 @@ custom_window:SetPoint("center", UIParent, "center") custom_window:SetSize(850, 500) - custom_window:EnableMouse (true) - custom_window:SetMovable (true) + custom_window:EnableMouse(true) + custom_window:SetMovable(true) custom_window:SetScript("OnMouseDown", function(self, button) if (button == "LeftButton") then if (not self.moving) then @@ -222,7 +222,7 @@ f.Close:GetHighlightTexture():SetDesaturated(true) f.Close:GetPushedTexture():SetDesaturated(true) - f.Close:SetAlpha (0.7) + f.Close:SetAlpha(0.7) f.Close:SetScript("OnClick", function() _detalhes:CloseCustomDisplayWindow() end) f.Close:SetScript("OnHide", function() _detalhes:CloseCustomDisplayWindow() @@ -231,10 +231,10 @@ --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: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}) @@ -279,7 +279,7 @@ DetailsCustomPanel.code3_default = [[ local value, top, total, combat, instance = ... - return math.floor (value) + return math.floor(value) ]] DetailsCustomPanel.code3 = DetailsCustomPanel.code3_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 @@ -435,10 +435,10 @@ DetailsCustomPanel:ClearFocus() _detalhes.MicroButtonAlert:Hide() - if (string.len (name) < 5) then - return false, _detalhes:Msg (Loc ["STRING_CUSTOM_SHORTNAME"]) - elseif (string.len (name) > 32) then - return false, _detalhes:Msg (Loc ["STRING_CUSTOM_LONGNAME"]) + if (string.len(name) < 5) then + return false, _detalhes:Msg(Loc ["STRING_CUSTOM_SHORTNAME"]) + elseif (string.len(name) > 32) then + return false, _detalhes:Msg(Loc ["STRING_CUSTOM_LONGNAME"]) end _detalhes:ResetCustomFunctionsCache() @@ -480,9 +480,9 @@ object.tooltip = false if (DetailsCustomPanel.IsImporting) then - _detalhes:Msg (Loc ["STRING_CUSTOM_IMPORTED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_IMPORTED"]) else - _detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_SAVED"]) end if (DetailsCustomPanel.IsImporting) then @@ -508,9 +508,9 @@ } tinsert(_detalhes.custom, new_custom_object) - _setmetatable (new_custom_object, _detalhes.atributo_custom) + _setmetatable(new_custom_object, _detalhes.atributo_custom) new_custom_object.__index = _detalhes.atributo_custom - _detalhes:Msg (Loc ["STRING_CUSTOM_CREATED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_CREATED"]) end DetailsCustomPanel:Reset() @@ -548,9 +548,9 @@ end if (DetailsCustomPanel.IsImporting) then - _detalhes:Msg (Loc ["STRING_CUSTOM_IMPORTED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_IMPORTED"]) else - _detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_SAVED"]) end if (DetailsCustomPanel.IsImporting) then @@ -591,9 +591,9 @@ end tinsert(_detalhes.custom, new_custom_object) - _setmetatable (new_custom_object, _detalhes.atributo_custom) + _setmetatable(new_custom_object, _detalhes.atributo_custom) new_custom_object.__index = _detalhes.atributo_custom - _detalhes:Msg (Loc ["STRING_CUSTOM_CREATED"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_CREATED"]) end DetailsCustomPanel:Reset() @@ -740,13 +740,13 @@ custom_window.menu = {} local menu_start = -50 local menu_up_frame = _CreateFrame ("frame", nil, custom_window) - menu_up_frame:SetFrameLevel (custom_window:GetFrameLevel()+2) + menu_up_frame:SetFrameLevel(custom_window:GetFrameLevel()+2) local onenter = function(self) - --self.icontexture:SetVertexColor (1, 1, 1, 1) + --self.icontexture:SetVertexColor(1, 1, 1, 1) end local onleave = function(self) - --self.icontexture:SetVertexColor (.9, .9, .9, 1) + --self.icontexture:SetVertexColor(.9, .9, .9, 1) end function custom_window:CreateMenuButton (label, icon, clickfunc, param1, param2, tooltip, name, coords) @@ -755,8 +755,8 @@ 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:SetTemplate (CONST_BUTTON_TEMPLATE) - button:SetTemplate (gump:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + --button:SetTemplate(CONST_BUTTON_TEMPLATE) + button:SetTemplate(gump:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) button:SetWidth(160) button:SetIcon (icon, CONST_MENU_HEIGHT-4, CONST_MENU_HEIGHT-4, "overlay", {.1, .9, .1, .9}, nil, 4) @@ -771,8 +771,8 @@ local build_menu = function(self, button, func, param2) GameCooltip:Reset() - for index, custom_object in _ipairs(_detalhes.custom) do - GameCooltip:AddLine (custom_object:GetName()) + 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 @@ -814,7 +814,7 @@ for key, value in pairs(custom_object) do if (object_keys [key]) then if (type(value) == "table") then - export_object [key] = Details.CopyTable (value) + export_object [key] = Details.CopyTable(value) else export_object [key] = value end @@ -824,10 +824,10 @@ local encoded = Details:CompressData (export_object, "print") if (not custom_window.ExportBox) then - local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentExportBox", "ExportBox", CONST_EDITBOX_WIDTH, 20) + local editbox = _detalhes.gump:NewTextEntry(custom_window, nil, "$parentExportBox", "ExportBox", CONST_EDITBOX_WIDTH, 20) editbox:SetPoint("bottomleft", custom_window, "bottomleft", 10, 6) editbox:SetAutoFocus (false) - editbox:SetTemplate (CONST_TEXTENTRY_TEMPLATE) + editbox:SetTemplate(CONST_TEXTENTRY_TEMPLATE) editbox:SetHook("OnEditFocusLost", function() editbox:Hide() end) @@ -838,7 +838,7 @@ local flashTexture = editbox:CreateTexture(nil, "overlay") flashTexture:SetColorTexture (1, 1, 1) flashTexture:SetAllPoints() - flashTexture:SetAlpha (0) + flashTexture:SetAlpha(0) local flashAnimHub = DetailsFramework:CreateAnimationHub (flashTexture) DetailsFramework:CreateAnimation(flashAnimHub, "alpha", 1, 0.2, 0, 1) @@ -871,10 +871,10 @@ 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) + 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:SetAutoFocus (false) - editbox:SetTemplate (CONST_TEXTENTRY_TEMPLATE) + editbox:SetTemplate(CONST_TEXTENTRY_TEMPLATE) local import = function() local text = editbox:GetText() @@ -882,7 +882,7 @@ local deserialized_object = Details:DecompressData (text, "print") if (not deserialized_object) then - _detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_IMPORT_ERROR"]) return end @@ -890,7 +890,7 @@ DetailsCustomPanel:CancelFunc() end - setmetatable (deserialized_object, _detalhes.atributo_custom) + setmetatable(deserialized_object, _detalhes.atributo_custom) deserialized_object.__index = _detalhes.atributo_custom _detalhes.MicroButtonAlert.Text:SetText(Loc ["STRING_CUSTOM_IMPORT_ALERT"]) @@ -907,7 +907,7 @@ end 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:SetTemplate(CONST_BUTTON_TEMPLATE) okey_button:SetPoint("left", editbox, "right", 2, 0) end @@ -963,21 +963,21 @@ 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: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) - selected_right:SetVertexColor (1, .8, 0, 1) + 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) - selected_center:SetVertexColor (1, .8, 0, 1) + 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") @@ -1033,9 +1033,9 @@ 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) + local name_field = gump:NewTextEntry(box0, nil, "$parentNameEntry", "nameentry", 200, 20) name_field:SetPoint("left", name_label, "left", 62, 0) - name_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) + name_field:SetTemplate(CONST_TEXTENTRY_TEMPLATE) name_field.tooltip = Loc ["STRING_CUSTOM_NAME_DESC"] custom_window.name_field = name_field @@ -1043,9 +1043,9 @@ 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) + local author_field = gump:NewTextEntry(box0, nil, "$parentAuthorEntry", "authorentry", 200, 20) author_field:SetPoint("left", author_label, "left", 62, 0) - author_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) + author_field:SetTemplate(CONST_TEXTENTRY_TEMPLATE) author_field.tooltip = Loc ["STRING_CUSTOM_AUTHOR_DESC"] author_field:SetText(UnitName ("player") .. "-" .. GetRealmName()) custom_window.author_field = author_field @@ -1054,9 +1054,9 @@ 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) + local desc_field = gump:NewTextEntry(box0, nil, "$parentDescEntry", "descentry", 200, 20) desc_field:SetPoint("left", desc_label, "left", 62, 0) - desc_field:SetTemplate (CONST_TEXTENTRY_TEMPLATE) + desc_field:SetTemplate(CONST_TEXTENTRY_TEMPLATE) desc_field.tooltip = Loc ["STRING_CUSTOM_DESCRIPTION_DESC"] custom_window.desc_field = desc_field @@ -1082,22 +1082,22 @@ 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:SetTemplate (CONST_REGULAR_BUTTON_TEMPLATE) + 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:SetTemplate (CONST_REGULAR_BUTTON_TEMPLATE) + accept_button:SetTemplate(CONST_REGULAR_BUTTON_TEMPLATE) - cancel_button:SetFrameLevel (500) - accept_button:SetFrameLevel (500) + cancel_button:SetFrameLevel(500) + accept_button:SetFrameLevel(500) --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:SetFrameLevel (box0:GetFrameLevel()+1) + box1:SetFrameLevel(box0:GetFrameLevel()+1) --source local source_label = gump:NewLabel(box1, box1, "$parenSourceLabel", "source", Loc ["STRING_CUSTOM_SOURCE"], "GameFontHighlightLeft") --localize-me @@ -1125,7 +1125,7 @@ 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) + local source_field = gump:NewTextEntry(box1, nil, "$parentSourceEntry", "sourceentry", 201, 20) source_field:SetPoint("topleft", source_dropdown, "bottomleft", 0, -2) source_field:Disable() custom_window.source_field = source_field @@ -1141,7 +1141,7 @@ adds_boss_image:SetWidth(20) adds_boss_image:SetHeight(16) - local actorsFrame = gump:NewPanel (custom_window, _, "DetailsCustomActorsFrame2", "actorsFrame", 1, 1) + local actorsFrame = gump:NewPanel(custom_window, _, "DetailsCustomActorsFrame2", "actorsFrame", 1, 1) actorsFrame:SetPoint("topleft", custom_window, "topright", 5, -60) actorsFrame:Hide() @@ -1157,12 +1157,12 @@ 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) + 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]]) - modelFrameBackgroundIcon:SetVertexColor (.5, .5, .5, 0.7) + modelFrameBackgroundIcon:SetVertexColor(.5, .5, .5, 0.7) modelFrameBackground:Hide() modelFrameBackgroundIcon:Hide() @@ -1181,7 +1181,7 @@ button.MyObject.line:SetBlendMode("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) GameTooltip:SetOwner(button, "ANCHOR_TOPLEFT") - GameTooltip:AddLine (button.MyObject.actor) + GameTooltip:AddLine(button.MyObject.actor) GameTooltip:Show() local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id) @@ -1229,9 +1229,9 @@ local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActors2EncounterImageButton"..i) t:SetPoint("left", thisButton) t:SetTexture([[Interface\MINIMAP\TRACKING\Target]]) - t:SetDesaturated (true) + t:SetDesaturated(true) t:SetSize(20, 20) - t:SetAlpha (0.7) + 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) @@ -1286,7 +1286,7 @@ if (_detalhes:InstanceIsRaid (instanceId)) then - GameCooltip:AddLine (instanceTable.name, _, 1, "white") + GameCooltip:AddLine(instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) for index, encounterName in ipairs(instanceTable.boss_names) do @@ -1347,7 +1347,7 @@ 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) + local target_field = gump:NewTextEntry(box1, nil, "$parentTargetEntry", "targetentry", 201, 20) target_field:SetPoint("topleft", target_dropdown, "bottomleft", 0, -2) target_field:Disable() custom_window.target_field = target_field @@ -1363,7 +1363,7 @@ adds_boss_image:SetWidth(20) adds_boss_image:SetHeight(16) - local actorsFrame = gump:NewPanel (custom_window, _, "DetailsCustomActorsFrame", "actorsFrame", 1, 1) + local actorsFrame = gump:NewPanel(custom_window, _, "DetailsCustomActorsFrame", "actorsFrame", 1, 1) actorsFrame:SetPoint("topleft", custom_window, "topright", 5, -60) actorsFrame:Hide() @@ -1389,7 +1389,7 @@ button.MyObject.line:SetBlendMode("ADD") button.MyObject.label:SetTextColor (1, 1, 1, 1) GameTooltip:SetOwner(button, "ANCHOR_TOPLEFT") - GameTooltip:AddLine (button.MyObject.actor) + GameTooltip:AddLine(button.MyObject.actor) GameTooltip:Show() local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id) @@ -1437,9 +1437,9 @@ local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActorsEncounterImageButton"..i) t:SetPoint("left", thisButton) t:SetTexture([[Interface\MINIMAP\TRACKING\Target]]) - t:SetDesaturated (true) + t:SetDesaturated(true) t:SetSize(20, 20) - t:SetAlpha (0.7) + 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) @@ -1494,7 +1494,7 @@ if (_detalhes:InstanceIsRaid (instanceId)) then - GameCooltip:AddLine (instanceTable.name, _, 1, "white") + GameCooltip:AddLine(instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) for index, encounterName in ipairs(instanceTable.boss_names) do @@ -1545,7 +1545,7 @@ spell_id_boss_image:SetWidth(20) spell_id_boss_image:SetHeight(16) - local spellsFrame = gump:NewPanel (custom_window, _, "DetailsCustomSpellsFrame", "spellsFrame", 1, 1) + local spellsFrame = gump:NewPanel(custom_window, _, "DetailsCustomSpellsFrame", "spellsFrame", 1, 1) spellsFrame:SetPoint("topleft", custom_window, "topright", 5, 0) spellsFrame:Hide() @@ -1654,7 +1654,7 @@ if (_detalhes:InstanceisRaid (instanceId)) then - GameCooltip:AddLine (instanceTable.name, _, 1, "white") + GameCooltip:AddLine(instanceTable.name, _, 1, "white") GameCooltip:AddIcon (instanceTable.icon, 1, 1, 64, 32) for index, encounterName in ipairs(instanceTable.boss_names) do @@ -1696,38 +1696,38 @@ box2:SetSize(450, 180) box2:SetPoint("topleft", icon_label.widget, "bottomleft", -10, -20) - box2:SetFrameLevel (box0:GetFrameLevel()+1) + 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.tooltip = Loc ["STRING_CUSTOM_EDITCODE_DESC"] - maincode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) + 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.tooltip = Loc ["STRING_CUSTOM_EDITTOOLTIP_DESC"] - tooltipcode_button:SetTemplate (CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) + 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.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) + 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.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) + percentcode_button:SetTemplate(CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE) box2:Hide() --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:SetFrameLevel (custom_window:GetFrameLevel()+4) + code_editor:SetFrameLevel(custom_window:GetFrameLevel()+4) code_editor:SetBackdrop(nil) code_editor:HookScript ("OnUpdate", function() local script = code_editor:GetText() @@ -1748,7 +1748,7 @@ --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:SetTemplate (CONST_CODETEXTENTRY_TEMPLATE) + codeEditorBackground:SetTemplate(CONST_CODETEXTENTRY_TEMPLATE) code_editor:Hide() code_editor.font_size = 11 @@ -1760,14 +1760,14 @@ if (code_editor.expanded) then code_editor:SetSize(CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT) code_editor.expanded = nil - codeEditorBackground:SetTemplate (CONST_CODETEXTENTRY_TEMPLATE) + 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) else code_editor:SetSize(CONST_EDITBOX_WIDTH, CONST_EDITBOX_HEIGHT*1.9) code_editor.expanded = true - codeEditorBackground:SetTemplate (CONST_CODETEXTENTRYEXPANDED_TEMPLATE) + codeEditorBackground:SetTemplate(CONST_CODETEXTENTRYEXPANDED_TEMPLATE) --custom_window.box0.cancelbutton:SetPoint("bottomleft", attribute_box, "bottomright", -237, -10) --custom_window.box0.acceptbutton:SetPoint @@ -1808,7 +1808,7 @@ local object = DetailsCustomPanel.IsEditing if (type(object) ~= "table") then - return _detalhes:Msg ("This object need to be saved before.") + return _detalhes:Msg("This object need to be saved before.") end object.script = main_code @@ -1830,27 +1830,27 @@ end local supportFrame = CreateFrame("frame", "$parentSupportFrame", custom_window) - supportFrame:SetFrameLevel (500) + 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:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) + 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:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) + 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:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) + 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:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) + 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:SetTemplate (CONST_CODETEXTENTRYBUTTON_TEMPLATE) + open_API:SetTemplate(CONST_CODETEXTENTRYBUTTON_TEMPLATE) local errorString = gump:CreateLabel(supportFrame) errorString:SetPoint("left", open_API, "right", 10, 0) diff --git a/frames/window_custom_scripts.lua b/frames/window_custom_scripts.lua index fe0394c6..435138c2 100644 --- a/frames/window_custom_scripts.lua +++ b/frames/window_custom_scripts.lua @@ -4,8 +4,8 @@ local Details = _G._detalhes local DF = _G.DetailsFramework local _ ---local AceComm = LibStub ("AceComm-3.0") ---local AceSerializer = LibStub ("AceSerializer-3.0") +--local AceComm = LibStub("AceComm-3.0") +--local AceSerializer = LibStub("AceSerializer-3.0") local Loc = LibStub("AceLocale-3.0"):GetLocale("Details") local CONST_MENU_X_POSITION = 10 @@ -23,8 +23,8 @@ local CONST_EDITBOX_HEIGHT = 370 local CONST_EDITBOX_BUTTON_WIDTH = 80 local CONST_EDITBOX_BUTTON_HEIGHT = 20 -local CONST_BUTTON_TEMPLATE = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") -local CONST_TEXTENTRY_TEMPLATE = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") +local CONST_BUTTON_TEMPLATE = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") +local CONST_TEXTENTRY_TEMPLATE = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS", { @@ -59,11 +59,11 @@ DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON", { 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") -local CONST_CODETEXTENTRYBUTTON_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON") -local CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS") -local CONST_REGULAR_BUTTON_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON") +local CONST_CODETEXTENTRY_TEMPLATE = DF:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX") +local CONST_CODETEXTENTRYEXPANDED_TEMPLATE = DF:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED") +local CONST_CODETEXTENTRYBUTTON_TEMPLATE = DF:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON") +local CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE = DF:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS") +local CONST_REGULAR_BUTTON_TEMPLATE = DF:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON") --new script button diff --git a/frames/window_dump.lua b/frames/window_dump.lua index 406bd3d9..0d994d1e 100644 --- a/frames/window_dump.lua +++ b/frames/window_dump.lua @@ -19,7 +19,7 @@ end function Details:Dump (...) if (not DetailsDumpFrame) then - DetailsDumpFrame = DetailsFramework:CreateSimplePanel (_G.UIParent) + DetailsDumpFrame = DetailsFramework:CreateSimplePanel(_G.UIParent) DetailsDumpFrame:SetSize(700, 600) DetailsDumpFrame:SetTitle ("Details! Dump Table [|cFFFF3333Ready Only|r]") @@ -40,10 +40,10 @@ function Details:Dump (...) 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) - text_editor.__background:SetAlpha (0.8) - text_editor.__background:SetVertTile (true) - text_editor.__background:SetHorizTile (true) + text_editor.__background:SetVertexColor(0.27, 0.27, 0.27) + text_editor.__background:SetAlpha(0.8) + text_editor.__background:SetVertTile(true) + text_editor.__background:SetHorizTile(true) text_editor.__background:SetAllPoints() end @@ -80,10 +80,10 @@ end function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) if (not _G.DetailsExportWindow) then - local importWindow = DetailsFramework:CreateSimplePanel (_G.UIParent, 800, 610, "Details! Dump String", "DetailsExportWindow") + local importWindow = DetailsFramework:CreateSimplePanel(_G.UIParent, 800, 610, "Details! Dump String", "DetailsExportWindow") importWindow:SetFrameStrata("FULLSCREEN") importWindow:SetPoint("center") - DetailsFramework:ApplyStandardBackdrop (importWindow, false, 1.2) + 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}) @@ -105,10 +105,10 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) importTextEditor:SetBackdropBorderColor(0, 0, 0, 1) importTextEditor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647) - importTextEditor.__background:SetVertexColor (0.27, 0.27, 0.27) - importTextEditor.__background:SetAlpha (0.8) - importTextEditor.__background:SetVertTile (true) - importTextEditor.__background:SetHorizTile (true) + importTextEditor.__background:SetVertexColor(0.27, 0.27, 0.27) + importTextEditor.__background:SetAlpha(0.8) + importTextEditor.__background:SetVertTile(true) + importTextEditor.__background:SetHorizTile(true) importTextEditor.__background:SetAllPoints() --import button @@ -118,12 +118,12 @@ 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) @@ -138,7 +138,7 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText) titleText = titleText or "Details! Dump String" _G.DetailsExportWindow.Title:SetText(titleText) - C_Timer.After (.2, function() + C_Timer.After(.2, function() _G.DetailsExportWindow.ImportEditor:SetFocus (true) _G.DetailsExportWindow.ImportEditor.editbox:HighlightText (0) end) diff --git a/frames/window_eventtracker.lua b/frames/window_eventtracker.lua index 068d7009..54a6ee07 100644 --- a/frames/window_eventtracker.lua +++ b/frames/window_eventtracker.lua @@ -10,20 +10,20 @@ function Details:OpenEventTrackerOptions (from_options_panel) local DF = _detalhes.gump - local f = DF:CreateSimplePanel (_G.UIParent, 700, 400, "Details! Event Tracker Options", "DetailsEventTrackerOptions") + 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) local LibWindow = _G.LibStub("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.event_tracker.options_frame) - LibWindow.MakeDraggable (f) - LibWindow.RestorePosition (f) + LibWindow.RegisterConfig(f, _detalhes.event_tracker.options_frame) + LibWindow.MakeDraggable(f) + LibWindow.RestorePosition(f) - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") --frame strata options local set_frame_strata = function(_, _, strata) @@ -69,7 +69,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) --options table local options = { - {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")}, --enabled { type = "toggle", @@ -129,7 +129,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) name = "Frame Strata" }, {type = "breakline"}, - {type = "label", get = function() return "Line Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {type = "label", get = function() return "Line Settings:" end, text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")}, --line height { type = "range", @@ -217,7 +217,7 @@ function Details:OpenEventTrackerOptions (from_options_panel) f:SetScript("OnHide", function() --reopen the options panel if (f.FromOptionsPanel) then - C_Timer.After (0.2, function() + C_Timer.After(0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) end) end @@ -249,16 +249,16 @@ function Details:CreateEventTrackerFrame(parent, name) 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:EnableMouse (true) - f:SetMovable (true) + f:SetBackdropColor(unpack(_detalhes.event_tracker.frame.backdrop_color)) + f:EnableMouse(true) + f:SetMovable(true) f:SetResizable(true) f:SetClampedToScreen (true) - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame) - LibWindow.MakeDraggable (f) - LibWindow.RestorePosition (f) + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(f, _detalhes.event_tracker.frame) + LibWindow.MakeDraggable(f) + LibWindow.RestorePosition(f) --two resizers @@ -334,7 +334,7 @@ function Details:CreateEventTrackerFrame(parent, name) local scroll_createline = function(self, index) local line = CreateFrame("frame", "$parentLine" .. index, self,"BackdropTemplate") - line:EnableMouse (false) + line:EnableMouse(false) line.Index = index --hack to not trigger error on UpdateWorldTrackerLines since Index is set after this function is ran --set its backdrop @@ -346,7 +346,7 @@ function Details:CreateEventTrackerFrame(parent, name) statusbar:SetAllPoints() local statusbartexture = statusbar:CreateTexture(nil, "border") statusbar:SetStatusBarTexture (statusbartexture) - statusbar:SetMinMaxValues (0, 1) + statusbar:SetMinMaxValues(0, 1) statusbar:SetValue(0) local statusbarspark = statusbar:CreateTexture(nil, "artwork") @@ -432,9 +432,9 @@ function Details:CreateEventTrackerFrame(parent, name) local get_player_icon = function(spec, class) if (spec) then - return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack (_detalhes.class_specs_coords [spec]) + return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(_detalhes.class_specs_coords [spec]) elseif (class) then - return [[Interface\AddOns\Details\images\classes_small]], unpack (_detalhes.class_coords [class]) + return [[Interface\AddOns\Details\images\classes_small]], unpack(_detalhes.class_coords [class]) else return [[Interface\AddOns\Details\images\classes_plus]], 0.50390625, 0.62890625, 0, 0.125 end @@ -443,11 +443,11 @@ function Details:CreateEventTrackerFrame(parent, name) local add_role_and_class_color = function(player_name, player_serial) --get the actor object - local actor = _detalhes.tabela_vigente[1]:GetActor (player_name) + local actor = _detalhes.tabela_vigente[1]:GetActor(player_name) if (actor) then --remove realm name - player_name = _detalhes:GetOnlyName (player_name) + player_name = _detalhes:GetOnlyName(player_name) local class, spec, role = actor.classe, actor.spec, actor.role if (not class) then @@ -468,7 +468,7 @@ function Details:CreateEventTrackerFrame(parent, name) else local spec, class = get_spec_or_class (player_serial, player_name) - player_name = _detalhes:GetOnlyName (player_name) + player_name = _detalhes:GetOnlyName(player_name) if (class) then --add the class color @@ -520,7 +520,7 @@ function Details:CreateEventTrackerFrame(parent, name) local texture, L, R, T, B = get_player_icon (spec, class) 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) @@ -596,7 +596,7 @@ function Details:CreateEventTrackerFrame(parent, name) 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:SetVertexColor(.1, .1, .1, .9) TitleBackground:SetPoint("topleft", f, "topleft") TitleBackground:SetPoint("topright", f, "topright") TitleBackground:SetHeight(header_size) @@ -639,13 +639,13 @@ function Details:CreateEventTrackerFrame(parent, name) --set texture local texture = SharedMedia:Fetch ("statusbar", _detalhes.event_tracker.line_texture) line.StatusbarTexture:SetTexture(texture) - line.StatusbarTexture:SetVertexColor (unpack (_detalhes.event_tracker.line_color)) + 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) - line.ActionIcon:SetAlpha (0.65) + line.ActionIcon:SetAlpha(0.65) end -- /run _detalhes.event_tracker.font_shadow = 24 @@ -676,16 +676,16 @@ function Details:CreateEventTrackerFrame(parent, name) end f:SetSize(_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) - LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame) - LibWindow.RestorePosition (f) + LibWindow.RegisterConfig(f, _detalhes.event_tracker.frame) + LibWindow.RestorePosition(f) scrollframe:OnSizeChanged() if (_detalhes.event_tracker.frame.locked) then - f:EnableMouse (false) + f:EnableMouse(false) left_resize:Hide() right_resize:Hide() else - f:EnableMouse (true) + f:EnableMouse(true) left_resize:Show() right_resize:Show() end @@ -702,8 +702,8 @@ function Details:CreateEventTrackerFrame(parent, name) scrollframe:SetPoint("topright", f, "topright", 0, 0) end - f:SetBackdropColor(unpack (_detalhes.event_tracker.frame.backdrop_color)) - scrollframe.__background:SetVertexColor (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) @@ -734,13 +734,13 @@ function Details:CreateEventTrackerFrame(parent, name) if (not flag) then return false end - return bit.band (flag, OBJECT_TYPE_PLAYER) ~= 0 + return bit.band(flag, OBJECT_TYPE_PLAYER) ~= 0 end local is_enemy = function(flag) if (not flag) then return false end - return bit.band (flag, OBJECT_TYPE_ENEMY) ~= 0 + return bit.band(flag, OBJECT_TYPE_ENEMY) ~= 0 end combatLog:SetScript("OnEvent", function(self, event) @@ -778,7 +778,7 @@ function Details:CreateEventTrackerFrame(parent, name) local amountToShow = #CurrentShowing if (amountToShow > amountOfLines) then - tremove (CurrentShowing, amountToShow) + tremove(CurrentShowing, amountToShow) end scrollframe:Refresh() end diff --git a/frames/window_forge.lua b/frames/window_forge.lua index 3f8be064..7dd3fa07 100644 --- a/frames/window_forge.lua +++ b/frames/window_forge.lua @@ -22,7 +22,7 @@ local CONST_BUTTONSELECTED_TEMPLATE = Details:GetFramework():InstallTemplate("bu function Details:InitializeForge() - local DetailsForgePanel = Details.gump:CreateSimplePanel (UIParent, 960, 600, "Details! " .. L["STRING_SPELLLIST"], "DetailsForgePanel") + local DetailsForgePanel = Details.gump:CreateSimplePanel(UIParent, 960, 600, "Details! " .. L["STRING_SPELLLIST"], "DetailsForgePanel") DetailsForgePanel.Frame = DetailsForgePanel DetailsForgePanel.__name = L["STRING_SPELLLIST"] DetailsForgePanel.real_name = "DETAILS_FORGE" @@ -44,11 +44,11 @@ function Details:OpenForge() DetailsForgePanel.Initialized = true --main frame - local f = DetailsForgePanel or Details.gump:CreateSimplePanel (UIParent, 960, 600, "Details! " .. L["STRING_SPELLLIST"], "DetailsForgePanel") + local f = DetailsForgePanel or Details.gump:CreateSimplePanel(UIParent, 960, 600, "Details! " .. L["STRING_SPELLLIST"], "DetailsForgePanel") f:SetPoint("center", UIParent, "center") f:SetFrameStrata("HIGH") f:SetToplevel (true) - f:SetMovable (true) + f:SetMovable(true) f.Title:SetTextColor (1, .8, .2) local have_plugins_enabled @@ -91,11 +91,11 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + 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"]) + 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + closeButton:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end --modules @@ -113,10 +113,10 @@ function Details:OpenForge() 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: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:SetAllPoints() @@ -128,8 +128,8 @@ function Details:OpenForge() --scroll gradient local blackdiv = f:CreateTexture(nil, "artwork") blackdiv:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) - blackdiv:SetVertexColor (0, 0, 0) - blackdiv:SetAlpha (1) + blackdiv:SetVertexColor(0, 0, 0) + blackdiv:SetAlpha(1) blackdiv:SetPoint("topleft", f, "topleft", 170, -100) blackdiv:SetHeight(461) blackdiv:SetWidth(200) @@ -137,8 +137,8 @@ function Details:OpenForge() --big gradient local blackdiv = f:CreateTexture(nil, "artwork") blackdiv:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) - blackdiv:SetVertexColor (0, 0, 0) - blackdiv:SetAlpha (0.7) + 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) @@ -150,7 +150,7 @@ function Details:OpenForge() local buttons = {} function f:InstallModule (module) - if (module and type (module) == "table") then + if (module and type(module) == "table") then tinsert(all_modules, module) end end @@ -170,7 +170,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllPlayersFilterPanel end, @@ -234,7 +234,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_OWNERNAME"] .. ": ") @@ -242,7 +242,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllPetsFilterPanel end, @@ -321,7 +321,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllEnemiesFilterPanel end, @@ -418,7 +418,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") @@ -426,7 +426,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeAllSpellsFilterPanel end, @@ -548,7 +548,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ") @@ -556,7 +556,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") @@ -564,7 +564,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeEncounterBossSpellsFilterPanel end, @@ -709,7 +709,7 @@ function Details:OpenForge() local searchEntry = fw:CreateTextEntry(npcIdFrame, nil, 120, 20, "entry", "DetailsForgeEncounterNpcIDsFilter") searchEntry:SetHook("OnTextChanged", function() f:refresh() end) searchEntry:SetPoint("left", filterSpellNameLabel, "right", 2, 0) - searchEntry:SetTemplate(Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + searchEntry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeEncounterNpcIDsFilterPanel @@ -803,7 +803,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") @@ -811,7 +811,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end return DetailsForgeDBMBarsFilterPanel end, @@ -906,7 +906,7 @@ function Details:OpenForge() 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)) + local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = DetailsFramework.EncounterJournal.EJ_GetSectionInfo (abs(spellid)) spellname, spellicon = title, abilityIcon else spellname, _, spellicon = GetSpellInfo(spellid) @@ -934,7 +934,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall") label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ") @@ -942,7 +942,7 @@ function Details:OpenForge() 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:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) -- end return DetailsForgeBigWigsBarsFilterPanel @@ -1042,9 +1042,9 @@ function Details:OpenForge() end for index, button in ipairs(buttons) do - button:SetTemplate (CONST_BUTTON_TEMPLATE) + button:SetTemplate(CONST_BUTTON_TEMPLATE) end - buttons[module_number]:SetTemplate (CONST_BUTTONSELECTED_TEMPLATE) + buttons[module_number]:SetTemplate(CONST_BUTTONSELECTED_TEMPLATE) local module = all_modules [module_number] if (module) then @@ -1075,7 +1075,7 @@ function Details:OpenForge() for o = 1, #fillpanel.scrollframe.lines do for i = 1, #fillpanel.scrollframe.lines [o].entry_inuse do --text entry - fillpanel.scrollframe.lines [o].entry_inuse [i]:SetTemplate (fw:GetTemplate ("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE")) + fillpanel.scrollframe.lines [o].entry_inuse [i]:SetTemplate(fw:GetTemplate("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE")) end end end @@ -1109,10 +1109,10 @@ function Details:OpenForge() for i = 1, #all_modules do local module = all_modules [i] - local b = fw:CreateButton (f, select_module, 140, 20, module.name, i) + local b = fw:CreateButton(f, select_module, 140, 20, module.name, i) b.tooltip = module.desc - b:SetTemplate (CONST_BUTTON_TEMPLATE) + 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) diff --git a/frames/window_macros.lua b/frames/window_macros.lua index a1bedfa1..1fc4b56b 100644 --- a/frames/window_macros.lua +++ b/frames/window_macros.lua @@ -6,7 +6,7 @@ local DF = _G.DetailsFramework local _ function Details:InitializeMacrosWindow() - local DetailsMacrosPanel = DF:CreateSimplePanel (UIParent, 700, 480, "Details! Useful Macros", "DetailsMacrosPanel") + local DetailsMacrosPanel = DF:CreateSimplePanel(UIParent, 700, 480, "Details! Useful Macros", "DetailsMacrosPanel") DetailsMacrosPanel.Frame = DetailsMacrosPanel DetailsMacrosPanel.__name = "Macros" DetailsMacrosPanel.real_name = "DETAILS_MACROSWINDOW" @@ -27,7 +27,7 @@ function Details.OpenMacrosWindow() if (not DetailsMacrosPanel or not DetailsMacrosPanel.Initialized) then DetailsMacrosPanel.Initialized = true - local f = DetailsMacrosPanel or DF:CreateSimplePanel (UIParent, 700, 480, "Details! Useful Macros", "DetailsMacrosPanel") + local f = DetailsMacrosPanel or DF:CreateSimplePanel(UIParent, 700, 480, "Details! Useful Macros", "DetailsMacrosPanel") local scrollbox_line_backdrop_color = {0, 0, 0, 0.2} local scrollbox_line_backdrop_color_onenter = {.3, .3, .3, 0.5} @@ -37,10 +37,10 @@ function Details.OpenMacrosWindow() 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: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:SetAllPoints() f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) @@ -50,11 +50,11 @@ function Details.OpenMacrosWindow() 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) @@ -92,16 +92,16 @@ function Details.OpenMacrosWindow() 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: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") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") options_dropdown_template = DF.table.copy ({}, options_dropdown_template) options_dropdown_template.backdropcolor = {.51, .51, .51, .3} options_dropdown_template.onenterbordercolor = {.51, .51, .51, .2} diff --git a/frames/window_main.lua b/frames/window_main.lua index c5df2109..e7dc5f98 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -18,7 +18,7 @@ local unpack = unpack local CreateFrame = CreateFrame local _GetTime = GetTime local _GetCursorPosition = GetCursorPosition -local _UIParent = UIParent +local UIParent = UIParent local _IsAltKeyDown = IsAltKeyDown local _IsShiftKeyDown = IsShiftKeyDown local _IsControlKeyDown = IsControlKeyDown @@ -237,7 +237,7 @@ function Details:MostrarScrollBar(sem_animacao) 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.scroll:SetMinMaxValues(0, slider_height) self.rolagem = true self.scroll:Enable() @@ -1658,13 +1658,13 @@ end function Details:DelayOptionsRefresh(instance, noReopen) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then - Details:ScheduleTimer ("OpenOptionsWindow", 0.1, {instance or _G.DetailsOptionsWindow.instance, noReopen}) + Details:ScheduleTimer("OpenOptionsWindow", 0.1, {instance or _G.DetailsOptionsWindow.instance, noReopen}) end end function Details:RefreshLockedState() if (not self.baseframe and self.meu_id and self:IsEnabled()) then - self:ScheduleTimer ("RefreshLockedState", 1) + self:ScheduleTimer("RefreshLockedState", 1) return elseif (not self.baseframe) then return @@ -1982,7 +1982,7 @@ local lineScript_Onmouseup = function(self, button) 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 + 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 @@ -2413,10 +2413,10 @@ local icon_frame_on_click_up = function(self, button) if (Details.ilevel.core:HasQueuedInspec (self.unitname)) then --icon animation - local anim = tremove (Details.icon_animations.load.available) + local anim = tremove(Details.icon_animations.load.available) if (not anim) then icon_frame_create_animation() - anim = tremove (Details.icon_animations.load.available) + anim = tremove(Details.icon_animations.load.available) end local f = anim @@ -2435,13 +2435,13 @@ local icon_frame_on_click_up = function(self, button) frame.question_icon:Hide() end end - Details:ScheduleTimer ("HideBarQuestionIcon", 1, f) + Details:ScheduleTimer("HideBarQuestionIcon", 1, f) self.icon_animation = anim anim.icon_frame = self local pid - pid = icon_frame_events:ScheduleTimer ("CancelAnim", 1, {anim}) + pid = icon_frame_events:ScheduleTimer("CancelAnim", 1, {anim}) Details.icon_animations.load.in_use [anim] = pid anim.parent = self @@ -2455,10 +2455,10 @@ local icon_frame_on_click_up = function(self, button) end --icon animation - local anim = tremove (Details.icon_animations.load.available) + local anim = tremove(Details.icon_animations.load.available) if (not anim) then icon_frame_create_animation() - anim = tremove (Details.icon_animations.load.available) + anim = tremove(Details.icon_animations.load.available) end anim:Show() @@ -2475,9 +2475,9 @@ local icon_frame_on_click_up = function(self, button) local pid if (does_query) then - pid = icon_frame_events:ScheduleTimer ("CancelAnim", 4, {anim, true}) + pid = icon_frame_events:ScheduleTimer("CancelAnim", 4, {anim, true}) else - pid = icon_frame_events:ScheduleTimer ("CancelAnim", 0.2, {anim}) + pid = icon_frame_events:ScheduleTimer("CancelAnim", 0.2, {anim}) end Details.icon_animations.load.in_use [anim] = pid anim.parent = self @@ -2996,7 +2996,7 @@ local hide_click_func = function() --empty end -function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) +function Details:InstanceAlert (msg, icon, timeInSeconds, clickfunc, doflash, forceAlert) if (not forceAlert and Details.streamer_config.no_alerts) then --return @@ -3059,9 +3059,9 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) self.alert.button.func_param = {unpack(clickfunc, 2)} end - time = time or 15 - self.alert_time = time - Details:ScheduleTimer ("InstanceAlertTime", time, self) + timeInSeconds = timeInSeconds or 15 + self.alert_time = timeInSeconds + Details:ScheduleTimer("InstanceAlertTime", timeInSeconds, self) self.alert:SetPoint("bottom", self.baseframe, "bottom", 0, -12) self.alert:SetPoint("left", self.baseframe, "left", 3, 0) @@ -3077,7 +3077,6 @@ function Details:InstanceAlert (msg, icon, time, clickfunc, doflash, forceAlert) end self.alert:Play() - end local alert_on_click = function(self, button) @@ -3090,8 +3089,7 @@ local alert_on_click = function(self, button) self:GetParent():Hide() end -local function CreateAlertFrame (baseframe, instancia) - +local function CreateAlertFrame(baseframe, instancia) local frame_upper = CreateFrame("scrollframe", "DetailsAlertFrameScroll" .. instancia.meu_id, baseframe) frame_upper:SetPoint("bottom", baseframe, "bottom") frame_upper:SetPoint("left", baseframe, "left", 3, 0) @@ -3215,7 +3213,7 @@ local function CreateAlertFrame (baseframe, instancia) end function alert_bg:DoFlash() - C_Timer.After (0.23, do_flash) + C_Timer.After(0.23, do_flash) end alert_bg.text = text @@ -3247,7 +3245,7 @@ function Details:InstanceMsg (text, icon, textcolor, iconcoords, iconcolor) self.freeze_texto:SetTextColor(1, 1, 1, 1) end - if (iconcoords and type (iconcoords) == "table") then + if (iconcoords and type(iconcoords) == "table") then self.freeze_icon:SetTexCoord(unpack(iconcoords)) else self.freeze_icon:SetTexCoord(0, 1, 0, 1) @@ -3267,10 +3265,10 @@ function Details:schedule_hide_anti_overlap (self) end local function hide_anti_overlap (self) if (self.schdule) then - Details:CancelTimer (self.schdule) + Details:CancelTimer(self.schdule) self.schdule = nil end - local schdule = Details:ScheduleTimer ("schedule_hide_anti_overlap", 0.3, self) + local schdule = Details:ScheduleTimer("schedule_hide_anti_overlap", 0.3, self) self.schdule = schdule end @@ -3279,7 +3277,7 @@ local function show_anti_overlap (instance, host, side) local anti_menu_overlap = instance.baseframe.anti_menu_overlap if (anti_menu_overlap.schdule) then - Details:CancelTimer (anti_menu_overlap.schdule) + Details:CancelTimer(anti_menu_overlap.schdule) anti_menu_overlap.schdule = nil end @@ -3310,7 +3308,7 @@ do local tooltip_anchor = CreateFrame("frame", "DetailsTooltipAnchor", UIParent,"BackdropTemplate") tooltip_anchor:SetSize(140, 20) tooltip_anchor:SetAlpha(0) - tooltip_anchor:SetMovable (false) + 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}}) @@ -3357,7 +3355,7 @@ do if (self.locked) then self:SetAlpha(1) self:EnableMouse(true) - self:SetMovable (true) + self:SetMovable(true) self:SetFrameStrata("FULLSCREEN") self.locked = false tooltip_anchor.alert.animOut:Stop() @@ -3366,7 +3364,7 @@ do self:SetAlpha(0) self:EnableMouse(false) self:SetFrameStrata("MEDIUM") - self:SetMovable (false) + self:SetMovable(false) self.locked = true tooltip_anchor.alert.animIn:Stop() tooltip_anchor.alert.animOut:Play() @@ -3409,7 +3407,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- main frames ----------------------------------------------------------------------------------------------------------------------------------------------- --baseframe is the lowest frame in the window architecture - local baseframe = CreateFrame("scrollframe", "DetailsBaseFrame" .. ID, _UIParent, "BackdropTemplate") + local baseframe = CreateFrame("scrollframe", "DetailsBaseFrame" .. ID, UIParent, "BackdropTemplate") baseframe:SetMovable(true) baseframe:SetResizable(true) baseframe:SetUserPlaced(false) @@ -3463,7 +3461,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) instancia.windowBackgroundDisplay = backgrounddisplay --row frame is the parent of rows, it have setallpoints on baseframe - local rowframe = CreateFrame("frame", "DetailsRowFrame"..ID, _UIParent) --row frame + local rowframe = CreateFrame("frame", "DetailsRowFrame"..ID, UIParent) --row frame rowframe:SetAllPoints(baseframe) rowframe:SetFrameStrata(baseframe_strata) rowframe:SetFrameLevel(3) @@ -3555,7 +3553,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --config set scrollbar:SetOrientation ("VERTICAL") scrollbar.scrollMax = 0 - scrollbar:SetMinMaxValues (0, 0) + scrollbar:SetMinMaxValues(0, 0) scrollbar:SetValue(0) scrollbar.ultimo = 0 @@ -3597,7 +3595,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) baseframe:SetClampedToScreen (true) baseframe:SetSize(Details.new_window_size.width, Details.new_window_size.height) - baseframe:SetPoint("center", _UIParent) + baseframe:SetPoint("center", UIParent) baseframe:EnableMouseWheel(false) baseframe:EnableMouse(true) @@ -5444,7 +5442,7 @@ function Details:StatusBarAlert(text, icon, color, time) if (icon or text) then statusbar:Show() if (time) then - Details:ScheduleTimer ("StatusBarAlertTime", time, self) + Details:ScheduleTimer("StatusBarAlertTime", time, self) end else statusbar:Hide() @@ -5541,7 +5539,7 @@ function gump:CriaRodape(baseframe, instancia) baseframe.DOWNFrame:Show() baseframe.DOWNFrame:EnableMouse(true) - baseframe.DOWNFrame:SetMovable (true) + baseframe.DOWNFrame:SetMovable(true) baseframe.DOWNFrame:SetResizable(true) BGFrame_scripts(baseframe.DOWNFrame, baseframe, instancia) @@ -6157,7 +6155,7 @@ function Details:SetMenuOwner (self, instance) local instance_height = instance.baseframe:GetHeight() - if (y + math.max (instance_height, 250) > screen_height) then + 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) @@ -6395,7 +6393,7 @@ local buildSegmentTooltip = function(self, deltaTime) 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: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") @@ -6405,7 +6403,7 @@ local buildSegmentTooltip = function(self, deltaTime) 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: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") @@ -6687,7 +6685,7 @@ local buildSegmentTooltip = function(self, deltaTime) 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: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") @@ -6701,7 +6699,7 @@ local buildSegmentTooltip = function(self, deltaTime) 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: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 @@ -7319,16 +7317,16 @@ end --update the window click through state local updateClickThroughListener = Details:CreateEventListener() function updateClickThroughListener:EnterCombat() - Details:InstanceCall (function(instance) - C_Timer.After (1.5, function() + Details:InstanceCall(function(instance) + C_Timer.After(1.5, function() instance:UpdateClickThrough() end) end) end function updateClickThroughListener:LeaveCombat() - Details:InstanceCall (function(instance) - C_Timer.After (1.5, function() + Details:InstanceCall(function(instance) + C_Timer.After(1.5, function() instance:UpdateClickThrough() end) end) @@ -7498,25 +7496,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 @@ -7543,15 +7541,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 @@ -7561,8 +7559,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 @@ -7571,8 +7569,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 @@ -7580,7 +7578,7 @@ function Details:AdjustAlphaByContext(interacting) --raid debug (inside instance + out of combat) if (self.hide_on_context[6].enabled) then if ((Details.zone_type == "raid" or Details.zone_type == "party") and IsInInstance()) then - Details:ScheduleTimer ("DelayedCheckOutOfCombatAndGroupAlpha", 0.3, self, getAlphaByContext(self, 6)) + Details:ScheduleTimer("DelayedCheckOutOfCombatAndGroupAlpha", 0.3, self, getAlphaByContext(self, 6)) end end @@ -7600,8 +7598,8 @@ function Details:AdjustAlphaByContext(interacting) else --player is not inside an arena if (self.hide_on_context[contextId].inverse) then - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, contextId)) - self:SetWindowAlphaForCombat (true, true, getAlphaByContext(self, contextId)) + self:SetWindowAlphaForCombat(true, true, getAlphaByContext(self, contextId)) + self:SetWindowAlphaForCombat(true, true, getAlphaByContext(self, contextId)) hasRuleEnabled = true end end @@ -7613,10 +7611,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 @@ -7624,10 +7622,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 @@ -7638,20 +7636,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 @@ -7659,12 +7657,12 @@ function Details:AdjustAlphaByContext(interacting) --in combat if (self.hide_on_context[1].enabled) then - Details:ScheduleTimer ("DelayedCheckCombatAlpha", 0.3, self, getAlphaByContext(self, 1)) + Details:ScheduleTimer("DelayedCheckCombatAlpha", 0.3, self, getAlphaByContext(self, 1)) end --out of combat if (self.hide_on_context[2].enabled) then - Details:ScheduleTimer ("DelayedCheckOutOfCombatAlpha", 0.3, self, getAlphaByContext(self, 2)) + Details:ScheduleTimer("DelayedCheckOutOfCombatAlpha", 0.3, self, getAlphaByContext(self, 2)) end --if no rule is enabled, show the window @@ -9456,7 +9454,7 @@ local function click_to_change_segment (instancia, buttontype) local total_shown = segments_filled+2 local goal = segmento_goal+1 - local select_ = math.abs (goal - total_shown) + local select_ = math.abs(goal - total_shown) GameCooltip:Select(1, select_) instancia:TrocaTabela(segmento_goal) @@ -9473,7 +9471,7 @@ local function click_to_change_segment (instancia, buttontype) local total_shown = segments_filled+2 local goal = segmento_goal+1 - local select_ = math.abs (goal - total_shown) + local select_ = math.abs(goal - total_shown) GameCooltip:Select(1, select_) instancia:TrocaTabela(segmento_goal) @@ -9486,7 +9484,7 @@ local function click_to_change_segment (instancia, buttontype) local total_shown = segments_filled+2 local goal = segmento_goal+1 - local select_ = math.abs (goal - total_shown) + local select_ = math.abs(goal - total_shown) GameCooltip:Select(1, select_) instancia:TrocaTabela(segmento_goal) @@ -9587,7 +9585,7 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.UPFrame:Show() baseframe.UPFrame:EnableMouse(true) - baseframe.UPFrame:SetMovable (true) + baseframe.UPFrame:SetMovable(true) baseframe.UPFrame:SetResizable(true) BGFrame_scripts(baseframe.UPFrame, baseframe, instancia) @@ -9598,7 +9596,7 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.UPFrameConnect:SetPoint("bottomright", baseframe, "topright", 0, -1) baseframe.UPFrameConnect:SetHeight(2) baseframe.UPFrameConnect:EnableMouse(true) - baseframe.UPFrameConnect:SetMovable (true) + baseframe.UPFrameConnect:SetMovable(true) baseframe.UPFrameConnect:SetResizable(true) baseframe.UPFrameConnect.is_toolbar = true @@ -9608,7 +9606,7 @@ function gump:CriaCabecalho (baseframe, instancia) baseframe.UPFrameLeftPart:SetPoint("bottomleft", baseframe, "topleft", 0, 0) baseframe.UPFrameLeftPart:SetSize(22, 20) baseframe.UPFrameLeftPart:EnableMouse(true) - baseframe.UPFrameLeftPart:SetMovable (true) + baseframe.UPFrameLeftPart:SetMovable(true) baseframe.UPFrameLeftPart:SetResizable(true) baseframe.UPFrameLeftPart.is_toolbar = true diff --git a/frames/window_news.lua b/frames/window_news.lua index 11b3c6e2..d1ac1938 100644 --- a/frames/window_news.lua +++ b/frames/window_news.lua @@ -15,7 +15,7 @@ function Details:OpenNewsWindow(textToShow, dumpValues, keeptext) return end - if (textToShow and type (textToShow) == "table") then + if (textToShow and type(textToShow) == "table") then DetailsNewsWindowLower:SetSize(450, 5000) DetailsNewsWindowSlider:SetMinMaxValues(0, 5000) DetailsNewsWindowText:SetHeight(5000) @@ -118,7 +118,7 @@ function Details:CreateOrOpenNewsWindow() slider:SetOrientation ("vertical"); slider:SetSize(16, 499) slider:SetPoint("topleft", frameUpper, "topright") - slider:SetMinMaxValues (0, 2000) + slider:SetMinMaxValues(0, 2000) slider:SetValue(0) slider:SetScript("OnValueChanged", function(self) frameUpper:SetVerticalScroll (self:GetValue()) @@ -155,7 +155,7 @@ function Details:CreateOrOpenNewsWindow() local onToggleAutoOpen = function(_, _, state) Details.auto_open_news_window = state end - local autoOpenCheckbox = DetailsFramework:CreateSwitch(statusBar, onToggleAutoOpen, Details.auto_open_news_window, _, _, _, _, "AutoOpenCheckbox", _, _, _, _, _, DetailsFramework:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) + local autoOpenCheckbox = DetailsFramework:CreateSwitch(statusBar, onToggleAutoOpen, Details.auto_open_news_window, _, _, _, _, "AutoOpenCheckbox", _, _, _, _, _, DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE")) autoOpenCheckbox:SetAsCheckBox() autoOpenCheckbox:SetPoint("left", statusBar, "left", 2, 0) @@ -163,7 +163,7 @@ function Details:CreateOrOpenNewsWindow() autoOpenText:SetPoint("left", autoOpenCheckbox, "right", 2, 0) DetailsFramework:ApplyStandardBackdrop(statusBar) - statusBar:SetAlpha (0.8) + statusBar:SetAlpha(0.8) DetailsFramework:BuildStatusbarAuthorInfo(statusBar, "", "") statusBar.authorName:SetPoint("left", statusBar, "left", 207, 0) diff --git a/frames/window_options2.lua b/frames/window_options2.lua index bb8c6500..e024ead8 100644 --- a/frames/window_options2.lua +++ b/frames/window_options2.lua @@ -7,7 +7,7 @@ local Details = _G.Details local DF = _G.DetailsFramework local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") --local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0") ---local LDB = _G.LibStub ("LibDataBroker-1.1", true) +--local LDB = _G.LibStub("LibDataBroker-1.1", true) --local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true) --options panel namespace @@ -22,13 +22,13 @@ local preset_version = 3 Details.preset_version = preset_version --templates -local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") -local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") -local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") -local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") +local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") +local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") +local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") +local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") -local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") -local options_button_template_selected = DF.table.copy({}, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) +local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") +local options_button_template_selected = DF.table.copy({}, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) options_button_template_selected.backdropbordercolor = {1, .8, .2} --options @@ -50,7 +50,6 @@ function Details.options.InitializeOptionsWindow(instance) f.__icon = [[Interface\Scenarios\ScenarioIcon-Interact]] _G.DetailsPluginContainerWindow.EmbedPlugin(f, f, true) f.sectionFramesContainer = {} - Details:FormatBackground(f) DF:ApplyStandardBackdrop(f) local titleBar = DF:CreateTitleBar(f, "Options Panel") @@ -145,7 +144,7 @@ function Details.options.InitializeOptionsWindow(instance) instanceSelection:SetTemplate(options_dropdown_template) instanceSelection:SetHook("OnEnter", function() GameCooltip:Reset() - GameCooltip:Preset (2) + GameCooltip:Preset(2) GameCooltip:AddLine(Loc ["STRING_MINITUTORIAL_OPTIONS_PANEL1"]) GameCooltip:ShowCooltip(instanceSelection.widget, "tooltip") end) @@ -192,7 +191,7 @@ function Details.options.InitializeOptionsWindow(instance) --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:SetTemplate (options_button_template) + 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 @@ -254,7 +253,7 @@ function Details.options.InitializeOptionsWindow(instance) if (optionName:find(searchingText)) then if optionData.header ~= lastTab then if lastTab ~= nil then - options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank + options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")} -- blank end options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}} lastTab = optionData.header diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index fa719032..f30d4430 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -31,7 +31,7 @@ local Details = _G.Details local DF = _G.DetailsFramework local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details") local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0") -local LDB = _G.LibStub ("LibDataBroker-1.1", true) +local LDB = _G.LibStub("LibDataBroker-1.1", true) local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true) local _ local unpack = _G.unpack @@ -46,13 +46,13 @@ local mainHeightSize = 800 local presetVersion = 3 --templates -local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") -local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") -local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") -local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") -local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") +local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") +local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") +local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") +local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") +local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") -local subSectionTitleTextTemplate = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE") +local subSectionTitleTextTemplate = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE") local font_select_icon, font_select_texcoord = [[Interface\AddOns\Details\images\icons]], {472/512, 513/512, 186/512, 230/512} local texture_select_icon, texture_select_texcoord = [[Interface\AddOns\Details\images\icons]], {472/512, 513/512, 186/512, 230/512} @@ -805,7 +805,7 @@ do for key, value in pairs(skinObject) do if (key ~= "skin" and not _detalhes.instance_skin_ignored_values[key]) then if (type(value) == "table") then - instance[key] = Details.CopyTable (value) + instance[key] = Details.CopyTable(value) else instance[key] = value end @@ -837,7 +837,7 @@ do if (dataTable) then --add the new skin _detalhes.savedStyles [#_detalhes.savedStyles+1] = dataTable - _detalhes:Msg (Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_OKEY"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_OKEY"]) Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() else @@ -916,7 +916,7 @@ do end end - _detalhes:Msg (Loc ["STRING_OPTIONS_SAVELOAD_APPLYALL"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_SAVELOAD_APPLYALL"]) Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() end, @@ -2618,7 +2618,7 @@ do {--text color type = "color", get = function() - local r, g, b = unpack (currentInstance.attribute_text.text_color) + local r, g, b = unpack(currentInstance.attribute_text.text_color) return {r, g, b, a} end, set = function(self, r, g, b, a) @@ -2819,7 +2819,7 @@ do {--window color (skin color) type = "color", get = function() - local r, g, b = unpack (currentInstance.color) + local r, g, b = unpack(currentInstance.color) return {r, g, b, 1} end, @@ -3109,23 +3109,23 @@ do local hideLeftButton = sectionFrame.MicroDisplayLeftDropdown.hideLeftMicroFrameButton if (instance.StatusBar ["left"].options.isHidden) then - hideLeftButton:GetNormalTexture():SetDesaturated (false) + hideLeftButton:GetNormalTexture():SetDesaturated(false) else - hideLeftButton:GetNormalTexture():SetDesaturated (true) + hideLeftButton:GetNormalTexture():SetDesaturated(true) end local hide_center_button = sectionFrame.MicroDisplayCenterDropdown.HideCenterMicroFrameButton if (instance.StatusBar ["center"].options.isHidden) then - hide_center_button:GetNormalTexture():SetDesaturated (false) + hide_center_button:GetNormalTexture():SetDesaturated(false) else - hide_center_button:GetNormalTexture():SetDesaturated (true) + hide_center_button:GetNormalTexture():SetDesaturated(true) end local hide_right_button = sectionFrame.MicroDisplayRightDropdown.HideRightMicroFrameButton if (instance.StatusBar ["right"].options.isHidden) then - hide_right_button:GetNormalTexture():SetDesaturated (false) + hide_right_button:GetNormalTexture():SetDesaturated(false) else - hide_right_button:GetNormalTexture():SetDesaturated (true) + hide_right_button:GetNormalTexture():SetDesaturated(true) end local left = instance.StatusBar ["left"].__name @@ -3169,7 +3169,7 @@ do {--color type = "color", get = function() - local r, g, b = unpack (currentInstance.statusbar_info.overlay) + local r, g, b = unpack(currentInstance.statusbar_info.overlay) local alpha = currentInstance.statusbar_info.alpha return {r, g, b, alpha} end, @@ -3220,7 +3220,7 @@ do --dropdown on select option local onMicroDisplaySelect = function(_, _, micro_display) - local anchor, index = unpack (micro_display) + local anchor, index = unpack(micro_display) if (index == -1) then return _detalhes.StatusBar:SetPlugin (currentInstance, -1, anchor) @@ -3280,16 +3280,16 @@ do _detalhes.StatusBar:SetPlugin (currentInstance, -1, "left") end if (currentInstance.StatusBar ["left"].options.isHidden) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) else - self:GetNormalTexture():SetDesaturated (true) + self:GetNormalTexture():SetDesaturated(true) 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:GetNormalTexture():SetDesaturated (true) + hideLeftMicroFrameButton:GetNormalTexture():SetDesaturated(true) hideLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] hideLeftMicroFrameButton:SetHook("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") @@ -3306,15 +3306,15 @@ do end if (currentInstance.StatusBar ["center"].options.isHidden) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) else - self:GetNormalTexture():SetDesaturated (true) + 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:GetNormalTexture():SetDesaturated (true) + HideCenterMicroFrameButton:GetNormalTexture():SetDesaturated(true) HideCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] HideCenterMicroFrameButton:SetHook("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") @@ -3330,15 +3330,15 @@ do _detalhes.StatusBar:SetPlugin (currentInstance, -1, "right") end if (currentInstance.StatusBar ["right"].options.isHidden) then - self:GetNormalTexture():SetDesaturated (false) + self:GetNormalTexture():SetDesaturated(false) else - self:GetNormalTexture():SetDesaturated (true) + 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:GetNormalTexture():SetDesaturated (true) + HideRightMicroFrameButton:GetNormalTexture():SetDesaturated(true) HideRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] HideRightMicroFrameButton:SetHook("OnEnter", function(self, capsule) self:GetNormalTexture():SetBlendMode("ADD") @@ -3424,8 +3424,8 @@ do if (self.plugin) then local desc = self.plugin:GetPluginDescription() if (desc) then - GameCooltip:Preset (2) - GameCooltip:AddLine (desc) + GameCooltip:Preset(2) + GameCooltip:AddLine(desc) GameCooltip:SetType ("tooltip") GameCooltip:SetOwner(self, "bottomleft", "topleft", 150, -2) GameCooltip:Show() @@ -3433,8 +3433,8 @@ do end if (self.hasDesc) then - GameCooltip:Preset (2) - GameCooltip:AddLine (self.hasDesc) + GameCooltip:Preset(2) + GameCooltip:AddLine(self.hasDesc) GameCooltip:SetType ("tooltip") GameCooltip:SetOwner(self, "bottomleft", "topleft", 150, -2) GameCooltip:Show() @@ -3605,8 +3605,8 @@ do 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) + 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) i = i + 1 @@ -3743,8 +3743,8 @@ do 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) + 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) i = i + 1 @@ -3861,7 +3861,7 @@ do _detalhes:ApplyProfile (profile_name) - _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], profile_name) + _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_LOADED"], profile_name) afterUpdate() end local buildProfileMenuForAlwaysUse = function() @@ -3874,7 +3874,7 @@ do local selectProfile = function(_, _, profileName) _detalhes:ApplyProfile(profileName) - _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], profileName) + _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_LOADED"], profileName) --Details.options.SetCurrentInstanceAndRefresh(currentInstance) --afterUpdate() _G.DetailsOptionsWindow:Hide() @@ -3941,7 +3941,7 @@ do local profileName = profileNameString:GetText() if (profileName == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_FIELDEMPTY"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_FIELDEMPTY"]) end profileNameString:SetText("") @@ -3953,7 +3953,7 @@ do afterUpdate() Details.options.SetCurrentInstanceAndRefresh(currentInstance) else - return _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_NOTCREATED"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_NOTCREATED"]) end end, --icontexture = [[Interface\PetBattles\PetBattle-LockIcon]], @@ -3978,7 +3978,7 @@ do local profileName = profileDropdown:GetValue() if (profileName == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_FIELDEMPTY"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_FIELDEMPTY"]) end if (#_detalhes:GetProfileList() == 1) then @@ -3993,7 +3993,7 @@ do Details.options.SetCurrentInstanceAndRefresh(currentInstance) afterUpdate() - _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_REMOVEOKEY"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_REMOVEOKEY"]) end, name = Loc ["STRING_OPTIONS_PROFILES_ERASE"], }, @@ -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 @@ -4760,10 +4760,10 @@ do icon4:SetDrawLayer ("artwork", 1) icon4:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367 - icon1:SetVertexColor (.15, .15, .15, 1) - icon2:SetVertexColor (.15, .15, .15, 1) - icon3:SetVertexColor (.15, .15, .15, 1) - icon4:SetVertexColor (.15, .15, .15, 1) + icon1:SetVertexColor(.15, .15, .15, 1) + icon2:SetVertexColor(.15, .15, .15, 1) + icon3:SetVertexColor(.15, .15, .15, 1) + icon4:SetVertexColor(.15, .15, .15, 1) --corners local w, h = 20, 20 @@ -4774,7 +4774,7 @@ do L1:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.29296875, 0.1953125+0.0009765625) L1:SetSize(w, h) L1:SetDrawLayer ("overlay", 2) - L1:SetVertexColor (1, 1, 1, .8) + L1:SetVertexColor(1, 1, 1, .8) local L2 = sectionFrame:CreateTexture(nil, "overlay") L2:SetPoint("bottomleft", preview, "bottomleft") @@ -4782,7 +4782,7 @@ do L2:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.1953125+0.0009765625, 0.29296875) L2:SetSize(w, h) L2:SetDrawLayer ("overlay", 2) - L2:SetVertexColor (1, 1, 1, .8) + L2:SetVertexColor(1, 1, 1, .8) local L3 = sectionFrame:CreateTexture(nil, "overlay") L3:SetPoint("bottomright", preview, "bottomright", 0, 0) @@ -4790,7 +4790,7 @@ do L3:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.1953125+0.0009765625, 0.29296875) L3:SetSize(w, h) L3:SetDrawLayer ("overlay", 5) - L3:SetVertexColor (1, 1, 1, .8) + L3:SetVertexColor(1, 1, 1, .8) local L4 = sectionFrame:CreateTexture(nil, "overlay") L4:SetPoint("topright", preview, "topright", 0, 0) @@ -4798,16 +4798,16 @@ do L4:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.29296875, 0.1953125+0.0009765625) L4:SetSize(w, h) L4:SetDrawLayer ("overlay", 5) - L4:SetVertexColor (1, 1, 1, .8) + L4:SetVertexColor(1, 1, 1, .8) --update preview function sectionFrame:UpdateWallpaperInfo() local wallpaper = currentInstance.wallpaper preview:SetTexture(wallpaper.texture) - preview:SetTexCoord (unpack (wallpaper.texcoord)) - preview:SetVertexColor (unpack (wallpaper.overlay)) - preview:SetAlpha (wallpaper.alpha) + preview:SetTexCoord (unpack(wallpaper.texcoord)) + preview:SetVertexColor(unpack(wallpaper.overlay)) + preview:SetAlpha(wallpaper.alpha) end --wallpaper alignment @@ -4864,8 +4864,8 @@ do f:SetPoint("center", UIParent, "center") f:SetFrameStrata("FULLSCREEN") f:SetSize(550, 170) - f:EnableMouse (true) - f:SetMovable (true) + f:EnableMouse(true) + f:SetMovable(true) f:SetScript("OnMouseDown", function(self, button) if (self.isMoving) then return @@ -4899,7 +4899,7 @@ do 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) + 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.tooltip = Loc ["STRING_OPTIONS_WALLPAPER_LOAD_FILENAME_DESC"] @@ -5058,7 +5058,7 @@ do for atributo, sub_atributo in ipairs(attributes) do local icones = sub_atributo.icones for index, att_name in ipairs(sub_atributo.lista) do - local texture, texcoord = unpack (icones [index]) + 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} i = i + 1 @@ -5466,7 +5466,7 @@ do --[=[]] local spec1Table = {} - local playerSpecs = DF.ClassSpecIds [select (2, UnitClass("player"))] + local playerSpecs = DF.ClassSpecIds [select(2, UnitClass("player"))] for specID, _ in pairs(playerSpecs) do local spec_id, specName, spec_description, spec_icon = GetSpecializationInfoByID(specID) tinsert(spec1Table, { @@ -5568,7 +5568,7 @@ do --raid tools f:SetFrameStrata("FULLSCREEN") f:EnableMouse() - f:SetMovable (true) + f:SetMovable(true) f:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then if (f.IsMoving) then @@ -5615,11 +5615,11 @@ do --raid tools function f:CreateLabel() local L = { - icon = DF:CreateImage (f, nil, 16, 16, "overlay", {0.1, 0.9, 0.1, 0.9}), + icon = DF:CreateImage(f, nil, 16, 16, "overlay", {0.1, 0.9, 0.1, 0.9}), text = DF:CreateLabel(f, "", 10, "white", "GameFontHighlightSmall"), } - L.switch = DF:CreateSwitch (f, on_switch_func, false) + 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) @@ -5966,7 +5966,7 @@ do streamerTitleDesc:SetJustifyV ("top") 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}) + 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) --get the plugin object @@ -6056,7 +6056,7 @@ do 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}) + 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) local enableEventTracker = function() @@ -6098,7 +6098,7 @@ do 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}) + 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) local enableArenaDPS = function() @@ -6274,9 +6274,9 @@ do --add --add panel - local addframe = DF:NewPanel (sectionFrame, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 644, 462) + local addframe = DF:NewPanel(sectionFrame, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 644, 462) addframe:SetPoint(startX, startY - 40) - addframe:SetFrameLevel (7) + addframe:SetFrameLevel(7) DF:ApplyStandardBackdrop(addframe) addframe:Hide() @@ -6285,7 +6285,7 @@ do 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) + local spellname_entry = DF:NewTextEntry(addframe, nil, "$parentSpellnameEntry", "spellnameEntry", 160, 20, spellname_entry_func, nil, nil, nil, nil, options_dropdown_template) spellname_entry:SetPoint("left", spellname, "right", 2, 0) local spellid_entry_func = function(arg1, arg2, spellid) @@ -6294,11 +6294,11 @@ do spellname_entry:SetText(spellname) addframe.spellIconButton.icon.texture = icon else - _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_NOTFOUND"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_SPELL_NOTFOUND"]) end end local spellid_entry = DF:NewSpellEntry (addframe, spellid_entry_func, 160, 20, nil, nil, "spellidEntry", "$parentSpellidEntry") - spellid_entry:SetTemplate (options_dropdown_template) + spellid_entry:SetTemplate(options_dropdown_template) spellid_entry:SetPoint("left", spellid, "right", 2, 0) local icon_button_func = function(texture) @@ -6317,17 +6317,17 @@ do local addspell = function() local id = spellid_entry.text if (id == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_IDERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_SPELL_IDERROR"]) end local name = spellname_entry.text if (name == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_NAMEERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_SPELL_NAMEERROR"]) end local icon = addframe.spellIconButton.icon.texture id = tonumber (id) if (not id) then - return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_IDERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_SPELL_IDERROR"]) end _detalhes:UserCustomSpellAdd (id, name, icon) @@ -6420,7 +6420,7 @@ do local big_code_editor = DF:NewSpecialLuaEditorEntry (sectionFrame, 683, 422, "bigCodeEditor", "$parentBigCodeEditor") big_code_editor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 70) - big_code_editor:SetFrameLevel (sectionFrame:GetFrameLevel()+6) + big_code_editor:SetFrameLevel(sectionFrame:GetFrameLevel()+6) big_code_editor:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) DF:ReskinSlider(big_code_editor.scroll) big_code_editor:SetBackdropColor(0.5, 0.5, 0.5, 0.95) @@ -6457,7 +6457,7 @@ do local func = data [2] if (type(func) == "function") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_CODELOADED"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_CODELOADED"]) end big_code_editor:SetText(func) @@ -6490,7 +6490,7 @@ do local big_code_editor2 = DF:NewSpecialLuaEditorEntry (sectionFrame, 643, 402, "exportEditor", "$parentExportEditor", true) big_code_editor2:SetPoint("topleft", sectionFrame, "topleft", 7, -70) - big_code_editor2:SetFrameLevel (sectionFrame:GetFrameLevel()+6) + big_code_editor2:SetFrameLevel(sectionFrame:GetFrameLevel()+6) big_code_editor2:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) DF:ReskinSlider(big_code_editor2.scroll) big_code_editor2:SetBackdropColor(0.5, 0.5, 0.5, 0.95) @@ -6506,7 +6506,7 @@ do close_export:SetPoint(10, 18) close_export:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]]) close_export:SetText(Loc ["STRING_OPTIONS_CHART_CLOSE"]) - close_export:SetTemplate (options_button_template) + close_export:SetTemplate(options_button_template) local export_function = function(index) local data = _detalhes.savedTimeCaptures [index] @@ -6589,9 +6589,9 @@ do panel:Refresh() --add panel - local addframe = DF:NewPanel (sectionFrame, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 683, 422) + local addframe = DF:NewPanel(sectionFrame, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 683, 422) addframe:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 70) - addframe:SetFrameLevel (7) + addframe:SetFrameLevel(7) addframe:Hide() addframe:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16}) @@ -6600,7 +6600,7 @@ do --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) + 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) @@ -6627,12 +6627,12 @@ do --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) + 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) --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) + 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) --open add panel button @@ -6659,7 +6659,7 @@ do local font, size, flag = importframe.editbox:GetFont() importframe.editbox:SetFont (font, 9, flag) importframe:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 70) - importframe:SetFrameLevel (sectionFrame:GetFrameLevel()+6) + importframe:SetFrameLevel(sectionFrame:GetFrameLevel()+6) 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) @@ -6677,21 +6677,21 @@ do 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)) + local register = _detalhes:TimeDataRegister (unpack(unserialize)) if (type(register) == "string") then - _detalhes:Msg (register) + _detalhes:Msg(register) end else - _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_IMPORTERROR"]) end else - _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_IMPORTERROR"]) end importframe:Hide() panel:Refresh() else - _detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"]) + _detalhes:Msg(Loc ["STRING_CUSTOM_IMPORT_ERROR"]) return end end @@ -6700,7 +6700,7 @@ do accept_import:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]]) accept_import:SetPoint(10, 18) accept_import:SetText(Loc ["STRING_OPTIONS_CHART_IMPORT"]) - accept_import:SetTemplate (options_button_template) + accept_import:SetTemplate(options_button_template) local cancelimport = function() importframe:ClearFocus() @@ -6711,7 +6711,7 @@ do cancel_changes:SetIcon ([[Interface\PetBattles\DeadPetIcon]]) cancel_changes:SetText(Loc ["STRING_OPTIONS_CHART_CANCEL"]) cancel_changes:SetPoint(132, 18) - cancel_changes:SetTemplate (options_button_template) + cancel_changes:SetTemplate(options_button_template) local import = function() importframe:Show() @@ -6739,24 +6739,24 @@ do local addcapture = function() local name = capture_name_entry.text if (name == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_NAMEERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_NAMEERROR"]) end local author = capture_author_entry.text if (author == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_AUTHORERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_AUTHORERROR"]) end local icon = addframe.iconButton.iconTexture local version = capture_version_entry.text if (version == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_VERSIONERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_VERSIONERROR"]) end local func = capture_func_entry:GetText() if (func == "") then - return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_FUNCERROR"]) + return _detalhes:Msg(Loc ["STRING_OPTIONS_CHART_FUNCERROR"]) end _detalhes:TimeDataRegister (name, func, nil, author, version, icon, true) @@ -6789,8 +6789,8 @@ do addcapturebutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4) closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4) - addcapturebutton:SetTemplate (options_button_template) - closebutton:SetTemplate (options_button_template) + addcapturebutton:SetTemplate(options_button_template) + closebutton:SetTemplate(options_button_template) addcapturebutton:SetPoint("bottomright", addframe, "bottomright", -5, 5) closebutton:SetPoint("right", addcapturebutton, "left", -4, 0) diff --git a/frames/window_plater.lua b/frames/window_plater.lua index e03e2cb2..0b9cd0e9 100644 --- a/frames/window_plater.lua +++ b/frames/window_plater.lua @@ -4,7 +4,7 @@ local Details = _G.Details local DF = _G.DetailsFramework function Details:InitializePlaterIntegrationWindow() - local DetailsPlaterIntegrationPanel = DF:CreateSimplePanel (UIParent, 700, 480, "Details! Plater Nameplates Integration", "DetailsPlaterIntegrationPanel") + local DetailsPlaterIntegrationPanel = DF:CreateSimplePanel(UIParent, 700, 480, "Details! Plater Nameplates Integration", "DetailsPlaterIntegrationPanel") DetailsPlaterIntegrationPanel.Frame = DetailsPlaterIntegrationPanel DetailsPlaterIntegrationPanel.__name = "Plater Nameplates" DetailsPlaterIntegrationPanel.real_name = "DETAILS_PLATERWINDOW" @@ -25,15 +25,15 @@ function Details.OpenPlaterIntegrationWindow() DetailsPlaterIntegrationPanel.Initialized = true - local f = DetailsPlaterIntegrationPanel or DF:CreateSimplePanel (UIParent, 700, 480, "Details! Plater Nameplates Integration", "DetailsPlaterIntegrationPanel") + 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:SetAlpha (0.8) - f.bg1:SetVertexColor (0.27, 0.27, 0.27) - f.bg1:SetVertTile (true) - f.bg1:SetHorizTile (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:SetAllPoints() f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) @@ -61,7 +61,7 @@ function Details.OpenPlaterIntegrationWindow() local menu_table = { - {type = "label", get = function() return "Add Real Time DPS Info in the Nameplate:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + {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 { @@ -173,7 +173,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")}, + {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 { @@ -285,7 +285,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")}, + {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 { @@ -397,11 +397,11 @@ function Details.OpenPlaterIntegrationWindow() }, } - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + 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) @@ -411,10 +411,10 @@ function Details.OpenPlaterIntegrationWindow() --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: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:SetAllPoints() titleBackground:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) @@ -424,7 +424,7 @@ function Details.OpenPlaterIntegrationWindow() 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") + local platerImage = DF:CreateImage(titleBackground, "Interface\\AddOns\\Details\\images\\plater_image") platerImage:SetSize(256, 64) platerImage:SetPoint("topright", f, "topright", -150, -35) diff --git a/frames/window_playerbreakdown.lua b/frames/window_playerbreakdown.lua index ffd597aa..661b7bf3 100644 --- a/frames/window_playerbreakdown.lua +++ b/frames/window_playerbreakdown.lua @@ -1,7 +1,7 @@ --errors ~pet local _detalhes = _G._detalhes -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local gump = _detalhes.gump @@ -9,9 +9,9 @@ local _ --lua locals --local _string_len = string.len local _math_floor = math.floor -local _ipairs = ipairs +local ipairs = ipairs local _pairs = pairs -local _type = type +local type = type --api locals local _CreateFrame = CreateFrame local _GetTime = GetTime @@ -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 @@ -196,10 +196,10 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.avatar:SetTexture(avatar [2]) info.avatar_bg:SetTexture(avatar [4]) if (avatar [5]) then - info.avatar_bg:SetTexCoord (unpack (avatar [5])) + info.avatar_bg:SetTexCoord (unpack(avatar [5])) end if (avatar [6]) then - info.avatar_bg:SetVertexColor (unpack (avatar [6])) + info.avatar_bg:SetVertexColor(unpack(avatar [6])) end info.avatar_nick:SetText(avatar [1] or nome) @@ -208,7 +208,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo info.avatar_attribute:SetPoint("CENTER", info.avatar_nick, "CENTER", 0, 14) info.avatar:Show() info.avatar_bg:Show() - info.avatar_bg:SetAlpha (.65) + info.avatar_bg:SetAlpha(.65) info.avatar_nick:Show() info.avatar_attribute:Show() info.nome:Hide() @@ -527,7 +527,7 @@ function gump:HidaAllDetalheInfo() for i = 1, spellInfoSettings.amount do gump:HidaDetalheInfo (i) end - for _, barra in _ipairs(info.barras3) do + for _, barra in ipairs(info.barras3) do barra:Hide() end _detalhes.playerDetailWindow.spell_icone:SetTexture("") @@ -615,7 +615,7 @@ function gump:CriaDetalheInfo (index) info.bg = _CreateFrame ("StatusBar", "DetailsPlayerDetailsWindow_DetalheInfoBG" .. index, _detalhes.playerDetailWindow.container_detalhes, "BackdropTemplate") info.bg:SetStatusBarTexture ("Interface\\AddOns\\Details\\images\\bar_detalhes2") info.bg:SetStatusBarColor (1, 1, 1, .84) - info.bg:SetMinMaxValues (0, 100) + info.bg:SetMinMaxValues(0, 100) info.bg:SetValue(100) info.bg:SetSize(320, 47) @@ -659,7 +659,7 @@ function info:SetDetailInfoConfigs (texture, color, x, y) if (color) then local texture = info.grupos_detalhes [i].bg:GetStatusBarTexture() - texture:SetVertexColor (unpack (color)) + texture:SetVertexColor(unpack(color)) end if (x or y) then @@ -733,7 +733,7 @@ function gump:SetaDetalheInfoAltura (index, xmod, ymod) 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_end:SetAlpha(.75) info.bg.overlay:SetWidth(background:GetWidth() + 24) info.bg.overlay:SetHeight(background:GetHeight() + 16) @@ -747,7 +747,7 @@ 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 + 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 @@ -854,8 +854,8 @@ local function cria_container_barras (este_gump, SWW) container_barras:SetAllPoints(container_barras_window) container_barras:SetWidth(300) container_barras:SetHeight(150) - container_barras:EnableMouse (true) - container_barras:SetMovable (true) + container_barras:EnableMouse(true) + container_barras:SetMovable(true) container_barras_window:SetWidth(300) container_barras_window:SetHeight(145) @@ -922,9 +922,9 @@ local function cria_container_detalhes (este_gump, SWW) container_detalhes:SetPoint("TOPRIGHT", este_gump, "TOPRIGHT", -74, -76) container_detalhes:SetWidth(220) container_detalhes:SetHeight(270) - container_detalhes:EnableMouse (true) + container_detalhes:EnableMouse(true) container_detalhes:SetResizable(false) - container_detalhes:SetMovable (true) + container_detalhes:SetMovable(true) este_gump.container_detalhes = container_detalhes end @@ -937,8 +937,8 @@ local function cria_container_alvos (este_gump, SWW) container_alvos:SetAllPoints(container_alvos_window) container_alvos:SetWidth(300) container_alvos:SetHeight(100) - container_alvos:EnableMouse (true) - container_alvos:SetMovable (true) + container_alvos:EnableMouse(true) + container_alvos:SetMovable(true) container_alvos_window:SetWidth(300) container_alvos_window:SetHeight(100) @@ -975,7 +975,7 @@ local default_icon_change = function(jogador, classe) else if (jogador.enemy) then if (_detalhes.class_coords [_detalhes.faction_against]) then - info.classe_icone:SetTexCoord (_unpack (_detalhes.class_coords [_detalhes.faction_against])) + info.classe_icone:SetTexCoord (_unpack(_detalhes.class_coords [_detalhes.faction_against])) if (_detalhes.faction_against == "Horde") then info.nome:SetTextColor (1, 91/255, 91/255, 1) else @@ -1033,14 +1033,14 @@ function _detalhes:ApplyPDWSkin (skin_name) if (skin) then local successful, errortext = pcall (skin.func) if (not successful) then - _detalhes:Msg ("error occurred on skin call():", errortext) + _detalhes:Msg("error occurred on skin call():", errortext) local former_skin = _detalhes.playerdetailwindow_skins [_detalhes.player_details_window.skin] pcall (former_skin.func) else _detalhes.player_details_window.skin = skin_name end else - _detalhes:Msg ("skin not found.") + _detalhes:Msg("skin not found.") end if (info and info:IsShown() and info.jogador and info.jogador.classe) then @@ -1077,8 +1077,8 @@ local default_skin = function() local window = DetailsPlayerDetailsWindow 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.bg1:SetAlpha(1) + window.bg1:SetVertexColor(1, 1, 1) window:SetBackdrop(nil) window:SetBackdropColor(1, 1, 1, 1) window:SetBackdropBorderColor(1, 1, 1, 1) @@ -1089,15 +1089,15 @@ local default_skin = function() 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) - window.right_background2:SetAlpha (1) - window.right_background3:SetAlpha (1) - window.right_background4:SetAlpha (1) - window.right_background5:SetAlpha (1) + window.leftbars1_backgound:SetAlpha(1) + window.leftbars2_backgound:SetAlpha(1) + window.right_background1:SetAlpha(1) + window.right_background2:SetAlpha(1) + window.right_background3:SetAlpha(1) + window.right_background4:SetAlpha(1) + window.right_background5:SetAlpha(1) - window.close_button:GetNormalTexture():SetDesaturated (false) + window.close_button:GetNormalTexture():SetDesaturated(false) window.title_string:ClearAllPoints() window.title_string:SetPoint("center", window, "center") @@ -1110,7 +1110,7 @@ local default_skin = function() window.classe_icone:SetWidth(64) window.classe_icone:SetHeight(64) window.classe_icone:SetDrawLayer ("BACKGROUND", 1) - window.classe_icone:SetAlpha (1) + window.classe_icone:SetAlpha(1) window.close_button:SetWidth(32) window.close_button:SetHeight(32) @@ -1146,14 +1146,14 @@ local default_skin = function() --no targets texture window.no_targets:SetPoint("BOTTOMLEFT", window, "BOTTOMLEFT", 20, 6) window.no_targets:SetSize(301, 100) - window.no_targets:SetAlpha (1) + 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:SetDesaturated (true) - window.bg2_sec_texture:SetAlpha (0.3) + 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) @@ -1232,7 +1232,7 @@ local default_skin = function() 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:SetVertexColor (1, 1, 1, 1) + window.container_barras.slider.thumb:SetVertexColor(1, 1, 1, 1) -- window.container_alvos.cima:SetNormalTexture("Interface\\BUTTONS\\UI-ScrollBar-ScrollUpButton-Up") @@ -1268,7 +1268,7 @@ local default_skin = function() 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:SetVertexColor (1, 1, 1, 1) + window.container_alvos.slider.thumb:SetVertexColor(1, 1, 1, 1) end _detalhes:InstallPDWSkin ("WoWClassic", {func = default_skin, author = "Details! Team", version = "v1.0", desc = "Default skin."}) @@ -1276,10 +1276,10 @@ _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:SetAlpha (0.7) - window.bg1:SetVertexColor (0.27, 0.27, 0.27) - window.bg1:SetVertTile (true) - window.bg1:SetHorizTile (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:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) @@ -1294,16 +1294,16 @@ local elvui_skin = function() window.leftbars2_backgound:SetPoint("topleft", window.container_alvos, "topleft", -2, 23) window.leftbars2_backgound:SetPoint("bottomright", window.container_alvos, "bottomright", 4, 0) - window.leftbars1_backgound:SetAlpha (bgs_alpha) - window.leftbars2_backgound:SetAlpha (bgs_alpha) + window.leftbars1_backgound:SetAlpha(bgs_alpha) + window.leftbars2_backgound:SetAlpha(bgs_alpha) - window.right_background1:SetAlpha (bgs_alpha) - window.right_background2:SetAlpha (bgs_alpha) - window.right_background3:SetAlpha (bgs_alpha) - window.right_background4:SetAlpha (bgs_alpha) - window.right_background5:SetAlpha (bgs_alpha) + window.right_background1:SetAlpha(bgs_alpha) + window.right_background2:SetAlpha(bgs_alpha) + window.right_background3:SetAlpha(bgs_alpha) + window.right_background4:SetAlpha(bgs_alpha) + window.right_background5:SetAlpha(bgs_alpha) - window.close_button:GetNormalTexture():SetDesaturated (true) + window.close_button:GetNormalTexture():SetDesaturated(true) local titlebar = window.extra_frames ["ElvUITitleBar"] if (not titlebar) then @@ -1318,13 +1318,13 @@ local elvui_skin = function() local name_bg_texture = window:CreateTexture(nil, "background") name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true) - name_bg_texture:SetHorizTile (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:SetVertexColor (0, 0, 0, 0.2) + name_bg_texture:SetVertexColor(0, 0, 0, 0.2) window.extra_frames ["ElvUINameTexture"] = name_bg_texture else titlebar:Show() @@ -1342,7 +1342,7 @@ local elvui_skin = function() 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.classe_icone:SetAlpha(1) window.close_button:SetWidth(20) window.close_button:SetHeight(20) @@ -1354,11 +1354,11 @@ local elvui_skin = function() window.avatar:SetParent(titlebar) --bar container - window.container_barras:SetPoint(unpack (containerSettings.spells.point)) + 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:SetPoint(unpack(containerSettings.targets.point)) window.container_alvos:SetSize(containerSettings.targets.width, containerSettings.targets.height) --texts @@ -1375,14 +1375,14 @@ local elvui_skin = function() --no targets texture window.no_targets:SetPoint("BOTTOMLEFT", window, "BOTTOMLEFT", 3, 6) window.no_targets:SetSize(418, 150) - window.no_targets:SetAlpha (0.4) + window.no_targets:SetAlpha(0.4) --right panel textures window.bg2_sec_texture:SetPoint("topleft", window.bg1_sec_texture, "topleft", 7, 0) window.bg2_sec_texture:SetPoint("bottomright", window.bg1_sec_texture, "bottomright", -30, 0) window.bg2_sec_texture:SetTexture([[Interface\Glues\CREDITS\Warlords\Shadowmoon_Color_jlo3]]) - window.bg2_sec_texture:SetDesaturated (true) - window.bg2_sec_texture:SetAlpha (0) + window.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) @@ -1453,7 +1453,7 @@ local elvui_skin = function() disabledTexture:SetPoint("topleft", window.container_barras.cima, "topleft", 1, 0) disabledTexture:SetPoint("bottomright", window.container_barras.cima, "bottomright", 1, 0) - disabledTexture:SetAlpha (0.5) + 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]]}) @@ -1481,7 +1481,7 @@ local elvui_skin = function() disabledTexture:SetPoint("topleft", window.container_barras.baixo, "topleft", 1, -4) disabledTexture:SetPoint("bottomright", window.container_barras.baixo, "bottomright", 1, -4) - disabledTexture:SetAlpha (0.5) + 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]]}) @@ -1500,7 +1500,7 @@ local elvui_skin = function() window.container_barras.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) window.container_barras.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) window.container_barras.slider.thumb:SetSize(12, 12) - window.container_barras.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) + window.container_barras.slider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95) -- @@ -1525,7 +1525,7 @@ local elvui_skin = function() disabledTexture:SetPoint("topleft", f.cima, "topleft", 1, 0) disabledTexture:SetPoint("bottomright", f.cima, "bottomright", 1, 0) - disabledTexture:SetAlpha (0.5) + disabledTexture:SetAlpha(0.5) f.cima:SetSize(16, 16) f.cima:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) @@ -1555,7 +1555,7 @@ local elvui_skin = function() disabledTexture:SetPoint("topleft", f.baixo, "topleft", 1, -4) disabledTexture:SetPoint("bottomright", f.baixo, "bottomright", 1, -4) - disabledTexture:SetAlpha (0.5) + disabledTexture:SetAlpha(0.5) f.baixo:SetSize(16, 16) f.baixo:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]]}) @@ -1574,7 +1574,7 @@ local elvui_skin = function() window.container_alvos.slider.thumb:SetTexture([[Interface\AddOns\Details\images\icons2]]) window.container_alvos.slider.thumb:SetTexCoord (482/512, 492/512, 104/512, 120/512) window.container_alvos.slider.thumb:SetSize(12, 12) - window.container_alvos.slider.thumb:SetVertexColor (0.6, 0.6, 0.6, 0.95) + window.container_alvos.slider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95) --class icon window.SetClassIcon = function(player, class) @@ -1584,13 +1584,13 @@ local elvui_skin = function() elseif (player.spec) then window.classe_icone:SetTexture([[Interface\AddOns\Details\images\spec_icons_normal_alpha]]) - window.classe_icone:SetTexCoord (_unpack (_detalhes.class_specs_coords [player.spec])) - --esta_barra.icone_classe:SetVertexColor (1, 1, 1) + 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]]) - local l, r, t, b = unpack (coords) + local l, r, t, b = unpack(coords) info.classe_icone:SetTexCoord (l+0.01953125, r-0.01953125, t+0.01953125, b-0.01953125) else @@ -1624,9 +1624,9 @@ function gump:CriaJanelaInfo() este_gump:SetWidth(PLAYER_DETAILS_WINDOW_WIDTH) este_gump:SetHeight(PLAYER_DETAILS_WINDOW_HEIGHT) - este_gump:EnableMouse (true) + este_gump:EnableMouse(true) este_gump:SetResizable(false) - este_gump:SetMovable (true) + este_gump:SetMovable(true) este_gump.SummaryWindowWidgets = CreateFrame("frame", "DetailsPlayerDetailsWindowSummaryWidgets", este_gump, "BackdropTemplate") local SWW = este_gump.SummaryWindowWidgets @@ -1667,7 +1667,7 @@ function gump:CriaJanelaInfo() este_gump.close_button:SetHeight(32) este_gump.close_button:SetPoint("TOPRIGHT", este_gump, "TOPRIGHT", 5, -8) este_gump.close_button:SetText("X") - este_gump.close_button:SetFrameLevel (este_gump:GetFrameLevel()+5) + este_gump.close_button:SetFrameLevel(este_gump:GetFrameLevel()+5) --�cone da magia selecionada para mais detalhes @@ -1687,10 +1687,10 @@ function gump:CriaJanelaInfo() _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 = 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:SetAlpha (0.5) - este_gump.options_button.button:GetNormalTexture():SetDesaturated (true) + 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 @@ -1750,7 +1750,7 @@ function gump:CriaJanelaInfo() este_gump.topright_text2:SetText("") end - if (size and type (size) == "number") then + if (size and type(size) == "number") then _detalhes.gump:SetFontSize (este_gump.topright_text1, size) _detalhes.gump:SetFontSize (este_gump.topright_text2, size) end @@ -1774,10 +1774,10 @@ function gump:CriaJanelaInfo() for i = 1, spellInfoSettings.amount do local right_background1 = CreateFrame("frame", "DetailsPlayerDetailsWindow_right_background" .. i, SWW, "BackdropTemplate") - right_background1:EnableMouse (false) + right_background1:EnableMouse(false) right_background1:SetPoint("topleft", este_gump, "topleft", right_background_X, right_background_Y [i]) right_background1:SetSize(220, 43) - Details.gump:ApplyStandardBackdrop (right_background1) + Details.gump:ApplyStandardBackdrop(right_background1) este_gump ["right_background" .. i] = right_background1 end @@ -1793,8 +1793,8 @@ function gump:CriaJanelaInfo() 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: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") @@ -1809,8 +1809,8 @@ function gump:CriaJanelaInfo() 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: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"]) @@ -1832,23 +1832,23 @@ function gump:CriaJanelaInfo() -- 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) +-- leftbars1_backgound:SetAlpha(alpha_bgs) -- este_gump.leftbars1_backgound = leftbars1_backgound local leftbars1_backgound = CreateFrame("frame", "DetailsPlayerDetailsWindow_Left_SpellsBackground", SWW, "BackdropTemplate") - leftbars1_backgound:EnableMouse (false) + leftbars1_backgound:EnableMouse(false) leftbars1_backgound:SetSize(303, 149) - leftbars1_backgound:SetAlpha (alpha_bgs) - leftbars1_backgound:SetFrameLevel (SWW:GetFrameLevel()) - Details.gump:ApplyStandardBackdrop (leftbars1_backgound) + 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") - leftbars2_backgound:EnableMouse (false) + leftbars2_backgound:EnableMouse(false) leftbars2_backgound:SetSize(303, 122) - leftbars2_backgound:SetAlpha (alpha_bgs) - leftbars2_backgound:SetFrameLevel (SWW:GetFrameLevel()) - Details.gump:ApplyStandardBackdrop (leftbars2_backgound) + 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) @@ -1878,14 +1878,14 @@ function gump:CriaJanelaInfo() "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:SetFrameLevel (este_gump:GetFrameLevel()+2) + este_gump.report_esquerda:SetFrameLevel(este_gump:GetFrameLevel()+2) este_gump.topleft_report = este_gump.report_esquerda --bot�o de reportar da caixa dos alvos este_gump.report_alvos = gump:NewDetailsButton (SWW, este_gump, nil, _detalhes.Reportar, este_gump, 3, 16, 16, "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport3") 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:SetFrameLevel(3) --solved inactive problem --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, @@ -1898,8 +1898,8 @@ function gump:CriaJanelaInfo() 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) + DetailsFramework:ApplyStandardBackdrop(statusBar) + statusBar:SetAlpha(PLAYER_DETAILS_STATUSBAR_ALPHA) statusBar.Text = DetailsFramework:CreateLabel(statusBar) statusBar.Text:SetPoint("left", 2, 0) @@ -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, @@ -1967,7 +1967,7 @@ function gump:CriaJanelaInfo() --SUMMARY local summaryBox = CreateFrame("frame", nil, frame, "BackdropTemplate") - _detalhes.gump:ApplyStandardBackdrop (summaryBox) + _detalhes.gump:ApplyStandardBackdrop(summaryBox) summaryBox:SetPoint("topleft", frame, "topleft", 10, -15) summaryBox:SetSize(200, 160) @@ -2034,7 +2034,7 @@ function gump:CriaJanelaInfo() y = -5 local meleeBox = CreateFrame("frame", nil, frame, "BackdropTemplate") - _detalhes.gump:ApplyStandardBackdrop (meleeBox) + _detalhes.gump:ApplyStandardBackdrop(meleeBox) meleeBox:SetPoint("topleft", summaryBox, "bottomleft", 0, -5) meleeBox:SetSize(200, 160) @@ -2125,7 +2125,7 @@ function gump:CriaJanelaInfo() y = -5 local absorbsBox = CreateFrame("frame", nil, frame, "BackdropTemplate") - _detalhes.gump:ApplyStandardBackdrop (absorbsBox) + _detalhes.gump:ApplyStandardBackdrop(absorbsBox) absorbsBox:SetPoint("topleft", summaryBox, "topright", 10, 0) absorbsBox:SetSize(200, 160) @@ -2186,7 +2186,7 @@ function gump:CriaJanelaInfo() y = -5 local healingBox = CreateFrame("frame", nil, frame,"BackdropTemplate") - _detalhes.gump:ApplyStandardBackdrop (healingBox) + _detalhes.gump:ApplyStandardBackdrop(healingBox) healingBox:SetPoint("topleft", absorbsBox, "bottomleft", 0, -5) healingBox:SetSize(200, 160) @@ -2238,7 +2238,7 @@ function gump:CriaJanelaInfo() y = -5 local spellsBox = CreateFrame("frame", nil, frame,"BackdropTemplate") - _detalhes.gump:ApplyStandardBackdrop (spellsBox) + _detalhes.gump:ApplyStandardBackdrop(spellsBox) spellsBox:SetPoint("topleft", absorbsBox, "topright", 10, 0) spellsBox:SetSize(346, 160 * 2 + 5) @@ -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" @@ -2490,11 +2490,11 @@ function gump:CriaJanelaInfo() table.sort (myReceivedHeal, _detalhes.Sort2) --Sort2 sort by second index for i = 1, 5 do - local label1, label2 = unpack (tab ["healer" .. i]) + local label1, label2 = unpack(tab ["healer" .. i]) if (myReceivedHeal [i]) then local name = myReceivedHeal [i][1] - name = _detalhes:GetOnlyName (name) + name = _detalhes:GetOnlyName(name) --name = _detalhes:RemoveOwnerName (name) label1:SetText(name .. ":") @@ -2560,14 +2560,14 @@ function gump:CriaJanelaInfo() local esta_habilidade = cooldowns_usados[i] local nome_magia, _, icone_magia = _GetSpellInfo(esta_habilidade[1]) - local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) + local label1, label2, icon1, framebg = unpack(tab ["spell" .. index_used]) framebg.spellid = esta_habilidade[1] framebg:Show() --attempt to get the buff update local spellInfo = buffUpdateSpells:GetSpell (framebg.spellid) if (spellInfo) then - 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]) end @@ -2599,7 +2599,7 @@ function gump:CriaJanelaInfo() for targetName, amountCasted in pairs(targets) do if (targetName == player.nome) then local spellName, _, spellIcon = _GetSpellInfo(spellID) - local label1, label2, icon1, framebg = unpack (tab ["spell" .. index_used]) + local label1, label2, icon1, framebg = unpack(tab ["spell" .. index_used]) framebg.spellid = spellID framebg:Show() @@ -2608,7 +2608,7 @@ function gump:CriaJanelaInfo() 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) end @@ -2631,7 +2631,7 @@ function gump:CriaJanelaInfo() for i = index_used, 40 do - local label1, label2, icon1, framebg = unpack (tab ["spell" .. i]) + local label1, label2, icon1, framebg = unpack(tab ["spell" .. i]) framebg.spellid = nil framebg:Hide() @@ -2709,7 +2709,7 @@ function gump:CriaJanelaInfo() local line_onleave = function(self) GameTooltip:Hide() - self:SetBackdropColor(unpack (self.BackgroundColor)) + self:SetBackdropColor(unpack(self.BackgroundColor)) end local line_onclick = function(self) @@ -2743,7 +2743,7 @@ function gump:CriaJanelaInfo() local apply = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") local refresh = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") - --local waButton = DF:CreateButton (line, wa_button, 18, 18) + --local waButton = DF:CreateButton(line, wa_button, 18, 18) --waButton:SetIcon ([[Interface\AddOns\WeakAuras\Media\Textures\icon]]) DF:SetFontSize (name, text_size) @@ -2794,7 +2794,7 @@ function gump:CriaJanelaInfo() 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.Uptime:SetText(DF:IntegerToTimer (aura [3]) .. " (|cFFBBAAAA" .. floor(aura [6]) .. "%|r)") line.Apply:SetText(aura [4]) line.Refresh:SetText(aura [5]) @@ -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 @@ -2821,7 +2821,7 @@ function gump:CriaJanelaInfo() f:SetPoint("center", anchorWidget, "center") f:SetScript("OnEnter", function() GameTooltip:SetOwner(f, "ANCHOR_TOPRIGHT") - GameTooltip:AddLine (desc) + GameTooltip:AddLine(desc) GameTooltip:Show() end) f:SetScript("OnLeave", function() @@ -2891,7 +2891,7 @@ function gump:CriaJanelaInfo() end local auras_tab_fill = function(tab, player, combat) - local miscActor = combat:GetActor (4, player:name()) + local miscActor = combat:GetActor(4, player:name()) local combatTime = combat:GetCombatTime() do --buffs @@ -3020,7 +3020,7 @@ function gump:CriaJanelaInfo() if (player_2) then local player_2_target = player_2.targets player_2_target_pool = {} - for target_name, amount in _pairs (player_2_target) do + for target_name, amount in _pairs(player_2_target) do player_2_target_pool [#player_2_target_pool+1] = {target_name, amount} end table.sort (player_2_target_pool, _detalhes.Sort2) @@ -3039,7 +3039,7 @@ function gump:CriaJanelaInfo() if (player_3) then local player_3_target = player_3.targets player_3_target_pool = {} - for target_name, amount in _pairs (player_3_target) do + for target_name, amount in _pairs(player_3_target) do player_3_target_pool [#player_3_target_pool+1] = {target_name, amount} end table.sort (player_3_target_pool, _detalhes.Sort2) @@ -3063,8 +3063,8 @@ function gump:CriaJanelaInfo() local target_name = data [1] bar [1]:SetTexture(target_texture) - bar [1]:SetDesaturated (true) - bar [1]:SetAlpha (.7) + bar [1]:SetDesaturated(true) + bar [1]:SetAlpha(.7) bar [2].lefttext:SetText(index .. ". " .. target_name) bar [2].lefttext:SetTextColor (1, 1, 1, 1) @@ -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 @@ -3092,8 +3092,8 @@ function gump:CriaJanelaInfo() if (player_2_target_total) then bar_2 [1]:SetTexture(target_texture) - bar_2 [1]:SetDesaturated (true) - bar_2 [1]:SetAlpha (.7) + bar_2 [1]:SetDesaturated(true) + bar_2 [1]:SetAlpha(.7) bar_2 [2].lefttext:SetText(player_2_target_index .. ". " .. target_name) bar_2 [2].lefttext:SetTextColor (1, 1, 1, 1) @@ -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 @@ -3164,8 +3164,8 @@ function gump:CriaJanelaInfo() if (player_3_target_total) then bar_3 [1]:SetTexture(target_texture) - bar_3 [1]:SetDesaturated (true) - bar_3 [1]:SetAlpha (.7) + bar_3 [1]:SetDesaturated(true) + bar_3 [1]:SetAlpha(.7) bar_3 [2].lefttext:SetText(player_3_target_index .. ". " .. target_name) bar_3 [2].lefttext:SetTextColor (1, 1, 1, 1) @@ -3253,15 +3253,15 @@ function gump:CriaJanelaInfo() --main player skills local spells_sorted = {} - for spellid, spelltable in _pairs (player.spells._ActorTable) do + for spellid, spelltable in _pairs(player.spells._ActorTable) do spells_sorted [#spells_sorted+1] = {spelltable, spelltable.total} end --main player pets - for petIndex, petName in _ipairs(player:Pets()) do + 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 + for _spellid, _skill in _pairs(petActor:GetActorSpells()) do spells_sorted [#spells_sorted+1] = {_skill, _skill.total, petName} end end @@ -3289,14 +3289,14 @@ function gump:CriaJanelaInfo() player_2_spells_sorted = {} --player 2 spells - for spellid, spelltable in _pairs (other_players [1].spells._ActorTable) do + for spellid, spelltable in _pairs(other_players [1].spells._ActorTable) do 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 + for _spellid, _skill in _pairs(petActor:GetActorSpells()) do player_2_spells_sorted [#player_2_spells_sorted+1] = {_skill, _skill.total, petName} end end @@ -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 @@ -3331,14 +3331,14 @@ function gump:CriaJanelaInfo() if (other_players [2]) then --player 3 spells - for spellid, spelltable in _pairs (other_players [2].spells._ActorTable) do + for spellid, spelltable in _pairs(other_players [2].spells._ActorTable) do 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 + for _spellid, _skill in _pairs(petActor:GetActorSpells()) do player_3_spells_sorted [#player_3_spells_sorted+1] = {_skill, _skill.total, petName} end end @@ -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 @@ -3372,7 +3372,7 @@ function gump:CriaJanelaInfo() local petName = data [3] bar [1]:SetTexture(icon) --bar[1] = spellicon bar[2] = statusbar - bar [1]:SetTexCoord (unpack (IconTexCoord)) --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) @@ -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] @@ -3409,10 +3409,10 @@ function gump:CriaJanelaInfo() -- ~compare if (spell) then bar_2 [1]:SetTexture(icon) - bar_2 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar + 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:SetTextColor (1, 1, 1, 1) - bar_2 [2]:SetStatusBarColor (unpack (bar_color)) + bar_2 [2]:SetStatusBarColor (unpack(bar_color)) bar_2 [2]:SetBackdropColor(1, 1, 1, 0.1) if (spell.total == 0 and data [2] == 0) then @@ -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] @@ -3486,10 +3486,10 @@ function gump:CriaJanelaInfo() if (spell) then bar_3 [1]:SetTexture(icon) - bar_3 [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar + 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:SetTextColor (1, 1, 1, 1) - bar_3 [2]:SetStatusBarColor (unpack (bar_color)) + bar_3 [2]:SetStatusBarColor (unpack(bar_color)) bar_3 [2]:SetBackdropColor(1, 1, 1, 0.1) if (spell.total == 0 and data [2] == 0) then @@ -3576,7 +3576,7 @@ function gump:CriaJanelaInfo() end - for index, spelltable in _ipairs(spells_sorted) do + for index, spelltable in ipairs(spells_sorted) do end @@ -3594,7 +3594,7 @@ function gump:CriaJanelaInfo() --player 1 targets local my_targets = self.tab.player.targets local target_pool = {} - for target_name, amount in _pairs (my_targets) do + for target_name, amount in _pairs(my_targets) do target_pool [#target_pool+1] = {target_name, amount} end table.sort (target_pool, _detalhes.Sort2) @@ -3608,7 +3608,7 @@ function gump:CriaJanelaInfo() local compare_fill = function(tab, player, combat) local players_to_compare = tab.players - local defaultPlayerName = _detalhes:GetOnlyName (player:Name()) + local defaultPlayerName = _detalhes:GetOnlyName(player:Name()) DetailsPlayerComparisonBox1.name_label:SetText(defaultPlayerName) local label2 = _G ["DetailsPlayerComparisonBox2"].name_label @@ -3618,7 +3618,7 @@ function gump:CriaJanelaInfo() local label3_percent = _G ["DetailsPlayerComparisonBox3"].name_label_percent if (players_to_compare [1]) then - local playerName = _detalhes:GetOnlyName (players_to_compare [1]:Name()) + local playerName = _detalhes:GetOnlyName(players_to_compare [1]:Name()) label2:SetText(playerName) label2_percent:SetText(defaultPlayerName .. " %") else @@ -3626,7 +3626,7 @@ function gump:CriaJanelaInfo() label2_percent:SetText("") end if (players_to_compare [2]) then - local playerName = _detalhes:GetOnlyName (players_to_compare [2]:Name()) + local playerName = _detalhes:GetOnlyName(players_to_compare [2]:Name()) label3:SetText(playerName) label3_percent:SetText(defaultPlayerName .. " %") else @@ -3668,8 +3668,8 @@ function gump:CriaJanelaInfo() -- player 1 local player_1_skills = {} - for spellid, spell in _pairs (player_1.spells._ActorTable) do - for name, amount in _pairs (spell.targets) do + for spellid, spell in _pairs(player_1.spells._ActorTable) do + for name, amount in _pairs(spell.targets) do if (name == target_name) then player_1_skills [#player_1_skills+1] = {spellid, amount} end @@ -3684,8 +3684,8 @@ function gump:CriaJanelaInfo() local player_2_skills = {} local player_2_top if (player_2) then - for spellid, spell in _pairs (player_2.spells._ActorTable) do - for name, amount in _pairs (spell.targets) do + for spellid, spell in _pairs(player_2.spells._ActorTable) do + for name, amount in _pairs(spell.targets) do if (name == target_name) then player_2_skills [#player_2_skills+1] = {spellid, amount} end @@ -3693,15 +3693,15 @@ function gump:CriaJanelaInfo() end table.sort (player_2_skills, _detalhes.Sort2) player_2_top = player_2_skills [1] and player_2_skills [1][2] or 0 - bar2 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) + bar2 [2]:SetStatusBarColor (unpack(bar_color_on_enter)) end -- player 3 local player_3_skills = {} local player_3_top if (player_3) then - for spellid, spell in _pairs (player_3.spells._ActorTable) do - for name, amount in _pairs (spell.targets) do + for spellid, spell in _pairs(player_3.spells._ActorTable) do + for name, amount in _pairs(spell.targets) do if (name == target_name) then player_3_skills [#player_3_skills+1] = {spellid, amount} end @@ -3709,7 +3709,7 @@ function gump:CriaJanelaInfo() end table.sort (player_3_skills, _detalhes.Sort2) player_3_top = player_3_skills [1] and player_3_skills [1][2] or 0 - bar3 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) + bar3 [2]:SetStatusBarColor (unpack(bar_color_on_enter)) end -- build tooltip @@ -3724,7 +3724,7 @@ 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() @@ -3732,7 +3732,7 @@ function gump:CriaJanelaInfo() local name, _, icon = _GetSpellInfo(spell[1]) bar [1]:SetTexture(icon) - bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar + 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) @@ -3743,7 +3743,7 @@ function gump:CriaJanelaInfo() 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 @@ -3751,7 +3751,7 @@ function gump:CriaJanelaInfo() end bar [1]:SetTexture(icon) - bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar + bar [1]:SetTexCoord (unpack(IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2].lefttext:SetText(this_index .. ". " .. name) bar [2].bg:Show() @@ -3798,7 +3798,7 @@ 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 @@ -3806,7 +3806,7 @@ function gump:CriaJanelaInfo() end bar [1]:SetTexture(icon) - bar [1]:SetTexCoord (unpack (IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar + bar [1]:SetTexCoord (unpack(IconTexCoord)) --bar[1] = spellicon bar[2] = statusbar bar [2].lefttext:SetText(this_index .. ". " .. name) bar [2].bg:Show() @@ -3875,9 +3875,9 @@ function gump:CriaJanelaInfo() bar1[2]:SetStatusBarColor (.5, .5, .5, 1) bar1[2].icon:SetTexCoord (0, 1, 0, 1) - bar2[2]:SetStatusBarColor (unpack (bar_color)) + bar2[2]:SetStatusBarColor (unpack(bar_color)) bar2[2].icon:SetTexCoord (0, 1, 0, 1) - bar3[2]:SetStatusBarColor (unpack (bar_color)) + bar3[2]:SetStatusBarColor (unpack(bar_color)) bar3[2].icon:SetTexCoord (0, 1, 0, 1) frame1.tooltip:Hide() @@ -3969,7 +3969,7 @@ function gump:CriaJanelaInfo() else local spellname = GetSpellInfo(spellid) local extra_search_found - for casted_spellid, amount in _pairs (player1_misc.spell_cast or {}) do + 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) @@ -4008,7 +4008,7 @@ function gump:CriaJanelaInfo() if (bar2[2].righttext:GetText()) then - bar2 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) + bar2 [2]:SetStatusBarColor (unpack(bar_color_on_enter)) bar2[2].icon:SetTexCoord (.1, .9, .1, .9) -- hits @@ -4056,7 +4056,7 @@ function gump:CriaJanelaInfo() --criticals if (critical > bar2[3][3]) then --[[ - local percent = abs ((bar2[3][3] / critical * 100) -100) + local percent = abs((bar2[3][3] / critical * 100) -100) percent = _math_floor(percent) if (percent > 999) then up = "" .. 999 @@ -4074,10 +4074,10 @@ function gump:CriaJanelaInfo() 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 + local down = diff / math.max(critical, 0.1) * 100 --bar2[3][3] = 62 critical = 53 diff = 9 - --print (diff, bar2[3][3], critical) - --print (math.max (critical * 100, 0.1)) + --print(diff, bar2[3][3], critical) + --print(math.max(critical * 100, 0.1)) down = _math_floor(down) if (down > 999) then @@ -4133,7 +4133,7 @@ function gump:CriaJanelaInfo() local amt_casts = player2_misc.spell_cast and player2_misc.spell_cast [spellid] if (not amt_casts) then local spellname = GetSpellInfo(spellid) - for casted_spellid, amount in _pairs (player2_misc.spell_cast or {}) do + for casted_spellid, amount in _pairs(player2_misc.spell_cast or {}) do local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then amt_casts = amount @@ -4188,7 +4188,7 @@ function gump:CriaJanelaInfo() --------------------------------------------------- if (bar3[2].righttext:GetText()) then - bar3 [2]:SetStatusBarColor (unpack (bar_color_on_enter)) + bar3 [2]:SetStatusBarColor (unpack(bar_color_on_enter)) bar3[2].icon:SetTexCoord (.1, .9, .1, .9) --hits @@ -4236,7 +4236,7 @@ function gump:CriaJanelaInfo() --critical if (critical > bar3[3][3]) then --[[ - local percent = abs ((bar3[3][3] / critical * 100) -100) + 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) @@ -4256,7 +4256,7 @@ function gump:CriaJanelaInfo() 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 + local down = diff / math.max(critical, 0.1) * 100 down = _math_floor(down) if (down > 999) then down = "" .. 999 @@ -4310,7 +4310,7 @@ function gump:CriaJanelaInfo() local amt_casts = player3_misc.spell_cast and player3_misc.spell_cast [spellid] if (not amt_casts) then local spellname = GetSpellInfo(spellid) - for casted_spellid, amount in _pairs (player3_misc.spell_cast or {}) do + for casted_spellid, amount in _pairs(player3_misc.spell_cast or {}) do local casted_spellname = GetSpellInfo(casted_spellid) if (casted_spellname == spellname) then amt_casts = amount @@ -4374,9 +4374,9 @@ function gump:CriaJanelaInfo() bar1[2]:SetStatusBarColor (.5, .5, .5, 1) bar1[2].icon:SetTexCoord (0, 1, 0, 1) - bar2[2]:SetStatusBarColor (unpack (bar_color)) + bar2[2]:SetStatusBarColor (unpack(bar_color)) bar2[2].icon:SetTexCoord (0, 1, 0, 1) - bar3[2]:SetStatusBarColor (unpack (bar_color)) + bar3[2]:SetStatusBarColor (unpack(bar_color)) bar3[2].icon:SetTexCoord (0, 1, 0, 1) frame1.tooltip:Hide() @@ -4400,12 +4400,12 @@ function gump:CriaJanelaInfo() 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:SetAlpha(ALPHA_BLEND_AMOUNT) bar:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) bar:SetBackdropColor(1, 1, 1, 0.1) - bar:SetMinMaxValues (0, 100) + bar:SetMinMaxValues(0, 100) bar:SetValue(100) bar:SetHeight(14) bar.icon = spellicon @@ -4475,7 +4475,7 @@ function gump:CriaJanelaInfo() 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:SetVertexColor(0, 0, 0, 0.2) background:SetPoint("topleft", tooltip, "topleft", 0, 0) background:SetPoint("bottomright", tooltip, "bottomright", 0, 0) @@ -4556,8 +4556,8 @@ function gump:CriaJanelaInfo() 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])) + bg_line1:SetAlpha(bg_alpha) + bg_line1:SetVertexColor(unpack(colors[i])) end return tooltip @@ -4575,7 +4575,7 @@ function gump:CriaJanelaInfo() _detalhes.gump:CreateBorder (tooltip) function tooltip:Reset() - for index, bar in _ipairs(tooltip.bars) do + for index, bar in ipairs(tooltip.bars) do bar [1]:SetTexture("") bar [2].lefttext:SetText("") bar [2].righttext:SetText("") @@ -4611,8 +4611,8 @@ function gump:CriaJanelaInfo() 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:SetStatusBarColor (unpack(bar_color)) + bar:SetMinMaxValues(0, 100) bar:SetValue(0) bar:SetHeight(14) bar.icon = spellicon @@ -4652,11 +4652,11 @@ function gump:CriaJanelaInfo() local bg_line1 = bar:CreateTexture(nil, "artwork") bg_line1:SetTexture([[Interface\AddOns\Details\images\bar_background]]) bg_line1:SetAllPoints() - bg_line1:SetAlpha (0.7) + bg_line1:SetAlpha(0.7) if (index % 2 == 0) then - bg_line1:SetVertexColor (_unpack (bars_colors [2])) + bg_line1:SetVertexColor(_unpack(bars_colors [2])) else - bg_line1:SetVertexColor (_unpack (bars_colors [2])) + bg_line1:SetVertexColor(_unpack(bars_colors [2])) end bar.bg = bg_line1 @@ -4668,7 +4668,7 @@ function gump:CriaJanelaInfo() 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:SetVertexColor(0, 0, 0, 0.6) background:SetPoint("topleft", tooltip, "topleft", 2, -4) background:SetPoint("bottomright", tooltip, "bottomright", -4, 2) @@ -4682,11 +4682,11 @@ function gump:CriaJanelaInfo() _detalhes.gump:ReskinSlider(frame1) frame1:SetBackdrop(frame_backdrop) - frame1:SetBackdropColor(unpack (frame_backdrop_color)) - frame1:SetBackdropBorderColor(unpack (frame_backdrop_border_color)) + 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) + Details.gump:ApplyStandardBackdrop(frame1) frame1.bars = {} frame1.tab = tab @@ -4711,15 +4711,15 @@ function gump:CriaJanelaInfo() _detalhes.gump:ReskinSlider(target1) target1:SetBackdrop(frame_backdrop) - target1:SetBackdropColor(unpack (frame_backdrop_color)) - target1:SetBackdropBorderColor(unpack (frame_backdrop_border_color)) + 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]) --override backdrop settings and use the framework defaults - Details.gump:ApplyStandardBackdrop (target1) + Details.gump:ApplyStandardBackdrop(target1) --criar as barras do target1 for i = 1, targetBars do @@ -4735,11 +4735,11 @@ function gump:CriaJanelaInfo() 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:SetBackdropColor(unpack(frame_backdrop_color)) + frame2:SetBackdropBorderColor(unpack(frame_backdrop_border_color)) --override backdrop settings and use the framework defaults - Details.gump:ApplyStandardBackdrop (frame2) + Details.gump:ApplyStandardBackdrop(frame2) frame2.bars = {} frame2.tooltip = create_tooltip ("DetailsPlayerComparisonBox2Tooltip") @@ -4778,14 +4778,14 @@ function gump:CriaJanelaInfo() 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: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]) --override backdrop settings and use the framework defaults - Details.gump:ApplyStandardBackdrop (target2) + Details.gump:ApplyStandardBackdrop(target2) --criar as barras do target2 for i = 1, targetBars do @@ -4797,11 +4797,11 @@ 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:SetBackdropColor(unpack(frame_backdrop_color)) + frame3:SetBackdropBorderColor(unpack(frame_backdrop_border_color)) --override backdrop settings and use the framework defaults - Details.gump:ApplyStandardBackdrop (frame3) + Details.gump:ApplyStandardBackdrop(frame3) frame3.bars = {} frame3.tooltip = create_tooltip ("DetailsPlayerComparisonBox3Tooltip") @@ -4839,14 +4839,14 @@ function gump:CriaJanelaInfo() 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: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]) --override backdrop settings and use the framework defaults - Details.gump:ApplyStandardBackdrop (target3) + Details.gump:ApplyStandardBackdrop(target3) --criar as barras do target1 for i = 1, targetBars do @@ -4877,7 +4877,7 @@ function gump:CriaJanelaInfo() local my_spells = {} local my_spells_total = 0 --build my spell list - for spellid, _ in _pairs (playerObject.spells._ActorTable) do + for spellid, _ in _pairs(playerObject.spells._ActorTable) do my_spells [spellid] = true my_spells_total = my_spells_total + 1 end @@ -4890,17 +4890,17 @@ 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 - for spellid, _ in _pairs (actor.spells._ActorTable) do + for spellid, _ in _pairs(actor.spells._ActorTable) do if (my_spells [spellid]) then same_spells = same_spells + 1 end end - local match_percentage = same_spells / max (my_spells_total, 0.000001) * 100 + local match_percentage = same_spells / max(my_spells_total, 0.000001) * 100 if (match_percentage > 30) then tinsert(tabOBject.players, actor) @@ -4984,12 +4984,12 @@ function gump:CriaJanelaInfo() tab:ClearAllPoints() --get the button width - local buttonTemplate = gump:GetTemplate ("button", "DETAILS_TAB_BUTTON_TEMPLATE") + local buttonTemplate = gump:GetTemplate("button", "DETAILS_TAB_BUTTON_TEMPLATE") local buttonWidth = buttonTemplate.width + 1 --pixelutil might not be compatible with classic wow if (PixelUtil) then - PixelUtil.SetSize (tab, buttonTemplate.width, buttonTemplate.height) + PixelUtil.SetSize(tab, buttonTemplate.width, buttonTemplate.height) if (tabsShown >= breakLine) then --next row of icons PixelUtil.SetPoint (tab, "bottomright", info, "topright", -514 + (buttonWidth * (secondRowIndex)), -50) secondRowIndex = secondRowIndex + 1 @@ -5006,7 +5006,7 @@ function gump:CriaJanelaInfo() end end - tab:SetAlpha (0.8) + tab:SetAlpha(0.8) else tab.frame:Hide() tab:Hide() @@ -5023,7 +5023,7 @@ function gump:CriaJanelaInfo() 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 @@ -5044,14 +5044,14 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f end --create a button for the tab - local newTabButton = gump:CreateButton (info, onclick, 20, 20, nil, nil, nil, nil, nil, "DetailsPlayerBreakdownWindowTab" .. tabname) - newTabButton:SetTemplate ("DETAILS_TAB_BUTTON_TEMPLATE") + local newTabButton = gump:CreateButton(info, onclick, 20, 20, nil, nil, nil, nil, nil, "DetailsPlayerBreakdownWindowTab" .. tabname) + newTabButton:SetTemplate("DETAILS_TAB_BUTTON_TEMPLATE") if (tabname == "Summary") then - newTabButton:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") + newTabButton:SetTemplate("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") end newTabButton:SetText(localized_name) newTabButton:SetFrameStrata("HIGH") - newTabButton:SetFrameLevel (info:GetFrameLevel()+1) + newTabButton:SetFrameLevel(info:GetFrameLevel()+1) newTabButton:Hide() newTabButton.condition = condition @@ -5064,8 +5064,8 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f 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) + newTabButton.frame:SetFrameLevel(info:GetFrameLevel()+5) + newTabButton.frame:EnableMouse(true) if (iconSettings) then local texture = iconSettings.texture @@ -5077,7 +5077,7 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f newTabButton:SetIcon (texture, width, height, "overlay", coords, overlay, textdistance, leftpadding, textheight, short_method) if (iconSettings.desaturated) then - newTabButton.icon:SetDesaturated (true) + newTabButton.icon:SetDesaturated(true) end end @@ -5121,12 +5121,12 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f 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") + tab:SetTemplate("DETAILS_TAB_BUTTON_TEMPLATE") end - self:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") + self:SetTemplate("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") self.frame:Show() info.selectedTab = self.tabname end @@ -5137,19 +5137,19 @@ function _detalhes:CreatePlayerDetailsTab (tabname, localized_name, condition, f 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") + tab:SetTemplate("DETAILS_TAB_BUTTON_TEMPLATE") end - self:SetTemplate ("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") + self:SetTemplate("DETAILS_TAB_BUTTONSELECTED_TEMPLATE") info.selectedTab = self.tabname --run onclick func local result, errorText = pcall (self.onclick) if (not result) then - print (errorText) + print(errorText) end end @@ -5183,7 +5183,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) local amt = _detalhes.report_lines if (not player) then - _detalhes:Msg ("Player not found.") + _detalhes:Msg("Player not found.") return end @@ -5204,7 +5204,7 @@ 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 @@ -5228,13 +5228,13 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) elseif (botao == 3) then --bot�o dos alvos if (atributo == 1 and sub_atributo == 3) then - print (Loc ["STRING_ACTORFRAME_NOTHING"]) + print(Loc ["STRING_ACTORFRAME_NOTHING"]) return end report_lines = {"Details! " .. Loc ["STRING_ACTORFRAME_REPORTTARGETS"] .. " " .. _detalhes.sub_atributos [1].lista [1] .. " " .. Loc ["STRING_ACTORFRAME_REPORTOF"] .. " " .. player.nome} - for index, barra in _ipairs(info.barras2) do + for index, barra in ipairs(info.barras2) do if (barra:IsShown()) then report_lines [#report_lines+1] = barra.lineText1:GetText().." -> ".. barra.lineText4:GetText() end @@ -5249,7 +5249,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) --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 - print (Loc ["STRING_ACTORFRAME_NOTHING"]) + print(Loc ["STRING_ACTORFRAME_NOTHING"]) return end local nome = _GetSpellInfo(player.detalhes) @@ -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 @@ -5325,7 +5325,7 @@ function _detalhes.playerDetailWindow:monta_relatorio (botao) botao = botao - 10 local nome - if (_type(spellid) == "string") then + if (type(spellid) == "string") then --is a pet else nome = _GetSpellInfo(player.detalhes) @@ -5436,14 +5436,14 @@ local row_on_enter = function(self) if (IsShiftKeyDown()) then if (type(self.show) == "number") then GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") - GameTooltip:AddLine (Loc ["ABILITY_ID"] .. ": " .. self.show) + GameTooltip:AddLine(Loc ["ABILITY_ID"] .. ": " .. self.show) GameTooltip:Show() end end if (self.show == 98021) then GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT") - GameTooltip:AddLine (Loc ["STRING_SPIRIT_LINK_TOTEM_DESC"]) + GameTooltip:AddLine(Loc ["STRING_SPIRIT_LINK_TOTEM_DESC"]) GameTooltip:Show() end @@ -5451,7 +5451,7 @@ local row_on_enter = function(self) 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) + 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 @@ -5491,7 +5491,7 @@ local row_on_leave = function(self) self.icone:SetWidth(CONST_BAR_HEIGHT) self.icone:SetHeight(CONST_BAR_HEIGHT) --volta com a alfa antiga da barra - self.icone:SetAlpha (1) + self.icone:SetAlpha(1) --remover o conte�do que estava sendo mostrado na direita if (info.mostrando_mouse_over) then @@ -5558,7 +5558,7 @@ local row_on_mouseup = function(self, button) --clicou em outra barra else --clicou em outra barra e trocou o foco - barra_antiga:SetAlpha (.9) --volta a alfa antiga + barra_antiga:SetAlpha(.9) --volta a alfa antiga info.mostrando = self info.showing = i @@ -5566,7 +5566,7 @@ local row_on_mouseup = function(self, button) info.jogador.detalhes = self.show info.jogador:MontaDetalhes (self.show, self) - self:SetAlpha (1) + self:SetAlpha(1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) self.on_focus = true return @@ -5575,7 +5575,7 @@ local row_on_mouseup = function(self, button) --nao tinha barras pressionadas info.mostrando_mouse_over = false - self:SetAlpha (1) + self:SetAlpha(1) self.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1) self.on_focus = true end @@ -5641,7 +5641,7 @@ end local miniframe_func_on_enter = function(self) local barra = self:GetParent() - if (barra.show and type (barra.show) == "number") then + if (barra.show and type(barra.show) == "number") then local spellname = _GetSpellInfo(barra.show) if (spellname) then GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT") @@ -5661,7 +5661,7 @@ local target_on_enter = function(self) local barra = self:GetParent():GetParent() - if (barra.show and type (barra.show) == "number") then + if (barra.show and type(barra.show) == "number") then local actor = barra.other_actor or info.jogador local spell = actor.spells and actor.spells:PegaHabilidade (barra.show) if (spell) then @@ -5688,8 +5688,8 @@ local target_on_enter = function(self) end --add and sort - for target_name, amount in _pairs (ActorTargetsContainer) do - --print (target_name, amount) + for target_name, amount in _pairs(ActorTargetsContainer) do + --print(target_name, amount) ActorTargetsSortTable [#ActorTargetsSortTable+1] = {target_name, amount or 0} total = total + (amount or 0) end @@ -5698,9 +5698,9 @@ local target_on_enter = function(self) local spellname = _GetSpellInfo(barra.show) GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") - GameTooltip:AddLine (barra.index .. ". " .. spellname) - GameTooltip:AddLine (info.target_text) - GameTooltip:AddLine (" ") + GameTooltip:AddLine(barra.index .. ". " .. spellname) + GameTooltip:AddLine(info.target_text) + GameTooltip:AddLine(" ") --get time type local meu_tempo @@ -5737,8 +5737,8 @@ local target_on_enter = function(self) GameCooltip:Show() - self.texture:SetAlpha (1) - self:SetAlpha (1) + self.texture:SetAlpha(1) + self:SetAlpha(1) barra:GetScript("OnEnter")(barra) return else @@ -5766,23 +5766,23 @@ local target_on_enter = function(self) GameTooltip:Show() else GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") - GameTooltip:AddLine (barra.index .. ". " .. barra.show) - GameTooltip:AddLine (info.target_text) - GameTooltip:AddLine (Loc ["STRING_NO_TARGET"], 1, 1, 1) - GameTooltip:AddLine (Loc ["STRING_MORE_INFO"], 1, 1, 1) + GameTooltip:AddLine(barra.index .. ". " .. barra.show) + GameTooltip:AddLine(info.target_text) + GameTooltip:AddLine(Loc ["STRING_NO_TARGET"], 1, 1, 1) + GameTooltip:AddLine(Loc ["STRING_MORE_INFO"], 1, 1, 1) GameTooltip:Show() end else GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") - GameTooltip:AddLine (barra.index .. ". " .. barra.show) - GameTooltip:AddLine (info.target_text) - GameTooltip:AddLine (Loc ["STRING_NO_TARGET"], 1, 1, 1) - GameTooltip:AddLine (Loc ["STRING_MORE_INFO"], 1, 1, 1) + GameTooltip:AddLine(barra.index .. ". " .. barra.show) + GameTooltip:AddLine(info.target_text) + GameTooltip:AddLine(Loc ["STRING_NO_TARGET"], 1, 1, 1) + GameTooltip:AddLine(Loc ["STRING_MORE_INFO"], 1, 1, 1) GameTooltip:Show() end - self.texture:SetAlpha (1) - self:SetAlpha (1) + self.texture:SetAlpha(1) + self:SetAlpha(1) barra:GetScript("OnEnter")(barra) end @@ -5790,8 +5790,8 @@ local target_on_leave = function(self) GameTooltip:Hide() GameCooltip:Hide() self:GetParent():GetParent():GetScript("OnLeave")(self:GetParent():GetParent()) - self.texture:SetAlpha (.7) - self:SetAlpha (.7) + self.texture:SetAlpha(.7) + self:SetAlpha(.7) end @@ -5858,7 +5858,7 @@ end function gump:CriaNovaBarraInfo2(instancia, index) if (_detalhes.playerDetailWindow.barras2 [index]) then - print ("erro a barra "..index.." ja existe na janela de detalhes...") + print("erro a barra "..index.." ja existe na janela de detalhes...") return end @@ -5873,9 +5873,9 @@ function gump:CriaNovaBarraInfo2(instancia, index) esta_barra:SetPoint("LEFT", janela, "LEFT", CONST_TARGET_HEIGHT, 0) esta_barra:SetPoint("RIGHT", janela, "RIGHT", 0, 0) esta_barra:SetPoint("TOP", janela, "TOP", 0, y) - esta_barra:SetFrameLevel (janela:GetFrameLevel() + 1) + esta_barra:SetFrameLevel(janela:GetFrameLevel() + 1) - esta_barra:EnableMouse (true) + esta_barra:EnableMouse(true) esta_barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") --icone @@ -5904,7 +5904,7 @@ local y_start = -10 function gump:CriaNovaBarraInfo3 (instancia, index) if (_detalhes.playerDetailWindow.barras3 [index]) then - print ("erro a barra "..index.." ja existe na janela de detalhes...") + print("erro a barra "..index.." ja existe na janela de detalhes...") return end @@ -5922,7 +5922,7 @@ function gump:CriaNovaBarraInfo3 (instancia, index) container3_bars_pointFunc (esta_barra, index) - esta_barra:EnableMouse (true) + esta_barra:EnableMouse(true) CriaTexturaBarra(esta_barra) @@ -5932,8 +5932,8 @@ function gump:CriaNovaBarraInfo3 (instancia, index) esta_barra.icone:SetHeight(14) esta_barra.icone:SetPoint("RIGHT", esta_barra.textura, "LEFT", 18, 0) - esta_barra:SetAlpha (0.9) - esta_barra.icone:SetAlpha (1) + esta_barra:SetAlpha(0.9) + esta_barra.icone:SetAlpha(1) esta_barra.isDetalhe = true diff --git a/frames/window_playerbreakdown_list.lua b/frames/window_playerbreakdown_list.lua index 8a9b4170..c3e8418d 100644 --- a/frames/window_playerbreakdown_list.lua +++ b/frames/window_playerbreakdown_list.lua @@ -153,7 +153,7 @@ line:SetScript("OnClick", lineOnClick) 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:SetBackdropColor(unpack(scrollbox_line_backdrop_color)) line:SetBackdropBorderColor(0, 0, 0, 1) local specIcon = line:CreateTexture("$parentSpecIcon", "artwork") diff --git a/frames/window_profiler.lua b/frames/window_profiler.lua index b57b13a0..aebe2e56 100644 --- a/frames/window_profiler.lua +++ b/frames/window_profiler.lua @@ -1,6 +1,6 @@ local Details = _G.Details -local L = _G.LibStub ("AceLocale-3.0"):GetLocale( "Details" ) +local L = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" ) function Details:OpenProfiler() diff --git a/frames/window_report.lua b/frames/window_report.lua index 68875081..2b021d15 100644 --- a/frames/window_report.lua +++ b/frames/window_report.lua @@ -598,7 +598,7 @@ local createDropdown = function(thisFrame) window.fechar:SetHeight(20) window.fechar:SetPoint("TOPRIGHT", window, "TOPRIGHT", 0, -3) window.fechar:Show() - window.fechar:GetNormalTexture():SetDesaturated (true) + window.fechar:GetNormalTexture():SetDesaturated(true) local recentReportButton = window.recently_report_buttons[10] recentReportButton:Hide() @@ -682,8 +682,8 @@ local createDropdown = function(thisFrame) bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) bg1:SetAlpha(0.7) bg1:SetVertexColor(0.27, 0.27, 0.27) - bg1:SetVertTile (true) - bg1:SetHorizTile (true) + bg1:SetVertTile(true) + bg1:SetHorizTile(true) bg1:SetAllPoints() tinsert(window.all_widgets, bg1) @@ -713,7 +713,7 @@ local createDropdown = function(thisFrame) function Details:DelayUpdateReportWindowRecentlyReported() if (DetailsReportWindow) then - Details:ScheduleTimer ("UpdateRecentlyReported", 0.5) + Details:ScheduleTimer("UpdateRecentlyReported", 0.5) end end diff --git a/frames/window_rowtexteditor.lua b/frames/window_rowtexteditor.lua index 111f83e7..07f49325 100644 --- a/frames/window_rowtexteditor.lua +++ b/frames/window_rowtexteditor.lua @@ -13,7 +13,7 @@ local panel = Details:CreateWelcomePanel ("DetailsWindowOptionsBarTextEditor", n panel:SetPoint("center", UIParent, "center") panel:Hide() panel:SetFrameStrata("FULLSCREEN") -DF:ApplyStandardBackdrop (panel) +DF:ApplyStandardBackdrop(panel) DF:CreateTitleBar (panel, "Details! Custom Line Text Editor") function panel:Open (text, callback, host, default) @@ -31,11 +31,11 @@ function panel:Open (text, callback, host, default) end local y = -32 -local buttonTemplate = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") +local buttonTemplate = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local textentry = DF:NewSpecialLuaEditorEntry (panel, scrollWidth, 555, "editbox", "$parentEntry") textentry:SetPoint("topleft", panel, "topleft", 10, y) -DF:ApplyStandardBackdrop (textentry) +DF:ApplyStandardBackdrop(textentry) DF:SetFontSize (textentry.editbox, 14) DF:ReskinSlider(textentry.scroll) @@ -45,9 +45,9 @@ local arg3_button = DF:NewButton(panel, nil, "$parentButton3", nil, 80, 20, func 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) +arg1_button:SetTemplate(buttonTemplate) +arg2_button:SetTemplate(buttonTemplate) +arg3_button:SetTemplate(buttonTemplate) arg1_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] arg2_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"] @@ -165,10 +165,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:SetTemplate (buttonTemplate) +color_button:SetTemplate(buttonTemplate) func_button:SetPoint("topright", panel, "topright", -12, y - (20*3)) -func_button:SetTemplate (buttonTemplate) +func_button:SetTemplate(buttonTemplate) color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"] func_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"] @@ -179,20 +179,20 @@ local done = function() 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:SetTemplate(buttonTemplate) 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:SetTemplate(buttonTemplate) 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:SetTemplate(buttonTemplate) 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) cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"] -cancel_button:SetTemplate (buttonTemplate) +cancel_button:SetTemplate(buttonTemplate) 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 3ee051de..809c97de 100644 --- a/frames/window_runcode.lua +++ b/frames/window_runcode.lua @@ -6,7 +6,7 @@ local _ -- ~run ~runcode function Details:InitializeRunCodeWindow() - local DetailsRunCodePanel = DF:CreateSimplePanel (UIParent, 700, 480, "Details! Run Code", "DetailsRunCodePanel") + local DetailsRunCodePanel = DF:CreateSimplePanel(UIParent, 700, 480, "Details! Run Code", "DetailsRunCodePanel") DetailsRunCodePanel.Frame = DetailsRunCodePanel DetailsRunCodePanel.__name = "Auto Run Code" DetailsRunCodePanel.real_name = "DETAILS_RUNCODEWINDOW" @@ -30,7 +30,7 @@ function Details.OpenRunCodeWindow() DetailsRunCodePanel.Initialized = true - local f = DetailsRunCodePanel or DF:CreateSimplePanel (UIParent, 700, 480, "Details! Run Code", "DetailsRunCodePanel") + local f = DetailsRunCodePanel or DF:CreateSimplePanel(UIParent, 700, 480, "Details! Run Code", "DetailsRunCodePanel") --lua editor local code_editor = DF:NewSpecialLuaEditorEntry (f, 885, 510, "text", "$parentCodeEditorWindow") @@ -52,10 +52,10 @@ function Details.OpenRunCodeWindow() 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) - code_editor.__background:SetAlpha (0.8) - code_editor.__background:SetVertTile (true) - code_editor.__background:SetHorizTile (true) + code_editor.__background:SetVertexColor(0.27, 0.27, 0.27) + code_editor.__background:SetAlpha(0.8) + code_editor.__background:SetVertTile(true) + code_editor.__background:SetHorizTile(true) code_editor.__background:SetAllPoints() --code compile error warning @@ -69,7 +69,7 @@ function Details.OpenRunCodeWindow() 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) code_editor.NextCodeCheck = 0.33 @@ -118,10 +118,10 @@ function Details.OpenRunCodeWindow() return t end - 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")) + 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:SetFrameLevel (code_editor:GetFrameLevel() + 10) + code_type_dropdown:SetFrameLevel(code_editor:GetFrameLevel() + 10) code_type_label:SetPoint("bottomleft", code_editor, "topleft", 0, 8) --create save button @@ -142,7 +142,7 @@ function Details.OpenRunCodeWindow() local button_y = -6 - 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")) + 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) @@ -153,7 +153,7 @@ function Details.OpenRunCodeWindow() 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")) + 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) @@ -171,7 +171,7 @@ function Details.OpenRunCodeWindow() end end - 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")) + 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) diff --git a/frames/window_scrolldamage.lua b/frames/window_scrolldamage.lua index 9539bbb9..1c240a09 100644 --- a/frames/window_scrolldamage.lua +++ b/frames/window_scrolldamage.lua @@ -69,7 +69,7 @@ function Details:ScrollDamage() if (spellTable) then local line = self:GetLine(i) - local time, token, hidding, sourceSerial, sourceName, sourceFlag, sourceFlag2, targetSerial, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill, school, resisted, blocked, absorbed, isCritical = unpack (spellTable) + local time, token, hidding, sourceSerial, sourceName, sourceFlag, sourceFlag2, targetSerial, targetName, targetFlag, targetFlag2, spellID, spellName, spellType, amount, overKill, school, resisted, blocked, absorbed, isCritical = unpack(spellTable) local spellName, _, spellIcon @@ -136,7 +136,7 @@ function Details:ScrollDamage() 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:SetBackdropColor(unpack(backdrop_color)) DF:Mixin(line, DF.HeaderFunctions) diff --git a/frames/window_spellcategory.lua b/frames/window_spellcategory.lua index cdd08288..5d5b9a8d 100644 --- a/frames/window_spellcategory.lua +++ b/frames/window_spellcategory.lua @@ -154,7 +154,7 @@ function Details.Survey.OpenSpellCategoryScreen() statusBar:SetPoint("bottomleft", detailsSpellCategoryFrame, "bottomleft") statusBar:SetPoint("bottomright", detailsSpellCategoryFrame, "bottomright") statusBar:SetHeight(26) - statusBar:SetAlpha (0.8) + statusBar:SetAlpha(0.8) DF:ApplyStandardBackdrop(statusBar) --statusbar of the statusbar @@ -162,7 +162,7 @@ function Details.Survey.OpenSpellCategoryScreen() statusBar2:SetPoint("topleft", statusBar, "bottomleft") statusBar2:SetPoint("topright", statusBar, "bottomright") statusBar2:SetHeight(20) - statusBar2:SetAlpha (0.8) + statusBar2:SetAlpha(0.8) DF:ApplyStandardBackdrop(statusBar2) DF:ApplyStandardBackdrop(statusBar2) local dataInfoLabel = DF:CreateLabel(statusBar2, "This cooldown data is send to people on Details! team and shared in 'Open Raid' library where any weakaura or addon can use it", 12, "silver") diff --git a/frames/window_statistics.lua b/frames/window_statistics.lua index 7afe9e26..2895a726 100644 --- a/frames/window_statistics.lua +++ b/frames/window_statistics.lua @@ -38,7 +38,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f:SetFrameStrata("HIGH") f:SetToplevel (true) - f:SetMovable (true) + f:SetMovable(true) f:SetWidth(850) f:SetHeight(500) tinsert(UISpecialFrames, "DetailsRaidHistoryWindow") @@ -67,10 +67,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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: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:SetAllPoints() @@ -96,28 +96,28 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild tutorialFrame.Desc.width = 370 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"]) + 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:SetTemplate (DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + closeButton:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) end --background local background = f:CreateTexture("$parentBackgroundImage", "border") - background:SetAlpha (0.3) + background:SetAlpha(0.3) 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]]) - div:SetAlpha (0.1) + div:SetAlpha(0.1) 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") - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local selectKillTimeline = function() f.GuildRankCheckBox:SetValue(false) @@ -139,7 +139,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end --kill timeline - 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 + 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) @@ -147,7 +147,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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 + 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) @@ -201,7 +201,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f.WorkingFrame:Show() f.WorkingAnimation:Play() - C_Timer.NewTicker (10, function(self) + C_Timer.NewTicker(10, function(self) if (not Details.LastGuildSyncReceived) then f.GuildSyncButton:Enable() f.EndAnimationHub:Play() @@ -214,7 +214,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end) 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) + 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:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4) @@ -290,7 +290,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild end 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) + 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:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4) @@ -299,7 +299,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local instanceId = Details:GetInstanceIdFromEncounterId (encounterId) if (instanceId) then local file, L, R, T, B = Details:GetRaidBackground (instanceId) - --print ("file:", file) + --print("file:", file) --can't get the image, looks to be restricted --[[ if (file) then @@ -373,7 +373,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") - raid_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + raid_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select boss: local on_boss_select = function(_, _, boss) @@ -384,7 +384,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") - boss_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + boss_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select difficulty: local on_diff_select = function(_, _, diff) @@ -397,7 +397,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") - diff_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + diff_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select role: local on_role_select = function(_, _, role) @@ -411,7 +411,7 @@ 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") - role_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + role_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select guild: local on_guild_select = function(_, _, guild) @@ -422,7 +422,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") - guild_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + guild_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select playerbase: local on_player_select = function(_, _, player) @@ -436,7 +436,7 @@ 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") - player_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + player_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --select player: local onPlayer2Select = function(_, _, player) @@ -444,7 +444,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild f:BuildPlayerTable (player) end local build_player2_list = function() - local encounterTable, guild, role = unpack (f.build_player2_data or {}) + local encounterTable, guild, role = unpack(f.build_player2_data or {}) local t = {} local alreadyListed = {} if (encounterTable) then @@ -466,7 +466,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") - player2_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + player2_dropdown:SetTemplate(DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) function f:UpdateDropdowns(DoNotSelectRaid) @@ -494,7 +494,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild if (difficulty == 14) then --don't show normal encounters --tinsert(difficultyList, {value = 14, label = "Normal", icon = icon, onclick = on_diff_select}) - --print ("has normal encounter") + --print("has normal encounter") elseif (difficulty == 15) then local alreadyHave = false @@ -581,7 +581,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild 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") + --print("has normal encounter") elseif (difficulty == 15) then local alreadyHave = false for i, t in ipairs(difficultyList) do @@ -664,10 +664,10 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild function f:BuildPlayerTable (playerName) - local encounterTable, guild, role = unpack (f.build_player2_data or {}) + local encounterTable, guild, role = unpack(f.build_player2_data or {}) local data = {} - if (type(playerName) == "string" and string.len (playerName) > 1) then + if (type(playerName) == "string" and string.len(playerName) > 1) then for encounterIndex, encounter in ipairs(encounterTable) do if (encounter.guild == guild) then @@ -693,12 +693,12 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local onenter = function(self) GameCooltip:Reset() GameCooltip:SetType ("tooltip") - GameCooltip:Preset (2) + GameCooltip:Preset(2) - GameCooltip:AddLine ("Total Done:", Details:ToK2 (self.data.value), 1, "white") - GameCooltip:AddLine ("Dps:", Details:ToK2 (self.data.value / self.data.elapsed), 1, "white") - GameCooltip:AddLine ("Item Level:", floor (self.data.data [2]), 1, "white") - GameCooltip:AddLine ("Date:", self.data.fulldate:gsub (".*%s", ""), 1, "white") + GameCooltip:AddLine("Total Done:", Details:ToK2 (self.data.value), 1, "white") + GameCooltip:AddLine("Dps:", Details:ToK2 (self.data.value / self.data.elapsed), 1, "white") + GameCooltip:AddLine("Item Level:", floor(self.data.data [2]), 1, "white") + GameCooltip:AddLine("Date:", self.data.fulldate:gsub (".*%s", ""), 1, "white") GameCooltip:SetOwner(self.ball.tooltip_anchor) GameCooltip:Show() @@ -768,19 +768,19 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild local sortTable = {} for playerName, t in pairs(playerScore) do - local className = select (2, GetClassInfo (t.class or 0)) + local className = select(2, GetClassInfo (t.class or 0)) local classColor = "FFFFFFFF" if (className) then classColor = RAID_CLASS_COLORS [className] and RAID_CLASS_COLORS [className].colorStr end - local playerNameFormated = Details:GetOnlyName (playerName) + local playerNameFormated = Details:GetOnlyName(playerName) tinsert(sortTable, { "|c" .. classColor .. playerNameFormated .. "|r", Details:comma_value (t.ps), Details:ToK2 (t.total), DF:IntegerToTimer (t.length), - floor (t.ilvl), + floor(t.ilvl), t.date, t.total, t.ps, @@ -841,7 +841,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild tinsert(players, player) players_index [playerName] = #players - --print ("not index", playerName, amt_encounters, date, 2, amt_encounters-1) + --print("not index", playerName, amt_encounters, date, 2, amt_encounters-1) else player = players [index] for i = #player+1, amt_encounters-1 do @@ -862,9 +862,9 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild tinsert(playerTable, "") end - local className = select (2, GetClassInfo (player_class [playerTable [1]] or 0)) + local className = select(2, GetClassInfo (player_class [playerTable [1]] or 0)) if (className) then - local playerNameFormated = Details:GetOnlyName (playerTable[1]) + local playerNameFormated = Details:GetOnlyName(playerTable[1]) local classColor = RAID_CLASS_COLORS [className] and RAID_CLASS_COLORS [className].colorStr playerTable [1] = "|c" .. classColor .. playerNameFormated .. "|r" end diff --git a/frames/window_switch.lua b/frames/window_switch.lua index d622e27b..83b4afd3 100644 --- a/frames/window_switch.lua +++ b/frames/window_switch.lua @@ -242,7 +242,7 @@ do allDisplaysFrame.check_text_size (button.text) button.texture:SetTexture(Details.sub_atributos [attribute].icones [i] [1]) - button.texture:SetTexCoord (unpack (Details.sub_atributos [attribute].icones [i] [2])) + button.texture:SetTexCoord (unpack(Details.sub_atributos [attribute].icones [i] [2])) tinsert(allDisplaysFrame.buttons [attribute], button) y = y - 17 end @@ -532,12 +532,12 @@ function Details.switch:ShowMe(instancia) index = index - 1 end - local button = gump:CreateButton (Details.switch.frame, segment_switch, 100, 20, "", index) + 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:SetClickFunction(segment_switch, nil, nil, "right") - local boss_texture = gump:CreateImage (button, nil, 16, 16) + local boss_texture = gump:CreateImage(button, nil, 16, 16) boss_texture:SetPoint("right", s, "left", -2, 0) local background = button:CreateTexture(nil, "background") @@ -586,8 +586,8 @@ function Details.switch:ShowMe(instancia) local window_width, window_height = Details.switch.current_instancia:GetSize() - local horizontal_amt = floor (math.max (window_width / 100, 2)) - local vertical_amt = floor ((window_height - y) / 20) + local horizontal_amt = floor(math.max(window_width / 100, 2)) + local vertical_amt = floor((window_height - y) / 20) local size = window_width / horizontal_amt local frame = Details.switch.frame @@ -694,7 +694,7 @@ function Details.switch:ShowMe(instancia) 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 + local mostrar_quantas = floor(altura / Details.switch.button_height) * 2 local precisa_mostrar = 0 for i = 1, #Details.switch.table do @@ -932,7 +932,7 @@ function Details.switch:Update() local button = Details.switch.buttons [i] if (not button) then button = Details.switch:NewSwitchButton (Details.switch.frame, i, x, y, jump) - button:SetFrameLevel (Details.switch.frame:GetFrameLevel()+2) + button:SetFrameLevel(Details.switch.frame:GetFrameLevel()+2) Details.switch.showing = Details.switch.showing + 1 end diff --git a/frames/window_wa.lua b/frames/window_wa.lua index c495b206..3cf635bb 100644 --- a/frames/window_wa.lua +++ b/frames/window_wa.lua @@ -1,5 +1,5 @@ local _detalhes = _G._detalhes -local L = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local L = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) --default weaktable _detalhes.weaktable = {__mode = "v"} @@ -68,7 +68,7 @@ local text_dispell_prototype = { ["events"] = "COMBAT_LOG_EVENT_UNFILTERED, ENCOUNTER_START", ["use_spellName"] = false, ["use_spellId"] = false, - ["custom"] = "function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select (2, aura_env.text:gsub (\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub (\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend", + ["custom"] = "function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select(2, aura_env.text:gsub (\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub (\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend", ["spellIds"] = { }, ["use_message"] = true, @@ -1419,7 +1419,7 @@ local glow_prototype = { function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size, other_values, in_combat, cooldown_animation) - --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) + --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 if (not WeakAuras or not WeakAurasSaved) then @@ -1466,7 +1466,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n aura_env.interrupted = aura_env.interrupted + 1 aura_env.text = aura_env.text .. "|cffc5ffc5" .. who_name .. " (" .. aura_env.interrupted .. ") ".. "|r\n" end - if (select (2, aura_env.text:gsub ("\n", "")) == 9) then + if (select(2, aura_env.text:gsub ("\n", "")) == 9) then aura_env.text = aura_env.text:gsub (".-\n", "", 1) end return true @@ -1509,7 +1509,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1 aura_env.text = aura_env.text .. "|cffd2e8ff" .. who_name .. " (" .. aura_env.dispels_by [who_name] .. ") ".. "|r\n" - if (select (2, aura_env.text:gsub ("\n", "")) == 11) then + if (select(2, aura_env.text:gsub ("\n", "")) == 11) then aura_env.text = aura_env.text:gsub (".-\n", "", 2) aura_env.text = "@title\n" .. aura_env.text end @@ -1566,7 +1566,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n new_aura.width = icon_size new_aura.height = icon_size elseif (aura_type == "aurabar") then - new_aura.width = max (icon_size, 370) + new_aura.width = max(icon_size, 370) new_aura.height = 38 elseif (aura_type == "text") then new_aura.fontSize = min (icon_size, 72) @@ -1580,15 +1580,15 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n ]] init_start = init_start:gsub ("@text", icon_text) - init_start = init_start:gsub ("@countdown", floor (stacksize)) - new_aura.trigger.remaining = tostring (floor (stacksize)) + init_start = init_start:gsub ("@countdown", floor(stacksize)) + new_aura.trigger.remaining = tostring (floor(stacksize)) new_aura.actions.init.custom = init_start if (other_values.dbm_timer_id) then new_aura.trigger.event = "DBM Timer" local timerId = tostring (other_values.dbm_timer_id) - --print ("timerId:", other_values.dbm_timer_id, type (other_values.dbm_timer_id), timerId:find ("%s")) + --print("timerId:", other_values.dbm_timer_id, type(other_values.dbm_timer_id), timerId:find ("%s")) --other_values.spellid --if (timerId:find ("%s")) then @@ -1617,8 +1617,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n local init_start = [[ aura_env.reimaningTime = @countdown ]] - init_start = init_start:gsub ("@countdown", floor (stacksize)) - trigger.remaining = tostring (floor (stacksize)) + init_start = init_start:gsub ("@countdown", floor(stacksize)) + trigger.remaining = tostring (floor(stacksize)) new_aura.actions.init.custom = init_start if (other_values.dbm_timer_id) then @@ -1795,7 +1795,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n --check stack size if (stacksize and stacksize >= 1) then - stacksize = floor (stacksize) + stacksize = floor(stacksize) local add = _detalhes.table.copy ({}, stack_prototype) add.trigger.count = tostring (stacksize) _detalhes.table.overwrite (new_aura, add) @@ -1835,7 +1835,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n end --using sound - if (sound and type (sound) == "table") then + if (sound and type(sound) == "table") then local add = _detalhes.table.copy ({}, sound_prototype_custom) add.actions.start.sound_path = sound.sound_path add.actions.start.sound_channel = sound.sound_channel or "Master" @@ -1958,7 +1958,7 @@ local empty_other_values = {} function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, triggertype, auratype, other_values) if (not spellname) then - spellname = select (1, GetSpellInfo(spellid)) + spellname = select(1, GetSpellInfo(spellid)) end wipe (empty_other_values) @@ -1984,17 +1984,17 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f:SetSize(800, 600) f:SetPoint("center", UIParent, "center", 0, 150) f:SetFrameStrata("DIALOG") - f:EnableMouse (true) - f:SetMovable (true) + 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:SetAlpha (0.8) - f.bg1:SetVertexColor (0.27, 0.27, 0.27) - f.bg1:SetVertTile (true) - f.bg1:SetHorizTile (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:SetAllPoints() f:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) @@ -2002,11 +2002,11 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f:SetBackdropBorderColor(0, 0, 0, 1) --register to libwindow - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, _detalhes.createauraframe) - LibWindow.RestorePosition (f) - LibWindow.MakeDraggable (f) - LibWindow.SavePosition (f) + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(f, _detalhes.createauraframe) + LibWindow.RestorePosition(f) + LibWindow.MakeDraggable(f) + LibWindow.SavePosition(f) f:SetScript("OnMouseDown", function(self, button) if (button == "RightButton") then @@ -2035,7 +2035,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr f.Close:GetHighlightTexture():SetDesaturated(true) f.Close:GetPushedTexture():SetDesaturated(true) - f.Close:SetAlpha (0.7) + f.Close:SetAlpha(0.7) f.Close:SetScript("OnClick", function() f:Hide() end) --title @@ -2045,16 +2045,16 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local fw = _detalhes:GetFramework() - local text_template = fw:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local dropdown_template = fw:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local switch_template = fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local slider_template = fw:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local button_template = fw:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local text_template = fw:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local dropdown_template = fw:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local switch_template = fw:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local slider_template = fw:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local button_template = fw:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") --aura name 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:SetTemplate(slider_template) name_textentry:SetPoint("left", name_label, "right", 2, 0) f.name = name_textentry @@ -2077,13 +2077,13 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr 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) + 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) - local Icon_StatusbarAuraType = fw:CreateImage (f, [[Interface\AddOns\Details\images\icons2]], 92, 12, "overlay", {235/512, 327/512, 336/512, 348/512}, nil, nil) + 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) - local Icon_TextOnlyAuraType = fw:CreateImage (f, [[Interface\AddOns\Details\images\icons2]], 57, 8, "overlay", {250/512, 306/512, 360/512, 367/512}, nil, nil) + 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) local AuraTypeSelectedColor = {1, 1, 1, 0.3} @@ -2106,19 +2106,19 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr 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) @@ -2134,25 +2134,25 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr 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") + 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: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: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: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:SetBackdropBorderColor(unpack(AuraTypeBorderColor)) --trigger list --target @@ -2226,8 +2226,8 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end for i = 1, #triggerList do - local checkBox = fw:CreateSwitch (f, OnChangeTriggerState, i == 1) - checkBox:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + local checkBox = fw:CreateSwitch(f, OnChangeTriggerState, i == 1) + checkBox:SetTemplate(fw:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) checkBox:SetAsCheckBox() checkBox:SetFixedParameter(triggerList [i].value) @@ -2245,7 +2245,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --spellname 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:SetTemplate(slider_template) spellname_textentry:SetPoint("left", spellname_label, "right", 2, 0) f.spellname = spellname_textentry spellname_textentry.tooltip = "Spell/Debuff/Buff to be tracked." @@ -2253,14 +2253,14 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --spellid 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:SetTemplate(slider_template) auraid_textentry:Disable() auraid_textentry:SetPoint("left", auraid_label, "right", 2, 0) --use spellid 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")) + 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) @@ -2268,8 +2268,8 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --in combat only 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")) + 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.tooltip = "Only active when in combat." @@ -2290,8 +2290,8 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --is cooldown 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")) + 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.tooltip = "Only active when in combat." @@ -2299,7 +2299,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --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) + 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) stack_slider.tooltip = "Minimum amount of stacks to trigger the aura." @@ -2397,7 +2397,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr return t end local sound_effect = fw:CreateDropDown (f, sound_options, 1, 150, 20, "SoundEffectDropdown", "$parentSoundEffectDropdown") - sound_effect:SetTemplate (slider_template) + 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) sound_effect.tooltip = "Sound played when the aura triggers." @@ -2405,20 +2405,20 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --say something 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:SetTemplate(slider_template) 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 = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText") - aura_text:SetTemplate (slider_template) + aura_text:SetTemplate(slider_template) 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 = fw:CreateSwitch (f, function(self, _, state) + local useglow = fw:CreateSwitch(f, function(self, _, state) if (state and self.glow_test) then self.glow_test:Show() self.glow_test.animOut:Stop() @@ -2429,7 +2429,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr end end, false, nil, nil, nil, nil, "UseGlow") - useglow:SetTemplate (fw:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + useglow:SetTemplate(fw:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) useglow:SetAsCheckBox() useglow:SetPoint("left", useglow_label, "right", 2, 0) @@ -2443,14 +2443,14 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr --encounter id 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:SetTemplate(slider_template) 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") - icon_size_slider:SetTemplate (slider_template) + icon_size_slider:SetTemplate(slider_template) icon_size_slider:SetPoint("left", icon_size_label, "right", 2, 0) icon_size_slider.tooltip = "Icon size, width and height." @@ -2463,7 +2463,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr return t end local aura_addon = fw:CreateDropDown (f, addon_options, 1, 150, 20, "AuraAddonDropdown", "$parentAuraAddonDropdown") - aura_addon:SetTemplate (slider_template) + 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) @@ -2491,7 +2491,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr 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:SetTemplate(slider_template) weakauras_folder:SetPoint("left", weakauras_folder_label, "right", 2, 0) --make new group @@ -2500,19 +2500,19 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr local weakauras_newgroup_textentry = f.NewWeakaurasGroupTextEntry if (not WeakAurasSaved or not WeakAurasSaved.displays) then - print ("nop, weakauras not found") + print("nop, weakauras not found") return end local groupName = weakauras_newgroup_textentry.text - if (string.len (groupName) == 0) then - print ("nop, group name is too small") + if (string.len(groupName) == 0) then + print("nop, group name is too small") return end if (WeakAurasSaved.displays [groupName]) then - print ("nop, group already exists") + print("nop, group already exists") return end @@ -2538,14 +2538,14 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr 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:SetTemplate(slider_template) 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")) + 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) @@ -2580,19 +2580,19 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr if (addon == "WA") then _detalhes:CreateWeakAura (aura_type_value, spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow, eid, folder, iconsize, f.other_values, incombat, iscooldown) else - _detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.") + _detalhes:Msg("No Aura Addon selected. Addons currently supported: WeakAuras 2.") end f:Hide() end - 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")) + 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) - 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")) + 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) @@ -2762,7 +2762,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr DetailsAuraPanel.AuraText:SetText(DetailsAuraPanel.other_values.text or "") DetailsAuraPanel.SaySomething:SetText("") - if (triggertype and type (triggertype) == "number") then + if (triggertype and type(triggertype) == "number") then DetailsAuraPanel.AuraOnDropdown:Select(triggertype, true) DetailsAuraPanel.SetTriggerState (DetailsAuraPanel.TriggerList [triggertype].value) --passed by index not by the trigger ID else @@ -2770,7 +2770,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr DetailsAuraPanel.SetTriggerState (1) end - if (auratype and type (auratype) == "number") then + if (auratype and type(auratype) == "number") then DetailsAuraPanel.AuraTypeDropdown:Select(auratype, true) DetailsAuraPanel.OnSelectAuraType (nil, nil, auratype) else diff --git a/frames/window_welcome.lua b/frames/window_welcome.lua index a91aa394..5dce3e39 100644 --- a/frames/window_welcome.lua +++ b/frames/window_welcome.lua @@ -1,5 +1,5 @@ local _detalhes = _G._detalhes -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") local g = _detalhes.gump @@ -24,7 +24,7 @@ function _detalhes:OpenWelcomeWindow() window:SetBackdropColor(0, 0, 0, 0.75) window:SetWidth(612) window:SetHeight(315) - window:SetMovable (true) + window:SetMovable(true) window:SetScript("OnMouseDown", function() window:StartMoving() end) window:SetScript("OnMouseUp", function() window:StopMovingOrSizing() end) window:SetScript("OnHide", function() @@ -44,7 +44,7 @@ function _detalhes:OpenWelcomeWindow() 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) + rodape_bg:SetVertexColor(0, 0, 0, 1) local logotipo = window:CreateTexture(nil, "overlay") logotipo:SetPoint("topleft", window, "topleft", 16, -20) @@ -57,12 +57,12 @@ function _detalhes:OpenWelcomeWindow() cancel:SetWidth(22) cancel:SetHeight(22) cancel:SetPoint("bottomleft", window, "bottomleft", 12, 14) - cancel:SetFrameLevel (window:GetFrameLevel()+1) + 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:GetNormalTexture():SetDesaturated (true) + cancel:GetNormalTexture():SetDesaturated(true) cancel:Disable() local cancelText = cancel:CreateFontString (nil, "overlay", "GameFontNormal") @@ -74,7 +74,7 @@ function _detalhes:OpenWelcomeWindow() forward:SetWidth(26) forward:SetHeight(26) forward:SetPoint("bottomright", window, "bottomright", -14, 13) - forward:SetFrameLevel (window:GetFrameLevel()+1) + 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]]) @@ -133,7 +133,7 @@ function _detalhes:OpenWelcomeWindow() instance.baseframe:SetPoint("left", DetailsWelcomeWindow, "right", 10, 0) DetailsWelcomeWindow.SetLocTimer = nil end - DetailsWelcomeWindow.SetLocTimer = _detalhes:ScheduleTimer ("WelcomeSetLoc", 12) + DetailsWelcomeWindow.SetLocTimer = _detalhes:ScheduleTimer("WelcomeSetLoc", 12) --/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) @@ -151,7 +151,7 @@ function _detalhes:OpenWelcomeWindow() got = true elseif (not InCombatLockdown()) then - --print ("process time:", elapsed) + --print("process time:", elapsed) if (elapsed < 0.295) then _detalhes.use_row_animations = true @@ -183,7 +183,7 @@ function _detalhes:OpenWelcomeWindow() end --deprecated - --_detalhes:ScheduleTimer ("CalcCpuPower", 10) + --_detalhes:ScheduleTimer("CalcCpuPower", 10) --detect ElvUI --[=[ --deprecated @@ -202,7 +202,7 @@ function _detalhes:OpenWelcomeWindow() for key, value in pairs(instance) do if (_detalhes.instance_defaults [key] ~= nil) then if (type(value) == "table") then - savedObject [key] = Details.CopyTable (value) + savedObject [key] = Details.CopyTable(value) else savedObject [key] = value end @@ -241,7 +241,7 @@ local window_openned_at = time() angel:SetTexCoord (0.162109375, 0.591796875, 0, 1) angel:SetWidth(442) angel:SetHeight(256) - angel:SetAlpha (.2) + angel:SetAlpha(.2) local texto1 = window:CreateFontString (nil, "overlay", "GameFontNormal") texto1:SetPoint("topleft", window, "topleft", 13, -220) @@ -262,7 +262,7 @@ local window_openned_at = time() bg55:SetPoint("bottomright", window, "bottomright", -10, 10) bg55:SetHeight(125*3) bg55:SetWidth(89*3) - bg55:SetAlpha (.05) + bg55:SetAlpha(.05) bg55:SetTexCoord (1, 0, 0, 1) local texto55 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -320,7 +320,7 @@ local window_openned_at = time() local instance1 = _detalhes:GetInstance(1) local skin_dropdown = g:NewDropDown (window, _, "$parentSkinDropdown", "skinDropdown", 160, 20, buildSkinMenu, instance1.skin) - skin_dropdown:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + 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") @@ -426,7 +426,7 @@ local window_openned_at = time() 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:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.LatinAlphabetCheckBox.OnSwitch = onSelectAlphabet window.LatinAlphabetLabel:SetPoint("left", window.LatinAlphabetCheckBox, "right", 2, 0) @@ -438,7 +438,7 @@ local window_openned_at = time() 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:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.CyrillicAlphabetCheckBox.OnSwitch = onSelectAlphabet window.CyrillicAlphabetLabel:SetPoint("left", window.CyrillicAlphabetCheckBox, "right", 2, 0) tinsert(allAlphabetCheckBoxes, window.CyrillicAlphabetCheckBox) @@ -449,7 +449,7 @@ local window_openned_at = time() 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:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.ChinaCheckBox.OnSwitch = onSelectAlphabet window.ChinaAlphabetLabel:SetPoint("left", window.ChinaCheckBox, "right", 2, 0) tinsert(allAlphabetCheckBoxes, window.ChinaCheckBox) @@ -460,7 +460,7 @@ local window_openned_at = time() 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:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.KoreanCheckBox.OnSwitch = onSelectAlphabet window.KoreanAlphabetLabel:SetPoint("left", window.KoreanCheckBox, "right", 2, 0) tinsert(allAlphabetCheckBoxes, window.KoreanCheckBox) @@ -471,7 +471,7 @@ local window_openned_at = time() 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:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.TaiwanCheckBox.OnSwitch = onSelectAlphabet window.TaiwanAlphabetLabel:SetPoint("left", window.TaiwanCheckBox, "right", 2, 0) tinsert(allAlphabetCheckBoxes, window.TaiwanCheckBox) @@ -499,8 +499,8 @@ local window_openned_at = time() self.MyObject:Disable() end - 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")) + 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) @@ -514,7 +514,7 @@ local window_openned_at = time() local instance = window.editing_window if (instance.menu_alpha.enabled and a ~= instance.color[4]) then - _detalhes:Msg (Loc ["STRING_OPTIONS_MENU_ALPHAWARNING"]) + _detalhes:Msg(Loc ["STRING_OPTIONS_MENU_ALPHAWARNING"]) instance:InstanceColor (r, g, b, instance.menu_alpha.onleave, nil, true) if (_detalhes.options_group_edit) then @@ -545,12 +545,12 @@ local window_openned_at = time() local change_color = function() window.editing_window = _detalhes:GetInstance(1) - local r, g, b, a = unpack (window.editing_window.color) + local r, g, b, a = unpack(window.editing_window.color) _detalhes.gump:ColorPick (window, r, g, b, a, windowcolor_callback) end - local window_color = g:CreateButton (window, change_color, buttonWidth, 20, Loc ["STRING_OPTIONS_CHANGECOLOR"]) - window_color:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + 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:SetIcon ([[Interface\AddOns\Details\images\icons]], 14, 14, nil, {434/512, 466/512, 277/512, 307/512}, nil, 4, 2) @@ -560,7 +560,7 @@ local window_openned_at = time() -- 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:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) + window.BarHeightSlider:SetTemplate(g:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")) window.BarHeightSlider:SetHook("OnValueChange", function(self, _, amount) local instance1 = Details:GetInstance(1) @@ -580,7 +580,7 @@ local window_openned_at = time() -- 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:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) + window.TextSizeSlider:SetTemplate(g:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")) window.TextSizeSlider:SetHook("OnValueChange", function(self, _, amount) local instance1 = Details:GetInstance(1) @@ -619,7 +619,7 @@ local window_openned_at = time() local instance1 = _detalhes:GetInstance(1) local font_dropdown = g:NewDropDown (window, _, "$parentFontDropdown", "FontDropdown", 160, 20, buildFontMenu, instance1.row_info.font_face) - font_dropdown:SetTemplate (g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + 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") @@ -631,7 +631,7 @@ local window_openned_at = time() g:NewSwitch (window, _, "$parentShowPercentCheckBox", "ShowPercentCheckBox", 20, 20, _, _, false) window.ShowPercentCheckBox:SetAsCheckBox() window.ShowPercentCheckBox:SetFixedParameter(1) - window.ShowPercentCheckBox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + window.ShowPercentCheckBox:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.ShowPercentCheckBox.OnSwitch = function(self, fixedParameter, value) local instance1 = Details:GetInstance(1) @@ -669,7 +669,7 @@ local window_openned_at = time() end if (DetailsWelcomeWindow.SetLocTimer) then - _detalhes:CancelTimer (DetailsWelcomeWindow.SetLocTimer) + _detalhes:CancelTimer(DetailsWelcomeWindow.SetLocTimer) DetailsWelcomeWindow.SetLocTimer = nil _detalhes:WelcomeSetLoc() end @@ -696,7 +696,7 @@ local window_openned_at = time() 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:SetAlpha(.05) numeral_image:SetTexCoord (1, 0, 0, 1) g:NewLabel(window, _, "$parentChangeMindNumeralLabel", "changemindNumeralLabel", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") @@ -713,7 +713,7 @@ local window_openned_at = time() local WesternNumbersCheckbox = g:NewSwitch (window, _, "WesternNumbersCheckbox", "WesternNumbersCheckbox", 20, 20, _, _, true) WesternNumbersCheckbox:SetAsCheckBox() WesternNumbersCheckbox:SetFixedParameter(1) - WesternNumbersCheckbox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + WesternNumbersCheckbox:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) WesternNumbersCheckbox:SetPoint("topleft", window, "topleft", 40, -130) window.WesternNumbersLabel:SetPoint("left", WesternNumbersCheckbox, "right", 2, 0) @@ -722,7 +722,7 @@ local window_openned_at = time() local AsianNumbersCheckbox = g:NewSwitch (window, _, "AsianNumbersCheckbox", "AsianNumbersCheckbox", 20, 20, _, _, true) AsianNumbersCheckbox:SetAsCheckBox() AsianNumbersCheckbox:SetFixedParameter(2) - AsianNumbersCheckbox:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + AsianNumbersCheckbox:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) AsianNumbersCheckbox:SetPoint("topleft", window, "topleft", 40, -200) window.AsianNumbersLabel:SetPoint("left", AsianNumbersCheckbox, "right", 2, 0) @@ -815,7 +815,7 @@ local window_openned_at = time() ampulheta:SetPoint("bottomright", window, "bottomright", -10, 10) ampulheta:SetHeight(125*3)--125 ampulheta:SetWidth(89*3)--82 - ampulheta:SetAlpha (.05) + ampulheta:SetAlpha(.05) ampulheta:SetTexCoord (1, 0, 0, 1) g:NewLabel(window, _, "$parentChangeMind2Label", "changemind2Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") @@ -832,7 +832,7 @@ local window_openned_at = time() local chronometer = g:NewSwitch (window, _, "WelcomeWindowChronometer", "WelcomeWindowChronometer", 20, 20, _, _, true) chronometer:SetAsCheckBox() chronometer:SetFixedParameter(1) - chronometer:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + chronometer:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.ChronometerLabel:SetPoint("left", chronometer, "right", 2, 0) --continuouses checkbox @@ -840,7 +840,7 @@ local window_openned_at = time() local continuous = g:NewSwitch (window, _, "WelcomeWindowContinuous", "WelcomeWindowContinuous", 20, 20, _, _, true) continuous:SetAsCheckBox() continuous:SetFixedParameter(1) - continuous:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + continuous:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.ContinuousLabel:SetPoint("left", continuous, "right", 2, 0) --on clkich chronomoeter checkbox @@ -915,7 +915,7 @@ local window_openned_at = time() pleasewait:Hide() pleasewait:SetText("") forward:Enable() - _detalhes:CancelTimer (window.free_frame3_schedule) + _detalhes:CancelTimer(window.free_frame3_schedule) window.free_frame3_schedule = nil end end @@ -923,7 +923,7 @@ local window_openned_at = time() if (window_openned_at-10 > time()) then forward:Disable() if (window.free_frame3_schedule) then - _detalhes:CancelTimer (window.free_frame3_schedule) + _detalhes:CancelTimer(window.free_frame3_schedule) window.free_frame3_schedule = nil end window.free_frame3_schedule = _detalhes:ScheduleRepeatingTimer ("FreeTutorialFrame3", 1) @@ -931,7 +931,7 @@ local window_openned_at = time() end) free_frame3:SetScript("OnHide", function() if (window.free_frame3_schedule) then - _detalhes:CancelTimer (window.free_frame3_schedule) + _detalhes:CancelTimer(window.free_frame3_schedule) window.free_frame3_schedule = nil pleasewait:SetText("") pleasewait:Hide() @@ -955,7 +955,7 @@ local window_openned_at = time() bg:SetPoint("bottomright", window, "bottomright", -10, 10) bg:SetHeight(125*3)--125 bg:SetWidth(89*3)--82 - bg:SetAlpha (.05) + bg:SetAlpha(.05) bg:SetTexCoord (1, 0, 0, 1) g:NewLabel(window, _, "$parentChangeMind4Label", "changemind4Label", Loc ["STRING_WELCOME_11"], "GameFontNormal", 9, "orange") @@ -992,7 +992,7 @@ local window_openned_at = time() 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:SetTemplate (g:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")) + window.updatespeedSlider:SetTemplate(g:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")) window.updatespeedSlider:SetThumbSize (50) window.updatespeedSlider.useDecimals = true local updateColor = function(slider, value) @@ -1027,7 +1027,7 @@ local window_openned_at = time() _detalhes:SetUseAnimations (value) end - window.animateSlider:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + window.animateSlider:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.animateSlider:SetAsCheckBox() --window.animateSlider.tooltip = Loc ["STRING_WELCOME_17"] --removed @@ -1042,7 +1042,7 @@ local window_openned_at = time() _detalhes:GetInstance(1):FastPSUpdate (value) end - window.DpsHpsSlider:SetTemplate (g:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")) + window.DpsHpsSlider:SetTemplate(g:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")) window.DpsHpsSlider:SetAsCheckBox() --window.DpsHpsSlider.tooltip = Loc ["STRING_WELCOME_64"] @@ -1054,7 +1054,7 @@ local window_openned_at = time() -- g:NewSlider (window, _, "$parentSlider", "segmentsSlider", 120, 20, 1, 25, 1, _detalhes.segments_amount) -- min, max, step, defaultv -- window.segmentsSlider:SetPoint("left", window.segmentsLabel, "right", 2, 0) -- window.segmentsSlider:SetHook("OnValueChange", function(self, _, amount) --slider, fixedValue, sliderValue - -- _detalhes.segments_amount = math.floor (amount) + -- _detalhes.segments_amount = math.floor(amount) -- end) -- window.segmentsSlider.tooltip = Loc ["STRING_WELCOME_22"] @@ -1064,14 +1064,14 @@ local window_openned_at = time() 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) + 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) - mech_icon2:SetAlpha (0.6) + mech_icon2:SetAlpha(0.6) mech_icon2:SetTexCoord (0, 1, 40/128, 1) mech_icon2:SetDrawLayer ("overlay", 2) @@ -1122,7 +1122,7 @@ local window_openned_at = time() bg6:SetPoint("bottomright", window, "bottomright", -10, 10) bg6:SetHeight(125*3)--125 bg6:SetWidth(89*3)--82 - bg6:SetAlpha (.1) + bg6:SetAlpha(.1) bg6:SetTexCoord (1, 0, 0, 1) local texto5 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1152,16 +1152,16 @@ local window_openned_at = time() stretch_frame_alert:SetScript("OnShow", function() local instance = _detalhes:GetInstance(1) _detalhes.OnEnterMainWindow(instance) - instance.baseframe.button_stretch:SetAlpha (1) + 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.animOut:Stop() frame_alert.alert.animIn:Play() if (_detalhes.stopwelcomealert) then - _detalhes:CancelTimer (_detalhes.stopwelcomealert) + _detalhes:CancelTimer(_detalhes.stopwelcomealert) end - _detalhes.stopwelcomealert = _detalhes:ScheduleTimer ("StopPlayStretchAlert", 30) + _detalhes.stopwelcomealert = _detalhes:ScheduleTimer("StopPlayStretchAlert", 30) end) @@ -1180,7 +1180,7 @@ local window_openned_at = time() bg6:SetPoint("bottomright", window, "bottomright", -10, 10) bg6:SetHeight(125*3)--125 bg6:SetWidth(89*3)--82 - bg6:SetAlpha (.1) + bg6:SetAlpha(.1) bg6:SetTexCoord (1, 0, 0, 1) local texto6 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1216,9 +1216,9 @@ local window_openned_at = time() frame_alert.alert.animOut:Stop() frame_alert.alert.animIn:Play() if (_detalhes.stopwelcomealert) then - _detalhes:CancelTimer (_detalhes.stopwelcomealert) + _detalhes:CancelTimer(_detalhes.stopwelcomealert) end - _detalhes.stopwelcomealert = _detalhes:ScheduleTimer ("StopPlayStretchAlert", 30) + _detalhes.stopwelcomealert = _detalhes:ScheduleTimer("StopPlayStretchAlert", 30) end) pages [#pages+1] = {bg6, texto6, instance_button_image, texto_instance_button, instance_frame_alert} @@ -1236,7 +1236,7 @@ local window_openned_at = time() bg7:SetPoint("bottomright", window, "bottomright", -10, 10) bg7:SetHeight(125*3)--125 bg7:SetWidth(89*3)--82 - bg7:SetAlpha (.1) + bg7:SetAlpha(.1) bg7:SetTexCoord (1, 0, 0, 1) local texto7 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1305,7 +1305,7 @@ local window_openned_at = time() bg77:SetPoint("bottomright", window, "bottomright", -10, 10) bg77:SetHeight(125*3)--125 bg77:SetWidth(89*3)--82 - bg77:SetAlpha (.1) + bg77:SetAlpha(.1) bg77:SetTexCoord (1, 0, 0, 1) local texto77 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1351,7 +1351,7 @@ local window_openned_at = time() bg88:SetPoint("bottomright", window, "bottomright", -10, 10) bg88:SetHeight(125*3)--125 bg88:SetWidth(89*3)--82 - bg88:SetAlpha (.1) + bg88:SetAlpha(.1) bg88:SetTexCoord (1, 0, 0, 1) local texto88 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1380,7 +1380,7 @@ local window_openned_at = time() _detalhes.tabela_historico:resetar() created_test_bars = 0 - local current_combat = _detalhes:GetCombat ("current") + local current_combat = _detalhes:GetCombat("current") local actors_classes = CLASS_SORT_ORDER local total_damage = 0 local total_heal = 0 @@ -1450,9 +1450,9 @@ local window_openned_at = time() frame_alert.alert.animOut:Stop() frame_alert.alert.animIn:Play() if (_detalhes.stopwelcomealert) then - _detalhes:CancelTimer (_detalhes.stopwelcomealert) + _detalhes:CancelTimer(_detalhes.stopwelcomealert) end - _detalhes.stopwelcomealert = _detalhes:ScheduleTimer ("StopPlayStretchAlert", 2) + _detalhes.stopwelcomealert = _detalhes:ScheduleTimer("StopPlayStretchAlert", 2) end) @@ -1474,7 +1474,7 @@ local window_openned_at = time() bg11:SetPoint("bottomright", window, "bottomright", -10, 10) bg11:SetHeight(125*3)--125 bg11:SetWidth(89*3)--82 - bg11:SetAlpha (.1) + bg11:SetAlpha(.1) bg11:SetTexCoord (1, 0, 0, 1) local texto11 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1513,7 +1513,7 @@ local window_openned_at = time() bg8:SetPoint("bottomright", window, "bottomright", -10, 10) bg8:SetHeight(125*3)--125 bg8:SetWidth(89*3)--82 - bg8:SetAlpha (.1) + bg8:SetAlpha(.1) bg8:SetTexCoord (1, 0, 0, 1) local texto8 = window:CreateFontString (nil, "overlay", "GameFontNormal") @@ -1535,7 +1535,7 @@ local window_openned_at = time() final_frame:Hide() final_frame:SetScript("OnShow", function() cancel:Enable() - cancel:GetNormalTexture():SetDesaturated (false) + cancel:GetNormalTexture():SetDesaturated(false) end) pages [#pages+1] = {bg8, texto8, texto, final_frame} diff --git a/functions/api2.lua b/functions/api2.lua index 4b86e252..cf424ad9 100644 --- a/functions/api2.lua +++ b/functions/api2.lua @@ -43,7 +43,7 @@ end --return the spell object and the spellId local getSpellObject = function(playerObject, spellId, isLiteral) - local parameterType = type (spellId) + local parameterType = type(spellId) if (parameterType == "number" and isLiteral) then --is the id of a spell and literal, directly get the spell object @@ -357,7 +357,7 @@ function Details.SegmentTotalDamage (segment) return 0 end - return floor (combatObject.totals_grupo [1]) + return floor(combatObject.totals_grupo [1]) end @@ -394,7 +394,7 @@ function Details.SegmentTotalHealing (segment) return 0 end - return floor (combatObject.totals_grupo [2]) + return floor(combatObject.totals_grupo [2]) end --[=[ @@ -654,7 +654,7 @@ function Details.UnitDamage (unitId, segment) return 0 end - return floor (playerObject.total or 0) + return floor(playerObject.total or 0) end @@ -714,7 +714,7 @@ function Details.UnitDamageByPhase (unitId, phaseNumber, segment) end local phaseDamage = damagePhaseData [unitName] or 0 - return floor (phaseDamage) + return floor(phaseDamage) end --[=[ @@ -771,10 +771,10 @@ function Details.UnitDamageInfo (unitId, segment) return damageInfo end - damageInfo.total = floor (playerObject.total) - damageInfo.totalWithoutPet = floor (playerObject.total_without_pet) - damageInfo.damageAbsorbed = floor (playerObject.totalabsorbed) - damageInfo.damageTaken = floor (playerObject.damage_taken) + damageInfo.total = floor(playerObject.total) + damageInfo.totalWithoutPet = floor(playerObject.total_without_pet) + damageInfo.damageAbsorbed = floor(playerObject.totalabsorbed) + damageInfo.damageTaken = floor(playerObject.damage_taken) damageInfo.friendlyFire = playerObject.friendlyfire_total damageInfo.activityTime = playerObject:Tempo() @@ -1092,7 +1092,7 @@ function Details.UnitDamageTaken (unitId, segment) return 0 end - return floor (playerObject.damage_taken) + return floor(playerObject.damage_taken) end --[=[ @@ -1202,7 +1202,7 @@ function Details.UnitDamageTakenFromSpell (unitId, spellId, isLiteral, segment) local damageContainer = combatObject:GetContainer (DETAILS_ATTRIBUTE_DAMAGE) local totalDamageTaken = 0 - if (isLiteral and type (spellId) == "number") then + if (isLiteral and type(spellId) == "number") then for i = 1, #damageContainer._ActorTable do for thisSpellId, spellObject in pairs(damageContainer._ActorTable [i].spells._ActorTable) do if (thisSpellId == spellId) then @@ -1437,7 +1437,7 @@ function Details.UnitHealing (unitId, segment) return 0 end - return floor (playerObject.total or 0) + return floor(playerObject.total or 0) end @@ -1498,14 +1498,14 @@ function Details.UnitHealingInfo (unitId, segment) return healingInfo end - healingInfo.total = floor (playerObject.total) - healingInfo.totalWithoutPet = floor (playerObject.total_without_pet) - healingInfo.totalOverhealWithoutPet = floor (playerObject.totalover_without_pet) - healingInfo.overhealing = floor (playerObject.totalover) - healingInfo.absorbed = floor (playerObject.totalabsorb) - healingInfo.healingDenied = floor (playerObject.totaldenied) - healingInfo.healingEnemy = floor (playerObject.heal_enemy_amt) - healingInfo.healingTaken = floor (playerObject.healing_taken) + healingInfo.total = floor(playerObject.total) + healingInfo.totalWithoutPet = floor(playerObject.total_without_pet) + healingInfo.totalOverhealWithoutPet = floor(playerObject.totalover_without_pet) + healingInfo.overhealing = floor(playerObject.totalover) + healingInfo.absorbed = floor(playerObject.totalabsorb) + healingInfo.healingDenied = floor(playerObject.totaldenied) + healingInfo.healingEnemy = floor(playerObject.heal_enemy_amt) + healingInfo.healingTaken = floor(playerObject.healing_taken) healingInfo.activityTime = playerObject:Tempo() return healingInfo @@ -1826,7 +1826,7 @@ function Details.UnitHealingTaken (unitId, segment) return 0 end - return floor (playerObject.healing_taken) + return floor(playerObject.healing_taken) end @@ -1941,7 +1941,7 @@ function Details.UnitHealingTakenFromSpell (unitId, spellId, isLiteral, segment) local healingContainer = combatObject:GetContainer (DETAILS_ATTRIBUTE_HEAL) local totalHealingTaken = 0 - if (isLiteral and type (spellId) == "number") then + if (isLiteral and type(spellId) == "number") then for i = 1, #healingContainer._ActorTable do for thisSpellId, spellObject in pairs(healingContainer._ActorTable [i].spells._ActorTable) do if (thisSpellId == spellId) then diff --git a/functions/attributes.lua b/functions/attributes.lua index c7efff13..335017fd 100644 --- a/functions/attributes.lua +++ b/functions/attributes.lua @@ -2,7 +2,7 @@ do local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) --Globals --[[global]] DETAILS_ATTRIBUTE_DAMAGE = 1 diff --git a/functions/boss.lua b/functions/boss.lua index 341e57e8..190c33ef 100644 --- a/functions/boss.lua +++ b/functions/boss.lua @@ -3,7 +3,7 @@ do local _detalhes = _G._detalhes _detalhes.EncounterInformation = {} - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --details api functions @@ -127,7 +127,7 @@ do if (t) then local _end = t.combat_end if (_end) then - return unpack (_end) + return unpack(_end) end end return @@ -167,15 +167,15 @@ do 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 @@ -230,7 +230,7 @@ do if (bosstables) then local bg = bosstables.backgroundFile if (bg) then - return bg.file, unpack (bg.coords) + return bg.file, unpack(bg.coords) end end end @@ -326,7 +326,7 @@ do end function _detalhes:GetInstanceEJID (mapid) - mapid = mapid or select (8, GetInstanceInfo()) + mapid = mapid or select(8, GetInstanceInfo()) if (mapid) then local instance_info = _detalhes.EncounterInformation [mapid] if (instance_info) then @@ -341,7 +341,7 @@ do local mapID = C_Map.GetBestMapForUnit ("player") if (not mapID) then - --print ("Details! exeption handled: zone has no map") + --print("Details! exeption handled: zone has no map") return end diff --git a/functions/bossmods.lua b/functions/bossmods.lua index 23edd158..5a5aee37 100644 --- a/functions/bossmods.lua +++ b/functions/bossmods.lua @@ -47,9 +47,9 @@ function Details:BossModsLink() Details:OnCombatPhaseChanged() encounterTable.phase = phase local currentCombat = Details:GetCurrentCombat() - local time = currentCombat:GetCombatTime() - if (time > 5) then - tinsert(currentCombat.PhaseData, {phase, time}) + local combatTime = currentCombat:GetCombatTime() + if (combatTime > 5) then + tinsert(currentCombat.PhaseData, {phase, combatTime}) end Details:SendEvent("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase) end @@ -71,15 +71,15 @@ function Details:BossModsLink() function Details:BigWigs_SetStage (event, module, phase) phase = tonumber(phase) - if (phase and type (phase) == "number" and Details.encounter_table.phase ~= phase) then + if (phase and type(phase) == "number" and Details.encounter_table.phase ~= phase) then Details:OnCombatPhaseChanged() Details.encounter_table.phase = phase - local cur_combat = Details:GetCurrentCombat() - local time = cur_combat:GetCombatTime() - if (time > 5) then - tinsert(cur_combat.PhaseData, {phase, time}) + local currentCombat = Details:GetCurrentCombat() + local combatTime = currentCombat:GetCombatTime() + if (combatTime > 5) then + tinsert(currentCombat.PhaseData, {phase, combatTime}) end Details:SendEvent("COMBAT_ENCOUNTER_PHASE_CHANGED", nil, phase) @@ -107,7 +107,7 @@ function Details:CreateCallbackListeners() 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, ...) + local encounterID, encounterName, difficultyID, raidSize = select(1, ...) current_encounter = encounterID elseif (event == "ENCOUNTER_END" or event == "PLAYER_REGEN_ENABLED") then diff --git a/functions/buff.lua b/functions/buff.lua index 3f762aca..527d6ade 100644 --- a/functions/buff.lua +++ b/functions/buff.lua @@ -6,7 +6,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ --initialize buffs name container _detalhes.Buffs.BuffsTable = {} -- armazenara o [nome do buff] = { tabela do buff } @@ -21,7 +21,7 @@ --local pointers local _pairs = pairs --lua local - local _ipairs = ipairs --lua local + local ipairs = ipairs --lua local ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --details api functions @@ -29,14 +29,14 @@ --return if the buff is already registred or not function _detalhes.Buffs:IsRegistred (buff) if (type(buff) == "number") then - for _, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do + for _, buffObject in _pairs(_detalhes.Buffs.BuffsTable) do if (buffObject.id == buff) then return true end end return false elseif (type(buff) == "string") then - for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do + for name, _ in _pairs(_detalhes.Buffs.BuffsTable) do if (name == buff) then return true end @@ -70,7 +70,7 @@ --return a list of registred buffs function _detalhes.Buffs:GetBuffList() local list = {} - for name, _ in _pairs (_detalhes.Buffs.BuffsTable) do + for name, _ in _pairs(_detalhes.Buffs.BuffsTable) do list [#list+1] = name end return list @@ -79,7 +79,7 @@ --return a list of registred buffs ids function _detalhes.Buffs:GetBuffListIds() local list = {} - for name, buffObject in _pairs (_detalhes.Buffs.BuffsTable) do + for name, buffObject in _pairs(_detalhes.Buffs.BuffsTable) do list [#list+1] = buffObject.id end return list @@ -126,7 +126,7 @@ 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 @@ -141,7 +141,7 @@ 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 - setmetatable (bufftable, _detalhes.Buffs) + setmetatable(bufftable, _detalhes.Buffs) return bufftable end @@ -153,7 +153,7 @@ _detalhes.Buffs:BuildTables() end - for _, BuffTable in _pairs (_detalhes.Buffs.BuffsTable) do + for _, BuffTable in _pairs(_detalhes.Buffs.BuffsTable) do if (BuffTable.active) then BuffTable.start = _detalhes._tempo BuffTable.castedAmt = 1 @@ -180,7 +180,7 @@ end --[[ - for index, BuffName in _pairs (_detalhes.SoloTables.BuffsTableNameCache) do + for index, BuffName in _pairs(_detalhes.SoloTables.BuffsTableNameCache) do if (BuffName == name) then local BuffObject = _detalhes.SoloTables.SoloBuffUptime [name] if (not BuffObject) then diff --git a/functions/classes.lua b/functions/classes.lua index 16c20881..a4071cc2 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -6,82 +6,82 @@ do -------- container que armazena o cache de pets _detalhes.container_pets = {} _detalhes.container_pets.__index = _detalhes.container_pets - setmetatable (_detalhes.container_pets, _detalhes) + setmetatable(_detalhes.container_pets, _detalhes) -------- time machine controla o tempo em combate dos jogadores _detalhes.timeMachine = {} _detalhes.timeMachine.__index = _detalhes.timeMachine - setmetatable (_detalhes.timeMachine, _detalhes) + setmetatable(_detalhes.timeMachine, _detalhes) -------- classe da tabela que armazenar� todos os combates efetuados _detalhes.historico = {} _detalhes.historico.__index = _detalhes.historico - setmetatable (_detalhes.historico, _detalhes) + setmetatable(_detalhes.historico, _detalhes) ---------------- classe da tabela onde ser�o armazenados cada combate efetuado _detalhes.combate = {} _detalhes.combate.__index = _detalhes.combate - setmetatable (_detalhes.combate, _detalhes.historico) + setmetatable(_detalhes.combate, _detalhes.historico) ------------------------ armazenas classes de jogadores ou outros derivados _detalhes.container_combatentes = {} _detalhes.container_combatentes.__index = _detalhes.container_combatentes - setmetatable (_detalhes.container_combatentes, _detalhes.combate) + setmetatable(_detalhes.container_combatentes, _detalhes.combate) -------------------------------- dano das habilidades. _detalhes.atributo_damage = {} _detalhes.atributo_damage.__index = _detalhes.atributo_damage - setmetatable (_detalhes.atributo_damage, _detalhes.container_combatentes) + setmetatable(_detalhes.atributo_damage, _detalhes.container_combatentes) -------------------------------- cura das habilidades. _detalhes.atributo_heal = {} _detalhes.atributo_heal.__index = _detalhes.atributo_heal - setmetatable (_detalhes.atributo_heal, _detalhes.container_combatentes) + setmetatable(_detalhes.atributo_heal, _detalhes.container_combatentes) -------------------------------- e_energy ganha _detalhes.atributo_energy = {} _detalhes.atributo_energy.__index = _detalhes.atributo_energy - setmetatable (_detalhes.atributo_energy, _detalhes.container_combatentes) + setmetatable(_detalhes.atributo_energy, _detalhes.container_combatentes) -------------------------------- outros atributos _detalhes.atributo_misc = {} _detalhes.atributo_misc.__index = _detalhes.atributo_misc - setmetatable (_detalhes.atributo_misc, _detalhes.container_combatentes) + setmetatable(_detalhes.atributo_misc, _detalhes.container_combatentes) -------------------------------- atributos customizados _detalhes.atributo_custom = {} _detalhes.atributo_custom.__index = _detalhes.atributo_custom - setmetatable (_detalhes.atributo_custom, _detalhes.container_combatentes) + setmetatable(_detalhes.atributo_custom, _detalhes.container_combatentes) -------------------------------- armazena as classes de habilidades usadas pelo combatente _detalhes.container_habilidades = {} _detalhes.container_habilidades.__index = _detalhes.container_habilidades - setmetatable (_detalhes.container_habilidades, _detalhes.combate) + setmetatable(_detalhes.container_habilidades, _detalhes.combate) ---------------------------------------- classe das habilidades que d�o cura _detalhes.habilidade_cura = {} _detalhes.habilidade_cura.__index = _detalhes.habilidade_cura - setmetatable (_detalhes.habilidade_cura, _detalhes.container_habilidades) + setmetatable(_detalhes.habilidade_cura, _detalhes.container_habilidades) ---------------------------------------- classe das habilidades que d�o danos _detalhes.habilidade_dano = {} _detalhes.habilidade_dano.__index = _detalhes.habilidade_dano - setmetatable (_detalhes.habilidade_dano, _detalhes.container_habilidades) + setmetatable(_detalhes.habilidade_dano, _detalhes.container_habilidades) ---------------------------------------- classe das habilidades que d�o e_energy _detalhes.habilidade_e_energy = {} _detalhes.habilidade_e_energy.__index = _detalhes.habilidade_e_energy - setmetatable (_detalhes.habilidade_e_energy, _detalhes.container_habilidades) + setmetatable(_detalhes.habilidade_e_energy, _detalhes.container_habilidades) ---------------------------------------- classe das habilidades variadas _detalhes.habilidade_misc = {} _detalhes.habilidade_misc.__index = _detalhes.habilidade_misc - setmetatable (_detalhes.habilidade_misc, _detalhes.container_habilidades) + setmetatable(_detalhes.habilidade_misc, _detalhes.container_habilidades) ---------------------------------------- classe dos alvos das habilidads _detalhes.alvo_da_habilidade = {} _detalhes.alvo_da_habilidade.__index = _detalhes.alvo_da_habilidade - setmetatable (_detalhes.alvo_da_habilidade, _detalhes.container_combatentes) + setmetatable(_detalhes.alvo_da_habilidade, _detalhes.container_combatentes) @@ -125,7 +125,7 @@ do end end - function _detalhes:GetOnlyName (string) + function _detalhes:GetOnlyName(string) if (string) then return string:gsub (("%-.*"), "") end @@ -139,7 +139,7 @@ do return self.nome:gsub ((" <.*"), "") end - function _detalhes:GetCLName (id) + function _detalhes:GetCLName(id) local name, realm = UnitName (id) if (name) then if (realm and realm ~= "") then diff --git a/functions/coach.lua b/functions/coach.lua index 790703ea..24333ebe 100644 --- a/functions/coach.lua +++ b/functions/coach.lua @@ -503,7 +503,7 @@ function Details.Coach.WelcomePanel() end, 80, 20, "Start Coaching!") startCoachButton:SetPoint("bottomright", welcomePanel, "bottomright", -10, 10) - startCoachButton:SetTemplate(DetailsFramework:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + startCoachButton:SetTemplate(DetailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) function welcomePanel.Update() local good = 0 diff --git a/functions/deathmenu.lua b/functions/deathmenu.lua index b3fd8c37..6bab9225 100644 --- a/functions/deathmenu.lua +++ b/functions/deathmenu.lua @@ -12,8 +12,8 @@ detailsOnDeathMenu.Debug = false detailsOnDeathMenu:RegisterEvent ("PLAYER_REGEN_ENABLED") detailsOnDeathMenu:RegisterEvent ("ENCOUNTER_END") -DetailsFramework:ApplyStandardBackdrop (detailsOnDeathMenu) -detailsOnDeathMenu:SetAlpha (0.75) +DetailsFramework:ApplyStandardBackdrop(detailsOnDeathMenu) +detailsOnDeathMenu:SetAlpha(0.75) --disable text detailsOnDeathMenu.disableLabel = Details.gump:CreateLabel(detailsOnDeathMenu, "you can disable this at /details > Raid Tools", 9) @@ -25,7 +25,7 @@ detailsOnDeathMenu.warningLabel:Hide() detailsOnDeathMenu:SetScript("OnEvent", function(self, event, ...) if (event == "ENCOUNTER_END") then - C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) + C_Timer.After(0.5, detailsOnDeathMenu.ShowPanel) end end) @@ -33,7 +33,7 @@ function detailsOnDeathMenu.OpenEncounterBreakdown() if (not Details:GetPlugin ("DETAILS_PLUGIN_ENCOUNTER_DETAILS")) then detailsOnDeathMenu.warningLabel.text = "Encounter Breakdown plugin is disabled! Please enable it in the Addon Control Panel." detailsOnDeathMenu.warningLabel:Show() - C_Timer.After (5, function() + C_Timer.After(5, function() detailsOnDeathMenu.warningLabel:Hide() end) end @@ -46,14 +46,14 @@ function detailsOnDeathMenu.OpenPlayerEndurance() if (not Details:GetPlugin ("DETAILS_PLUGIN_DEATH_GRAPHICS")) then detailsOnDeathMenu.warningLabel.text = "Advanced Death Logs plugin is disabled! Please enable it (or download) in the Addon Control Panel." detailsOnDeathMenu.warningLabel:Show() - C_Timer.After (5, function() + C_Timer.After(5, function() detailsOnDeathMenu.warningLabel:Hide() end) end DetailsPluginContainerWindow.OnMenuClick (nil, nil, "DETAILS_PLUGIN_DEATH_GRAPHICS", true) - C_Timer.After (0, function() + C_Timer.After(0, function() local a = Details_DeathGraphsModeEnduranceButton and Details_DeathGraphsModeEnduranceButton.MyObject:Click() end) @@ -67,7 +67,7 @@ function detailsOnDeathMenu.OpenPlayerSpells() local window3 = Details:GetWindow (3) local window4 = Details:GetWindow (4) - local assignedRole = UnitGroupRolesAssigned ("player") + local assignedRole = UnitGroupRolesAssigned("player") if (assignedRole == "HEALER") then if (window1 and window1:GetDisplay() == 2) then Details:OpenPlayerDetails(1) @@ -106,27 +106,27 @@ function detailsOnDeathMenu.OpenPlayerSpells() 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 = 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:Hide() detailsOnDeathMenu.breakdownButton.CoolTip = { Type = "tooltip", BuildFunc = function() - GameCooltip2:Preset (2) - GameCooltip2:AddLine ("Show a panel with:") - GameCooltip2:AddLine ("- Player Damage Taken") - GameCooltip2:AddLine ("- Damage Taken by Spell") - GameCooltip2:AddLine ("- Enemy Damage Taken") - GameCooltip2:AddLine ("- Player Deaths") - GameCooltip2:AddLine ("- Interrupts and Dispells") - GameCooltip2:AddLine ("- Damage Done Chart") - GameCooltip2:AddLine ("- Damage Per Phase") - GameCooltip2:AddLine ("- Weakauras Tool") + GameCooltip2:Preset(2) + GameCooltip2:AddLine("Show a panel with:") + GameCooltip2:AddLine("- Player Damage Taken") + GameCooltip2:AddLine("- Damage Taken by Spell") + GameCooltip2:AddLine("- Enemy Damage Taken") + GameCooltip2:AddLine("- Player Deaths") + GameCooltip2:AddLine("- Interrupts and Dispells") + GameCooltip2:AddLine("- Damage Done Chart") + GameCooltip2:AddLine("- Damage Per Phase") + GameCooltip2:AddLine("- Weakauras Tool") if (not Details:GetPlugin ("DETAILS_PLUGIN_ENCOUNTER_DETAILS")) then - GameCooltip2:AddLine ("Encounter Breakdown plugin is disabled in the Addon Control Panel.", "", 1, "red") + GameCooltip2:AddLine("Encounter Breakdown plugin is disabled in the Addon Control Panel.", "", 1, "red") end end, --called when user mouse over the frame @@ -150,24 +150,24 @@ detailsOnDeathMenu.breakdownButton.CoolTip = { 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 = 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:Hide() detailsOnDeathMenu.enduranceButton.CoolTip = { Type = "tooltip", BuildFunc = function() - GameCooltip2:Preset (2) - GameCooltip2:AddLine ("Open Player Endurance Breakdown") - GameCooltip2:AddLine ("") - GameCooltip2:AddLine ("Player endurance is calculated using the amount of player deaths.") - GameCooltip2:AddLine ("By default the plugin register the three first player deaths on each encounter to calculate who is under performing.") + GameCooltip2:Preset(2) + GameCooltip2:AddLine("Open Player Endurance Breakdown") + GameCooltip2:AddLine("") + GameCooltip2:AddLine("Player endurance is calculated using the amount of player deaths.") + GameCooltip2:AddLine("By default the plugin register the three first player deaths on each encounter to calculate who is under performing.") - --GameCooltip2:AddLine (" ") + --GameCooltip2:AddLine(" ") if (not Details:GetPlugin ("DETAILS_PLUGIN_DEATH_GRAPHICS")) then - 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") + 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 @@ -191,16 +191,16 @@ detailsOnDeathMenu.enduranceButton.CoolTip = { 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 = 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:Hide() detailsOnDeathMenu.spellsButton.CoolTip = { Type = "tooltip", BuildFunc = function() - GameCooltip2:Preset (2) - GameCooltip2:AddLine ("Open your player Details! breakdown.") + GameCooltip2:Preset(2) + GameCooltip2:AddLine("Open your player Details! breakdown.") end, --called when user mouse over the frame OnEnterFunc = function(self) @@ -239,13 +239,13 @@ function detailsOnDeathMenu.CanShowPanel() --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) + C_Timer.After(0.5, detailsOnDeathMenu.ShowPanel) return false end end if (Details.in_combat) then - C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) + C_Timer.After(0.5, detailsOnDeathMenu.ShowPanel) return false end @@ -292,7 +292,7 @@ end hooksecurefunc ("StaticPopup_Show", function(which, text_arg1, text_arg2, data, insertedFrame) if (which == "DEATH") then if (detailsOnDeathMenu.Debug) then - C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel) + C_Timer.After(0.5, detailsOnDeathMenu.ShowPanel) end end end) diff --git a/functions/deathrecap.lua b/functions/deathrecap.lua index 5e0afcd6..212279b4 100644 --- a/functions/deathrecap.lua +++ b/functions/deathrecap.lua @@ -2,7 +2,7 @@ local Details = _G.Details local textAlpha = 0.9 -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local L = AceLocale:GetLocale ( "Details" ) local on_deathrecap_line_enter = function(self) @@ -12,10 +12,10 @@ local on_deathrecap_line_enter = function(self) self:SetBackdropColor(.3, .3, .3, .2) GameTooltip:Show() self.backgroundTextureOverlay:Show() - self.timeAt:SetAlpha (1) - self.sourceName:SetAlpha (1) - self.amount:SetAlpha (1) - self.lifePercent:SetAlpha (1) + self.timeAt:SetAlpha(1) + self.sourceName:SetAlpha(1) + self.amount:SetAlpha(1) + self.lifePercent:SetAlpha(1) end end @@ -23,10 +23,10 @@ local on_deathrecap_line_leave = function(self) GameTooltip:Hide() self:SetBackdropColor(.3, .3, .3, 0) self.backgroundTextureOverlay:Hide() - self.timeAt:SetAlpha (textAlpha) - self.sourceName:SetAlpha (textAlpha) - self.amount:SetAlpha (textAlpha) - self.lifePercent:SetAlpha (textAlpha) + self.timeAt:SetAlpha(textAlpha) + self.sourceName:SetAlpha(textAlpha) + self.amount:SetAlpha(textAlpha) + self.lifePercent:SetAlpha(textAlpha) end local create_deathrecap_line = function(parent, n) @@ -79,10 +79,10 @@ local create_deathrecap_line = function(parent, n) Details.gump:SetFontSize (sourceName, 10) --text alpha - timeAt:SetAlpha (textAlpha) - sourceName:SetAlpha (textAlpha) - amount:SetAlpha (textAlpha) - lifePercent:SetAlpha (textAlpha) + timeAt:SetAlpha(textAlpha) + sourceName:SetAlpha(textAlpha) + amount:SetAlpha(textAlpha) + lifePercent:SetAlpha(textAlpha) --text setup amount:SetWidth(85) @@ -97,13 +97,13 @@ local create_deathrecap_line = function(parent, n) backgroundTexture:SetTexture([[Interface\AddOns\Details\images\deathrecap_background]]) backgroundTexture:SetTexCoord (0, 1, 0, 1) - backgroundTexture:SetVertexColor (.1, .1, .1, .3) + backgroundTexture:SetVertexColor(.1, .1, .1, .3) --top border 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:SetVertexColor(.1, .1, .1, .3) TopFader:SetPoint("bottomleft", backgroundTexture, "topleft", 0, -0) TopFader:SetPoint("bottomright", backgroundTexture, "topright", 0, -0) TopFader:SetHeight(32) @@ -115,24 +115,24 @@ local create_deathrecap_line = function(parent, n) 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:SetVertexColor(.1, .1, .1, .3) 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) + backgroundTexture:SetVertexColor(.2, .1, .1, .3) end backgroundTexture:SetPoint("topleft", 0, 1) backgroundTexture:SetPoint("bottomright", 0, -1) - backgroundTexture:SetDesaturated (true) + backgroundTexture:SetDesaturated(true) backgroundTextureOverlay:SetTexture([[Interface\AdventureMap\AdventureMap]]) backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024) backgroundTextureOverlay:SetAllPoints() - backgroundTextureOverlay:SetDesaturated (true) - backgroundTextureOverlay:SetAlpha (0.5) + backgroundTextureOverlay:SetDesaturated(true) + backgroundTextureOverlay:SetAlpha(0.5) backgroundTextureOverlay:Hide() line.timeAt = timeAt @@ -173,7 +173,7 @@ function Details.BuildDeathTableFromRecap (recapID) {}, --deathlog events (events [1] and events [1].timestamp) or (DeathRecapFrame and DeathRecapFrame.DeathTimeStamp) or 0, --time of death UnitName ("player"), - select (2, UnitClass ("player")), + select(2, UnitClass ("player")), UnitHealthMax ("player"), "0m 0s", --formated fight time ["dead"] = true, @@ -272,7 +272,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) 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:SetPoint("topright", DeathRecapFrame, "topright", (-abs(i-6) * 22) - 10, -5) local text = segmentButton:CreateFontString (nil, "overlay", "GameFontNormal") segmentButton.text = text @@ -398,7 +398,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) end) for i = #BiggestDamageHits, 1, -1 do if (BiggestDamageHits [i][4] + relevanceTime < timeOfDeath) then - tremove (BiggestDamageHits, i) + tremove(BiggestDamageHits, i) end end @@ -449,7 +449,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) else --cut table to show only 10 events while (#BiggestDamageHits > 10) do - tremove (BiggestDamageHits, 11) + tremove(BiggestDamageHits, 11) end end @@ -474,7 +474,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) local event = events [i] local evType = event [1] - local hp = min (floor (event [5] / maxHP * 100), 100) + local hp = min (floor(event [5] / maxHP * 100), 100) local spellName, _, spellIcon = Details.GetSpellInfo(event [2]) local amount = event [3] local eventTime = event [4] @@ -500,7 +500,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) if (not sourceClass) then local combat = Details:GetCurrentCombat() if (combat) then - local sourceActor = combat:GetActor (1, source) + local sourceActor = combat:GetActor(1, source) if (sourceActor) then sourceClass = sourceActor.classe end @@ -510,7 +510,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) if (not sourceSpec) then local combat = Details:GetCurrentCombat() if (combat) then - local sourceActor = combat:GetActor (1, source) + local sourceActor = combat:GetActor(1, source) if (sourceActor) then sourceSpec = sourceActor.spec end @@ -518,7 +518,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) end --remove real name or owner name - source = Details:GetOnlyName (source) + source = Details:GetOnlyName(source) --remove owner name source = source:gsub ((" <.*"), "") @@ -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 @@ -556,8 +556,8 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat) --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 .. "%") diff --git a/functions/dungeon.lua b/functions/dungeon.lua index 8a6dc5a9..5e249c37 100644 --- a/functions/dungeon.lua +++ b/functions/dungeon.lua @@ -22,14 +22,13 @@ Should the chart data be volatile? local mythicDungeonCharts = Details:CreateEventListener() _G.DetailsMythicDungeonChartHandler = mythicDungeonCharts -function mythicDungeonCharts:Debug (...) +function mythicDungeonCharts:Debug(...) if (debugmode or verbosemode) then - print ("Details! DungeonCharts: ", ...) + print("Details! DungeonCharts: ", ...) end end local addPlayerDamage = function(unitName, unitRealm) - --get the combatlog name local CLName if (unitRealm and unitRealm ~= "") then @@ -37,91 +36,90 @@ local addPlayerDamage = function(unitName, unitRealm) else CLName = unitName end - + --get the player data local playerData = mythicDungeonCharts.ChartTable.Players [CLName] - + --if this is the first tick for the player, ignore the damage done on this tick --this is done to prevent a tick tick with all the damage the player did on the previous segment local bIsFirstTick = false - + --check if the player data doesn't exists if (not playerData) then playerData = { Name = unitName, ChartData = {max_value = 0}, - Class = select (2, UnitClass (CLName)), - + Class = select(2, UnitClass (CLName)), + --spec zero for now, need to retrive later during combat Spec = 0, - + --last damage to calc difference LastDamage = 0, - + --if started a new combat, need to reset the lastdamage LastCombatID = -1, } - + mythicDungeonCharts.ChartTable.Players [CLName] = playerData bIsFirstTick = true end - + --get the current combat - local currentCombat = Details:GetCombat (DETAILS_SEGMENTID_CURRENT) + local currentCombat = Details:GetCombat(DETAILS_SEGMENTID_CURRENT) if (currentCombat) then - local isOverallSegment = false - + local mythicDungeonInfo = currentCombat.is_mythic_dungeon if (mythicDungeonInfo) then if (mythicDungeonInfo.TrashOverallSegment or mythicDungeonInfo.OverallSegment) then isOverallSegment = true end end - + if (not isOverallSegment) then --check if the combat has changed local segmentId = currentCombat.combat_id if (segmentId ~= playerData.LastCombatID) then playerData.LastDamage = 0 playerData.LastCombatID = segmentId - - --mythicDungeonCharts:Debug ("Combat changed for player", CLName) + + --mythicDungeonCharts:Debug("Combat changed for player", CLName) end - local actorTable = currentCombat:GetActor (DETAILS_ATTRIBUTE_DAMAGE, CLName) + local actorTable = currentCombat:GetActor(DETAILS_ATTRIBUTE_DAMAGE, CLName) if (actorTable) then --update the player spec playerData.Spec = actorTable.spec - + if (bIsFirstTick) then --ignore previous damage playerData.LastDamage = actorTable.total end - + --get the damage done local damageDone = actorTable.total - + --check which data is used, dps or damage done if (CONST_USE_PLAYER_EDPS) then local eDps = damageDone / currentCombat:GetCombatTime() - + --add the damage to the chart table tinsert(playerData.ChartData, eDps) - --mythicDungeonCharts:Debug ("Added dps for " , CLName, ":", eDps) - + --mythicDungeonCharts:Debug("Added dps for " , CLName, ":", eDps) + if (eDps > playerData.ChartData.max_value) then playerData.ChartData.max_value = eDps end else --calc the difference and add to the table - local damageDiff = floor (damageDone - playerData.LastDamage) - playerData.LastDamage = damageDone - + local damageDiff = floor(damageDone - playerData.LastDamage) + playerData.LastDamage = damageDone + --add the damage to the chart table tinsert(playerData.ChartData, damageDiff) - --mythicDungeonCharts:Debug ("Added damage for " , CLName, ":", damageDiff) - + --mythicDungeonCharts:Debug("Added damage for " , CLName, ":", damageDiff) + if (damageDiff > playerData.ChartData.max_value) then playerData.ChartData.max_value = damageDiff end @@ -135,76 +133,73 @@ local addPlayerDamage = function(unitName, unitRealm) end local tickerCallback = function(tickerObject) - --check if is inside the dungeon - local inInstance = IsInInstance(); + local inInstance = IsInInstance() if (not inInstance) then mythicDungeonCharts:OnEndMythicDungeon() return end - + --check if still running the dungeon if (not mythicDungeonCharts.ChartTable or not mythicDungeonCharts.ChartTable.Running) then tickerObject:Cancel() return end - + --tick damage local totalPlayers = GetNumGroupMembers() for i = 1, totalPlayers-1 do local unitName, unitRealm = UnitName ("party" .. i) if (unitName) then - addPlayerDamage (unitName, unitRealm) + addPlayerDamage(unitName, unitRealm) end end - - addPlayerDamage (UnitName ("player")) + + addPlayerDamage(UnitName ("player")) end function mythicDungeonCharts:OnBossDefeated() - local currentCombat = Details:GetCurrentCombat() local segmentType = currentCombat:GetCombatType() local bossInfo = currentCombat:GetBossInfo() local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo() - + if (mythicLevel and mythicLevel > 0) then if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) tinsert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) - mythicDungeonCharts:Debug ("Boss defeated, time saved", currentCombat:GetCombatTime()) + mythicDungeonCharts:Debug("Boss defeated, time saved", currentCombat:GetCombatTime()) else if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.EndTime ~= -1) then local now = time() --check if the dungeon just ended if (mythicDungeonCharts.ChartTable.EndTime + 2 >= now) then - + if (bossInfo) then local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) tinsert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) - mythicDungeonCharts:Debug ("Boss defeated, time saved, but used time aproximation:", mythicDungeonCharts.ChartTable.EndTime + 2, now, currentCombat:GetCombatTime()) + mythicDungeonCharts:Debug("Boss defeated, time saved, but used time aproximation:", mythicDungeonCharts.ChartTable.EndTime + 2, now, currentCombat:GetCombatTime()) end end else - mythicDungeonCharts:Debug ("Boss defeated, but no chart capture is running") + mythicDungeonCharts:Debug("Boss defeated, but no chart capture is running") end end else - mythicDungeonCharts:Debug ("Boss defeated, but isn't a mythic dungeon boss fight") + mythicDungeonCharts:Debug("Boss defeated, but isn't a mythic dungeon boss fight") end end function mythicDungeonCharts:OnStartMythicDungeon() - if (not Details.mythic_plus.show_damage_graphic) then - mythicDungeonCharts:Debug ("Dungeon started, no capturing mythic dungeon chart data, disabled on profile") + mythicDungeonCharts:Debug("Dungeon started, no capturing mythic dungeon chart data, disabled on profile") if (verbosemode) then - mythicDungeonCharts:Debug ("OnStartMythicDungeon() not allowed") + mythicDungeonCharts:Debug("OnStartMythicDungeon() not allowed") end return else - mythicDungeonCharts:Debug ("Dungeon started, new capture started") + mythicDungeonCharts:Debug("Dungeon started, new capture started") end mythicDungeonCharts.ChartTable = { @@ -218,22 +213,22 @@ function mythicDungeonCharts:OnStartMythicDungeon() --store when each boss got defeated in comparison with the StartTime BossDefeated = {}, } - - mythicDungeonCharts.ChartTable.Ticker = C_Timer.NewTicker (1, tickerCallback) - + + mythicDungeonCharts.ChartTable.Ticker = C_Timer.NewTicker(1, tickerCallback) + --save the chart for development if (debugmode) then _detalhes.mythic_plus.last_mythicrun_chart = mythicDungeonCharts.ChartTable end if (verbosemode) then - mythicDungeonCharts:Debug ("OnStartMythicDungeon() success") + mythicDungeonCharts:Debug("OnStartMythicDungeon() success") end end function mythicDungeonCharts:OnEndMythicDungeon() if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running) then - + --stop capturinfg mythicDungeonCharts.ChartTable.Running = false mythicDungeonCharts.ChartTable.ElapsedTime = time() - mythicDungeonCharts.ChartTable.StartTime @@ -242,28 +237,28 @@ 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. local isInsideDungeon = IsInInstance() if (not isInsideDungeon) then - mythicDungeonCharts:Debug ("OnEndMythicDungeon() player wasn't inside the dungeon.") + mythicDungeonCharts:Debug("OnEndMythicDungeon() player wasn't inside the dungeon.") return end - - mythicDungeonCharts:Debug ("Dungeon ended successfully, chart data capture stopped, scheduling to open the window.") - + + mythicDungeonCharts:Debug("Dungeon ended successfully, chart data capture stopped, scheduling to open the 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) - + C_Timer.After(_detalhes.mythic_plus.delay_to_show_graphic or 5, mythicDungeonCharts.ShowReadyPanel) + if (verbosemode) then - mythicDungeonCharts:Debug ("OnEndMythicDungeon() success!") + mythicDungeonCharts:Debug("OnEndMythicDungeon() success!") end else - mythicDungeonCharts:Debug ("Dungeon ended, no chart data was running") + mythicDungeonCharts:Debug("Dungeon ended, no chart data was running") if (verbosemode) then - mythicDungeonCharts:Debug ("OnEndMythicDungeon() fail") + mythicDungeonCharts:Debug("OnEndMythicDungeon() fail") end end end @@ -277,108 +272,99 @@ mythicDungeonCharts:RegisterEvent ("COMBAT_BOSS_DEFEATED", "OnBossDefeated") --show a small panel telling the chart is ready to show function mythicDungeonCharts.ShowReadyPanel() - --check if is enabled if (not _detalhes.mythic_plus.show_damage_graphic) then return end - + --create the panel if (not mythicDungeonCharts.ReadyFrame) then mythicDungeonCharts.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate") - local f = mythicDungeonCharts.ReadyFrame - - 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) - DetailsFramework:ApplyStandardBackdrop (f) - DetailsFramework:CreateTitleBar (f, "Details! Damage Graphic for M+") + local readyFrame = mythicDungeonCharts.ReadyFrame + + readyFrame:SetSize(255, 80) + readyFrame:SetPoint("center", UIParent, "center", 300, 0) + readyFrame:SetFrameStrata("LOW") + readyFrame:EnableMouse(true) + readyFrame:SetMovable(true) + DetailsFramework:ApplyStandardBackdrop(readyFrame) + DetailsFramework:CreateTitleBar (readyFrame, "Details! Damage Graphic for M+") + + readyFrame:Hide() - f:Hide() - --register to libwindow - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, Details.mythic_plus.mythicrun_chart_frame_ready) - LibWindow.RestorePosition (f) - LibWindow.MakeDraggable (f) - LibWindow.SavePosition (f) - + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(readyFrame, Details.mythic_plus.mythicrun_chart_frame_ready) + LibWindow.RestorePosition(readyFrame) + LibWindow.MakeDraggable(readyFrame) + LibWindow.SavePosition(readyFrame) + --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) - + readyFrame.ShowButton = DetailsFramework:CreateButton(readyFrame, function() mythicDungeonCharts.ShowChart(); readyFrame:Hide() end, 80, 20, Loc ["STRING_SLASH_SHOW"]) + readyFrame.ShowButton:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + readyFrame.ShowButton:SetPoint("topright", readyFrame, "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) - + readyFrame.DiscartButton = DetailsFramework:CreateButton(readyFrame, function() readyFrame:Hide() end, 80, 20, Loc ["STRING_DISCARD"]) + readyFrame.DiscartButton:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + readyFrame.DiscartButton:SetPoint("right", readyFrame.ShowButton, "left", -5, 0) + --disable feature check box (dont show this again) local on_switch_enable = function(self, _, value) _detalhes.mythic_plus.show_damage_graphic = not value end - local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch (f, on_switch_enable, not _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, Loc ["STRING_MINITUTORIAL_BOOKMARK4"], DetailsFramework:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft") + + local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch(readyFrame, 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) + notAgainSwitch:SetPoint("bottomleft", readyFrame, "bottomleft", 5, 5) notAgainSwitch:SetAsCheckBox() end - + mythicDungeonCharts.ReadyFrame:Show() end function mythicDungeonCharts.ShowChart() - if (not mythicDungeonCharts.Frame) then - mythicDungeonCharts.Frame = CreateFrame("frame", "DetailsMythicDungeonChartFrame", UIParent, "BackdropTemplate") - local f = mythicDungeonCharts.Frame - - 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) - + local dungeonChartFrame = mythicDungeonCharts.Frame + + dungeonChartFrame:SetSize(1200, 620) + dungeonChartFrame:SetPoint("center", UIParent, "center", 0, 0) + dungeonChartFrame:SetFrameStrata("LOW") + dungeonChartFrame:EnableMouse(true) + dungeonChartFrame:SetMovable(true) + DetailsFramework:ApplyStandardBackdrop(dungeonChartFrame) + --minimized frame mythicDungeonCharts.FrameMinimized = CreateFrame("frame", "DetailsMythicDungeonChartFrameminimized", UIParent, "BackdropTemplate") local fMinimized = mythicDungeonCharts.FrameMinimized - + 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:EnableMouse(true) + fMinimized:SetMovable(true) fMinimized:Hide() - - f.IsMinimized = false - + DetailsFramework:ApplyStandardBackdrop(fMinimized) + + dungeonChartFrame.IsMinimized = false + --titlebar - local titlebar = CreateFrame("frame", nil, f, "BackdropTemplate") - titlebar:SetPoint("topleft", f, "topleft", 2, -3) - titlebar:SetPoint("topright", f, "topright", -2, -3) + local titlebar = CreateFrame("frame", nil, dungeonChartFrame, "BackdropTemplate") + titlebar:SetPoint("topleft", dungeonChartFrame, "topleft", 2, -3) + titlebar:SetPoint("topright", dungeonChartFrame, "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) - f.TitleText = titleLabel - + dungeonChartFrame.TitleText = titleLabel + --titlebar when minimized local titlebarMinimized = CreateFrame("frame", nil, fMinimized, "BackdropTemplate") titlebarMinimized:SetPoint("topleft", fMinimized, "topleft", 2, -3) @@ -387,208 +373,204 @@ function mythicDungeonCharts.ShowChart() 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) - f.TitleTextMinimized = titleLabelMinimized - - _detalhes:FormatBackground (f) - _detalhes:FormatBackground (fMinimized) - - tinsert(UISpecialFrames, "DetailsMythicDungeonChartFrame") - - --register to libwindow - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (f, Details.mythic_plus.mythicrun_chart_frame) - LibWindow.RestorePosition (f) - LibWindow.MakeDraggable (f) - LibWindow.SavePosition (f) - - LibWindow.RegisterConfig (fMinimized, Details.mythic_plus.mythicrun_chart_frame_minimized) - LibWindow.RestorePosition (fMinimized) - LibWindow.MakeDraggable (fMinimized) - LibWindow.SavePosition (fMinimized) - - f.ChartFrame = Details:GetFramework():CreateChartPanel (f, 1200, 600, "DetailsMythicDungeonChartGraphicFrame") - f.ChartFrame:SetPoint("topleft", f, "topleft", 5, -20) - - f.ChartFrame.FrameInUse = {} - f.ChartFrame.FrameFree = {} - f.ChartFrame.TextureID = 1 - - f.ChartFrame.ShowHeader = true - f.ChartFrame.HeaderOnlyIndicator = true - f.ChartFrame.HeaderShowOverlays = false - - 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:EnableMouse (false) - - f.ChartFrame.CloseButton:Hide() - - 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:SetTexCoord (17/64, 32/64, 0, 1) - f.BossWidgetsFrame.GraphPin:SetSize(16, 16) - - 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) + dungeonChartFrame.TitleTextMinimized = titleLabelMinimized - f:Hide() - - function f.ShowChartFrame() - if (f.IsMinimized) then - f.IsMinimized = false + tinsert(UISpecialFrames, "DetailsMythicDungeonChartFrame") + + --register to libwindow + local LibWindow = LibStub("LibWindow-1.1") + LibWindow.RegisterConfig(dungeonChartFrame, Details.mythic_plus.mythicrun_chart_frame) + LibWindow.RestorePosition(dungeonChartFrame) + LibWindow.MakeDraggable(dungeonChartFrame) + LibWindow.SavePosition(dungeonChartFrame) + + LibWindow.RegisterConfig(fMinimized, Details.mythic_plus.mythicrun_chart_frame_minimized) + LibWindow.RestorePosition(fMinimized) + LibWindow.MakeDraggable(fMinimized) + LibWindow.SavePosition(fMinimized) + + dungeonChartFrame.ChartFrame = Details:GetFramework():CreateChartPanel(dungeonChartFrame, 1200, 600, "DetailsMythicDungeonChartGraphicFrame") + dungeonChartFrame.ChartFrame:SetPoint("topleft", dungeonChartFrame, "topleft", 5, -20) + + dungeonChartFrame.ChartFrame.FrameInUse = {} + dungeonChartFrame.ChartFrame.FrameFree = {} + dungeonChartFrame.ChartFrame.TextureID = 1 + + dungeonChartFrame.ChartFrame.ShowHeader = true + dungeonChartFrame.ChartFrame.HeaderOnlyIndicator = true + dungeonChartFrame.ChartFrame.HeaderShowOverlays = false + + dungeonChartFrame.ChartFrame.Graphic.DrawLine = mythicDungeonCharts.CustomDrawLine + + dungeonChartFrame.ChartFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + dungeonChartFrame.ChartFrame:SetBackdropColor(0, 0, 0, 0.0) + dungeonChartFrame.ChartFrame:SetBackdropBorderColor(0, 0, 0, 0) + + dungeonChartFrame.ChartFrame:EnableMouse(false) + + dungeonChartFrame.ChartFrame.CloseButton:Hide() + + dungeonChartFrame.BossWidgetsFrame = CreateFrame("frame", "$parentBossFrames", dungeonChartFrame, "BackdropTemplate") + dungeonChartFrame.BossWidgetsFrame:SetFrameLevel(dungeonChartFrame:GetFrameLevel()+10) + dungeonChartFrame.BossWidgetsFrame.Widgets = {} + + dungeonChartFrame.BossWidgetsFrame.GraphPin = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay") + dungeonChartFrame.BossWidgetsFrame.GraphPin:SetTexture([[Interface\BUTTONS\UI-RadioButton]]) + dungeonChartFrame.BossWidgetsFrame.GraphPin:SetTexCoord (17/64, 32/64, 0, 1) + dungeonChartFrame.BossWidgetsFrame.GraphPin:SetSize(16, 16) + + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "artwork") + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetTexture([[Interface\Calendar\EventNotificationGlow]]) + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetTexCoord (0, 1, 0, 1) + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetSize(14, 14) + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetBlendMode("ADD") + dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetPoint("center", dungeonChartFrame.BossWidgetsFrame.GraphPin, "center", 0, 0) + + dungeonChartFrame:Hide() + + function dungeonChartFrame.ShowChartFrame() + if (dungeonChartFrame.IsMinimized) then + dungeonChartFrame.IsMinimized = false fMinimized:Hide() - f:Show() + dungeonChartFrame:Show() else - f:Show() + dungeonChartFrame:Show() end end - - local closeButton = CreateFrame("button", "$parentCloseButton", f, "UIPanelCloseButton") - closeButton:GetNormalTexture():SetDesaturated (true) + + local closeButton = CreateFrame("button", "$parentCloseButton", dungeonChartFrame, "UIPanelCloseButton") + closeButton:GetNormalTexture():SetDesaturated(true) 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") - minimizeButton:GetNormalTexture():SetDesaturated (true) + closeButton:SetPoint("topright", dungeonChartFrame, "topright", 0, -1) + closeButton:SetFrameLevel(dungeonChartFrame:GetFrameLevel()+16) + + local minimizeButton = CreateFrame("button", "$parentCloseButton", dungeonChartFrame, "UIPanelCloseButton") + minimizeButton:GetNormalTexture():SetDesaturated(true) minimizeButton:SetWidth(24) minimizeButton:SetHeight(24) minimizeButton:SetPoint("right", closeButton, "left", 2, 0) - minimizeButton:SetFrameLevel (f:GetFrameLevel()+16) + minimizeButton:SetFrameLevel(dungeonChartFrame: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]]) - + local closeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") - closeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true) + closeButtonWhenMinimized:GetNormalTexture():SetDesaturated(true) closeButtonWhenMinimized:SetWidth(24) closeButtonWhenMinimized:SetHeight(24) closeButtonWhenMinimized:SetPoint("topright", fMinimized, "topright", 0, -1) - closeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16) - + closeButtonWhenMinimized:SetFrameLevel(fMinimized:GetFrameLevel()+16) + local minimizeButtonWhenMinimized = CreateFrame("button", "$parentCloseButton", fMinimized, "UIPanelCloseButton") - minimizeButtonWhenMinimized:GetNormalTexture():SetDesaturated (true) + minimizeButtonWhenMinimized:GetNormalTexture():SetDesaturated(true) minimizeButtonWhenMinimized:SetWidth(24) minimizeButtonWhenMinimized:SetHeight(24) minimizeButtonWhenMinimized:SetPoint("right", closeButtonWhenMinimized, "left", 2, 0) - minimizeButtonWhenMinimized:SetFrameLevel (fMinimized:GetFrameLevel()+16) + 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]]) - + closeButtonWhenMinimized:SetScript("OnClick", function() - f.IsMinimized = false + dungeonChartFrame.IsMinimized = false fMinimized:Hide() minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) end) - + --replace the default click function local minimize_func = function(self) - if (f.IsMinimized) then - f.IsMinimized = false + if (dungeonChartFrame.IsMinimized) then + dungeonChartFrame.IsMinimized = false fMinimized:Hide() - f:Show() + dungeonChartFrame:Show() minimizeButtonWhenMinimized:SetNormalTexture([[Interface\BUTTONS\UI-Panel-HideButton-Up]]) minimizeButtonWhenMinimized:SetPushedTexture([[Interface\BUTTONS\UI-Panel-HideButton-Down]]) else - f.IsMinimized = true - f:Hide() + dungeonChartFrame.IsMinimized = true + dungeonChartFrame:Hide() fMinimized:Show() 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) - + --enabled box -- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame() local on_switch_enable = function(_, _, state) _detalhes.mythic_plus.show_damage_graphic = state end - local enabledSwitch, enabledLabel = Details.gump:CreateSwitch (f, on_switch_enable, _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, "Enabled", Details.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft") + local enabledSwitch, enabledLabel = Details.gump:CreateSwitch(dungeonChartFrame, 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") - enabledSwitch.checked_texture:SetVertexColor (.75, .75, .75) - - local leftDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay") - leftDivisorLine:SetSize(2, f.ChartFrame.Graphic:GetHeight()) + enabledSwitch.checked_texture:SetVertexColor(.75, .75, .75) + + local leftDivisorLine = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay") + leftDivisorLine:SetSize(2, dungeonChartFrame.ChartFrame.Graphic:GetHeight()) leftDivisorLine:SetColorTexture (1, 1, 1, 1) - leftDivisorLine:SetPoint("bottomleft", f.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0) - - local bottomDivisorLine = f.BossWidgetsFrame:CreateTexture(nil, "overlay") - bottomDivisorLine:SetSize(f.ChartFrame.Graphic:GetWidth(), 2) + leftDivisorLine:SetPoint("bottomleft", dungeonChartFrame.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0) + + local bottomDivisorLine = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay") + bottomDivisorLine:SetSize(dungeonChartFrame.ChartFrame.Graphic:GetWidth(), 2) bottomDivisorLine:SetColorTexture (1, 1, 1, 1) - 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) - - function f.ChartFrame.RefreshBossTimeline (self, bossTable, elapsedTime) - + bottomDivisorLine:SetPoint("bottomleft", dungeonChartFrame.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0) + + dungeonChartFrame.ChartFrame.Graphic:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) + dungeonChartFrame.ChartFrame.Graphic:SetBackdropColor(.5, .50, .50, 0.8) + dungeonChartFrame.ChartFrame.Graphic:SetBackdropBorderColor(0, 0, 0, 0.5) + + function dungeonChartFrame.ChartFrame.RefreshBossTimeline(self, bossTable, elapsedTime) for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do - - local bossWidget = f.BossWidgetsFrame.Widgets [i] + local bossWidget = dungeonChartFrame.BossWidgetsFrame.Widgets [i] + if (not bossWidget) then - local newBossWidget = CreateFrame("frame", "$parentBossWidget" .. i, f.BossWidgetsFrame, "BackdropTemplate") + local newBossWidget = CreateFrame("frame", "$parentBossWidget" .. i, dungeonChartFrame.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") + + local bossAvatar = Details:GetFramework():CreateImage(newBossWidget, "", 64, 32, "border") bossAvatar:SetPoint("bottomleft", newBossWidget, "bottomleft", 0, 0) newBossWidget.AvatarTexture = bossAvatar - - local verticalLine = Details:GetFramework():CreateImage (newBossWidget, "", 1, f.ChartFrame.Graphic:GetHeight(), "overlay") + + local verticalLine = Details:GetFramework():CreateImage(newBossWidget, "", 1, dungeonChartFrame.ChartFrame.Graphic:GetHeight(), "overlay") verticalLine:SetColorTexture (1, 1, 1, 0.3) verticalLine:SetPoint("bottomleft", 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") + + 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) - - f.BossWidgetsFrame.Widgets [i] = newBossWidget + + dungeonChartFrame.BossWidgetsFrame.Widgets [i] = newBossWidget bossWidget = newBossWidget end - - local chartLength = f.ChartFrame.Graphic:GetWidth() + + local chartLength = dungeonChartFrame.ChartFrame.Graphic:GetWidth() local secondsPerPixel = chartLength / elapsedTime local xPosition = bossTable[1] * secondsPerPixel - - bossWidget:SetPoint("bottomright", f.ChartFrame.Graphic, "bottomleft", xPosition, 0) - + + bossWidget:SetPoint("bottomright", dungeonChartFrame.ChartFrame.Graphic, "bottomleft", xPosition, 0) + bossWidget.TimeText:SetText(Details:GetFramework():IntegerToTimer (bossTable[1])) - + if (bossTable[2].bossimage) then bossWidget.AvatarTexture:SetTexture(bossTable[2].bossimage) else @@ -597,11 +579,10 @@ function mythicDungeonCharts.ShowChart() end end end - end - + mythicDungeonCharts.Frame.ChartFrame:Reset() - + if (not mythicDungeonCharts.ChartTable) then if (debugmode) then --development @@ -610,34 +591,37 @@ function mythicDungeonCharts.ShowChart() local t = {} Details:GetFramework().table.copy (t, Details.mythic_plus.last_mythicrun_chart) mythicDungeonCharts.ChartTable = t - mythicDungeonCharts:Debug ("no valid data, saved data loaded") + mythicDungeonCharts:Debug("no valid data, saved data loaded") + else - mythicDungeonCharts:Debug ("no valid data and no saved data, canceling") + mythicDungeonCharts:Debug("no valid data and no saved data, canceling") mythicDungeonCharts.Frame:Hide() return end + else mythicDungeonCharts.Frame:Hide() - mythicDungeonCharts:Debug ("no data found, canceling") + mythicDungeonCharts:Debug("no data found, canceling") + if (verbosemode) then - mythicDungeonCharts:Debug ("mythicDungeonCharts.ShowChart() failed: no chart table") + mythicDungeonCharts:Debug("mythicDungeonCharts.ShowChart() failed: no chart table") end return end end - + local charts = mythicDungeonCharts.ChartTable.Players local classDuplicated = {} - + mythicDungeonCharts.PlayerGraphIndex = {} for playerName, playerTable in pairs(charts) do - + local chartData = playerTable.ChartData local lineName = playerTable.Name - + classDuplicated [playerTable.Class] = (classDuplicated [playerTable.Class] or 0) + 1 - + local lineColor if (playerTable.Class) then local classColor = mythicDungeonCharts.ClassColors [playerTable.Class .. classDuplicated [playerTable.Class]] @@ -649,14 +633,14 @@ function mythicDungeonCharts.ShowChart() else lineColor = {1, 1, 1} end - + local combatTime = mythicDungeonCharts.ChartTable.ElapsedTime local texture = "line" - + --lowess smooth --chartData = mythicDungeonCharts.LowessSmoothing (chartData, 75) chartData = mythicDungeonCharts.Frame.ChartFrame:CalcLowessSmoothing (chartData, 75) - + local maxValue = 0 for i = 1, #chartData do if (chartData [i] > maxValue) then @@ -664,13 +648,13 @@ function mythicDungeonCharts.ShowChart() end end chartData.max_value = maxValue - - mythicDungeonCharts.Frame.ChartFrame:AddLine (chartData, lineColor, lineName, combatTime, texture, "SMA") + + mythicDungeonCharts.Frame.ChartFrame:AddLine(chartData, lineColor, lineName, combatTime, texture, "SMA") tinsert(mythicDungeonCharts.PlayerGraphIndex, playerName) end - + mythicDungeonCharts.Frame.ChartFrame:RefreshBossTimeline (mythicDungeonCharts.ChartTable.BossDefeated, mythicDungeonCharts.ChartTable.ElapsedTime) - + --generate boss time table local bossTimeTable = {} for i, bossTable in ipairs(mythicDungeonCharts.ChartTable.BossDefeated) do @@ -679,21 +663,21 @@ function mythicDungeonCharts.ShowChart() tinsert(bossTimeTable, bossTable[1]) tinsert(bossTimeTable, bossTable[1] - combatTime) end - + mythicDungeonCharts.Frame.ChartFrame:AddOverlay (bossTimeTable, {1, 1, 1, 0.05}, "Show Boss", "") - + --local phrase = " Average Dps (under development)\npress Escape to hide, Details! Alpha Build." .. _detalhes.build_counter .. "." .. _detalhes.realversion local phrase = "Details!: Average Dps for " - + 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.ShowChartFrame() - + if (verbosemode) then - mythicDungeonCharts:Debug ("mythicDungeonCharts.ShowChart() success") + mythicDungeonCharts:Debug("mythicDungeonCharts.ShowChart() success") end end @@ -705,67 +689,73 @@ local HideTooltip = function(ticker) mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPinGlow:Hide() end end + local PixelFrameOnEnter = function(self) local playerName = self.PlayerName --get the percent from the pixel height relative to the chart window local dps = self.Height / mythicDungeonCharts.Frame.ChartFrame:GetHeight() --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:Show() mythicDungeonCharts.Frame.BossWidgetsFrame.GraphPinGlow:Show() - GameCooltip2:Preset (2) + GameCooltip2:Preset(2) GameCooltip2:SetOption("FixedWidth", 100) GameCooltip2:SetOption("TextSize", 10) - local onlyName = _detalhes:GetOnlyName (playerName) - GameCooltip2:AddLine (onlyName) - + local onlyName = _detalhes:GetOnlyName(playerName) + GameCooltip2:AddLine(onlyName) + local classIcon, L, R, B, T = _detalhes:GetClassIcon (mythicDungeonCharts.ChartTable.Players [playerName] and mythicDungeonCharts.ChartTable.Players [playerName].Class) GameCooltip2:AddIcon (classIcon, 1, 1, 16, 16, L, R, B, T) - - GameCooltip2:AddLine (Details:GetCurrentToKFunction()(nil, floor (dps))) - + + GameCooltip2:AddLine(Details:GetCurrentToKFunction()(nil, floor(dps))) + GameCooltip2:SetOwner(self) GameCooltip2:Show() showID = showID + 1 end + local PixelFrameOnLeave = function(self) - local timer = C_Timer.NewTimer (1, HideTooltip) + local timer = C_Timer.NewTimer(1, HideTooltip) timer.ShowID = showID end local TAXIROUTE_LINEFACTOR = 128 / 126 -- Multiplying factor for texture coordinates local TAXIROUTE_LINEFACTOR_2 = TAXIROUTE_LINEFACTOR / 2 -- Half of that + function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer, linetexture, graphIndex) local relPoint = "BOTTOMLEFT" - + if sx == ex then if sy == ey then return else return self:DrawVLine(C, sx, sy, ey, w, color, layer) end + elseif sy == ey then return self:DrawHLine(C, sx, ex, sy, w, color, layer) end - + if not C.GraphLib_Lines then C.GraphLib_Lines = {} C.GraphLib_Lines_Used = {} end - + local T = tremove(C.GraphLib_Lines) or C:CreateTexture(nil, "ARTWORK") - + if linetexture then --this data series texture T:SetTexture(linetexture) + elseif C.CustomLine then --overall chart texture T:SetTexture(C.CustomLine) + else --no texture assigned, use default T:SetTexture(TextureDirectory.."line") end - + tinsert(C.GraphLib_Lines_Used, T) T:SetDrawLayer(layer or "ARTWORK") @@ -821,13 +811,11 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer, T:SetPoint("BOTTOMLEFT", C, relPoint, cx - Bwid, cy - Bhgt) T:SetPoint("TOPRIGHT", C, relPoint, cx + Bwid, cy + Bhgt) T:Show() - - --[= - + local playerName = mythicDungeonCharts.PlayerGraphIndex [graphIndex] if (mythicDungeonCharts.Frame.ChartFrame.TextureID % 3 == 0 and playerName) then - - local pixelFrame = tremove (mythicDungeonCharts.Frame.ChartFrame.FrameFree) + + local pixelFrame = tremove(mythicDungeonCharts.Frame.ChartFrame.FrameFree) if (not pixelFrame) then local newFrame = CreateFrame("frame", nil, mythicDungeonCharts.Frame.ChartFrame, "BackdropTemplate") newFrame:SetSize(1, 1) @@ -836,22 +824,20 @@ function mythicDungeonCharts:CustomDrawLine (C, sx, sy, ex, ey, w, color, layer, --newFrame:SetBackdropColor(0, 0, 0, 1) newFrame:SetScript("OnEnter", PixelFrameOnEnter) newFrame:SetScript("OnLeave", PixelFrameOnLeave) - + pixelFrame = newFrame end - + pixelFrame:SetPoint("BOTTOMLEFT", C, relPoint, cx - Bwid, cy - Bhgt) pixelFrame:SetPoint("TOPRIGHT", C, relPoint, cx + Bwid, cy + Bhgt) - + tinsert(mythicDungeonCharts.Frame.ChartFrame.FrameInUse, pixelFrame) pixelFrame.PlayerName = playerName pixelFrame.Height = ey - + end - + mythicDungeonCharts.Frame.ChartFrame.TextureID = mythicDungeonCharts.Frame.ChartFrame.TextureID + 1 - --]=] - return T end @@ -860,53 +846,52 @@ mythicDungeonCharts.ClassColors = { ["HUNTER1"] = { r = 0.67, g = 0.83, b = 0.45, colorStr = "ffabd473" }, ["HUNTER2"] = { r = 0.47, g = 0.63, b = 0.25, colorStr = "ffabd473" }, ["HUNTER3"] = { r = 0.27, g = 0.43, b = 0.05, colorStr = "ffabd473" }, - + ["WARLOCK1"] = { r = 0.53, g = 0.53, b = 0.93, colorStr = "ff8788ee" }, ["WARLOCK2"] = { r = 0.33, g = 0.33, b = 0.73, colorStr = "ff8788ee" }, ["WARLOCK3"] = { r = 0.13, g = 0.13, b = 0.53, colorStr = "ff8788ee" }, - + ["PRIEST1"] = { r = 1.0, g = 1.0, b = 1.0, colorStr = "ffffffff" }, ["PRIEST2"] = { r = 0.8, g = 0.8, b = 0.8, colorStr = "ffffffff" }, ["PRIEST3"] = { r = 0.6, g = 0.6, b = 0.6, colorStr = "ffffffff" }, - + ["PALADIN1"] = { r = 0.96, g = 0.55, b = 0.73, colorStr = "fff58cba" }, ["PALADIN2"] = { r = 0.76, g = 0.35, b = 0.53, colorStr = "fff58cba" }, ["PALADIN3"] = { r = 0.56, g = 0.15, b = 0.33, colorStr = "fff58cba" }, - + ["MAGE1"] = { r = 0.25, g = 0.78, b = 0.92, colorStr = "ff3fc7eb" }, ["MAGE2"] = { r = 0.05, g = 0.58, b = 0.72, colorStr = "ff3fc7eb" }, ["MAGE3"] = { r = 0.0, g = 0.38, b = 0.52, colorStr = "ff3fc7eb" }, - + ["ROGUE1"] = { r = 1.0, g = 0.96, b = 0.41, colorStr = "fffff569" }, ["ROGUE2"] = { r = 0.8, g = 0.76, b = 0.21, colorStr = "fffff569" }, ["ROGUE3"] = { r = 0.6, g = 0.56, b = 0.01, colorStr = "fffff569" }, - + ["DRUID1"] = { r = 1.0, g = 0.49, b = 0.04, colorStr = "ffff7d0a" }, ["DRUID2"] = { r = 0.8, g = 0.29, b = 0.04, colorStr = "ffff7d0a" }, ["DRUID3"] = { r = 0.6, g = 0.09, b = 0.04, colorStr = "ffff7d0a" }, - + ["SHAMAN1"] = { r = 0.0, g = 0.44, b = 0.87, colorStr = "ff0070de" }, ["SHAMAN2"] = { r = 0.0, g = 0.24, b = 0.67, colorStr = "ff0070de" }, ["SHAMAN3"] = { r = 0.0, g = 0.04, b = 0.47, colorStr = "ff0070de" }, - + ["WARRIOR1"] = { r = 0.78, g = 0.61, b = 0.43, colorStr = "ffc79c6e" }, ["WARRIOR2"] = { r = 0.58, g = 0.41, b = 0.23, colorStr = "ffc79c6e" }, ["WARRIOR3"] = { r = 0.38, g = 0.21, b = 0.03, colorStr = "ffc79c6e" }, - + ["DEATHKNIGHT1"] = { r = 0.77, g = 0.12 , b = 0.23, colorStr = "ffc41f3b" }, ["DEATHKNIGHT2"] = { r = 0.57, g = 0.02 , b = 0.03, colorStr = "ffc41f3b" }, ["DEATHKNIGHT3"] = { r = 0.37, g = 0.02 , b = 0.03, colorStr = "ffc41f3b" }, - + ["MONK1"] = { r = 0.0, g = 1.00 , b = 0.59, colorStr = "ff00ff96" }, ["MONK2"] = { r = 0.0, g = 0.8 , b = 0.39, colorStr = "ff00ff96" }, ["MONK3"] = { r = 0.0, g = 0.6 , b = 0.19, colorStr = "ff00ff96" }, - + ["DEMONHUNTER1"] = { r = 0.64, g = 0.19, b = 0.79, colorStr = "ffa330c9" }, ["DEMONHUNTER2"] = { r = 0.44, g = 0.09, b = 0.59, colorStr = "ffa330c9" }, ["DEMONHUNTER3"] = { r = 0.24, g = 0.09, b = 0.39, colorStr = "ffa330c9" }, }; - if (debugmode) then - C_Timer.After (1, mythicDungeonCharts.ShowChart) -end + C_Timer.After(1, mythicDungeonCharts.ShowChart) +end \ No newline at end of file diff --git a/functions/events.lua b/functions/events.lua index 0c2ce2ad..ea011559 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ --Event types: @@ -189,9 +189,9 @@ local common_events = { if (not _detalhes.RegistredEvents [event]) then if (object.Msg) then - object:Msg ("(debug) unknown event", event) + object:Msg("(debug) unknown event", event) else - _detalhes:Msg ("(debug) unknown event", event) + _detalhes:Msg("(debug) unknown event", event) end return end @@ -239,7 +239,7 @@ local common_events = { --internal functions local dispatch_error = function(name, errortext) - _detalhes:Msg ((name or ""), " |cFFFF9900error|r: ", errortext) + _detalhes:Msg((name or ""), " |cFFFF9900error|r: ", errortext) end --safe call an external func with payload and without telling who is calling @@ -374,21 +374,21 @@ local common_events = { _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) + _detalhes:CancelTimer(_detalhes.last_options_modified_schedule) _detalhes.last_options_modified_schedule = nil end else if (_detalhes.last_options_modified_schedule) then - _detalhes:CancelTimer (_detalhes.last_options_modified_schedule) + _detalhes:CancelTimer(_detalhes.last_options_modified_schedule) end - _detalhes.last_options_modified_schedule = _detalhes:ScheduleTimer ("SendOptionsModifiedEvent", 0.31, instance) + _detalhes.last_options_modified_schedule = _detalhes:ScheduleTimer("SendOptionsModifiedEvent", 0.31, instance) end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --listeners - local listener_meta = setmetatable ({}, _detalhes) + local listener_meta = setmetatable({}, _detalhes) listener_meta.__index = listener_meta function listener_meta:RegisterEvent (event, func) @@ -400,6 +400,6 @@ local common_events = { function _detalhes:CreateEventListener() local new = {Enabled = true, __enabled = true} - setmetatable (new, listener_meta) + setmetatable(new, listener_meta) return new end diff --git a/functions/loaddata.lua b/functions/loaddata.lua index a0ae5a5b..b8796271 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -19,7 +19,7 @@ function _detalhes:ApplyBasicKeys() --who is self.playername = UnitName ("player") - self.playerserial = UnitGUID ("player") + self.playerserial = UnitGUID("player") --player faction and enemy faction self.faction = UnitFactionGroup ("player") @@ -64,7 +64,7 @@ function _detalhes:ApplyBasicKeys() --load default profile keys for key, value in pairs(_detalhes.default_profile) do if (type(value) == "table") then - local ctable = Details.CopyTable (value) + local ctable = Details.CopyTable(value) self [key] = ctable else self [key] = value @@ -86,7 +86,7 @@ function _detalhes:LoadGlobalAndCharacterData() --it exists? if (not _detalhes_database) then - _detalhes_database = Details.CopyTable (_detalhes.default_player_data) + _detalhes_database = Details.CopyTable(_detalhes.default_player_data) end --load saved values @@ -95,7 +95,7 @@ function _detalhes:LoadGlobalAndCharacterData() --check if key exists, e.g. a new key was added if (_detalhes_database [key] == nil) then if (type(value) == "table") then - _detalhes_database [key] = Details.CopyTable (_detalhes.default_player_data [key]) + _detalhes_database [key] = Details.CopyTable(_detalhes.default_player_data [key]) else _detalhes_database [key] = value end @@ -107,7 +107,7 @@ function _detalhes:LoadGlobalAndCharacterData() for key2, value2 in pairs(_detalhes.default_player_data [key]) do if (_detalhes_database [key] [key2] == nil) then if (type(value2) == "table") then - _detalhes_database [key] [key2] = Details.CopyTable (_detalhes.default_player_data [key] [key2]) + _detalhes_database [key] [key2] = Details.CopyTable(_detalhes.default_player_data [key] [key2]) else _detalhes_database [key] [key2] = value2 end @@ -117,7 +117,7 @@ function _detalhes:LoadGlobalAndCharacterData() --copy the key from saved table to details object if (type(value) == "table") then - _detalhes [key] = Details.CopyTable (_detalhes_database [key]) + _detalhes [key] = Details.CopyTable(_detalhes_database [key]) else _detalhes [key] = _detalhes_database [key] end @@ -126,7 +126,7 @@ function _detalhes:LoadGlobalAndCharacterData() --check and build the default container for account database if (not _detalhes_global) then - _detalhes_global = Details.CopyTable (_detalhes.default_global_data) + _detalhes_global = Details.CopyTable(_detalhes.default_global_data) end for key, value in pairs(_detalhes.default_global_data) do @@ -134,7 +134,7 @@ function _detalhes:LoadGlobalAndCharacterData() --check if key exists if (_detalhes_global [key] == nil) then if (type(value) == "table") then - _detalhes_global [key] = Details.CopyTable (_detalhes.default_global_data [key]) + _detalhes_global [key] = Details.CopyTable(_detalhes.default_global_data [key]) else _detalhes_global [key] = value end @@ -155,7 +155,7 @@ function _detalhes:LoadGlobalAndCharacterData() for key2, value2 in pairs(_detalhes.default_global_data [key]) do if (_detalhes_global [key] [key2] == nil) then if (type(value2) == "table") then - _detalhes_global [key] [key2] = Details.CopyTable (_detalhes.default_global_data [key] [key2]) + _detalhes_global [key] [key2] = Details.CopyTable(_detalhes.default_global_data [key] [key2]) else _detalhes_global [key] [key2] = value2 end @@ -166,7 +166,7 @@ function _detalhes:LoadGlobalAndCharacterData() --copy the key from saved table to details object if (type(value) == "table") then - _detalhes [key] = Details.CopyTable (_detalhes_global [key]) + _detalhes [key] = Details.CopyTable(_detalhes_global [key]) else _detalhes [key] = _detalhes_global [key] end @@ -201,7 +201,7 @@ function _detalhes:LoadCombatTables() -- pets _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() if (_detalhes_database.tabela_pets) then - _detalhes.tabela_pets.pets = Details.CopyTable (_detalhes_database.tabela_pets) + _detalhes.tabela_pets.pets = Details.CopyTable(_detalhes_database.tabela_pets) end _detalhes:UpdateContainerCombatentes() @@ -382,16 +382,16 @@ function _detalhes:LoadConfig() local instance = _detalhes.tabela_instancias [index] if (instance) then saved_skin.__was_opened = instance.ativa - saved_skin.__pos = Details.CopyTable (instance.posicao) + saved_skin.__pos = Details.CopyTable(instance.posicao) saved_skin.__locked = instance.isLocked - saved_skin.__snap = Details.CopyTable (instance.snap) + saved_skin.__snap = Details.CopyTable(instance.snap) saved_skin.__snapH = instance.horizontalSnap saved_skin.__snapV = instance.verticalSnap for key, value in pairs(instance) do if (_detalhes.instance_defaults [key] ~= nil) then if (type(value) == "table") then - saved_skin [key] = Details.CopyTable (value) + saved_skin [key] = Details.CopyTable(value) else saved_skin [key] = value end @@ -402,14 +402,14 @@ function _detalhes:LoadConfig() for index, instance in _detalhes:ListInstances() do _detalhes.local_instances_config [index] = { - pos = Details.CopyTable (instance.posicao), + pos = Details.CopyTable(instance.posicao), is_open = instance.ativa, attribute = instance.atributo, sub_attribute = instance.sub_atributo, mode = instance.modo or 2, modo = instance.modo or 2, segment = instance.segmento, - snap = Details.CopyTable (instance.snap), + snap = Details.CopyTable(instance.snap), horizontalSnap = instance.horizontalSnap, verticalSnap = instance.verticalSnap, sub_atributo_last = instance.sub_atributo_last, diff --git a/functions/macros.lua b/functions/macros.lua index b6b4adca..4c187feb 100644 --- a/functions/macros.lua +++ b/functions/macros.lua @@ -8,9 +8,9 @@ function Details:OpenPlayerDetails(window) if (instance) then local display, subDisplay = instance:GetDisplay() if (display == 1) then - instance:AbreJanelaInfo (Details:GetPlayer (false, 1)) + instance:AbreJanelaInfo (Details:GetPlayer(false, 1)) elseif (display == 2) then - instance:AbreJanelaInfo (Details:GetPlayer (false, 2)) + instance:AbreJanelaInfo (Details:GetPlayer(false, 2)) end end end \ No newline at end of file diff --git a/functions/mythicdungeon.lua b/functions/mythicdungeon.lua index 584587fd..06791d6b 100644 --- a/functions/mythicdungeon.lua +++ b/functions/mythicdungeon.lua @@ -31,14 +31,14 @@ end .is_mythic_dungeon_segment = true .is_mythic_dungeon_run_id = run id from details.profile.mythic_dungeon_id boss, 'trash overall' and 'dungeon overall' segments have: - .is_mythic_dungeon + .is_mythic_dungeon boss segments have: .is_boss 'trash overall' segments have: .is_mythic_dungeon with .SegmentID = "trashoverall" 'dungeon overall' segment have: .is_mythic_dungeon with .SegmentID = "overall" - + --]] --precisa converter um wipe em um trash segment? provavel que sim @@ -46,12 +46,12 @@ end -- at the end of a mythic run, if enable on settings, merge all the segments from the mythic run into only one function DetailsMythicPlusFrame.MergeSegmentsOnEnd() if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MergeSegmentsOnEnd() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown()) + print("Details!", "MergeSegmentsOnEnd() > starting to merge mythic segments.", "InCombatLockdown():", InCombatLockdown()) end - + --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 local newCombat = Details:GetCurrentCombat() local segmentHistory = Details:GetCombatSegments() @@ -71,16 +71,16 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() canAddThisSegment = false end end - + if (canAddThisSegment) then newCombat = newCombat + pastCombat totalTime = totalTime + pastCombat:GetCombatTime() totalSegments = totalSegments + 1 - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MergeSegmentsOnEnd() > adding time:", pastCombat:GetCombatTime(), pastCombat.is_boss and pastCombat.is_boss.name) + print("MergeSegmentsOnEnd() > adding time:", pastCombat:GetCombatTime(), pastCombat.is_boss and pastCombat.is_boss.name) end - + if (endDate == "") then local _, whenEnded = pastCombat:GetDate() endDate =whenEnded @@ -89,18 +89,18 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() end end end - + --get the date where the first segment started if (lastSegment) then startDate = lastSegment:GetDate() end - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MergeSegmentsOnEnd() > totalTime:", totalTime, "startDate:", startDate) + print("Details!", "MergeSegmentsOnEnd() > totalTime:", totalTime, "startDate:", startDate) end - + local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - + --tag the segment as mythic overall segment newCombat.is_mythic_dungeon = { StartedAt = Details.MythicPlus.StartedAt, --the start of the run @@ -113,12 +113,12 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() Level = Details.MythicPlus.Level, EJID = Details.MythicPlus.ejID, } - + newCombat.total_segments_added = totalSegments - + newCombat.is_mythic_dungeon_segment = true newCombat.is_mythic_dungeon_run_id = Details.mythic_dungeon_id - + --set the segment time and date newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) @@ -133,12 +133,12 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd() Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) Details:InstanciaCallFunction(Details.ResetaGump) Details:RefreshMainWindow(-1, true) - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MergeSegmentsOnEnd() > finished merging segments.") - print ("Details!", "MergeSegmentsOnEnd() > all done, check in the segments list if everything is correct, if something is weird: '/details feedback' thanks in advance!") + print("Details!", "MergeSegmentsOnEnd() > finished merging segments.") + print("Details!", "MergeSegmentsOnEnd() > all done, check in the segments list if everything is correct, if something is weird: '/details feedback' thanks in advance!") end - + local lower_instance = Details:GetLowerInstanceNumber() if (lower_instance) then local instance = Details:GetInstance(lower_instance) @@ -152,45 +152,45 @@ end --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) + print("Details!", "MergeTrashCleanup() > running", DetailsMythicPlusFrame.TrashMergeScheduled and #DetailsMythicPlusFrame.TrashMergeScheduled) end - + local segmentsToMerge = DetailsMythicPlusFrame.TrashMergeScheduled - + --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 local newCombat = masterSegment local totalTime = newCombat:GetCombatTime() local startDate, endDate = "", "" local lastSegment - + --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 pastCombat._trashoverallalreadyadded = true - + if (endDate == "") then local _, whenEnded = pastCombat:GetDate() endDate = whenEnded end lastSegment = pastCombat end - + --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 @@ -207,19 +207,19 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) EncounterID = segmentsToMerge.EncounterID, EncounterName = segmentsToMerge.EncounterName or Loc ["STRING_UNKNOW"], } - + 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 newCombat:SetStartTime (GetTime() - totalTime) newCombat:SetEndTime (GetTime()) --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 + print("Details!", "MergeTrashCleanup() > finished merging trash segments.", _detalhes.tabela_vigente, _detalhes.tabela_vigente.is_boss) + end --should delete the trash segments after the merge? if (_detalhes.mythic_plus.delete_trash_after_merge) then @@ -227,33 +227,33 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule) for i = #segmentHistory, 1, -1 do local segment = segmentHistory [i] if (segment and segment._trashoverallalreadyadded) then - tremove (segmentHistory, i) + tremove(segmentHistory, i) end end for i = #segmentsToMerge, 1, -1 do - tremove (segmentsToMerge, i) + tremove(segmentsToMerge, i) end - + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") else --clear the segments to merge table for i = #segmentsToMerge, 1, -1 do - tremove (segmentsToMerge, i) + tremove(segmentsToMerge, i) --notify plugins about a segment deleted Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end - + --clear encounter name and id segmentsToMerge.EncounterID = nil segmentsToMerge.EncounterName = nil end --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:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") + Details:InstanciaCallFunction(Details.AtualizaSegmentos) + Details:InstanciaCallFunction(Details.AtualizaSoloMode_AfertReset) + Details:InstanciaCallFunction(Details.ResetaGump) Details:RefreshMainWindow(-1, true) end end @@ -262,58 +262,58 @@ end --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) + print("Details!", "MergeRemainingTrashAfterAllBossesDone() > running, #segments: ", #DetailsMythicPlusFrame.TrashMergeScheduled2, "trash overall table:", DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat) end - + 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 local totalTime = 0 local startDate, endDate = "", "" local lastSegment - + --add segments for i, pastCombat in ipairs(segmentsToMerge) do overallCombat = overallCombat + pastCombat if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MergeRemainingTrashAfterAllBossesDone() > segment added") + print("MergeRemainingTrashAfterAllBossesDone() > segment added") end totalTime = totalTime + pastCombat:GetCombatTime() - + --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 local _, whenEnded = pastCombat:GetDate() endDate = whenEnded end lastSegment = pastCombat end - + --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) + print("MergeRemainingTrashAfterAllBossesDone() > total combat time:", totalTime) end --set the segment date local startDate = overallCombat:GetDate() overallCombat:SetDate (startDate, endDate) if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MergeRemainingTrashAfterAllBossesDone() > new end date:", endDate) + print("MergeRemainingTrashAfterAllBossesDone() > new end date:", endDate) end - + local mythicDungeonInfo = overallCombat:GetMythicDungeonInfo() - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MergeRemainingTrashAfterAllBossesDone() > elapsed time before:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt) + print("MergeRemainingTrashAfterAllBossesDone() > elapsed time before:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt) end mythicDungeonInfo.StartedAt = mythicDungeonInfo.StartedAt - (Details.MythicPlus.EndedAt - Details.MythicPlus.PreviousBossKilledAt) if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MergeRemainingTrashAfterAllBossesDone() > elapsed time after:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt) + print("MergeRemainingTrashAfterAllBossesDone() > elapsed time after:", mythicDungeonInfo.EndedAt - mythicDungeonInfo.StartedAt) end - + --should delete the trash segments after the merge? if (_detalhes.mythic_plus.delete_trash_after_merge) then local removedCurrentSegment = false @@ -326,27 +326,27 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() if (_detalhes.tabela_vigente == segment) then removedCurrentSegment = true end - tremove (segmentHistory, i) + tremove(segmentHistory, i) break end end end - + for i = #segmentsToMerge, 1, -1 do - tremove (segmentsToMerge, i) + tremove(segmentsToMerge, i) end if (removedCurrentSegment) then --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 Details:EntrarEmCombate() Details:SairDoCombate() end - + --update all windows Details:InstanciaCallFunction(Details.FadeHandler.Fader, "IN", nil, "barras") Details:InstanciaCallFunction(Details.AtualizaSegmentos) @@ -354,12 +354,12 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() Details:InstanciaCallFunction(Details.ResetaGump) Details:RefreshMainWindow(-1, true) end - + Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") else --clear the segments to merge table for i = #segmentsToMerge, 1, -1 do - tremove (segmentsToMerge, i) + tremove(segmentsToMerge, i) --notify plugins about a segment deleted Details:SendEvent("DETAILS_DATA_SEGMENTREMOVED") end @@ -369,7 +369,7 @@ function DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat = nil if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MergeRemainingTrashAfterAllBossesDone() > done merging") + print("Details!", "MergeRemainingTrashAfterAllBossesDone() > done merging") end end @@ -377,11 +377,11 @@ end --it comes from details! control leave combat function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, encounterName, difficultyID, raidSize, endStatus) --hold your breath and count to ten if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "BossDefeated() > boss defeated | SegmentID:", Details.MythicPlus.SegmentID, " | mapID:", Details.MythicPlus.DungeonID) + print("Details!", "BossDefeated() > boss defeated | SegmentID:", Details.MythicPlus.SegmentID, " | mapID:", Details.MythicPlus.DungeonID) end - + local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - + --add the mythic dungeon info to the combat _detalhes.tabela_vigente.is_mythic_dungeon = { StartedAt = Details.MythicPlus.StartedAt, --the start of the run @@ -404,7 +404,7 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco --table with all past semgnets local segmentHistory = Details:GetCombatSegments() - + --iterate among segments for i = 1, 25 do --from the newer combat to the oldest local pastCombat = segmentHistory [i] @@ -413,7 +413,7 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco --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 @@ -422,27 +422,27 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco end end end - + --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 segmentsToMerge.LastBossKilledAt = time() - _detalhes.tabela_vigente:GetCombatTime() - + DetailsMythicPlusFrame.TrashMergeScheduled = segmentsToMerge - + --there's no more script run too long --if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "BossDefeated() > not in combat, merging trash now") + print("Details!", "BossDefeated() > not in combat, merging trash now") end --merge the trash clean up DetailsMythicPlusFrame.MergeTrashCleanup() --else -- if (DetailsMythicPlusFrame.DevelopmentDebug) then - -- print ("Details!", "BossDefeated() > player in combatlockdown, scheduling trash merge") + -- print("Details!", "BossDefeated() > player in combatlockdown, scheduling trash merge") -- end -- _detalhes.schedule_mythicdungeon_trash_merge = true --end @@ -459,13 +459,13 @@ function DetailsMythicPlusFrame.BossDefeated (this_is_end_end, encounterID, enco if (Details.mythic_plus.always_in_combat) then Details:EntrarEmCombate() end - + --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) Details.MythicPlus.PreviousBossKilledAt = time() - + --update the saved table inside the profile _detalhes:UpdateState_CurrentMythicDungeonRun (true, Details.MythicPlus.SegmentID, Details.MythicPlus.PreviousBossKilledAt) end @@ -474,75 +474,75 @@ end function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) if (DetailsMythicPlusFrame.IsDoingMythicDungeon) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MythicDungeonFinished() > the dungeon was a Mythic+ and just ended.") + print("Details!", "MythicDungeonFinished() > the dungeon was a Mythic+ and just ended.") end - + DetailsMythicPlusFrame.IsDoingMythicDungeon = false Details.MythicPlus.Started = false Details.MythicPlus.EndedAt = time()-1.9 - + 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 if (Details.in_combat) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MythicDungeonFinished() > was in combat, calling SairDoCombate():", InCombatLockdown()) + print("Details!", "MythicDungeonFinished() > was in combat, calling SairDoCombate():", InCombatLockdown()) end Details:SairDoCombate() end - + 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 if (_detalhes.mythic_plus.merge_boss_trash and not Details.MythicPlus.IsRestoredState and not fromZoneLeft) then - --is the current combat not a boss fight? + --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.") + print("Details!", "MythicDungeonFinished() > the last combat isn't a boss fight, might have trash after bosses done.") end - + --table with all past semgnets local segmentHistory = Details:GetCombatSegments() - + for i = 1, #segmentHistory do local pastCombat = segmentHistory [i] --does the combat exists - + if (pastCombat and not pastCombat._trashoverallalreadyadded and pastCombat:GetCombatTime() > 5) then --is the last boss? if (pastCombat.is_boss) then break end - + --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 local mythicDungeonInfo = pastCombat:GetMythicDungeonInfo() if (mythicDungeonInfo) then break end - + --merge this segment tinsert(segmentsToMerge, pastCombat) - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("MythicDungeonFinished() > found after last boss combat") + print("MythicDungeonFinished() > found after last boss combat") end end end end end end - + if (#segmentsToMerge > 0) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MythicDungeonFinished() > found ", #segmentsToMerge, "segments after the last boss") + print("Details!", "MythicDungeonFinished() > found ", #segmentsToMerge, "segments after the last boss") end - + --find the latest trash overall local segmentHistory = Details:GetCombatSegments() local latestTrashOverall @@ -553,45 +553,45 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) break end end - + if (latestTrashOverall) then --stores the segment table and the trash overall segment to use on the merge DetailsMythicPlusFrame.TrashMergeScheduled2 = segmentsToMerge DetailsMythicPlusFrame.TrashMergeScheduled2_OverallCombat = latestTrashOverall - + --there's no more script ran too long --if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MythicDungeonFinished() > not in combat, merging last pack of trash now") + print("Details!", "MythicDungeonFinished() > not in combat, merging last pack of trash now") end DetailsMythicPlusFrame.MergeRemainingTrashAfterAllBossesDone() --else -- if (DetailsMythicPlusFrame.DevelopmentDebug) then - -- print ("Details!", "MythicDungeonFinished() > player in combatlockdown, scheduling the merge for last trash packs") + -- print("Details!", "MythicDungeonFinished() > player in combatlockdown, scheduling the merge for last trash packs") -- end -- _detalhes.schedule_mythicdungeon_endtrash_merge = true --end end end - + --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 - print ("Details!", "MythicDungeonFinished() > not in combat, creating overall segment now") + print("Details!", "MythicDungeonFinished() > not in combat, creating overall segment now") end DetailsMythicPlusFrame.MergeSegmentsOnEnd() --else -- if (DetailsMythicPlusFrame.DevelopmentDebug) then - -- print ("Details!", "MythicDungeonFinished() > player in combatlockdown, scheduling the creation of the overall segment") + -- print("Details!", "MythicDungeonFinished() > player in combatlockdown, scheduling the creation of the overall segment") -- end -- _detalhes.schedule_mythicdungeon_overallrun_merge = true --end end - + Details.MythicPlus.IsRestoredState = nil - + --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) @@ -600,23 +600,23 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft) Details:CaptureSet (false, "energy", false, 15) Details:CaptureSet (false, "spellcast", false, 15) end - + --store data --[=[ - local expansion = tostring (select (4, GetBuildInfo())):match ("%d%d") - if (expansion and type (expansion) == "string" and string.len (expansion) == 2) then + local expansion = tostring (select(4, GetBuildInfo())):match ("%d%d") + if (expansion and type(expansion) == "string" and string.len(expansion) == 2) then local expansionDungeonData = _detalhes.dungeon_data [expansion] if (not expansionDungeonData) then expansionDungeonData = {} _detalhes.dungeon_data [expansion] = expansionDungeonData end - + --store information about the dungeon run --the the dungeon ID, can't be localized --players in the group --difficulty level -- - + end --]=] end @@ -625,19 +625,19 @@ end function DetailsMythicPlusFrame.MythicDungeonStarted() --flag as a mythic dungeon DetailsMythicPlusFrame.IsDoingMythicDungeon = true - + --this counter is individual for each character Details.mythic_dungeon_id = Details.mythic_dungeon_id + 1 - + local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo() local zoneName, _, _, _, _, _, _, currentZoneID = GetInstanceInfo() - + local mapID = C_Map.GetBestMapForUnit ("player") - + if (not mapID) then return end - + local ejID = DF.EncounterJournal.EJ_GetInstanceForMap (mapID) --setup the mythic run info @@ -652,31 +652,31 @@ function DetailsMythicPlusFrame.MythicDungeonStarted() Details.MythicPlus.PreviousBossKilledAt = time() Details:SaveState_CurrentMythicDungeonRun (Details.mythic_dungeon_id, zoneName, currentZoneID, time()+9.7, 1, mythicLevel, ejID, time()) - + --start a new combat segment after 10 seconds if (_detalhes.mythic_plus.always_in_combat) then - C_Timer.After (9.7, function() + C_Timer.After(9.7, function() if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "New segment for mythic dungeon created.") + print("Details!", "New segment for mythic dungeon created.") end _detalhes:EntrarEmCombate() end) end - + 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.") - + if (Details.debug) then Details:Msg("(debug) timer is for a mythic+ dungeon, overall has been reseted.") end end - + if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", "MythicDungeonStarted() > State set to Mythic Dungeon, new combat starting in 10 seconds.") + print("Details!", "MythicDungeonStarted() > State set to Mythic Dungeon, new combat starting in 10 seconds.") end - + end function DetailsMythicPlusFrame.OnChallengeModeStart() @@ -699,7 +699,7 @@ function DetailsMythicPlusFrame.OnChallengeModeStart() --print("currentZoneID", currentZoneID) --print("Details.MythicPlus.Level", Details.MythicPlus.Level) --print("mythicLevel", mythicLevel) - + if (not Details.MythicPlus.Started and Details.MythicPlus.DungeonID == currentZoneID and Details.MythicPlus.Level == mythicLevel) then Details.MythicPlus.Started = true Details.MythicPlus.EndedAt = nil @@ -720,11 +720,11 @@ DetailsMythicPlusFrame.EventListener:RegisterEvent ("COMBAT_PLAYER_LEAVE") DetailsMythicPlusFrame.EventListener:RegisterEvent ("COMBAT_MYTHICDUNGEON_START") DetailsMythicPlusFrame.EventListener:RegisterEvent ("COMBAT_MYTHICDUNGEON_END") -function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, event, ...) +function DetailsMythicPlusFrame.EventListener.OnDetailsEvent(contextObject, event, ...) --these events triggers within Details control functions, they run exactly after details! creates or close a segment if (event == "COMBAT_PLAYER_ENTER") then - - + + elseif (event == "COMBAT_PLAYER_LEAVE") then --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then @@ -733,13 +733,13 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve if (DetailsMythicPlusFrame.IsDoingMythicDungeon) then local combatObject = ... - + if (combatObject.is_boss) then if (not combatObject.is_boss.killed) then - + --just in case the combat get tagged as boss fight Details.tabela_vigente.is_boss = nil - + --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 = { @@ -752,34 +752,34 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve DetailsMythicPlusFrame.BossDefeated (false, combatObject.is_boss.id, combatObject.is_boss.name, combatObject.is_boss.diff, 5, 1) end end - + end - + elseif (event == "COMBAT_ENCOUNTER_START") then --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end - + local encounterID, encounterName, difficultyID, raidSize, endStatus = ... --nothing - + elseif (event == "COMBAT_ENCOUNTER_END") then --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end - + local encounterID, encounterName, difficultyID, raidSize, endStatus = ... --nothing elseif (event == "COMBAT_MYTHICDUNGEON_START") then - + print("COMBAT_MYTHICDUNGEON_START", ...) local lower_instance = _detalhes:GetLowerInstanceNumber() if (lower_instance) then lower_instance = _detalhes:GetInstance(lower_instance) if (lower_instance) then - C_Timer.After (3, function() + C_Timer.After(3, function() if (lower_instance:IsEnabled()) then --todo, need localization lower_instance:InstanceAlert ("Details!" .. " " .. "Damage" .. " " .. "Meter", {[[Interface\AddOns\Details\images\minimap]], 16, 16, false}, 3, {function() end}, false, true) @@ -787,67 +787,62 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent (contextObject, eve end) end end - + --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 if (_detalhes.streamer_config.reset_spec_cache) then wipe (_detalhes.cached_specs) end - - C_Timer.After (0.5, DetailsMythicPlusFrame.OnChallengeModeStart) - + + C_Timer.After(0.5, DetailsMythicPlusFrame.OnChallengeModeStart) + elseif (event == "COMBAT_MYTHICDUNGEON_END") then - --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 - C_Timer.After (2, DetailsMythicPlusFrame.MythicDungeonFinished) - + C_Timer.After(2, DetailsMythicPlusFrame.MythicDungeonFinished) end end DetailsMythicPlusFrame:SetScript("OnEvent", function(_, event, ...) - if (event == "START_TIMER") then DetailsMythicPlusFrame.LastTimer = GetTime() - + elseif (event == "ZONE_CHANGED_NEW_AREA") then if (DetailsMythicPlusFrame.IsDoingMythicDungeon) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Details!", event, ...) - print ("Zone changed and is Doing Mythic Dungeon") + print("Details!", event, ...) + print("Zone changed and is Doing Mythic Dungeon") end - + --ignore the event if ignoring mythic dungeon special treatment if (_detalhes.streamer_config.disable_mythic_dungeon) then return end - + local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo() if (currentZoneID ~= Details.MythicPlus.DungeonID) then if (DetailsMythicPlusFrame.DevelopmentDebug) then - print ("Zone changed and the zone is different than the dungeon") + print("Zone changed and the zone is different than the dungeon") end - + --send mythic dungeon end event _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_END") - + --finish the segment DetailsMythicPlusFrame.BossDefeated (true) - + --finish the mythic run DetailsMythicPlusFrame.MythicDungeonFinished (true) end end - end - end) diff --git a/functions/pack.lua b/functions/pack.lua index 0cc6ac75..747c2f1a 100644 --- a/functions/pack.lua +++ b/functions/pack.lua @@ -273,7 +273,7 @@ local unpackActorFlag = function(flag) end local isActorInGroup = function(class, flag) - if (bit.band (flag, IS_GROUP_OBJECT) ~= 0 and class ~= "UNKNOW" and class ~= "UNGROUPPLAYER" and class ~= "PET") then + if (bit.band(flag, IS_GROUP_OBJECT) ~= 0 and class ~= "UNKNOW" and class ~= "UNGROUPPLAYER" and class ~= "PET") then return true end return false diff --git a/functions/plater.lua b/functions/plater.lua index bb18a08a..20e5a36c 100644 --- a/functions/plater.lua +++ b/functions/plater.lua @@ -43,14 +43,14 @@ plater_integration_frame.OnTickFrameFunc = function(self, deltaTime) tinsert(damageTable.RealTimeBufferFromPlayer, 1, damageOnThisUpdateFromPlayer) --remove the damage from the buffer - local damageRemoved = tremove (damageTable.RealTimeBuffer, CONST_BUFFER_SIZE + 1) + local damageRemoved = tremove(damageTable.RealTimeBuffer, CONST_BUFFER_SIZE + 1) if (damageRemoved) then - damageTable.CurrentDamage = max (damageTable.CurrentDamage - damageRemoved, 0) + damageTable.CurrentDamage = max(damageTable.CurrentDamage - damageRemoved, 0) end - local damageRemovedFromPlayer = tremove (damageTable.RealTimeBufferFromPlayer, CONST_BUFFER_SIZE + 1) + local damageRemovedFromPlayer = tremove(damageTable.RealTimeBufferFromPlayer, CONST_BUFFER_SIZE + 1) if (damageRemovedFromPlayer) then - damageTable.CurrentDamageFromPlayer = max (damageTable.CurrentDamageFromPlayer - damageRemovedFromPlayer, 0) + damageTable.CurrentDamageFromPlayer = max(damageTable.CurrentDamageFromPlayer - damageRemovedFromPlayer, 0) end end @@ -124,7 +124,7 @@ function Details:RefreshPlaterIntegration() plater_integration_frame.OnTickFrame:SetScript("OnUpdate", plater_integration_frame.OnTickFrameFunc) --cache the player serial - plater_integration_frame.PlayerGUID = UnitGUID ("player") + plater_integration_frame.PlayerGUID = UnitGUID("player") --cancel the timer if already have one if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then @@ -132,7 +132,7 @@ function Details:RefreshPlaterIntegration() end --cleanup the old tables - plater_integration_frame.CleanUpTimer = C_Timer.NewTicker (10, function() + plater_integration_frame.CleanUpTimer = C_Timer.NewTicker(10, function() local now = time() for GUID, damageTable in pairs(plater_integration_frame.DamageTaken) do if (damageTable.LastEvent + 9.9 < now) then diff --git a/functions/playerclass.lua b/functions/playerclass.lua index baff40d1..6e1f2550 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -5,7 +5,7 @@ do local _detalhes = _G._detalhes local _ local _pairs = pairs - local _ipairs = ipairs + local ipairs = ipairs local _UnitClass = UnitClass local _select = select local _unpack = unpack @@ -42,13 +42,13 @@ 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] if (actor.classe ~= "UNGROUPPLAYER") then - local left, right, top, bottom = unpack (_detalhes.class_coords [actor.classe] or unknown_class_coords) - local r, g, b = unpack (_detalhes.class_colors [actor.classe]) + local left, right, top, bottom = unpack(_detalhes.class_coords [actor.classe] or unknown_class_coords) + local r, g, b = unpack(_detalhes.class_colors [actor.classe]) return actor.classe, left, right, top, bottom, r or 1, g or 1, b or 1 end end @@ -56,8 +56,8 @@ do return "UNKNOW", 0.75, 1, 0.75, 1, 1, 1, 1, 1 else - local left, right, top, bottom = unpack (_detalhes.class_coords [class]) - local r, g, b = unpack (_detalhes.class_colors [class]) + local left, right, top, bottom = unpack(_detalhes.class_coords [class]) + local r, g, b = unpack(_detalhes.class_colors [class]) return class, left, right, top, bottom, r or 1, g or 1, b or 1 end end @@ -71,7 +71,7 @@ do NONE = {0, 50/512, 110/512, 150/512}, } function _detalhes:GetRoleIcon (role) - return [[Interface\AddOns\Details\images\icons2]], unpack (roles [role]) + return [[Interface\AddOns\Details\images\icons2]], unpack(roles [role]) end function _detalhes:GetClassIcon (class) @@ -95,7 +95,7 @@ do elseif (c == "PET") then return [[Interface\AddOns\Details\images\classes_small]], 0.25, 0.49609375, 0.75, 1 else - return [[Interface\AddOns\Details\images\classes_small]], _unpack (_detalhes.class_coords [c]) + return [[Interface\AddOns\Details\images\classes_small]], _unpack(_detalhes.class_coords [c]) end end @@ -106,13 +106,13 @@ do end if (spec == 0) then - return [[Interface\AddOns\Details\images\classes_small]], unpack (_detalhes.class_coords["UNKNOW"]) + return [[Interface\AddOns\Details\images\classes_small]], unpack(_detalhes.class_coords["UNKNOW"]) end if (useAlpha) then - return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], unpack (_detalhes.class_specs_coords [spec]) + return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], unpack(_detalhes.class_specs_coords [spec]) else - return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack (_detalhes.class_specs_coords [spec]) + return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(_detalhes.class_specs_coords [spec]) end end end @@ -120,18 +120,18 @@ do local default_color = {1, 1, 1, 1} function _detalhes:GetClassColor (class) if (self.classe) then - return unpack (_detalhes.class_colors [self.classe] or default_color) + return unpack(_detalhes.class_colors [self.classe] or default_color) elseif (type(class) == "table" and class.classe) then - return unpack (_detalhes.class_colors [class.classe] or default_color) + return unpack(_detalhes.class_colors [class.classe] or default_color) elseif (type(class) == "string") then - return unpack (_detalhes.class_colors [class] or default_color) + return unpack(_detalhes.class_colors [class] or default_color) elseif (self.color) then return unpack(self.color) else - return unpack (default_color) + return unpack(default_color) end end @@ -150,14 +150,14 @@ do local spec = playerObject.spec if (spec) then texture = [[Interface\AddOns\Details\images\spec_icons_normal]] - L, R, T, B = unpack (_detalhes.class_specs_coords [spec]) + L, R, T, B = unpack(_detalhes.class_specs_coords [spec]) else texture = [[Interface\AddOns\Details\images\classes_small]] - L, R, T, B = unpack (_detalhes.class_coords [playerObject.classe or "UNKNOW"]) + L, R, T, B = unpack(_detalhes.class_coords [playerObject.classe or "UNKNOW"]) end else texture = [[Interface\AddOns\Details\images\classes_small]] - L, R, T, B = unpack (_detalhes.class_coords ["UNKNOW"]) + L, R, T, B = unpack(_detalhes.class_coords ["UNKNOW"]) end return texture, L, R, T, B @@ -172,7 +172,7 @@ do end 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 + for spellid, _ in _pairs(Actor.spells._ActorTable) do local class = _detalhes.ClassSpellList [spellid] if (class) then Actor.classe = class @@ -182,7 +182,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -194,11 +194,11 @@ do if (not Actor.nome) then if (not _detalhes.NoActorNameWarning) then - print ("==============") - _detalhes:Msg ("Unhandled Exception: Actor has no name, ContainerID: ", container.tipo) - _detalhes:Msg ("After the current combat, reset data and use /reload.") - _detalhes:Msg ("Report this issue to the Author: Actor with no name, container: ", container.tipo) - print ("==============") + print("==============") + _detalhes:Msg("Unhandled Exception: Actor has no name, ContainerID: ", container.tipo) + _detalhes:Msg("After the current combat, reset data and use /reload.") + _detalhes:Msg("Report this issue to the Author: Actor with no name, container: ", container.tipo) + print("==============") _detalhes.NoActorNameWarning = true end return @@ -214,7 +214,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -224,8 +224,8 @@ do if (tries and tries < 10) then t[3] = tries + 1 --thanks @Farmbuyer on curseforge - --_detalhes:ScheduleTimer ("GuessClass", 2, {Actor, container, tries+1}) - _detalhes:ScheduleTimer ("GuessClass", 2, t) --passing the same table instead of creating a new one + --_detalhes:ScheduleTimer("GuessClass", 2, {Actor, container, tries+1}) + _detalhes:ScheduleTimer("GuessClass", 2, t) --passing the same table instead of creating a new one end return false @@ -240,7 +240,7 @@ do -- try get the spec from actor name function _detalhes:GetSpec (name) - local guid = UnitGUID (name) + local guid = UnitGUID(name) if (guid) then local spec = _detalhes.cached_specs [guid] if (spec) 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] @@ -294,7 +294,7 @@ do --get from the spell cast list if (_detalhes.tabela_vigente) then - local misc_actor = _detalhes.tabela_vigente (4, Actor.nome) + local misc_actor = _detalhes.tabela_vigente(4, Actor.nome) if (misc_actor and misc_actor.spell_cast) then for spellid, _ in pairs(misc_actor.spell_cast) do local spec = SpecSpellList [spellid] @@ -311,7 +311,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -322,7 +322,7 @@ do end else if (Actor.spells) then - for spellid, _ in _pairs (Actor.spells._ActorTable) do + for spellid, _ in _pairs(Actor.spells._ActorTable) do local spec = SpecSpellList [spellid] if (spec) then if (spec ~= Actor.spec) then @@ -337,7 +337,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -356,7 +356,7 @@ do local misc_actor = container_misc._ActorTable [index] local buffs = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable if (buffs) then - for spellid, spell in _pairs (buffs) do + for spellid, spell in _pairs(buffs) do local spec = SpecSpellList [spellid] if (spec) then if (spec ~= Actor.spec) then @@ -371,7 +371,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -414,7 +414,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -424,7 +424,7 @@ do --get from the spell cast list if (_detalhes.tabela_vigente) then - local misc_actor = _detalhes.tabela_vigente (4, Actor.nome) + local misc_actor = _detalhes.tabela_vigente(4, Actor.nome) if (misc_actor and misc_actor.spell_cast) then for spellid, _ in pairs(misc_actor.spell_cast) do @@ -443,7 +443,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -453,7 +453,7 @@ do end else 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 + for spellid, _ in _pairs(Actor.spells._ActorTable) do local spec = SpecSpellList [spellid] if (spec) then _detalhes.cached_specs [Actor.serial] = spec @@ -468,7 +468,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -481,7 +481,7 @@ do else 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 + for spellid, _ in _pairs(Actor.spells._ActorTable) do local spec = SpecSpellList [spellid] if (spec) then _detalhes.cached_specs [Actor.serial] = spec @@ -496,7 +496,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -514,7 +514,7 @@ do local misc_actor = container_misc._ActorTable [index] local buffs = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable if (buffs) then - for spellid, spell in _pairs (buffs) do + for spellid, spell in _pairs(buffs) do local spec = SpecSpellList [spellid] if (spec) then @@ -530,7 +530,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -556,7 +556,7 @@ do container.need_refresh = true end - if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + if (Actor.minha_barra and type(Actor.minha_barra) == "table") then Actor.minha_barra.minha_tabela = nil _detalhes:ScheduleWindowUpdate (2, true) end @@ -567,12 +567,12 @@ do if (_detalhes.streamer_config.quick_detection) then if (tries and tries < 30) then t[3] = tries + 1 - _detalhes:ScheduleTimer ("GuessSpec", 1, t) + _detalhes:ScheduleTimer("GuessSpec", 1, t) end else if (tries and tries < 10) then t[3] = tries + 1 - _detalhes:ScheduleTimer ("GuessSpec", 3, t) + _detalhes:ScheduleTimer("GuessSpec", 3, t) end end @@ -617,7 +617,7 @@ function _detalhes:AddClassOrSpecIcon (playerName, class, spec, iconSize, useAlp if (spec) then local specString = "" - local L, R, T, B = unpack (_detalhes.class_specs_coords [spec]) + local L, R, T, B = unpack(_detalhes.class_specs_coords [spec]) if (L) then if (useAlphaIcons) then specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal_alpha:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" @@ -630,7 +630,7 @@ function _detalhes:AddClassOrSpecIcon (playerName, class, spec, iconSize, useAlp if (class) then local classString = "" - local L, R, T, B = unpack (_detalhes.class_coords [class]) + local L, R, T, B = unpack(_detalhes.class_coords [class]) if (L) then local imageSize = 128 if (useAlphaIcons) then diff --git a/functions/profiles.lua b/functions/profiles.lua index b062b294..ef99a501 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -27,7 +27,7 @@ end function _detalhes:CreateProfile (name) - if (not name or type (name) ~= "string" or name == "") then + if (not name or type(name) ~= "string" or name == "") then return false end @@ -37,7 +37,7 @@ function _detalhes:CreateProfile (name) end --copy the default table - local new_profile = Details.CopyTable (_detalhes.default_profile) + local new_profile = Details.CopyTable(_detalhes.default_profile) new_profile.instances = {} --add to global container @@ -126,7 +126,7 @@ function _detalhes:SetProfileCProp (name, cprop, value) if (profile) then if (type(value) == "table") then - rawset (profile, cprop, Details.CopyTable (value)) + rawset (profile, cprop, Details.CopyTable(value)) else rawset (profile, cprop, value) end @@ -171,7 +171,7 @@ function _detalhes:ResetProfile (profile_name) local instance = _detalhes:GetInstance(1) local exported = instance:ExportSkin() exported.__was_opened = instance:IsEnabled() - exported.__pos = Details.CopyTable (instance:GetPosition()) + exported.__pos = Details.CopyTable(instance:GetPosition()) exported.__locked = instance.isLocked exported.__snap = {} exported.__snapH = false @@ -222,7 +222,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --if the profile doesn't exist, just quit if (not profile) then - _detalhes:Msg ("Profile Not Found.") + _detalhes:Msg("Profile Not Found.") return false end @@ -239,7 +239,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --the entire key doesn't exist if (profile [key] == nil) then if (type(value) == "table") then - profile [key] = Details.CopyTable (_detalhes.default_profile [key]) + profile [key] = Details.CopyTable(_detalhes.default_profile [key]) else profile [key] = value end @@ -257,10 +257,10 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) if (type(value) == "table") then if (key == "class_specs_coords") then - value = Details.CopyTable (_detalhes.default_profile.class_specs_coords) + value = Details.CopyTable(_detalhes.default_profile.class_specs_coords) end - local ctable = Details.CopyTable (value) + local ctable = Details.CopyTable(value) _detalhes [key] = ctable else _detalhes [key] = value @@ -285,7 +285,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) for index, instance in _detalhes:ListInstances() do if (not getmetatable (instance)) then instance.iniciada = false - setmetatable (instance, _detalhes) + setmetatable(instance, _detalhes) end if (instance:IsStarted()) then if (instance:IsEnabled()) then @@ -341,7 +341,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --copy skin for key, value in pairs(skin) do if (type(value) == "table") then - instance [key] = Details.CopyTable (value) + instance [key] = Details.CopyTable(value) else instance [key] = value end @@ -372,21 +372,21 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) instance:LoadLocalInstanceConfig() --check window positioning if (_detalhes.profile_save_pos) then - --print ("is profile save pos", skin.__pos.normal.x, skin.__pos.normal.y) + --print("is profile save pos", skin.__pos.normal.x, skin.__pos.normal.y) if (skin.__pos) then - instance.posicao = Details.CopyTable (skin.__pos) + instance.posicao = Details.CopyTable(skin.__pos) else if (not instance.posicao) then - print ("|cFFFF2222Details!: Position for a window wasn't found! Moving it to the center of the screen.|r\nType '/details exitlog' to check for errors.") + print("|cFFFF2222Details!: Position for a window wasn't found! Moving it to the center of the screen.|r\nType '/details exitlog' to check for errors.") instance.posicao = {normal = {x = 1, y = 1, w = 300, h = 200}, solo = {}} elseif (not instance.posicao.normal) then - print ("|cFFFF2222Details!: Normal position for a window wasn't found! Moving it to the center of the screen.|r\nType '/details exitlog' to check for errors.") + print("|cFFFF2222Details!: Normal position for a window wasn't found! Moving it to the center of the screen.|r\nType '/details exitlog' to check for errors.") instance.posicao.normal = {x = 1, y = 1, w = 300, h = 200} end end instance.isLocked = skin.__locked - instance.snap = Details.CopyTable (skin.__snap) or {} + instance.snap = Details.CopyTable(skin.__snap) or {} instance.horizontalSnap = skin.__snapH instance.verticalSnap = skin.__snapV else @@ -445,8 +445,8 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) if (not _detalhes.initializing) then for _, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then - _detalhes.move_janela_func (instance.baseframe, true, instance) - _detalhes.move_janela_func (instance.baseframe, false, instance) + _detalhes.move_janela_func(instance.baseframe, true, instance) + _detalhes.move_janela_func(instance.baseframe, false, instance) end end else @@ -533,7 +533,7 @@ function _detalhes:SaveProfile (saveas) local current_value = _detalhes [key] if (type(current_value) == "table") then - local ctable = Details.CopyTable (current_value) + local ctable = Details.CopyTable(current_value) profile [key] = ctable else profile [key] = current_value @@ -1499,7 +1499,7 @@ function _detalhes:SaveProfileSpecial() 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 - local ctable = Details.CopyTable (current_value) + local ctable = Details.CopyTable(current_value) profile [key] = ctable else profile [key] = current_value @@ -1594,7 +1594,7 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun() print("D! (debug) mythic dungeon state restored.") - C_Timer.After (2, function() + C_Timer.After(2, function() _detalhes:SendEvent("COMBAT_MYTHICDUNGEON_START") end) return @@ -1712,7 +1712,7 @@ end function Details:ImportProfile (profileString, newProfileName) - if (not newProfileName or type (newProfileName) ~= "string" or string.len (newProfileName) < 2) then + 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 return end diff --git a/functions/rowanimation.lua b/functions/rowanimation.lua index ded336ed..56a6d08f 100644 --- a/functions/rowanimation.lua +++ b/functions/rowanimation.lua @@ -8,7 +8,7 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/functions/savedata.lua b/functions/savedata.lua index fb303ad1..ed79d97d 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -3,7 +3,7 @@ local _detalhes = _G._detalhes function _detalhes:WipeConfig() - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local b = CreateFrame("button", "DetailsResetConfigButton", UIParent) tinsert(UISpecialFrames, "DetailsResetConfigButton") @@ -33,14 +33,14 @@ function _detalhes:SaveLocalInstanceConfig() local a1, a2 = instance:GetDisplay() local t = { - pos = Details.CopyTable (instance:GetPosition()), + pos = Details.CopyTable(instance:GetPosition()), is_open = instance:IsEnabled(), attribute = a1 or 1, sub_attribute = a2 or 1, modo = instance:GetMode() or 2, mode = instance:GetMode() or 2, segment = instance:GetSegment() or 0, - snap = Details.CopyTable (instance.snap), + snap = Details.CopyTable(instance.snap), horizontalSnap = instance.horizontalSnap, verticalSnap = instance.verticalSnap, sub_atributo_last = instance.sub_atributo_last or {1, 1, 1, 1, 1}, @@ -56,10 +56,10 @@ function _detalhes:SaveLocalInstanceConfig() local cprofile = _detalhes:GetProfile() local skin = cprofile.instances [instance:GetId()] if (skin) then - t.pos = Details.CopyTable (skin.__pos) + t.pos = Details.CopyTable(skin.__pos) t.horizontalSnap = skin.__snapH t.verticalSnap = skin.__snapV - t.snap = Details.CopyTable (skin.__snap) + t.snap = Details.CopyTable(skin.__snap) t.is_open = skin.__was_opened t.isLocked = skin.__locked end diff --git a/functions/skins.lua b/functions/skins.lua index 4e522dda..8591e282 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -1,6 +1,6 @@ local _detalhes = _G._detalhes -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ --install skin function: @@ -1004,7 +1004,7 @@ local _ local align_right_chat = function() if (not RightChatPanel or not RightChatPanel:IsShown()) then - _detalhes:Msg ("Right Chat Panel isn't shown.") + _detalhes:Msg("Right Chat Panel isn't shown.") return end @@ -1068,10 +1068,10 @@ local _ instance1:SaveMainWindowPosition() instance2:SaveMainWindowPosition() - _detalhes.move_janela_func (instance1.baseframe, true, instance1) - _detalhes.move_janela_func (instance1.baseframe, false, instance1) - _detalhes.move_janela_func (instance2.baseframe, true, instance2) - _detalhes.move_janela_func (instance2.baseframe, false, instance2) + _detalhes.move_janela_func(instance1.baseframe, true, instance1) + _detalhes.move_janela_func(instance1.baseframe, false, instance1) + _detalhes.move_janela_func(instance2.baseframe, true, instance2) + _detalhes.move_janela_func(instance2.baseframe, false, instance2) end diff --git a/functions/slash.lua b/functions/slash.lua index 824a5d24..42d95115 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -1,7 +1,7 @@ local _detalhes = _G._detalhes -local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) +local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ local CreateFrame = CreateFrame @@ -33,7 +33,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == Loc ["STRING_SLASH_NEW"] or command == "new") then - _detalhes:CriarInstancia (nil, true) + _detalhes:CriarInstancia(nil, true) elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history" or command == "score" or command == "rank" or command == "ranking" or command == "statistics" or command == "stats") then _detalhes:OpenRaidHistoryWindow() @@ -55,7 +55,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (instance) then local this_instance = _detalhes:GetInstance(instance) if (not this_instance) then - return _detalhes:Msg (Loc ["STRING_WINDOW_NOTFOUND"]) + return _detalhes:Msg(Loc ["STRING_WINDOW_NOTFOUND"]) end if (this_instance:IsEnabled() and this_instance.baseframe) then this_instance:ShutDown() @@ -97,7 +97,7 @@ function SlashCmdList.DETAILS (msg, editbox) for instanceID, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then if (instance.hide_in_combat_type > 1) then - instance:SetWindowAlphaForCombat (true) + instance:SetWindowAlphaForCombat(true) end end end @@ -106,7 +106,7 @@ function SlashCmdList.DETAILS (msg, editbox) for instanceID, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then if (instance.hide_in_combat_type > 1) then - instance:SetWindowAlphaForCombat (false) + instance:SetWindowAlphaForCombat(false) end end end @@ -117,10 +117,10 @@ function SlashCmdList.DETAILS (msg, editbox) if (instance.hide_in_combat_type > 1) then if (instance.baseframe:GetAlpha() > 0.1) then --show - instance:SetWindowAlphaForCombat (true) + instance:SetWindowAlphaForCombat(true) else --hide - instance:SetWindowAlphaForCombat (false) + instance:SetWindowAlphaForCombat(false) end end end @@ -134,7 +134,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (instance) then local this_instance = _detalhes:GetInstance(instance) if (not this_instance) then - return _detalhes:Msg (Loc ["STRING_WINDOW_NOTFOUND"]) + return _detalhes:Msg(Loc ["STRING_WINDOW_NOTFOUND"]) end if (not this_instance:IsEnabled() and this_instance.baseframe) then this_instance:EnableInstance() @@ -158,7 +158,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:CaptureSet (false, "aura", true) _detalhes:CaptureSet (false, "spellcast", true) - print (Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREOFF"]) + print(Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREOFF"]) elseif (command == Loc ["STRING_SLASH_ENABLE"] or command == "enable") then @@ -169,7 +169,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes:CaptureSet (true, "aura", true) _detalhes:CaptureSet (true, "spellcast", true) - print (Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREON"]) + print(Loc ["STRING_DETAILS1"] .. Loc ["STRING_SLASH_CAPTUREON"]) elseif (command == Loc ["STRING_SLASH_OPTIONS"] or command == "options" or command == "config") then @@ -195,7 +195,7 @@ function SlashCmdList.DETAILS (msg, editbox) local questIds = {{"Tarlna the Ageless", 81535}, {"Drov the Ruiner ", 87437}, {"Rukhmar", 87493}} for _, _table in pairs(questIds) do - print (format ("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"])) + print(format ("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"])) end elseif (command == Loc ["STRING_SLASH_CHANGES"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS1"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS2"] or command == "news" or command == "updates") then @@ -269,20 +269,20 @@ function SlashCmdList.DETAILS (msg, editbox) local profile = _detalhes:GetProfile (rest) if (not profile) then - return _detalhes:Msg ("Profile Not Found.") + return _detalhes:Msg("Profile Not Found.") end if (not _detalhes:ApplyProfile (rest)) then return end - _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], rest) + _detalhes:Msg(Loc ["STRING_OPTIONS_PROFILE_LOADED"], rest) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then _G.DetailsOptionsWindow:Hide() GameCooltip:Close() end else - _detalhes:Msg ("/details profile ") + _detalhes:Msg("/details profile ") end -------- debug --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -293,17 +293,17 @@ function SlashCmdList.DETAILS (msg, editbox) local exitlog = _detalhes_global.exit_log local exiterrors = _detalhes_global.exit_errors - print ("EXIT LOG:") + print("EXIT LOG:") for index, text in ipairs(exitlog) do - print (text) + print(text) end - print ("ERRORS:") + print("ERRORS:") if (exiterrors) then for index, text in ipairs(exiterrors) do - print (text) + print(text) end else - print ("|cFF00FF00No error occured!|r") + print("|cFF00FF00No error occured!|r") end elseif (msg == "tr") then @@ -323,7 +323,7 @@ function SlashCmdList.DETAILS (msg, editbox) b:SetTarget (texture) A:Play() - C_Timer.NewTicker (1, function() + C_Timer.NewTicker(1, function() texture:SetTexCoord (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random()) end) @@ -331,7 +331,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "realmsync") then _detalhes.realm_sync = not _detalhes.realm_sync - _detalhes:Msg ("Realm Sync: ", _detalhes.realm_sync and "Enabled" or "Disabled") + _detalhes:Msg("Realm Sync: ", _detalhes.realm_sync and "Enabled" or "Disabled") if (not _detalhes.realm_sync) then LeaveChannelByName ("Details") @@ -341,10 +341,10 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "load") then - print (DetailsDataStorage) + print(DetailsDataStorage) local loaded, reason = LoadAddOn ("Details_DataStorage") - print (loaded, reason, DetailsDataStorage) + print(loaded, reason, DetailsDataStorage) elseif (msg == "owner2") then @@ -358,18 +358,18 @@ function SlashCmdList.DETAILS (msg, editbox) return text:GetText() end - print (GetGuardianOwner(UnitGUID ("target"))) + print(GetGuardianOwner(UnitGUID("target"))) elseif (msg == "chat") then elseif (msg == "chaticon") then - _detalhes:Msg ("|TInterface\\AddOns\\Details\\images\\icones_barra:" .. 14 .. ":" .. 14 .. ":0:0:256:32:0:32:0:32|tteste") + _detalhes:Msg("|TInterface\\AddOns\\Details\\images\\icones_barra:" .. 14 .. ":" .. 14 .. ":0:0:256:32:0:32:0:32|tteste") elseif (msg == "align") then local c = RightChatPanel local w,h = c:GetSize() - print (w,h) + print(w,h) local instance1 = _detalhes.tabela_instancias [1] local instance2 = _detalhes.tabela_instancias [2] @@ -386,7 +386,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "addcombat") then local combat = _detalhes.combate:NovaTabela (true, _detalhes.tabela_overall, 1) - local self = combat[1]:PegarCombatente (UnitGUID ("player"), UnitName ("player"), 1297, true) + local self = combat[1]:PegarCombatente (UnitGUID("player"), UnitName ("player"), 1297, true) self.total = 100000 self.total_without_pet = 100000 @@ -435,10 +435,10 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.tabela_historico:adicionar (combat) - _detalhes:InstanciaCallFunction (Details.FadeHandler.Fader, "in", nil, "barras") - _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:InstanciaCallFunction(Details.FadeHandler.Fader, "in", nil, "barras") + _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 @@ -464,11 +464,11 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.tabela_vigente.saved_pets [k] = {v[1], v[2], v[3]} end - _detalhes:Msg ("pet table has been saved on current combat.") + _detalhes:Msg("pet table has been saved on current combat.") elseif (msg == "move") then - print ("moving...") + print("moving...") local instance = _detalhes.tabela_instancias [1] instance.baseframe:ClearAllPoints() @@ -504,8 +504,8 @@ function SlashCmdList.DETAILS (msg, editbox) end elseif (msg == "time") then - print ("GetTime()", GetTime()) - print ("time()", time()) + print("GetTime()", GetTime()) + print("time()", time()) elseif (msg == "copy") then _G.DetailsCopy:Show() @@ -525,7 +525,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (realm) then nome = nome.."-"..realm end - print (nome, realm) + print(nome, realm) elseif (msg == "raid") then @@ -538,14 +538,14 @@ function SlashCmdList.DETAILS (msg, editbox) actorName = player end - print (actorName) + print(actorName) local guid = _detalhes:FindGUIDFromName ("Ditador") - print (guid) + print(guid) for i = 1, GetNumGroupMembers()-1, 1 do local name, realm = UnitName ("party"..i) - print (name, " -- ", realm) + print(name, " -- ", realm) end elseif (msg == "cacheparser") then @@ -555,10 +555,10 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "captures") then for k, v in pairs(_detalhes.capture_real) do - print ("real -",k,":",v) + print("real -",k,":",v) end for k, v in pairs(_detalhes.capture_current) do - print ("current -",k,":",v) + print("current -",k,":",v) end elseif (msg == "slider") then @@ -591,17 +591,17 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "bcollor") then --local instancia = _detalhes.tabela_instancias [1] - _detalhes.ResetButton.Middle:SetVertexColor (1, 1, 0, 1) + _detalhes.ResetButton.Middle:SetVertexColor(1, 1, 0, 1) - --print (_detalhes.ResetButton:GetHighlightTexture()) + --print(_detalhes.ResetButton:GetHighlightTexture()) local t = _detalhes.ResetButton:GetHighlightTexture() - t:SetVertexColor (0, 1, 0, 1) - --print (t:GetObjectType()) + t:SetVertexColor(0, 1, 0, 1) + --print(t:GetObjectType()) --_detalhes.ResetButton:SetHighlightTexture(t) _detalhes.ResetButton:SetNormalTexture(t) - print ("backdrop", _detalhes.ResetButton:GetBackdrop()) + print("backdrop", _detalhes.ResetButton:GetBackdrop()) _detalhes.ResetButton:SetBackdropColor(0, 0, 1, 1) @@ -610,14 +610,14 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == "mini") then local instance = _detalhes.tabela_instancias [1] --Details.VarDump () - --print (instance, instance.StatusBar.options, instance.StatusBar.left) - print (instance.StatusBar.options [instance.StatusBar.left.mainPlugin.real_name].textSize) - print (instance.StatusBar.left.options.textSize) + --print(instance, instance.StatusBar.options, instance.StatusBar.left) + print(instance.StatusBar.options [instance.StatusBar.left.mainPlugin.real_name].textSize) + print(instance.StatusBar.left.options.textSize) elseif (command == "owner") then local petname = rest:match ("^(%S*)%s*(.-)$") - local petGUID = UnitGUID ("target") + local petGUID = UnitGUID("target") if (not _G.DetailsScanTooltip) then local scanTool = CreateFrame("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate") @@ -630,7 +630,7 @@ function SlashCmdList.DETAILS (msg, editbox) scanTool:ClearLines() - print (petName) + print(petName) scanTool:SetUnit (petName) local ownerText = scanText:GetText() @@ -642,33 +642,33 @@ function SlashCmdList.DETAILS (msg, editbox) return owner -- This is the pet's owner end - --print (getPetOwner (petname)) - print (getPetOwner (petGUID)) + --print(getPetOwner (petname)) + print(getPetOwner (petGUID)) elseif (command == "buffsof") then local playername, segment = rest:match("^(%S*)%s*(.-)$") segment = tonumber (segment or 0) - print ("dumping buffs of ", playername, segment) + print("dumping buffs of ", playername, segment) - local c = _detalhes:GetCombat ("current") + local c = _detalhes:GetCombat("current") if (c) then local playerActor if (segment and segment ~= 0) then - local c = _detalhes:GetCombat (segment) + local c = _detalhes:GetCombat(segment) playerActor = c (4, playername) - print ("using segment", segment, c, "player actor:", playerActor) + print("using segment", segment, c, "player actor:", playerActor) else playerActor = c (4, playername) end - print ("actor table: ", playerActor) + print("actor table: ", playerActor) if (not playerActor) then - print ("actor table not found") + print("actor table not found") return end @@ -676,7 +676,7 @@ function SlashCmdList.DETAILS (msg, editbox) for spellid, spellTable in pairs(playerActor.buff_uptime_spells._ActorTable) do local spellname = GetSpellInfo(spellid) if (spellname) then - print (spellid, spellname, spellTable.uptime) + print(spellid, spellname, spellTable.uptime) end end end @@ -685,7 +685,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "teste") then local a, b = _detalhes:GetEncounterEnd (1098, 3) - print (a, unpack (b)) + print(a, unpack(b)) elseif (msg == "yesno") then --_detalhes:Show() @@ -693,9 +693,9 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "imageedit") then local callback = function(width, height, overlayColor, alpha, texCoords) - print (width, height, alpha) - print ("overlay: ", unpack (overlayColor)) - print ("crop: ", unpack (texCoords)) + print(width, height, alpha) + print("overlay: ", unpack(overlayColor)) + print("crop: ", unpack(texCoords)) end _detalhes.gump:ImageEditor (callback, "Interface\\TALENTFRAME\\bg-paladin-holy", nil, {1, 1, 1, 1}) -- {0.25, 0.25, 0.25, 0.25} @@ -703,7 +703,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "chat") then local name, fontSize, r, g, b, a, shown, locked = FCF_GetChatWindowInfo (1); - print (name,"|",fontSize,"|", r,"|", g,"|", b,"|", a,"|", shown,"|", locked) + print(name,"|",fontSize,"|", r,"|", g,"|", b,"|", a,"|", shown,"|", locked) --local fontFile, unused, fontFlags = self:GetFont(); --self:SetFont(fontFile, fontSize, fontFlags); @@ -722,7 +722,7 @@ function SlashCmdList.DETAILS (msg, editbox) } _detalhes.capture_current = _detalhes.capture_real _detalhes:CaptureRefresh() - print (Loc ["STRING_DETAILS1"] .. "capture has been reseted.") + print(Loc ["STRING_DETAILS1"] .. "capture has been reseted.") --debug elseif (command == "barra") then @@ -734,11 +734,11 @@ function SlashCmdList.DETAILS (msg, editbox) for i = 1, barra:GetNumPoints() do local point, relativeTo, relativePoint, xOfs, yOfs = barra:GetPoint (i) - print (point, relativeTo, relativePoint, xOfs, yOfs) + print(point, relativeTo, relativePoint, xOfs, yOfs) end elseif (msg == "opened") then - print ("Instances opened: " .. _detalhes.opened_windows) + print("Instances opened: " .. _detalhes.opened_windows) --debug, get a guid of something elseif (command == "backdrop") then --localize-me @@ -748,18 +748,18 @@ function SlashCmdList.DETAILS (msg, editbox) Details.VarDump (backdrop) Details.VarDump (backdrop.insets) - print ("bgcolor:",f:GetBackdropColor()) - print ("bordercolor",f:GetBackdropBorderColor()) + print("bgcolor:",f:GetBackdropColor()) + print("bordercolor",f:GetBackdropBorderColor()) elseif (command == "myguid") then --localize-me - local g = UnitGUID ("player") - print (type(g)) - print (g) - print (string.len (g)) + local g = UnitGUID("player") + print(type(g)) + print(g) + print(string.len(g)) local serial = g:sub (12, 18) serial = tonumber ("0x"..serial) - print (serial) + print(serial) --tonumber((UnitGUID("target")):sub(-12, -9), 16)) @@ -871,7 +871,7 @@ function SlashCmdList.DETAILS (msg, editbox) _detalhes.id_frame.texto:SetFocus() if (pass_guid == "-") then - local guid = UnitGUID ("target") + local guid = UnitGUID("target") if (guid) then local g = _detalhes:GetNpcIdFromGuid (guid) _detalhes.id_frame.texto:SetText("" .. g) @@ -879,7 +879,7 @@ function SlashCmdList.DETAILS (msg, editbox) end else - print (pass_guid.. " -> " .. tonumber (pass_guid:sub(6, 10), 16)) + 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:HighlightText() end @@ -888,7 +888,7 @@ function SlashCmdList.DETAILS (msg, editbox) local profile = rest:match("^(%S*)%s*(.-)$") - print ("Force apply profile: ", profile) + print("Force apply profile: ", profile) _detalhes:ApplyProfile (profile, false) @@ -898,33 +898,33 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "users" or msg == "version" or msg == "versioncheck") then Details.SendHighFive() - print (Loc ["STRING_DETAILS1"] .. "highfive sent, HI!") + print(Loc ["STRING_DETAILS1"] .. "highfive sent, HI!") - C_Timer.After (0.3, function() + C_Timer.After(0.3, function() Details.RefreshUserList() end) - C_Timer.After (0.6, function() + C_Timer.After(0.6, function() Details.RefreshUserList (true) end) - C_Timer.After (0.9, function() + C_Timer.After(0.9, function() Details.RefreshUserList (true) end) - C_Timer.After (1.3, function() + C_Timer.After(1.3, function() Details.RefreshUserList (true) end) - C_Timer.After (1.6, function() + C_Timer.After(1.6, function() Details.RefreshUserList (true) end) - C_Timer.After (3, function() + C_Timer.After(3, function() Details.RefreshUserList (true) end) - C_Timer.After (4, function() + C_Timer.After(4, function() Details.RefreshUserList (true) end) - C_Timer.After (5, function() + C_Timer.After(5, function() Details.RefreshUserList (true) end) - C_Timer.After (8, function() + C_Timer.After(8, function() Details.RefreshUserList (true) end) @@ -933,7 +933,7 @@ function SlashCmdList.DETAILS (msg, editbox) t = tonumber (t) if (not t) then - return print ("not T found.") + return print("not T found.") end local f = _detalhes.ListPanel @@ -949,7 +949,7 @@ function SlashCmdList.DETAILS (msg, editbox) f:add (name, i) end - print (i, "names found.") + print(i, "names found.") f:Show() @@ -959,7 +959,7 @@ function SlashCmdList.DETAILS (msg, editbox) t = tonumber (t) if (not t) then - return print ("not T found.") + return print("not T found.") end local f = _detalhes.ListPanel @@ -968,7 +968,7 @@ function SlashCmdList.DETAILS (msg, editbox) end local container = _detalhes.tabela_vigente [t]._ActorTable - print (#container, "actors found.") + print(#container, "actors found.") for index, actor in ipairs(container) do f:add (actor.nome, index, filter) end @@ -977,7 +977,7 @@ function SlashCmdList.DETAILS (msg, editbox) --debug elseif (msg == "save") then - print ("running... this is a debug command, details wont work until next /reload.") + print("running... this is a debug command, details wont work until next /reload.") _detalhes:PrepareTablesForSave() elseif (msg == "buffs") then @@ -986,7 +986,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (not name) then return end - print (spellid, name) + print(spellid, name) end elseif (msg == "id") then @@ -1012,21 +1012,21 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == "debug") then if (_detalhes.debug) then _detalhes.debug = false - print (Loc ["STRING_DETAILS1"] .. "diagnostic mode has been turned off.") + print(Loc ["STRING_DETAILS1"] .. "diagnostic mode has been turned off.") return else _detalhes.debug = true - print (Loc ["STRING_DETAILS1"] .. "diagnostic mode has been turned on.") + print(Loc ["STRING_DETAILS1"] .. "diagnostic mode has been turned on.") if (rest and rest ~= "") then if (rest == "-clear") then _detalhes_global.debug_chr_log = "" - print (Loc ["STRING_DETAILS1"] .. "log for characters has been wiped.") + print(Loc ["STRING_DETAILS1"] .. "log for characters has been wiped.") return end _detalhes.debug_chr = rest _detalhes_global.debug_chr_log = _detalhes_global.debug_chr_log or "" - print (Loc ["STRING_DETAILS1"] .. "diagnostic for character " .. rest .. " turned on.") + print(Loc ["STRING_DETAILS1"] .. "diagnostic for character " .. rest .. " turned on.") return end end @@ -1035,11 +1035,11 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (msg == "combatlog") then if (_detalhes.isLoggingCombat) then LoggingCombat (false) - print ("Wow combatlog record turned OFF.") + print("Wow combatlog record turned OFF.") _detalhes.isLoggingCombat = nil else LoggingCombat (true) - print ("Wow combatlog record turned ON.") + print("Wow combatlog record turned ON.") _detalhes.isLoggingCombat = true end @@ -1065,7 +1065,7 @@ function SlashCmdList.DETAILS (msg, editbox) BigWigs.RegisterMessage(addon, "BigWigs_Message") function addon:BigWigs_Message(event, module, key, text) if module.journalId == 1197 and text:match("^Phase %d$") then -- 1197 = Margok - print ("Phase Changed!", event, module, key, text) + print("Phase Changed!", event, module, key, text) end end @@ -1091,7 +1091,7 @@ function SlashCmdList.DETAILS (msg, editbox) local instancia = _detalhes.tabela_instancias [1] for _, barra in ipairs(instancia.barras) do local _, _, flags = barra.lineText1:GetFont() - print ("outline:",flags) + print("outline:",flags) end elseif (msg == "sell") then @@ -1107,7 +1107,7 @@ function SlashCmdList.DETAILS (msg, editbox) q = i[2] c = c+v[11]*q UseContainerItem (b, s) - print (n, q) + print(n, q) end end end @@ -1122,7 +1122,7 @@ function SlashCmdList.DETAILS (msg, editbox) local itemName, itemLink, itemRarity, itemLevel, _, itemType, itemSubType = GetItemInfo (itemLink) if (itemType == "Armor" or itemType == "Weapon") then --a weapon or armor if (itemLevel < 460) then - print ("Selling", itemName, itemType) + print("Selling", itemName, itemType) UseContainerItem (b, s) end end @@ -1167,7 +1167,7 @@ function SlashCmdList.DETAILS (msg, editbox) local name, description, encounterID, rootSectionID, link = DetailsFramework.EncounterJournal.EJ_GetEncounterInfoByIndex (i, 669) if (name) then DetailsFramework.EncounterJournal.EJ_SelectEncounter (encounterID) - print (name, encounterID, DetailsFramework.EncounterJournal.EJ_GetNumLoot()) + print(name, encounterID, DetailsFramework.EncounterJournal.EJ_GetNumLoot()) for o = 1, DetailsFramework.EncounterJournal.EJ_GetNumLoot() do local name, icon, slot, armorType, itemID, link, encounterID = DetailsFramework.EncounterJournal.EJ_GetLootInfoByIndex (o) @@ -1178,7 +1178,7 @@ function SlashCmdList.DETAILS (msg, editbox) end end - print ("total loot", total) + print("total loot", total) _detalhes_global.ALOOT = r elseif (msg == "ilvl" or msg == "itemlevel" or msg == "ilevel") then @@ -1193,7 +1193,7 @@ function SlashCmdList.DETAILS (msg, editbox) ["INVTYPE_RANGEDRIGHT"] = true, } - _detalhes:Msg ("======== Item Level Debug ========") + _detalhes:Msg("======== Item Level Debug ========") for equip_id = 1, 17 do if (equip_id ~= 4) then --shirt slot @@ -1202,7 +1202,7 @@ function SlashCmdList.DETAILS (msg, editbox) local _, _, itemRarity, iLevel, _, _, _, _, equipSlot = GetItemInfo (item) if (iLevel) then item_level = item_level + iLevel - print (iLevel, item) + print(iLevel, item) --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 @@ -1220,7 +1220,7 @@ function SlashCmdList.DETAILS (msg, editbox) end local average = item_level / item_amount - _detalhes:Msg ("gear score: " .. item_level, "| item amount:", item_amount, "| ilvl:", average) + _detalhes:Msg("gear score: " .. item_level, "| item amount:", item_amount, "| ilvl:", average) _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true) @@ -1245,7 +1245,7 @@ function SlashCmdList.DETAILS (msg, editbox) bar:SetTimer (start, fim) - --C_Timer.After (5, function() bar:CancelTimerBar() end) + --C_Timer.After(5, function() bar:CancelTimerBar() end) elseif (msg == "q") then @@ -1262,9 +1262,9 @@ function SlashCmdList.DETAILS (msg, editbox) if (myframe.texture:IsShown()) then myframe.texture:Hide() else - print (myframe.texture:GetTexture()) + print(myframe.texture:GetTexture()) myframe.texture:Show() - print (myframe.texture:GetTexture()) + print(myframe.texture:GetTexture()) end end @@ -1286,7 +1286,7 @@ function SlashCmdList.DETAILS (msg, editbox) local a = CreateFrame("statusbar", nil, UIParent) a:SetPoint("topleft", UIParent, "topleft", i*32, y) a:SetSize(32, 32) - a:SetMinMaxValues (0, 1) + a:SetMinMaxValues(0, 1) local texture = a:CreateTexture(nil, "overlay") texture:SetSize(32, 32) @@ -1299,9 +1299,9 @@ function SlashCmdList.DETAILS (msg, editbox) -- /run for o=1,10 do local f=CreateFrame("frame");f:SetPoint("center");f:SetSize(300,300); local t=f:CreateTexture(nil,"overlay");t:SetAllPoints();f:SetScript("OnUpdate",function() t:SetTexture("Interface\\1024")end);end; -- https://www.dropbox.com/s/ulyeqa2z0ummlu7/1024.tga?dl=0 - local time = 0 + local elapsedTime = 0 a:SetScript("OnUpdate", function(self, deltaTime) - time = time + deltaTime + elapsedTime = elapsedTime + deltaTime --texture:SetSize(math.random (50, 300), math.random (50, 300)) --local spec = allspecs [math.random (#allspecs)] @@ -1309,16 +1309,16 @@ function SlashCmdList.DETAILS (msg, editbox) --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])) + --texture:SetTexCoord (unpack(_detalhes.class_specs_coords [spec])) - --a:SetAlpha (abs (math.sin (time))) - --a:SetValue(abs (math.sin (time))) + --a:SetAlpha(abs(math.sin (time))) + --a:SetValue(abs(math.sin (time))) end) end elseif (msg == "alert") then --local instancia = _detalhes.tabela_instancias [1] - local f = function(a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end + local f = function(a, b, c, d, e, f, g) print(a, b, c, d, e, f, g) end --instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5, {f, 1, 2, 3, 4, 5}) local lower_instance = _detalhes:GetLowerInstanceNumber() @@ -1364,13 +1364,13 @@ function SlashCmdList.DETAILS (msg, editbox) if (spec) then local specID = DetailsFramework.GetSpecializationInfo (spec) if (specID and specID ~= 0) then - print ("Current SpecID: ", specID) + print("Current SpecID: ", specID) end end elseif (msg == "senditemlevel") then _detalhes:SendCharacterData() - print ("Item level dispatched.") + print("Item level dispatched.") elseif (msg == "talents") then local talents = {} @@ -1384,16 +1384,16 @@ function SlashCmdList.DETAILS (msg, editbox) end end - print ("talentID", "name", "texture", "selected", "available", "spellID", "unknown", "row", "column", "unknown", "unknown") + print("talentID", "name", "texture", "selected", "available", "spellID", "unknown", "row", "column", "unknown", "unknown") for i = 1, #talents do - print (GetTalentInfoByID (talents [i])) + print(GetTalentInfoByID (talents [i])) end elseif (msg == "merge") then --at this point, details! should not be in combat if (_detalhes.in_combat) then - _detalhes:Msg ("already in combat, closing current segment.") + _detalhes:Msg("already in combat, closing current segment.") _detalhes:SairDoCombate() end @@ -1428,7 +1428,7 @@ function SlashCmdList.DETAILS (msg, editbox) end newCombat.is_trash = false - _detalhes:Msg ("done merging, segments: " .. segmentsAdded .. ", total time: " .. DetailsFramework:IntegerToTimer (totalTime)) + _detalhes:Msg("done merging, segments: " .. segmentsAdded .. ", total time: " .. DetailsFramework:IntegerToTimer (totalTime)) --[[ --mythic+ debug --tag the segment as mythic overall segment @@ -1466,10 +1466,10 @@ function SlashCmdList.DETAILS (msg, editbox) --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:InstanciaCallFunction(Details.FadeHandler.Fader, "in", nil, "barras") + _detalhes:InstanciaCallFunction(_detalhes.AtualizaSegmentos) + _detalhes:InstanciaCallFunction(_detalhes.AtualizaSoloMode_AfertReset) + _detalhes:InstanciaCallFunction(_detalhes.ResetaGump) _detalhes:RefreshMainWindow(-1, true) elseif (msg == "ej") then @@ -1489,13 +1489,13 @@ function SlashCmdList.DETAILS (msg, editbox) while (nextID [1]) do --get the deepest section in the hierarchy - local ID = tremove (nextID) + local ID = tremove(nextID) local sectionInfo = C_EncounterJournal.GetSectionInfo (ID) if (sectionInfo) then tinsert(result, sectionInfo) - if (sectionInfo.spellID and type (sectionInfo.spellID) == "number" and sectionInfo.spellID ~= 0) then + if (sectionInfo.spellID and type(sectionInfo.spellID) == "number" and sectionInfo.spellID ~= 0) then tinsert(spellIDs, sectionInfo.spellID) end @@ -1541,17 +1541,17 @@ function SlashCmdList.DETAILS (msg, editbox) end elseif (msg == "9") then - print ("skin:", Details.skin) - print ("current profile:", _detalhes:GetCurrentProfileName()) - print ("always use profile:", _detalhes.always_use_profile) - print ("profile name:", _detalhes.always_use_profile_name) - print ("version:", _detalhes.build_counter >= _detalhes.alpha_build_counter and _detalhes.build_counter or _detalhes.alpha_build_counter) + print("skin:", Details.skin) + print("current profile:", _detalhes:GetCurrentProfileName()) + print("always use profile:", _detalhes.always_use_profile) + print("profile name:", _detalhes.always_use_profile_name) + print("version:", _detalhes.build_counter >= _detalhes.alpha_build_counter and _detalhes.build_counter or _detalhes.alpha_build_counter) elseif (msg == "record") then _detalhes.ScheduleLoadStorage() - _detalhes.TellDamageRecord = C_Timer.NewTimer (0.6, _detalhes.PrintEncounterRecord) + _detalhes.TellDamageRecord = C_Timer.NewTimer(0.6, _detalhes.PrintEncounterRecord) _detalhes.TellDamageRecord.Boss = 2032 _detalhes.TellDamageRecord.Diff = 16 @@ -1617,15 +1617,15 @@ function SlashCmdList.DETAILS (msg, editbox) t1, t2 = t1.t1, t1.t2 end for key, value in pairs(t2) do - if (not ignoredKeys [key] and type (value) ~= "function") then + if (not ignoredKeys [key] and type(value) ~= "function") then if (key == "targets") then t1 [key] = {} elseif (type(value) == "table") then t1 [key] = t1 [key] or {} - --print (key, value) - --local d = C_Timer.NewTimer (1, f.copy) + --print(key, value) + --local d = C_Timer.NewTimer(1, f.copy) --d.t1 = t1 [key] --d.t2 = t2 [key] --d.Timer = true @@ -1647,7 +1647,7 @@ function SlashCmdList.DETAILS (msg, editbox) --the segment received is raw and does not have metatables, need to refresh them local zipData = Details:CompressData (copySegment, "print") - --print (zipData) + --print(zipData) --Details:Dump (keys) Details:Dump ({zipData}) else @@ -1660,38 +1660,38 @@ function SlashCmdList.DETAILS (msg, editbox) --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]) + local whichType = type(_detalhes.default_profile [command]) --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 _detalhes [command] = rest - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest) + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest) else - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a number") + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a number") end elseif (whichType == "string") then rest = tostring (rest) if (rest) then _detalhes [command] = rest - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest) + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest) else - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a string") + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects a string") end elseif (whichType == "boolean") then if (rest == "true") then _detalhes [command] = true - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to true") + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to true") elseif (rest == "false") then _detalhes [command] = false - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to false") + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to false") else - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects true or false") + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' expects true or false") end end @@ -1700,7 +1700,7 @@ function SlashCmdList.DETAILS (msg, editbox) if (type(value) == "boolean") then value = value and "true" or "false" end - print (Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' current value is: " .. value) + print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' current value is: " .. value) end return @@ -1708,15 +1708,15 @@ function SlashCmdList.DETAILS (msg, editbox) end - print ("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_SHOW"] .. " " .. Loc ["STRING_SLASH_HIDE"] .. " " .. Loc ["STRING_SLASH_TOGGLE"] .. "|r|cfffcffb0 <" .. Loc ["STRING_WINDOW_NUMBER"] .. ">|r: " .. Loc ["STRING_SLASH_SHOWHIDETOGGLE_DESC"]) - print ("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_RESET"] .. "|r: " .. Loc ["STRING_SLASH_RESET_DESC"]) - print ("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_OPTIONS"] .. "|r|cfffcffb0 <" .. Loc ["STRING_WINDOW_NUMBER"] .. ">|r: " .. Loc ["STRING_SLASH_OPTIONS_DESC"]) - print ("|cffffaeae/details|r |cffffff33" .. "API" .. "|r: " .. Loc ["STRING_SLASH_API_DESC"]) - print ("|cffffaeae/details|r |cffffff33" .. "me" .. "|r: open the player breakdown for you.") --localize-me - print ("|cffffaeae/details|r |cffffff33" .. "spells" .. "|r: list of spells already saw.") --localize-me + print("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_SHOW"] .. " " .. Loc ["STRING_SLASH_HIDE"] .. " " .. Loc ["STRING_SLASH_TOGGLE"] .. "|r|cfffcffb0 <" .. Loc ["STRING_WINDOW_NUMBER"] .. ">|r: " .. Loc ["STRING_SLASH_SHOWHIDETOGGLE_DESC"]) + print("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_RESET"] .. "|r: " .. Loc ["STRING_SLASH_RESET_DESC"]) + print("|cffffaeae/details|r |cffffff33" .. Loc ["STRING_SLASH_OPTIONS"] .. "|r|cfffcffb0 <" .. Loc ["STRING_WINDOW_NUMBER"] .. ">|r: " .. Loc ["STRING_SLASH_OPTIONS_DESC"]) + print("|cffffaeae/details|r |cffffff33" .. "API" .. "|r: " .. Loc ["STRING_SLASH_API_DESC"]) + print("|cffffaeae/details|r |cffffff33" .. "me" .. "|r: open the player breakdown for you.") --localize-me + print("|cffffaeae/details|r |cffffff33" .. "spells" .. "|r: list of spells already saw.") --localize-me print("|cFFFFFF00DETAILS! VERSION|r:|cFFFFAA00" .. " " .. Details.GetVersionString()) - print ("|cffffaeae/details|r |cffffff33" .. "version" .. "|r: copy version.") + print("|cffffaeae/details|r |cffffff33" .. "version" .. "|r: copy version.") end end @@ -1758,7 +1758,7 @@ end function Details:UpdateUserPanel (usersTable) if (not Details.UserPanel) then - DetailsUserPanel = DetailsFramework:CreateSimplePanel (UIParent) + DetailsUserPanel = DetailsFramework:CreateSimplePanel(UIParent) DetailsUserPanel:SetSize(707, 505) DetailsUserPanel:SetTitle ("Details! Version Check") DetailsUserPanel.Data = {} @@ -1806,7 +1806,7 @@ function Details:UpdateUserPanel (usersTable) local userTable = data [index] if (userTable) then - local userName, userRealm, userVersion = unpack (userTable) + local userName, userRealm, userVersion = unpack(userTable) if (not userShown[userName]) then local line = self:GetLine(lineId) line.UserNameText.text = userName @@ -1821,17 +1821,17 @@ 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() @@ -1843,7 +1843,7 @@ function Details:UpdateUserPanel (usersTable) 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:SetBackdropColor(unpack(backdrop_color)) DetailsFramework:Mixin (line, DetailsFramework.HeaderFunctions) @@ -1895,7 +1895,7 @@ function Details:UpdateUserPanel (usersTable) end function _detalhes:CreateListPanel() - _detalhes.ListPanel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsActorsFrame", nil, 300, 600) + _detalhes.ListPanel = _detalhes.gump:NewPanel(UIParent, nil, "DetailsActorsFrame", nil, 300, 600) _detalhes.ListPanel:SetPoint("center", UIParent, "center", 300, 0) _detalhes.ListPanel.barras = {} @@ -1922,9 +1922,9 @@ function _detalhes:CreateListPanel() container_barras:SetAllPoints(container_barras_window) container_barras:SetWidth(500) container_barras:SetHeight(150) - container_barras:EnableMouse (true) + container_barras:EnableMouse(true) container_barras:SetResizable(false) - container_barras:SetMovable (true) + container_barras:SetMovable(true) container_barras_window:SetWidth(460) container_barras_window:SetHeight(550) @@ -1935,7 +1935,7 @@ function _detalhes:CreateListPanel() container_barras_window.slider:Altura (560) container_barras_window.slider:cimaPoint (0, 1) container_barras_window.slider:baixoPoint (0, -3) - container_barras_window.slider:SetFrameLevel (10) + container_barras_window.slider:SetFrameLevel(10) container_barras_window.ultimo = 0 diff --git a/functions/spellcache.lua b/functions/spellcache.lua index 9e34a7e6..55c22759 100644 --- a/functions/spellcache.lua +++ b/functions/spellcache.lua @@ -6,7 +6,7 @@ do --On The Fly SpellCache local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) local _ local _rawget = rawget local _rawset = rawset @@ -61,7 +61,7 @@ do --reset spell cache function _detalhes:ClearSpellCache() - _detalhes.spellcache = _setmetatable ({}, + _detalhes.spellcache = _setmetatable({}, {__index = function(tabela, valor) local esta_magia = _rawget (tabela, valor) if (esta_magia) then @@ -248,7 +248,7 @@ do if (spellid > 10) then local exists = _GetSpellInfo(spellid) if (not exists) then - tremove (_detalhes.savedCustomSpells, i) + tremove(_detalhes.savedCustomSpells, i) end end end @@ -278,7 +278,7 @@ do if (name) then _rawset (_detalhes.spellcache, spellid, {name, 1, icon}) end - return tremove (_detalhes.savedCustomSpells, index) + return tremove(_detalhes.savedCustomSpells, index) end return false @@ -286,7 +286,7 @@ do --overwrite for API GetSpellInfo function - _detalhes.getspellinfo = function(spellid) return _unpack (_detalhes.spellcache[spellid]) end + _detalhes.getspellinfo = function(spellid) return _unpack(_detalhes.spellcache[spellid]) end _detalhes.GetSpellInfo = _detalhes.getspellinfo --overwrite SpellInfo if the spell is a DoT, so Details.GetSpellInfo will return the name modified @@ -325,7 +325,7 @@ do load_frame.tick = _detalhes:ScheduleRepeatingTimer ("BuildSpellListSlowTick", 1) function load_frame:GetProgress() - return math.floor (step / max * 100) + return math.floor(step / max * 100) end end @@ -356,7 +356,7 @@ do step = max _G.DetailsLoadSpellCache.completed = true _G.DetailsLoadSpellCache.inprogress = false - _detalhes:CancelTimer (_G.DetailsLoadSpellCache.tick) + _detalhes:CancelTimer(_G.DetailsLoadSpellCache.tick) DetailsLoadSpellCacheProgress:Hide() load_frame:SetScript("OnUpdate", nil) end diff --git a/functions/spells.lua b/functions/spells.lua index 26499933..887bd6ff 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -3900,7 +3900,7 @@ do } - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) _detalhes.SpellOverwrite = { --[124464] = {name = GetSpellInfo(124464) .. " (" .. Loc ["STRING_MASTERY"] .. ")"}, --shadow word: pain mastery proc (priest) } @@ -3950,10 +3950,10 @@ do end local default_school_color = {145/255, 180/255, 228/255} function _detalhes:GetSpellSchoolColor (school) - return unpack (_detalhes.spells_school [school] and _detalhes.spells_school [school].decimals or default_school_color) + return unpack(_detalhes.spells_school [school] and _detalhes.spells_school [school].decimals or default_school_color) end function _detalhes:GetCooldownList (class) - class = class or select (2, UnitClass ("player")) + class = class or select(2, UnitClass ("player")) return _detalhes.DefensiveCooldownSpells [class] end end diff --git a/functions/testbars.lua b/functions/testbars.lua index e4af5b08..dcffea14 100644 --- a/functions/testbars.lua +++ b/functions/testbars.lua @@ -3,7 +3,7 @@ local Details = _G.Details function Details:TestBarsUpdate() - local current_combat = Details:GetCombat ("current") + local current_combat = Details:GetCombat("current") for index, actor in current_combat[1]:ListActors() do actor.total = actor.total + (actor.total / 100 * math.random (1, 10)) actor.total = actor.total - (actor.total / 100 * math.random (1, 10)) @@ -18,20 +18,20 @@ end function Details:StartTestBarUpdate() if (Details.test_bar_update) then - Details:CancelTimer (Details.test_bar_update) + Details:CancelTimer(Details.test_bar_update) end Details.test_bar_update = Details:ScheduleRepeatingTimer ("TestBarsUpdate", 0.1) end function Details:StopTestBarUpdate() if (Details.test_bar_update) then - Details:CancelTimer (Details.test_bar_update) + Details:CancelTimer(Details.test_bar_update) end Details.test_bar_update = nil end function Details:CreateTestBars (alphabet, isArena) - local current_combat = Details:GetCombat ("current") - local pclass = select (2, UnitClass ("player")) + local current_combat = Details:GetCombat("current") + local pclass = select(2, UnitClass ("player")) local actors_name = { {"Spiro", "EVOKER", 1467}, diff --git a/functions/timedata.lua b/functions/timedata.lua index 5b6adc31..320784be 100644 --- a/functions/timedata.lua +++ b/functions/timedata.lua @@ -1,13 +1,7 @@ - - - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---basic stuff - local _ local _detalhes = _G._detalhes - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" ) --mantain the enabled time captures _detalhes.timeContainer = {} @@ -55,7 +49,7 @@ end if (this_capture.do_not_save) then - return _detalhes:Msg ("This capture belongs to a plugin and cannot be edited.") + return _detalhes:Msg("This capture belongs to a plugin and cannot be edited.") end this_capture [INDEX_NAME] = name or this_capture [INDEX_NAME] @@ -116,7 +110,7 @@ end --check matrix - if (not matrix or type (matrix) ~= "table") then + if (not matrix or type(matrix) ~= "table") then return "Couldn't register the time capture, matrix was invalid." end @@ -137,14 +131,14 @@ --unregister function _detalhes:TimeDataUnregister (name) if (type(name) == "number") then - tremove (_detalhes.savedTimeCaptures, name) + 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 if (t [INDEX_NAME] == name) then - tremove (_detalhes.savedTimeCaptures, index) + tremove(_detalhes.savedTimeCaptures, index) if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then DetailsOptionsWindowTab17UserTimeCapturesFillPanel.MyObject:Refresh() end @@ -192,15 +186,15 @@ local func, errortext = loadstring (t [INDEX_FUNCTION]) if (func) then DetailsFramework:SetEnvironment(func) - tinsert(exec, { func = func, data = data, attributes = Details.CopyTable (t [INDEX_MATRIX]), is_user = true }) + tinsert(exec, { func = func, data = data, attributes = Details.CopyTable(t [INDEX_MATRIX]), is_user = true }) else - _detalhes:Msg ("|cFFFF9900error compiling script for time data (charts)|r: ", errortext) + _detalhes:Msg("|cFFFF9900error compiling script for time data (charts)|r: ", errortext) end else --plugin local func = t [INDEX_FUNCTION] DetailsFramework:SetEnvironment(func) - tinsert(exec, { func = func, data = data, attributes = Details.CopyTable (t [INDEX_MATRIX]) }) + tinsert(exec, { func = func, data = data, attributes = Details.CopyTable(t [INDEX_MATRIX]) }) end end @@ -218,7 +212,7 @@ local okey, result = _pcall (func, attributes) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on chart script function|r:", result) + _detalhes:Msg("|cFFFF9900error on chart script function|r:", result) result = 0 end @@ -263,21 +257,21 @@ -- raid dps [1] function() local combat = _detalhes.tabela_vigente - local time = combat:GetCombatTime() - if (not time or time == 0) then + local combatTime = combat:GetCombatTime() + if (not combatTime or combatTime == 0) then return 0 else - return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[1] / time) + return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[1] / combatTime) end end, -- raid hps [2] function() local combat = _detalhes.tabela_vigente - local time = combat:GetCombatTime() - if (not time or time == 0) then + local combatTime = combat:GetCombatTime() + if (not combatTime or combatTime == 0) then return 0 else - return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[2] / time) + return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[2] / combatTime) end end } @@ -419,7 +413,7 @@ end local get_player_dps = function() - local damage_player = _detalhes.tabela_vigente (1, _detalhes.playername) + local damage_player = _detalhes.tabela_vigente(1, _detalhes.playername) if (damage_player) then if (_detalhes.time_type == 1) then --activity time local combat_time = damage_player:Tempo() @@ -443,7 +437,7 @@ end local get_player_hps = function() - local heal_player = _detalhes.tabela_vigente (2, _detalhes.playername) + local heal_player = _detalhes.tabela_vigente(2, _detalhes.playername) if (heal_player) then if (_detalhes.time_type == 1) then --activity time local combat_time = heal_player:Tempo() @@ -494,7 +488,7 @@ end local get_player_heal = function() - local heal_player = _detalhes.tabela_vigente (2, _detalhes.playername) + local heal_player = _detalhes.tabela_vigente(2, _detalhes.playername) if (heal_player) then return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total) else diff --git a/plugins/Details_DataStorage/Details_DataStorage.lua b/plugins/Details_DataStorage/Details_DataStorage.lua index 3b946649..fe9ab9bc 100644 --- a/plugins/Details_DataStorage/Details_DataStorage.lua +++ b/plugins/Details_DataStorage/Details_DataStorage.lua @@ -32,7 +32,7 @@ f:SetScript("OnEvent", function(self, event, addonName) end if (_detalhes and _detalhes.debug) then - print ("|cFFFFFF00Details! Storage|r: loaded!") + print("|cFFFFFF00Details! Storage|r: loaded!") end DETAILS_STORAGE_LOADED = true diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index dc233e3d..4b3b8cc6 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -1,4 +1,4 @@ -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details_EncounterDetails") local Graphics = LibStub:GetLibrary("LibGraph-2.0") local _ @@ -6,7 +6,7 @@ local _ local isDebug = false local function DebugMessage (...) if (isDebug) then - print ("|cFFFFFF00EBreakDown|r:", ...) + print("|cFFFFFF00EBreakDown|r:", ...) end end @@ -26,7 +26,7 @@ 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 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 @@ -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 ) @@ -183,7 +183,7 @@ local function CreatePluginFrames (data) elseif (event == "COMBAT_PLAYER_LEAVE") then --combat leave and enter always send current combat table - _combat_object = select (1, ...) + _combat_object = select(1, ...) --check if was a boss fight EncounterDetails:WasEncounter() if (EncounterDetails.combat_boss_found) then @@ -241,7 +241,7 @@ local function CreatePluginFrames (data) elseif (event == "ZONE_TYPE_CHANGED") then if (EncounterDetails.db.show_icon == 1) then - if (select (1, ...) == "raid") then + if (select(1, ...) == "raid") then EncounterDetails:ShowIcon() else EncounterDetails:HideIcon() @@ -275,7 +275,7 @@ local function CreatePluginFrames (data) 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, ...) + local encounterID, encounterName, difficultyID, raidSize = select(1, ...) current_encounter = encounterID elseif (event == "ENCOUNTER_END" or event == "PLAYER_REGEN_ENABLED") then @@ -317,7 +317,7 @@ local function CreatePluginFrames (data) --EncounterDetails.DBM_timers if (_G.DBM) then local dbm_timer_callback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) - --print (bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) + --print(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid) local spell = tostring (spellId) if (spell and not current_table_dbm [spell]) then current_table_dbm [spell] = {spell, id, msg, timer, icon, bartype, spellId, colorId, modid} @@ -328,7 +328,7 @@ local function CreatePluginFrames (data) function EncounterDetails:RegisterBigWigsCallBack() if (BigWigsLoader) then function EncounterDetails:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...) - --print (event, module, spellid, bar_text, time, icon, ...) + --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 ""} @@ -339,7 +339,7 @@ local function CreatePluginFrames (data) end end end - EncounterDetails:ScheduleTimer ("RegisterBigWigsCallBack", 5) + EncounterDetails:ScheduleTimer("RegisterBigWigsCallBack", 5) --BigWigs_StartBar BigWigs_Bosses_Brackenspore mind_fungus Mind Fungus 51 Interface\Icons\inv_mushroom_10 true --bigwigs startbar mind_fungus @@ -378,26 +378,26 @@ local function CreatePluginFrames (data) function EncounterDetails:ShowIconBallonTutorial() if (InCombatLockdown()) then - C_Timer.After (5, function() - --print ("in combat") + C_Timer.After(5, function() + --print("in combat") re_ShowIconBallonTutorial() end) return end local hook_AlertButtonCloseButton = function() - --print ("done tutorial") + --print("done tutorial") EncounterDetails:SetTutorialCVar ("ENCOUNTER_DETAILS_BALLON_TUTORIAL1", true) end if (EncounterDetailsTutorialAlertButton1 or not EncounterDetails.ToolbarButton or not EncounterDetails.ToolbarButton:IsShown()) then - --print (EncounterDetailsTutorialAlertButton1, not EncounterDetails.ToolbarButton, not EncounterDetails.ToolbarButton:IsShown()) + --print(EncounterDetailsTutorialAlertButton1, not EncounterDetails.ToolbarButton, not EncounterDetails.ToolbarButton:IsShown()) return end --[=[ local alert = CreateFrame("frame", "EncounterDetailsTutorialAlertButton1", EncounterDetails.ToolbarButton, "MicroButtonAlertTemplate") - alert:SetFrameLevel (302) + alert:SetFrameLevel(302) alert.label = "Click here (on the skull icon) to bring the Encounter Breakdown panel" alert.Text:SetSpacing (4) alert:SetClampedToScreen (true) @@ -406,7 +406,7 @@ local function CreatePluginFrames (data) alert.CloseButton:HookScript ("OnClick", hook_AlertButtonCloseButton) alert:Show() --]=] - --print ("showing ballon") + --print("showing ballon") end function EncounterDetails:ShowIcon() @@ -416,8 +416,8 @@ local function CreatePluginFrames (data) --EncounterDetails:SetTutorialCVar ("ENCOUNTER_DETAILS_BALLON_TUTORIAL1", false) --debug if (not EncounterDetails:GetTutorialCVar("ENCOUNTER_DETAILS_BALLON_TUTORIAL1")) then - --print ("nao viu o tutorial ainda") - C_Timer.After (2, EncounterDetails.ShowIconBallonTutorial) + --print("nao viu o tutorial ainda") + C_Timer.After(2, EncounterDetails.ShowIconBallonTutorial) end end @@ -440,7 +440,7 @@ local function CreatePluginFrames (data) end EncounterDetailsFrame:HookScript ("OnShow", function() - C_Timer.After (0.1, function() + C_Timer.After(0.1, function() if (not EncounterDetails.LastOpenedTime or EncounterDetails.LastOpenedTime + 2 < GetTime()) then if (_detalhes.AddOnStartTime and _detalhes.AddOnStartTime + 30 < GetTime()) then EncounterDetails:OpenAndRefresh() @@ -481,7 +481,7 @@ local function CreatePluginFrames (data) end end - C_Timer.After (3, function() EncounterDetails:ShowTutorial() end) + C_Timer.After(3, function() EncounterDetails:ShowTutorial() end) DetailsPluginContainerWindow.OpenPlugin (EncounterDetails) @@ -520,31 +520,31 @@ local function CreatePluginFrames (data) --build the header --- CoolTip:AddLine (Loc ["STRING_PLUGIN_NAME"]) +-- CoolTip:AddLine(Loc ["STRING_PLUGIN_NAME"]) -- CoolTip:AddIcon (ENCOUNTERDETAILS_BUTTON.__icon, 1, 1, 20, 20) -- CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "main") --- GameCooltip:AddLine ("$div") +-- GameCooltip:AddLine("$div") --build the menu options --summary - CoolTip:AddLine ("Encounter Summary") + CoolTip:AddLine("Encounter Summary") CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "main") CoolTip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 20, 22, 0, 0.1015625, 0, 0.505625) --chart - CoolTip:AddLine ("Damage Graphic") + CoolTip:AddLine("Damage Graphic") CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "graph") CoolTip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 20, 22, 0.1271875, 0.21875, 0, 0.505625) --emotes - CoolTip:AddLine ("Boss Emotes") + CoolTip:AddLine("Boss Emotes") CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "emotes") CoolTip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 20, 22, 91/256, 116/256, 0, 0.505625) --weakauras - CoolTip:AddLine ("Create Encounter Weakauras") + CoolTip:AddLine("Create Encounter Weakauras") CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "spellsauras") if (_G.WeakAuras) then @@ -554,7 +554,7 @@ local function CreatePluginFrames (data) end --phases - CoolTip:AddLine ("Damage by Boss Phase") + CoolTip:AddLine("Damage by Boss Phase") CoolTip:AddMenu (1, EncounterDetails.Frame.switch, "phases") CoolTip:AddIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 1, 1, 20, 22, 151/256, 176/256, 0, 0.505625) @@ -586,7 +586,7 @@ local function CreatePluginFrames (data) _detalhes.EncounterDetailsTempWindow = nil --~remover ~autoabrir �brir ~abrir ~auto - --C_Timer.After (.5, EncounterDetails.OpenWindow) + --C_Timer.After(.5, EncounterDetails.OpenWindow) end @@ -623,14 +623,14 @@ end GameCooltip:SetType ("tooltipbar") GameCooltip:SetOwner(row) - GameCooltip:AddLine ("Click to Report", nil, 1, "orange") + GameCooltip:AddLine("Click to Report", nil, 1, "orange") GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 12, 16, 0.015625, 0.13671875, 0.4375, 0.59765625) GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, .5}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) 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) if (hp > 100) then @@ -640,7 +640,7 @@ end local evtype = event [1] local spellname, _, spellicon = _GetSpellInfo(event [2]) local amount = event [3] - local time = event [4] + local timeInSeconds = event [4] local source = event [6] if (type(evtype) == "boolean") then @@ -660,7 +660,7 @@ end source = source:gsub ("%[%*%] ", "") end - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white") GameCooltip:AddIcon (spellicon, 1, 1, 16, 16, .1, .9, .1, .9) if (event [9]) then @@ -675,7 +675,7 @@ end local class = Details:GetClass (source) local spec = Details:GetSpec (source) - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. Details:GetOnlyName (Details:AddClassOrSpecIcon (source, class, spec, 16, true)) .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s " .. spellname .. " (" .. Details:GetOnlyName(Details:AddClassOrSpecIcon (source, class, spec, 16, true)) .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white") GameCooltip:AddIcon (spellicon, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip:AddStatusBar (hp, 1, "green", true, statusBarBackground) end @@ -683,7 +683,7 @@ end elseif (type(evtype) == "number") then if (evtype == 1) then --cooldown - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "cooldown (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - 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) @@ -701,7 +701,7 @@ end source = source:gsub ("%[%*%] ", "") end - GameCooltip:AddLine ("" .. _cstr ("%.1f", time - hora_da_morte) .. "s [x" .. amount .. "] " .. spellname .. " (" .. source .. ")", "debuff (" .. hp .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s [x" .. amount .. "] " .. spellname .. " (" .. source .. ")", "debuff (" .. hp .. "%)", 1, "white", "white") GameCooltip:AddIcon (spellicon, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip:AddStatusBar (100, 1, "purple", true, statusBarBackground) @@ -709,13 +709,13 @@ end end end - GameCooltip:AddLine (deathTable [6] .. " " .. "died" , "-- -- -- ", 1, "white") + GameCooltip:AddLine(deathTable [6] .. " " .. "died" , "-- -- -- ", 1, "white") GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\small_icons", 1, 1, iconSize, iconSize, .75, 1, 0, 1) GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]}) if (battleress) then local nome_magia, _, icone_magia = _GetSpellInfo(battleress [2]) - GameCooltip:AddLine ("+" .. _cstr ("%.1f", battleress[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. battleress[6] .. ")", "", 1, "white") + GameCooltip:AddLine("+" .. _cstr ("%.1f", battleress[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. battleress[6] .. ")", "", 1, "white") GameCooltip:AddIcon ("Interface\\Glues\\CharacterSelect\\Glues-AddOn-Icons", 1, 1, nil, nil, .75, 1, 0, 1) GameCooltip:AddStatusBar (0, 1, .5, .5, .5, .5, false, {value = 100, color = {.5, .5, .5, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar4_vidro]]}) end @@ -723,10 +723,10 @@ end if (lastcooldown) then if (lastcooldown[3] == 1) then local nome_magia, _, icone_magia = _GetSpellInfo(lastcooldown [2]) - GameCooltip:AddLine (_cstr ("%.1f", lastcooldown[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")") + GameCooltip:AddLine(_cstr ("%.1f", lastcooldown[4] - hora_da_morte) .. "s " .. nome_magia .. " (" .. Loc ["STRING_LAST_COOLDOWN"] .. ")") GameCooltip:AddIcon (icone_magia) else - GameCooltip:AddLine (Loc ["STRING_NOLAST_COOLDOWN"]) + GameCooltip:AddLine(Loc ["STRING_NOLAST_COOLDOWN"]) GameCooltip:AddIcon ([[Interface\CHARACTERFRAME\UI-Player-PlayTimeUnhealthy]], 1, 1, 18, 18) end GameCooltip:AddStatusBar (0, 1, 1, 1, 1, 1, false, {value = 100, color = {.3, .3, .3, 1}, specialSpark = false, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) @@ -752,19 +752,19 @@ local function DispellInfo (dispell, barra) 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") + GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), tabela[2], 1, "white", "orange") GameCooltip:AddIcon ("Interface\\GossipFrame\\DailyActiveQuestIcon") else - GameCooltip:AddLine (EncounterDetails:GetOnlyName (tabela[1]), tabela[2], 1, "white", "orange") + GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), tabela[2], 1, "white", "orange") local specID = Details:GetSpec (tabela[1]) if (specID) then @@ -792,21 +792,21 @@ local function KickBy (magia, barra) 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 _table_sort (tabela_jogadores, _detalhes.Sort2) local spellName, _, spellIcon = GetSpellInfo(barra.lineText1:GetText()) - GameCooltip:AddLine (barra.lineText1:GetText()) + GameCooltip:AddLine(barra.lineText1:GetText()) if (spellIcon) then GameCooltip:AddIcon (spellIcon, nil, 1, EncounterDetails.CooltipLineHeight, EncounterDetails.CooltipLineHeight, 5/64, 59/64, 5/64, 59/64) 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") + GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), tabela[2], 1, "white") local specID = Details:GetSpec (tabela[1]) if (specID) then @@ -840,24 +840,24 @@ local function EnemySkills (habilidade, barra) 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 _table_sort (tabela_jogadores, _detalhes.Sort2) - GameCooltip:AddLine (barra.lineText1:GetText() .. " Damage Done") + GameCooltip:AddLine(barra.lineText1:GetText() .. " Damage Done") local ToK = _detalhes.ToKFunctions [_detalhes.ps_abbreviation] 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") - local r, g, b, a = unpack (_detalhes.tooltip.background) + GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), ToK (_, tabela[2]) .. " (" .. format ("%.1f", tabela[2] / total * 100) .. "%)", 1, "white") + local r, g, b, a = unpack(_detalhes.tooltip.background) local actorClass = Details:GetClass (tabela[1]) if (actorClass) then @@ -900,13 +900,13 @@ local function DamageTakenDetails (jogador, barra) 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 local habilidades = este_agressor.spells._ActorTable - for id, habilidade in _pairs (habilidades) do + for id, habilidade in _pairs(habilidades) do local alvos = habilidade.targets - for target_name, amount in _pairs (alvos) do + for target_name, amount in _pairs(alvos) do if (target_name == jogador.nome) then meus_agressores [#meus_agressores+1] = {id, amount, este_agressor.nome} end @@ -917,7 +917,7 @@ local function DamageTakenDetails (jogador, barra) _table_sort (meus_agressores, _detalhes.Sort2) - GameCooltip:AddLine (barra.lineText1:GetText() .. " Damage Taken") + GameCooltip:AddLine(barra.lineText1:GetText() .. " Damage Taken") local max = #meus_agressores if (max > 20) then @@ -937,14 +937,14 @@ local function DamageTakenDetails (jogador, barra) teve_melee = true end - GameCooltip:AddLine (nome_magia, ToK (_, meus_agressores[i][2]) .. " (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", 1, "white") + GameCooltip:AddLine(nome_magia, ToK (_, meus_agressores[i][2]) .. " (".._cstr("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", 1, "white") GameCooltip:AddStatusBar (meus_agressores[i][2] / topDamage * 100, 1, .55, .55, .55, .834, false, {value = 100, color = {.21, .21, .21, 0.8}, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) GameCooltip:AddIcon (icone_magia, nil, 1, EncounterDetails.CooltipLineHeight - 0, EncounterDetails.CooltipLineHeight - 0, .1, .9, .1, .9) end if (teve_melee) then - GameTooltip:AddLine ("* "..Loc ["STRING_MELEE_DAMAGE"], 0, 1, 0) + GameTooltip:AddLine("* "..Loc ["STRING_MELEE_DAMAGE"], 0, 1, 0) end GameCooltip:SetOwner(barra, "left", "right", 2, 0) @@ -1061,11 +1061,11 @@ function EncounterDetails:SetRowScripts (barra, index, container) self.mouse_over = true self:SetHeight(EncounterDetails.Frame.DefaultBarHeight + 1) - self:SetAlpha (1) + self:SetAlpha(1) EncounterDetails.SetBarBackdrop_OnEnter (self) --GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") - GameCooltip:Preset (2) + GameCooltip:Preset(2) GameCooltip:SetOwner(self) EncounterDetails:FormatCooltipSettings() @@ -1105,7 +1105,7 @@ function EncounterDetails:SetRowScripts (barra, index, container) end self:SetHeight(EncounterDetails.Frame.DefaultBarHeight) - self:SetAlpha (0.9) + self:SetAlpha(0.9) EncounterDetails.SetBarBackdrop_OnLeave (self) @@ -1133,7 +1133,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) EncounterDetailsFrame.ShowType = EncounterDetails.db.last_section_selected if (segment) then - _combat_object = EncounterDetails:GetCombat (segment) + _combat_object = EncounterDetails:GetCombat(segment) EncounterDetails._segment = segment DebugMessage ("there's a segment to use:", segment, _combat_object, _combat_object and _combat_object.is_boss) @@ -1164,7 +1164,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) end if (not _combat_object) then - --EncounterDetails:Msg ("no combat found.") + --EncounterDetails:Msg("no combat found.") DebugMessage ("_combat_object is nil, EXIT") return end @@ -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 @@ -1289,7 +1289,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local quantidade = 0 local dano_do_primeiro = 0 - for index, jogador in _ipairs(DamageContainer._ActorTable) do + 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 @@ -1318,7 +1318,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.jogador = jogador - barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) + barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe])) if (index == 1) then barra.textura:SetValue(100) @@ -1335,7 +1335,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) else 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])) + barra.icone:SetTexCoord (_unpack(EncounterDetails.class_coords [jogador.classe])) end end @@ -1363,7 +1363,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) --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 @@ -1371,9 +1371,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) --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 @@ -1382,12 +1382,12 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades_usadas = {} local have_pool = false - for spellid, _ in _pairs (habilidades_poll) do + for spellid, _ in _pairs(habilidades_poll) do have_pool = true 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 if ( @@ -1399,7 +1399,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades = jogador.spells._ActorTable - for id, habilidade in _pairs (habilidades) do + 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 @@ -1420,7 +1420,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) --pega os alvos e adiciona ao [2] local alvos = habilidade.targets - for target_name, amount in _pairs (alvos) do + 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 local tabela_dano_do_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [target_name]] @@ -1438,7 +1438,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) --check if the spell id is in the spell poll. local habilidades = jogador.spells._ActorTable - for id, habilidade in _pairs (habilidades) do + 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 @@ -1459,7 +1459,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) --pega os alvos e adiciona ao [2] local alvos = habilidade.targets - for target_name, amount in _pairs (alvos) do + 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 local tabela_dano_do_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [target_name]] @@ -1479,7 +1479,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local tabela_em_ordem = {} local jaFoi = {} - for id, tabela in _pairs (habilidades_usadas) do + for id, tabela in _pairs(habilidades_usadas) do local spellname = Details.GetSpellInfo(tabela [4]) if (not jaFoi [spellname]) then @@ -1493,7 +1493,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local tt = tabela_em_ordem [index] [2] -- tabela com [PlayerName] = {amount, class} for playerName, t in pairs(tabela [2]) do - local amount, class = unpack (t) + local amount, class = unpack(t) if (tt [playerName]) then tt [playerName][1] = tt [playerName][1] + amount else @@ -1510,7 +1510,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) dano_do_primeiro = 0 --mostra o resultado nas barras - for index, habilidade in _ipairs(tabela_em_ordem) do + for index, habilidade in ipairs(tabela_em_ordem) do --ta em ordem das habilidades que deram mais dano if (habilidade[1] > 0) then @@ -1522,7 +1522,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.report_text = Loc ["STRING_PLUGIN_NAME"].."! " .. Loc ["STRING_ABILITY_DAMAGE"] _detalhes:SetFontSize (barra.lineText1, CONST_FONT_SIZE) _detalhes:SetFontSize (barra.lineText4, CONST_FONT_SIZE) - barra.t:SetVertexColor (1, .8, .8, .8) + barra.t:SetVertexColor(1, .8, .8, .8) end local nome_magia, _, icone_magia = _GetSpellInfo(habilidade[4]) @@ -1537,7 +1537,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local spellSchool = _detalhes.spell_school_cache [nome_magia] or 1 local r, g, b = _detalhes:GetSpellSchoolColor (spellSchool) - barra.t:SetVertexColor (r, g, b) + barra.t:SetVertexColor(r, g, b) if (index == 1) then barra.textura:SetValue(100) @@ -1573,9 +1573,9 @@ function EncounterDetails:OpenAndRefresh (_, segment) --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 @@ -1588,12 +1588,12 @@ function EncounterDetails:OpenAndRefresh (_, segment) 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 if (adds_pool [_detalhes:GetNpcIdFromGuid (jogador.serial)] or ( jogador.flag_original and - bit.band (jogador.flag_original, 0x00000060) ~= 0 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 @@ -1608,7 +1608,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) tabela.total = jogador.total --em quem ele deu dano - for target_name, amount in _pairs (jogador.targets) do + for target_name, amount in _pairs(jogador.targets) do local este_jogador = _combat_object (1, target_name) if (este_jogador) then if (este_jogador.classe ~= "PET" and este_jogador.classe ~= "UNGROUPPLAYER" and este_jogador.classe ~= "UNKNOW") then @@ -1620,11 +1620,11 @@ function EncounterDetails:OpenAndRefresh (_, segment) _table_sort (tabela.dano_em, _detalhes.Sort2) --quem deu dano nele - for agressor, _ in _pairs (jogador.damage_from) do + for agressor, _ in _pairs(jogador.damage_from) do --local este_jogador = DamageContainer._ActorTable [DamageContainer._NameIndexTable [agressor]] local este_jogador = _combat_object (1, agressor) if (este_jogador and este_jogador:IsPlayer()) then - for target_name, amount in _pairs (este_jogador.targets) do + for target_name, amount in _pairs(este_jogador.targets) do if (target_name == nome) then tabela.damage_from [#tabela.damage_from+1] = {agressor, amount, este_jogador.classe} tabela.damage_from_total = tabela.damage_from_total + amount @@ -1651,19 +1651,19 @@ function EncounterDetails:OpenAndRefresh (_, segment) local tabela = barra.jogador local dano_em = tabela.dano_em - GameCooltip:Preset (2) + GameCooltip:Preset(2) GameCooltip:SetOwner(self) EncounterDetails:FormatCooltipSettings() - GameCooltip:AddLine (barra.lineText1:GetText().." ".. "Damage Done") + GameCooltip:AddLine(barra.lineText1:GetText().." ".. "Damage Done") local topDamage = dano_em[1] and dano_em[1][2] local dano_em_total = tabela.dano_em_total - for _, esta_tabela in _pairs (dano_em) do + for _, esta_tabela in _pairs(dano_em) do local coords = EncounterDetails.class_coords [esta_tabela[3]] - GameCooltip:AddLine (EncounterDetails:GetOnlyName (esta_tabela[1]), _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/dano_em_total*100) .."%)", 1, "white", "orange") + GameCooltip:AddLine(EncounterDetails:GetOnlyName(esta_tabela[1]), _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/dano_em_total*100) .."%)", 1, "white", "orange") local specID = Details:GetSpec (esta_tabela[1]) if (specID) then @@ -1687,8 +1687,8 @@ function EncounterDetails:OpenAndRefresh (_, segment) self.ArrowOnEnter = true GameCooltip:SetOwner(self, "right", "left", -10, 0) - GameCooltip:AddLine (" ") - GameCooltip:AddLine ("CLICK to Report") + GameCooltip:AddLine(" ") + GameCooltip:AddLine("CLICK to Report") GameCooltip:Show() end @@ -1698,21 +1698,21 @@ function EncounterDetails:OpenAndRefresh (_, segment) local tabela = barra.jogador local damage_from = tabela.damage_from - GameCooltip:Preset (2) + GameCooltip:Preset(2) GameCooltip:SetOwner(self) EncounterDetails:FormatCooltipSettings() - GameCooltip:AddLine (barra.lineText1:GetText().." "..Loc ["STRING_DAMAGE_TAKEN"]) + GameCooltip:AddLine(barra.lineText1:GetText().." "..Loc ["STRING_DAMAGE_TAKEN"]) local damage_from_total = tabela.damage_from_total local topDamage = damage_from[1] and damage_from[1][2] - for _, esta_tabela in _pairs (damage_from) do + for _, esta_tabela in _pairs(damage_from) do local coords = EncounterDetails.class_coords [esta_tabela[3]] if (coords) then - GameCooltip:AddLine (EncounterDetails:GetOnlyName (esta_tabela[1]), _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/damage_from_total*100) .."%)", 1, "white", "orange", nil, nil, "MONOCHRONE") + GameCooltip:AddLine(EncounterDetails:GetOnlyName(esta_tabela[1]), _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/damage_from_total*100) .."%)", 1, "white", "orange", nil, nil, "MONOCHRONE") local specID = Details:GetSpec (esta_tabela[1]) if (specID) then @@ -1730,18 +1730,18 @@ function EncounterDetails:OpenAndRefresh (_, segment) GameCooltip:AddStatusBar (esta_tabela[2] / topDamage * 100, 1, .3, .3, .3, .3, false, {value = 100, color = {.21, .21, .21, 0.8}, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) end else - GameCooltip:AddLine (esta_tabela[1], _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/damage_from_total*100) .."%)") + GameCooltip:AddLine(esta_tabela[1], _detalhes:ToK (esta_tabela[2]).." (".. _cstr ("%.1f", esta_tabela[2]/damage_from_total*100) .."%)") GameCooltip:AddStatusBar (esta_tabela[2] / topDamage * 100, 1, .3, .3, .3, .3, false, {value = 100, color = {.21, .21, .21, 0.8}, texture = [[Interface\AddOns\Details\images\bar_serenity]]}) end end self.mouse_over = true self:SetHeight(EncounterDetails.Frame.DefaultBarHeight + 1) - self:SetAlpha (1) + self:SetAlpha(1) EncounterDetails.SetBarBackdrop_OnEnter (self) - GameCooltip:AddLine (" ") - GameCooltip:AddLine ("CLICK to Report") + GameCooltip:AddLine(" ") + GameCooltip:AddLine("CLICK to Report") GameCooltip:SetOwner(self, "left", "right", -60, 0) GameCooltip:Show() @@ -1754,7 +1754,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) self.textura:SetBlendMode("BLEND") self.textura:SetSize(16, 16) else - self:SetAlpha (0.9) + self:SetAlpha(0.9) self:SetHeight(EncounterDetails.Frame.DefaultBarHeight) EncounterDetails.SetBarBackdrop_OnLeave (self) 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] @@ -1789,7 +1789,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) add_damage_done.barra = barra add_damage_done:SetWidth(EncounterDetails.CooltipLineHeight) add_damage_done:SetHeight(EncounterDetails.CooltipLineHeight) - add_damage_done:EnableMouse (true) + add_damage_done:EnableMouse(true) add_damage_done:SetResizable(false) add_damage_done:SetPoint("left", barra, "left", 0, 0) @@ -1822,7 +1822,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) 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 (_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) @@ -1855,7 +1855,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades_interrompidas = {} - for index, jogador in _ipairs(misc._ActorTable) do + for index, jogador in ipairs(misc._ActorTable) do if (not jogador.grupo) then --s� aparecer nego da raid break end @@ -1866,7 +1866,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local oque_interrompi = jogador.interrompeu_oque --vai ter [spellid] = quantidade - for spellid, amt in _pairs (oque_interrompi) do + 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 end @@ -1884,14 +1884,14 @@ function EncounterDetails:OpenAndRefresh (_, segment) --por em ordem tabela_em_ordem = {} - for spellid, tabela in _pairs (habilidades_interrompidas) do + for spellid, tabela in _pairs(habilidades_interrompidas) do tabela_em_ordem [#tabela_em_ordem+1] = tabela end _table_sort (tabela_em_ordem, _detalhes.Sort2) 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 @@ -1908,7 +1908,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) 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 + 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 @@ -1923,7 +1923,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.jogador = tabela - --barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) + --barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe])) if (index == 1) then barra.textura:SetValue(100) @@ -1964,7 +1964,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local habilidades_dispeladas = {} - for index, jogador in _ipairs(misc._ActorTable) do + for index, jogador in ipairs(misc._ActorTable) do if (not jogador.grupo) then --s� aparecer nego da raid break end @@ -1976,17 +1976,17 @@ function EncounterDetails:OpenAndRefresh (_, segment) local oque_dispelei = jogador.dispell_oque --vai ter [spellid] = quantidade - --print ("dispell: " .. jogador.classe .. " nome: " .. jogador.nome) + --print("dispell: " .. jogador.classe .. " nome: " .. jogador.nome) - for spellid, amt in _pairs (oque_dispelei) do + 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 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. habilidades_dispeladas [spellid] [1] [jogador.nome] = {0, jogador.classe} - --print (jogador.nome) - --print (jogador.classe) + --print(jogador.nome) + --print(jogador.classe) end habilidades_dispeladas [spellid] [2] = habilidades_dispeladas [spellid] [2] + amt @@ -1998,14 +1998,14 @@ function EncounterDetails:OpenAndRefresh (_, segment) --por em ordem tabela_em_ordem = {} - for spellid, tabela in _pairs (habilidades_dispeladas) do + for spellid, tabela in _pairs(habilidades_dispeladas) do tabela_em_ordem [#tabela_em_ordem+1] = tabela end _table_sort (tabela_em_ordem, _detalhes.Sort2) 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 @@ -2026,7 +2026,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.jogador = tabela - --barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [jogador.classe])) + --barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe])) if (index == 1) then barra.textura:SetValue(100) @@ -2065,7 +2065,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) 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 - for index, tabela in _ipairs(mortes) do + 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 @@ -2079,7 +2079,7 @@ function EncounterDetails:OpenAndRefresh (_, segment) local overlayTexture = barra:CreateTexture(nil, "overlay") overlayTexture:SetAllPoints() overlayTexture:SetColorTexture (1, 1, 1) - overlayTexture:SetAlpha (1) + overlayTexture:SetAlpha(1) overlayTexture:Hide() barra.OverlayTexture = overlayTexture end @@ -2097,11 +2097,11 @@ function EncounterDetails:OpenAndRefresh (_, segment) barra.jogador = tabela barra.extra = habilidades_info - barra.textura:SetStatusBarColor (_unpack (_detalhes.class_colors [tabela [4]])) + barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [tabela [4]])) barra.textura:SetValue(100) barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small") - barra.icone:SetTexCoord (_unpack (EncounterDetails.class_coords [tabela [4]])) + barra.icone:SetTexCoord (_unpack(EncounterDetails.class_coords [tabela [4]])) barra:Show() diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index 30eb83a8..d15938b1 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -1,10 +1,10 @@ do local _detalhes = _G._detalhes local DetailsFrameWork = _detalhes.gump - local AceLocale = LibStub ("AceLocale-3.0") + local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details_EncounterDetails") local Graphics = LibStub:GetLibrary("LibGraph-2.0") - local _ipairs = ipairs + local ipairs = ipairs local _math_floor = math.floor local _cstr = string.format local _GetSpellInfo = _detalhes.getspellinfo @@ -51,10 +51,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --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() @@ -187,7 +187,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) row.t = t row.textura:SetStatusBarTexture (t) row.textura:SetStatusBarColor (.5, .5, .5, 0) - row.textura:SetMinMaxValues (0,100) + row.textura:SetMinMaxValues(0,100) row.lineText1 = row.textura:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") row.lineText1:SetPoint("LEFT", row.textura, "LEFT", 22, -1) @@ -222,9 +222,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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:SetFrameLevel(container:GetFrameLevel() + 1) - barra:EnableMouse (true) + barra:EnableMouse(true) barra:RegisterForClicks ("LeftButtonDown","RightButtonUp") EncounterDetails:CreateRowTexture (barra) @@ -238,8 +238,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) barra.icone:SetHeight(default_height) barra.icone:SetPoint("RIGHT", barra.textura, "LEFT", 20, 0) - barra:SetAlpha (0.9) - barra.icone:SetAlpha (0.8) + barra:SetAlpha(0.9) + barra.icone:SetAlpha(0.8) EncounterDetails:SetRowScripts (barra, index, container) @@ -293,11 +293,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end g:ResetData() - local combat = EncounterDetails:GetCombat (segment) + local combat = EncounterDetails:GetCombat(segment) local graphicData = combat:GetTimeData ("Raid Damage Done") if (not graphicData or not combat.start_time or not combat.end_time) then - EncounterDetails:Msg ("This segment doesn't have chart data.") + EncounterDetails:Msg("This segment doesn't have chart data.") return --elseif (EncounterDetails.CombatsAlreadyDrew [combat:GetCombatNumber()]) then --return @@ -332,7 +332,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) return end for i = segment + 4, segment+1, -1 do - local combat = EncounterDetails:GetCombat (i) + local combat = EncounterDetails:GetCombat(i) if (combat) then --the combat exists local elapsed_time = combat:GetCombatTime() @@ -411,17 +411,17 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local _i = 3 - local graphMaxDps = math.max (g.max_damage, dps_max) + local graphMaxDps = math.max(g.max_damage, dps_max) while (_i <= #content-2) do local v = (content[_i-2]+content[_i-1]+content[_i]+content[_i+1]+content[_i+2])/5 --normalize _data [#_data+1] = {scaleW*(_i-2), v/graphMaxDps} --x and y coords _i = _i + 1 end - tremove (content, 1) - tremove (content, 1) - tremove (content, #graphicData) - tremove (content, #graphicData) + tremove(content, 1) + tremove(content, 1) + tremove(content, #graphicData) + tremove(content, #graphicData) --update timeline local tempo = combat.end_time - combat.start_time @@ -484,7 +484,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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 @@ -497,7 +497,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) vRowFrame = CreateFrame("frame", "DetailsEncountersVerticalLine"..i, g, "BackdropTemplate") vRowFrame:SetWidth(20) vRowFrame:SetHeight(43) - vRowFrame:SetFrameLevel (g:GetFrameLevel()+2) + vRowFrame:SetFrameLevel(g:GetFrameLevel()+2) vRowFrame:SetScript("OnEnter", function(frame) @@ -506,12 +506,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) GameCooltip:Reset() --time of death and player name - GameCooltip:AddLine (vRowFrame.dead[6].." "..vRowFrame.dead[3]) + GameCooltip:AddLine(vRowFrame.dead[6].." "..vRowFrame.dead[3]) local class, l, r, t, b = _detalhes:GetClass (vRowFrame.dead[3]) if (class) then GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 12, 12, l, r, t, b) end - GameCooltip:AddLine ("") + GameCooltip:AddLine("") --last hits: local death = vRowFrame.dead @@ -521,7 +521,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) if (type(this_hit[1]) == "boolean" and this_hit[1]) then local spellname, _, spellicon = _GetSpellInfo(this_hit[2]) local t = death [2] - this_hit [4] - GameCooltip:AddLine ("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3])) + GameCooltip:AddLine("-" .. _cstr ("%.1f", t) .. " " .. spellname .. " (" .. this_hit[6] .. ")", EncounterDetails:comma_value (this_hit [3])) GameCooltip:AddIcon (spellicon, 1, 1, 12, 12, 0.1, 0.9, 0.1, 0.9) amt = amt + 1 if (amt == 3) then @@ -548,7 +548,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) vRowFrame.texture:SetHeight(20) vRowFrame.texture:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center") vRowFrame.texture:SetPoint("bottom", "DetailsEncountersVerticalLine"..i, "bottom", 0, 0) - vRowFrame.texture:SetVertexColor (1, 1, 1, .5) + vRowFrame.texture:SetVertexColor(1, 1, 1, .5) vRowFrame.icon = vRowFrame:CreateTexture(nil, "overlay") vRowFrame.icon:SetTexture("Interface\\WorldStateFrame\\SkullBones") @@ -611,12 +611,12 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) insets = {left = 1, right = 1, top = 1, bottom = 1}}) 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_icon = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {11/1024, 24/1024, 376/1024, 390/1024}) local damage_label = DetailsFrameWork:CreateLabel(phase_panel, "Damage Done:") damage_icon:SetPoint("topleft", phase_panel, "topleft", 10, -10) damage_label:SetPoint("left", damage_icon, "right", 4, 0) - local heal_icon = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\skins\classic_skin_v1]], 16, 16, "overlay", {43/1024, 57/1024, 376/1024, 390/1024}) + local heal_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) @@ -645,9 +645,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local player_name = DetailsFrameWork:CreateLabel(phase_panel, "") local amount = DetailsFrameWork:CreateLabel(phase_panel, "") amount:SetJustifyH("right") - local icon = DetailsFrameWork:CreateImage (phase_panel, "", 16, 16) - local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") - bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) + local icon = DetailsFrameWork:CreateImage(phase_panel, "", 16, 16) + local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") + bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor(.2, .2, .2, 0.8) icon:SetPoint("topleft", phase_panel, "topleft", 10, ((index * 16) * -1) - 16) player_name:SetPoint("left", icon, "right", 2, 0) @@ -665,9 +665,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local player_name = DetailsFrameWork:CreateLabel(phase_panel, "") local amount = DetailsFrameWork:CreateLabel(phase_panel, "") amount:SetJustifyH("right") - local icon = DetailsFrameWork:CreateImage (phase_panel, "", 16, 16) - local bg = DetailsFrameWork:CreateImage (phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") - bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor (.2, .2, .2, 0.8) + local icon = DetailsFrameWork:CreateImage(phase_panel, "", 16, 16) + local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\AddOns\Details\images\BantoBar]], nil, nil, "artwork") + bg:SetPoint("left", icon, "left"); bg.height = 16; bg:SetPoint("right", amount, "right"); bg:SetVertexColor(.2, .2, .2, 0.8) icon:SetPoint("topleft", phase_panel, "topleft", 250, ((index * 16) * -1) - 16) player_name:SetPoint("left", icon, "right", 2, 0) @@ -687,11 +687,11 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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") + local bg = DetailsFrameWork:CreateImage(phase_panel, [[Interface\Tooltips\UI-Tooltip-Background]], nil, nil, "artwork") bg:SetPoint("left", phase_panel.phase_label, "left"); bg.height = 16; bg:SetPoint("right", phase_panel.report_label, "right"); - bg:SetVertexColor (0, 0, 0, 1) + bg:SetVertexColor(0, 0, 0, 1) local spark_container = {} local create_spark = function() @@ -729,14 +729,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local phase = self.phase local spark_index = 3 - self.texture:SetVertexColor (1, 1, 1) + self.texture:SetVertexColor(1, 1, 1) for _, f in ipairs(g.PhaseTextures) do if (f ~= self and f.phase == phase) then local spark1 = get_spark (spark_index) local spark2 = get_spark (spark_index+1) f.texture:SetBlendMode("ADD") - f.texture:SetVertexColor (1, 1, 1) + f.texture:SetVertexColor(1, 1, 1) spark1:SetPoint("left", f.texture, "left", -16, 0) spark2:SetPoint("right", f.texture, "right", 16, 0) spark1:Show() @@ -759,7 +759,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for i, player in ipairs(players) do local dlabel = phase_panel:GetDamageLabel (i) - dlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) + dlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1]) dlabel.righttext.text = _detalhes:ToK (_math_floor(player [2])) local class = EncounterDetails:GetClass (player [1]) @@ -796,13 +796,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for i, player in ipairs(players) do local hlabel = phase_panel:GetHealLabel (i) - hlabel.lefttext.text = EncounterDetails:GetOnlyName (player [1]) + hlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1]) 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:SetTexCoord (unpack (_detalhes.class_coords [classe])) + hlabel.icon:SetTexCoord (unpack(_detalhes.class_coords [classe])) else hlabel.icon:SetTexture([[Interface\LFGFRAME\LFGROLE_BW]]) hlabel.icon:SetTexCoord (.25, .5, 0, 1) @@ -818,7 +818,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self.heal_actors = players --show the panel - phase_panel:SetHeight((math.max (damage_players, heal_players) * 16) + 60) + phase_panel:SetHeight((math.max(damage_players, heal_players) * 16) + 60) phase_panel:SetPoint("bottom", self, "top", 0, 10) phase_panel:Show() @@ -836,7 +836,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for _, f in ipairs(g.PhaseTextures) do f.texture:SetBlendMode("BLEND") - f.texture:SetVertexColor (unpack (f.texture.original_color)) + f.texture:SetVertexColor(unpack(f.texture.original_color)) end hide_sparks() @@ -851,7 +851,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove (result, i) + tremove(result, i) end end EncounterDetails:SendReportLines (result) @@ -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) @@ -871,7 +871,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove (result, i) + tremove(result, i) end end EncounterDetails:SendReportLines (result) @@ -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) @@ -912,13 +912,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) phase = math.min (phase, 5) if (not phase_colors [phase]) then - _detalhes:Msg ("Phase out of range:", phase) - phase = math.max (phase, 1) + _detalhes:Msg("Phase out of range:", phase) + phase = math.max(phase, 1) end - texture.texture:SetVertexColor (unpack (phase_colors [phase])) + texture.texture:SetVertexColor(unpack(phase_colors [phase])) local oc = texture.texture.original_color - oc[1], oc[2], oc[3] = unpack (phase_colors [phase]) + oc[1], oc[2], oc[3] = unpack(phase_colors [phase]) texture:Show() @@ -970,7 +970,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --create lines for damage and time for i = 1, 8, 1 do local line = g:CreateTexture(nil, "overlay") - line:SetColorTexture (unpack (CONST_DAMAGE_LINES_COLOR)) + line:SetColorTexture (unpack(CONST_DAMAGE_LINES_COLOR)) line:SetWidth(CONST_CHART_WIDTH) line:SetHeight(1) @@ -993,7 +993,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) texture:SetWidth(9) texture:SetHeight(9) texture:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 499, -81) - texture:SetColorTexture (unpack (grafico_cores[i])) + texture:SetColorTexture (unpack(grafico_cores[i])) local text = g:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall") text:SetPoint("LEFT", texture, "right", 2, 0) text:SetJustifyH("LEFT") @@ -1037,17 +1037,17 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame:SetWidth(898) -- + 200 BossFrame:SetHeight(504) -- + 150 - BossFrame:EnableMouse (true) + BossFrame:EnableMouse(true) BossFrame:SetResizable(false) - BossFrame:SetMovable (true) + BossFrame:SetMovable(true) --background BossFrame.bg1 = BossFrame:CreateTexture(nil, "background") BossFrame.bg1:SetTexture([[Interface\AddOns\Details\images\background]], true) - BossFrame.bg1:SetAlpha (0.7) - BossFrame.bg1:SetVertexColor (0.27, 0.27, 0.27) - BossFrame.bg1:SetVertTile (true) - BossFrame.bg1:SetHorizTile (true) + BossFrame.bg1:SetAlpha(0.7) + BossFrame.bg1:SetVertexColor(0.27, 0.27, 0.27) + BossFrame.bg1:SetVertTile(true) + BossFrame.bg1:SetHorizTile(true) BossFrame.bg1:SetSize(790, 454) BossFrame.bg1:SetAllPoints() @@ -1062,16 +1062,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local name_bg_texture = BossFrame:CreateTexture(nil, "background") name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true) - name_bg_texture:SetHorizTile (true) + name_bg_texture:SetHorizTile(true) name_bg_texture:SetTexCoord (0, 1, 126/256, 19/256) name_bg_texture:SetPoint("topleft", BossFrame, "topleft", 2, -22) name_bg_texture:SetPoint("bottomright", BossFrame, "bottomright") name_bg_texture:SetHeight(54) - name_bg_texture:SetVertexColor (0, 0, 0, 0.2) + name_bg_texture:SetVertexColor(0, 0, 0, 0.2) --header background local headerFrame = CreateFrame("frame", "EncounterDetailsHeaderFrame", BossFrame,"BackdropTemplate") - headerFrame:EnableMouse (false) + 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}) @@ -1127,7 +1127,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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) + BossFrame.raidbackground:SetAlpha(0.1) --bot�o fechar titlebar.CloseButton = CreateFrame("Button", nil, titlebar, "UIPanelCloseButton") @@ -1138,8 +1138,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) titlebar.CloseButton:SetScript("OnClick", function(self) EncounterDetails:CloseWindow() end) - titlebar.CloseButton:SetFrameLevel (titlebar:GetFrameLevel()+2) - titlebar.CloseButton:GetNormalTexture():SetDesaturated (true) + titlebar.CloseButton:SetFrameLevel(titlebar:GetFrameLevel()+2) + titlebar.CloseButton:GetNormalTexture():SetDesaturated(true) --background completo @@ -1191,17 +1191,17 @@ _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 local resetSelectedButtonTemplate = function() - BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) end BossFrame.switch = function(to, _, to2) @@ -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 @@ -1232,7 +1232,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.ShowType = "main" BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1262,7 +1262,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1274,7 +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 @@ -1308,7 +1308,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.segmentosDropdown:Disable() - BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1328,7 +1328,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetailsPhaseFrame:Show() - BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType @@ -1346,7 +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 @@ -1373,7 +1373,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.segmentosDropdown:Enable() - BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) EncounterDetails.db.last_section_selected = BossFrame.ShowType end @@ -1388,34 +1388,34 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local HEADER_MENUBUTTONS_Y = -38 --summary - BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main") + BossFrame.buttonSwitchNormal = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Summary", "main") BossFrame.buttonSwitchNormal:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {0, 32/256, 0, 0.505625}) - BossFrame.buttonSwitchNormal:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) + BossFrame.buttonSwitchNormal:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE")) BossFrame.buttonSwitchNormal:SetWidth(BUTTON_WIDTH) --spells e auras - BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras") + BossFrame.buttonSwitchSpellsAuras = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Timers & Spells", "spellsauras") BossFrame.buttonSwitchSpellsAuras:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {33/256, 64/256, 0, 0.505625}) - BossFrame.buttonSwitchSpellsAuras:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchSpellsAuras:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) BossFrame.buttonSwitchSpellsAuras:SetWidth(BUTTON_WIDTH) BossFrame.AllButtons = {BossFrame.buttonSwitchNormal, BossFrame.buttonSwitchGraphic, BossFrame.buttonSwitchBossEmotes, BossFrame.buttonSwitchSpellsAuras, BossFrame.buttonSwitchPhases} --phases - BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases") + BossFrame.buttonSwitchPhases = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Phases", "phases") BossFrame.buttonSwitchPhases:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {65/256, 96/256, 0, 0.505625}) - BossFrame.buttonSwitchPhases:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchPhases:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) BossFrame.buttonSwitchPhases:SetWidth(BUTTON_WIDTH) --chart - BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph") + BossFrame.buttonSwitchGraphic = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Damage Graphic", "graph") BossFrame.buttonSwitchGraphic:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {97/256, 128/256, 0, 0.505625}) - BossFrame.buttonSwitchGraphic:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchGraphic:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) BossFrame.buttonSwitchGraphic:SetWidth(BUTTON_WIDTH) --emotes - BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton (BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes") + BossFrame.buttonSwitchBossEmotes = _detalhes.gump:CreateButton(BossFrame, BossFrame.switch, BUTTON_WIDTH, BUTTON_HEIGHT, "Emotes", "emotes") BossFrame.buttonSwitchBossEmotes:SetIcon ("Interface\\AddOns\\Details_EncounterDetails\\images\\boss_frame_buttons", 18, 18, "overlay", {129/256, 160/256, 0, 0.505625}) - BossFrame.buttonSwitchBossEmotes:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.buttonSwitchBossEmotes:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) BossFrame.buttonSwitchBossEmotes:SetWidth(BUTTON_WIDTH) --anchors @@ -1438,7 +1438,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local offset = FauxScrollFrame_GetOffset (self) - --print (EncounterDetails.charsaved, EncounterDetails.charsaved.emotes, EncounterDetails.charsaved.emotes [1], #EncounterDetails.charsaved.emotes) + --print(EncounterDetails.charsaved, EncounterDetails.charsaved.emotes, EncounterDetails.charsaved.emotes [1], #EncounterDetails.charsaved.emotes) local emote_pool = EncounterDetails.charsaved.emotes [emote_segment] if (searching) then @@ -1506,7 +1506,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) BossFrame.EmoteWidgets = {} --~emotes ~whispers - local bar_div_emotes = DetailsFrameWork:CreateImage (BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 480, "artwork", {724/1024, 728/1024, 0, 245/512}) + local bar_div_emotes = DetailsFrameWork:CreateImage(BossFrame, "Interface\\AddOns\\Details_EncounterDetails\\images\\boss_bg", 4, 480, "artwork", {724/1024, 728/1024, 0, 245/512}) bar_div_emotes:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 244, -74) bar_div_emotes:Hide() tinsert(BossFrame.EmoteWidgets, bar_div_emotes) @@ -1527,7 +1527,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) self:SetBackdropColor(1, 1, 1, .6) if (self.righttext:IsTruncated()) then GameCooltip:Reset() - GameCooltip:AddLine (self.righttext:GetText()) + GameCooltip:AddLine(self.righttext:GetText()) GameCooltip:SetOwner(self, "bottomleft", "topleft", 42, -9) GameCooltip:Show() end @@ -1541,7 +1541,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local row_on_mouse_up = function(self) --report local text = self.righttext:GetText() - local time = self.lefttext:GetText() + local timeString = self.lefttext:GetText() local reportFunc = function() -- remove textures @@ -1560,7 +1560,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) -- remove the left space text = text:gsub ("^%s$", "") - EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. time, "\"" .. text .. "\""}) + EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. timeString, "\"" .. text .. "\""}) end EncounterDetails:SendReportWindow (reportFunc) @@ -1591,7 +1591,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) line.righttext:SetHeight(14) line.righttext:SetJustifyH("left") - line:SetFrameLevel (scrollframe:GetFrameLevel()+1) + line:SetFrameLevel(scrollframe:GetFrameLevel()+1) line:SetScript("OnEnter", row_on_enter) line:SetScript("OnLeave", row_on_leave) @@ -1631,7 +1631,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end local dropdown = DetailsFrameWork:NewDropDown (BossFrame, _, "$parentEmotesSegmentDropdown", "EmotesSegment", 180, 20, build_emote_segments, 1) dropdown:SetPoint("topleft", emotes_segment_label, "bottomleft", -1, -2) - dropdown:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + dropdown:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) tinsert(BossFrame.EmoteWidgets, dropdown) tinsert(BossFrame.EmoteWidgets, emotes_segment_label) @@ -1643,8 +1643,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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")) + 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") @@ -1670,7 +1670,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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:GetNormalTexture():SetDesaturated(true) reset.tooltip = "Reset Search" tinsert(BossFrame.EmoteWidgets, search) @@ -1689,7 +1689,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) for index = 1, 16 do local bar = emote_lines [index] if (bar:IsShown() and added < AmtLines) then - local time = bar.lefttext:GetText() + local timeString = bar.lefttext:GetText() local text = bar.righttext:GetText() --"|Hunit:77182:Oregorger|hOregorger prepares to cast |cFFFF0000|Hspell:156879|h[Blackrock Barrage]|h|r." @@ -1710,7 +1710,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) -- remove the left space text = text:gsub ("^%s$", "") - tinsert(EncounterDetails.report_lines, time .. " " .. text) + tinsert(EncounterDetails.report_lines, timeString .. " " .. text) added = added + 1 if (added == AmtLines) then @@ -1721,7 +1721,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) EncounterDetails:SendReportLines (EncounterDetails.report_lines) else - EncounterDetails:Msg ("There is nothing to report.") + EncounterDetails:Msg("There is nothing to report.") end end @@ -1730,7 +1730,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end, nil, nil, nil, "Report Results") report_emote_button:SetIcon ([[Interface\AddOns\Details\images\report_button]], 8, 14, nil, {0, 1, 0, 1}, nil, 4, 2) - report_emote_button:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + report_emote_button:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) report_emote_button:SetPoint("topleft", search, "bottomleft", 0, -4) report_emote_button:Disable() @@ -1809,14 +1809,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) GameCooltip:SetOption("FixedWidth", false) for token, _ in pairs(info.token) do - GameCooltip:AddLine ("event:", token, 1, nil, "white") + GameCooltip:AddLine("event:", token, 1, nil, "white") end - GameCooltip:AddLine ("source:", info.source, 1, nil, "white") - GameCooltip:AddLine ("school:", EncounterDetails:GetSpellSchoolFormatedName (info.school), 1, nil, "white") + GameCooltip:AddLine("source:", info.source, 1, nil, "white") + GameCooltip:AddLine("school:", EncounterDetails:GetSpellSchoolFormatedName (info.school), 1, nil, "white") if (info.type) then - GameCooltip:AddLine ("aura type:", info.type, 1, nil, "white") + GameCooltip:AddLine("aura type:", info.type, 1, nil, "white") end GameCooltip:ShowCooltip(self, "tooltip") end @@ -1846,7 +1846,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --timerId local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20, nil, "$parentSpellId") - spellid:SetTemplate (AurasButtonTemplate) + spellid:SetTemplate(AurasButtonTemplate) spellid:SetHook("OnEditFocusGained", on_focus_gain) spellid:SetHook("OnEditFocusLost", on_focus_lost) spellid:SetHook("OnEnter", on_enter_spell) @@ -1854,14 +1854,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) --ability name local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 180, 20, nil, "$parentSpellName") - spellname:SetTemplate (AurasButtonTemplate) + spellname:SetTemplate(AurasButtonTemplate) spellname:SetHook("OnEditFocusGained", on_focus_gain) spellname:SetHook("OnEditFocusLost", on_focus_lost) spellname:SetHook("OnEnter", on_enter_spell) spellname:SetHook("OnLeave", on_leave_spell) local create_aura = DetailsFrameWork:NewButton(anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") - create_aura:SetTemplate (AurasButtonTemplate) + create_aura:SetTemplate(AurasButtonTemplate) spellicon:SetPoint("topleft", BossFrame, "topleft", 10, -85 + (i * 21 * -1)) spellid:SetPoint("left", spellicon, "right", 4, 0) @@ -1890,14 +1890,14 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) 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:SetTemplate(AurasButtonTemplate) spellid:SetHook("OnEditFocusGained", on_focus_gain) spellid:SetHook("OnEditFocusLost", on_focus_lost) spellid:SetHook("OnEnter", on_enter_spell) spellid:SetHook("OnLeave", on_leave_spell) local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 160, 20) - spellname:SetTemplate (AurasButtonTemplate) + spellname:SetTemplate(AurasButtonTemplate) spellname:SetHook("OnEditFocusGained", on_focus_gain) spellname:SetHook("OnEditFocusLost", on_focus_lost) spellname:SetHook("OnEnter", on_enter_spell) @@ -1923,7 +1923,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local create_aura = DetailsFrameWork:NewButton(anchor_frame, nil, "$parentCreateAuraButton", "AuraButton", 90, 18, create_aura_func, nil, nil, nil, "Make Aura") create_aura:SetPoint("left", spellinfo, "right", 4, 0) - create_aura:SetTemplate (AurasButtonTemplate) + create_aura:SetTemplate(AurasButtonTemplate) anchor_frame.icon = spellicon anchor_frame.spellid = spellid @@ -1939,7 +1939,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) end local update_enemy_spells = function() - local combat = EncounterDetails:GetCombat (EncounterDetails._segment) + local combat = EncounterDetails:GetCombat(EncounterDetails._segment) local spell_list = {} if (combat) then @@ -2138,7 +2138,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local spellname = timer_table [2]:gsub (" %(.%)", "") tinsert(t, {label = spellname, value = {timer_table [2], spellname, timer_table [5], timer_table.id}, icon = timer_table [5], onclick = on_select_bw_bar}) elseif (int_spell < 0) then - local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = C_EncounterJournal.GetSectionInfo (abs (int_spell)) + local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = C_EncounterJournal.GetSectionInfo (abs(int_spell)) tinsert(t, {label = title, value = {timer_table [2], title, timer_table [5] or abilityIcon, timer_table.id}, icon = timer_table [5] or abilityIcon, onclick = on_select_bw_bar}) else local spellname, _, spellicon = _GetSpellInfo(int_spell) @@ -2158,7 +2158,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails) local PhaseFrame = CreateFrame("frame", "EncounterDetailsPhaseFrame", BossFrame, "BackdropTemplate") PhaseFrame:SetAllPoints() -PhaseFrame:SetFrameLevel (BossFrame:GetFrameLevel()+1) +PhaseFrame:SetFrameLevel(BossFrame:GetFrameLevel()+1) PhaseFrame.DamageTable = {} PhaseFrame.HealingTable = {} PhaseFrame.LastPhaseSelected = 1 @@ -2177,7 +2177,7 @@ end) function PhaseFrame:ClearAll() --disable all buttons for i = 1, #PhaseFrame.PhaseButtons do - PhaseFrame.PhaseButtons[i]:SetTemplate (PhaseButtonTemplate) + PhaseFrame.PhaseButtons[i]:SetTemplate(PhaseButtonTemplate) PhaseFrame.PhaseButtons[i]:Disable() end @@ -2202,7 +2202,7 @@ function PhaseFrame.OnSelectPhase (phaseSelected) PhaseFrame:ClearAll() --get the selected segment - PhaseFrame.CurrentSegment = EncounterDetails:GetCombat (EncounterDetails._segment) + PhaseFrame.CurrentSegment = EncounterDetails:GetCombat(EncounterDetails._segment) if (not PhaseFrame.CurrentSegment) then return end @@ -2220,9 +2220,9 @@ function PhaseFrame.OnSelectPhase (phaseSelected) for buttonIndex, phase in ipairs(phases) do local button = PhaseFrame.PhaseButtons [buttonIndex] if (phase == phaseSelected) then - button:SetTemplate (PhaseButtonTemplateHighlight) + button:SetTemplate(PhaseButtonTemplateHighlight) else - button:SetTemplate (PhaseButtonTemplate) + button:SetTemplate(PhaseButtonTemplate) if (PhaseFrame.CurrentSegment.PhaseData.damage [phase]) then button:Enable() else @@ -2269,7 +2269,7 @@ local report_damage = function(IsCurrent, IsReverse, AmtLines) AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove (result, i) + tremove(result, i) end end EncounterDetails:SendReportLines (result) @@ -2277,13 +2277,13 @@ 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") +local Report_DamageButton = _detalhes.gump:CreateButton(PhaseFrame, report_damage, 16, 16, "report") Report_DamageButton:SetPoint("left", DamageLabel, "left", ScrollWidth-44, 0) Report_DamageButton.textcolor = "gray" Report_DamageButton.textsize = 9 @@ -2294,7 +2294,7 @@ local report_healing = function() AmtLines = AmtLines + 1 if (#result > AmtLines) then for i = #result, AmtLines+1, -1 do - tremove (result, i) + tremove(result, i) end end EncounterDetails:SendReportLines (result) @@ -2302,12 +2302,12 @@ 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") +local Report_HealingButton = _detalhes.gump:CreateButton(PhaseFrame, report_healing, 16, 16, "report") Report_HealingButton:SetPoint("left", HealLabel, "left", ScrollWidth-44, 0) Report_HealingButton.textcolor = "gray" Report_HealingButton.textsize = 9 @@ -2320,7 +2320,7 @@ 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) + local button = _detalhes.gump:CreateButton(PhaseFrame, PhaseFrame.OnSelectPhase, 60, 20, "", i) button:SetPoint("left", PhaseSelectLabel, "right", 8 + ((i-1) * 61), 0) tinsert(PhaseFrame.PhaseButtons, button) end @@ -2354,11 +2354,11 @@ 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) @@ -2370,7 +2370,7 @@ local ScrollCreateLine = function(self, index) line:SetScript("OnClick", line_onclick) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (BGColorDefault)) + line:SetBackdropColor(unpack(BGColorDefault)) local statusBar = DetailsFrameWork:CreateBar (line, EncounterDetails.Frame.DefaultBarTexture, 1, 1, 100) statusBar:SetAllPoints(line) @@ -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 @@ -2451,7 +2451,7 @@ for i = 1, 10 do line:SetScript("OnClick", PhaseBarOnClick) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (BGColorDefault)) + line:SetBackdropColor(unpack(BGColorDefault)) local icon = line:CreateTexture("$parentIcon", "overlay") icon:SetSize(16, 16) @@ -2482,7 +2482,7 @@ for i = 1, 20 do line:SetSize(150, ScrollLineHeight) line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) - line:SetBackdropColor(unpack (BGColorDefault)) + line:SetBackdropColor(unpack(BGColorDefault)) line:Hide() local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") _detalhes.gump:SetFontSize (name, 9) @@ -2521,7 +2521,7 @@ function PhaseFrame:GetPhaseTimers (segment, ordered) segment = segment or PhaseFrame.CurrentSegment for phaseIT = 1, #segment.PhaseData do - local phase, startAt = unpack (segment.PhaseData [phaseIT]) --phase iterator + local phase, startAt = unpack(segment.PhaseData [phaseIT]) --phase iterator local endAt = segment.PhaseData [phaseIT+1] and segment.PhaseData [phaseIT+1][2] or segment:GetCombatTime() local elapsed = endAt - startAt t [phase] = (t [phase] or 0) + elapsed @@ -2633,24 +2633,24 @@ end -- ~dropdown local segmentos = DetailsFrameWork:NewDropDown (frame, _, "$parentSegmentsDropdown", "segmentosDropdown", 160, 20, buildSegmentosMenu, nil) segmentos:SetPoint("left", segmentos_string, "right", 2, 0) - segmentos:SetTemplate (DetailsFrameWork:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + segmentos:SetTemplate(DetailsFrameWork:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --options button local options = DetailsFrameWork:NewButton(frame, nil, "$parentOptionsButton", "OptionsButton", 120, 20, EncounterDetails.OpenOptionsPanel, nil, nil, nil, "Options") options:SetPoint("left", segmentos, "right", 10, 0) - options:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + options:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) options:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3) --macro box BossFrame.MacroEditBox = DetailsFrameWork:CreateTextEntry (frame, function()end, 300, 20) BossFrame.MacroEditBox:SetPoint("left", options, "right", 10, 0) - BossFrame.MacroEditBox:SetAlpha (0.5) + BossFrame.MacroEditBox:SetAlpha(0.5) BossFrame.MacroEditBox:SetText("/run Details:OpenPlugin ('Encounter Breakdown')") - BossFrame.MacroEditBox:SetTemplate (DetailsFrameWork:GetTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) + BossFrame.MacroEditBox:SetTemplate(DetailsFrameWork:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) BossFrame.MacroEditBox:SetSize(360, 20) BossFrame.MacroEditBox:HookScript ("OnEditFocusGained", function() - C_Timer.After (0, function() BossFrame.MacroEditBox:HighlightText() end) + C_Timer.After(0, function() BossFrame.MacroEditBox:HighlightText() end) end) BossFrame.MacroEditBox.BackgroundLabel = DetailsFrameWork:CreateLabel(BossFrame.MacroEditBox, "macro") @@ -2685,7 +2685,7 @@ end 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:EnableMouse(true) dano_recebido_bg:SetResizable(false) dano_recebido_bg:SetPoint("topleft", frame, "topleft", 10, -78) @@ -2701,9 +2701,9 @@ end 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:EnableMouse(true) container_damagetaken_frame:SetResizable(false) - container_damagetaken_frame:SetMovable (true) + container_damagetaken_frame:SetMovable(true) container_damagetaken_window:SetWidth(BOX_WIDTH) container_damagetaken_window:SetHeight(BOX_HEIGHT) @@ -2736,7 +2736,7 @@ end 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:EnableMouse(true) habilidades_inimigas_bg:SetResizable(false) habilidades_inimigas_bg:SetPoint("topleft", frame, "topleft", 10, -276) @@ -2754,9 +2754,9 @@ end 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:EnableMouse(true) container_habilidades_frame:SetResizable(false) - container_habilidades_frame:SetMovable (true) + container_habilidades_frame:SetMovable(true) container_habilidades_window:SetWidth(BOX_WIDTH) container_habilidades_window:SetHeight(BOX_HEIGHT) @@ -2797,9 +2797,9 @@ end 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:EnableMouse(true) container_adds_frame:SetResizable(false) - container_adds_frame:SetMovable (true) + container_adds_frame:SetMovable(true) container_adds_window:SetWidth(BOX_WIDTH) container_adds_window:SetHeight(BOX_HEIGHT_UPPER) @@ -2842,9 +2842,9 @@ end 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:EnableMouse(true) container_interrupt_frame:SetResizable(false) - container_interrupt_frame:SetMovable (true) + container_interrupt_frame:SetMovable(true) container_interrupt_window:SetWidth(BOX_WIDTH) container_interrupt_window:SetHeight(BOX_HEIGHT_UPPER) @@ -2888,9 +2888,9 @@ end 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:EnableMouse(true) container_dispell_frame:SetResizable(false) - container_dispell_frame:SetMovable (true) + container_dispell_frame:SetMovable(true) container_dispell_window:SetWidth(BOX_WIDTH) container_dispell_window:SetHeight(BOX_HEIGHT_UPPER) @@ -2938,9 +2938,9 @@ end container_dead_frame:SetWidth(BOX_WIDTH) container_dead_frame:SetHeight(BOX_HEIGHT) - container_dead_frame:EnableMouse (true) + container_dead_frame:EnableMouse(true) container_dead_frame:SetResizable(false) - container_dead_frame:SetMovable (true) + container_dead_frame:SetMovable(true) container_dead_window:SetWidth(BOX_WIDTH) container_dead_window:SetHeight(BOX_HEIGHT_UPPER) @@ -2989,9 +2989,9 @@ end return end - local combat = EncounterDetails:GetCombat ("current") + local combat = EncounterDetails:GetCombat("current") --local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ... - --print ("2 =", arg2, "3 =", arg3, "4 =", arg4, "5 =", arg5, "6 =", arg6, "7 =", arg7, "8 =", arg8, "9 =", arg9) + --print("2 =", arg2, "3 =", arg3, "4 =", arg4, "5 =", arg5, "6 =", arg6, "7 =", arg7, "8 =", arg8, "9 =", arg9) if (combat and EncounterDetails:IsInCombat() and EncounterDetails:GetZoneType() == "raid") then local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ... tinsert(EncounterDetails.current_whisper_table, {combat:GetCombatTime(), arg3, arg4, emote_table [arg2]}) diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index 25614f6f..67ec0b52 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -295,7 +295,7 @@ local CreatePluginFrames = function() local runeIndicator = DF:CreateImage(line, "", scrollLineHeight, scrollLineHeight) --no pre pot - --local PrePotIndicator = DF:CreateImage (line, "", scroll_line_height, scroll_line_height) + --local PrePotIndicator = DF:CreateImage(line, "", scroll_line_height, scroll_line_height) --using details! --local DetailsIndicator = DF:CreateImage(line, "", scroll_line_height, scroll_line_height) diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index d5cb0997..31499907 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -1,8 +1,8 @@ local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") -local LDB = LibStub ("LibDataBroker-1.1", true) -local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) -local LibWindow = LibStub ("LibWindow-1.1") +local LDB = LibStub("LibDataBroker-1.1", true) +local LDBIcon = LDB and LibStub("LibDBIcon-1.0", true) +local LibWindow = LibStub("LibWindow-1.1") local _ ---need cleanup Loc ["STRING_MEMORY_ALERT_BUTTON"], @@ -151,7 +151,7 @@ local function CreatePluginFrames() 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: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() @@ -204,8 +204,8 @@ local function CreatePluginFrames() 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:EnableMouse(true) + SOF:SetMovable(true) SOF:SetResizable(true) SOF:SetClampedToScreen (true) @@ -223,23 +223,23 @@ local function CreatePluginFrames() StreamOverlay.db.main_frame_size [1] = SOF:GetWidth() StreamOverlay.db.main_frame_size [2] = SOF:GetHeight() --save main frame position - LibWindow.RegisterConfig (SOF, StreamOverlay.db) - LibWindow.SavePosition (SOF) + LibWindow.RegisterConfig(SOF, StreamOverlay.db) + LibWindow.SavePosition(SOF) --save the dps frame position - LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) - LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) + 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)) + SOF:SetSize(unpack(StreamOverlay.db.main_frame_size)) --set the main window location - LibWindow.RegisterConfig (SOF, StreamOverlay.db) - LibWindow.RestorePosition (SOF) - LibWindow.SavePosition (SOF) + LibWindow.RegisterConfig(SOF, StreamOverlay.db) + LibWindow.RestorePosition(SOF) + LibWindow.SavePosition(SOF) --set the dps frame location - LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) - LibWindow.RestorePosition (StreamerOverlayDpsHpsFrame) - LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) + LibWindow.RegisterConfig(StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) + LibWindow.RestorePosition(StreamerOverlayDpsHpsFrame) + LibWindow.SavePosition(StreamerOverlayDpsHpsFrame) --set the frame strata SOF:SetFrameStrata(StreamOverlay.db.main_frame_strata) StreamerOverlayDpsHpsFrame:SetFrameStrata(StreamOverlay.db.main_frame_strata) @@ -506,7 +506,7 @@ local function CreatePluginFrames() end line.icon2:SetTexture(data [4]) - line.icon2:SetTexCoord (unpack (data [5])) + 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) @@ -518,10 +518,10 @@ local function CreatePluginFrames() end --background - line:SetBackdropColor(unpack (data [8])) + 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) end @@ -586,7 +586,7 @@ local function CreatePluginFrames() statusbar_texture:SetTexture(1, 1, 1, 0.15) statusbar:SetStatusBarColor (0, 0, 0, 0) statusbar:SetStatusBarTexture (statusbar_texture) - statusbar:SetMinMaxValues (0, 100) + statusbar:SetMinMaxValues(0, 100) statusbar:SetValue(0) local statusbar_spark = statusbar:CreateTexture(nil, "artwork") statusbar_spark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]]) @@ -730,7 +730,7 @@ local function CreatePluginFrames() local line_in_use = line.in_use or 1 local content_in_use = StreamOverlay.battle_content [i] and StreamOverlay.battle_content [i].CastStart or 1 - if (max (line_in_use, content_in_use) + 60 < now) then + if (max(line_in_use, content_in_use) + 60 < now) then fader (nil, line, "in") else fader (nil, line, "out") @@ -743,7 +743,7 @@ local function CreatePluginFrames() local line_in_use = line.in_use or 1 local content_in_use = StreamOverlay.battle_content [i] and StreamOverlay.battle_content [i].CastStart or 1 - if (max (line_in_use, content_in_use) + 60 < now) then + if (max(line_in_use, content_in_use) + 60 < now) then fader (nil, StreamOverlay.battle_lines [i], "in") else fader (nil, StreamOverlay.battle_lines [i], "out") @@ -757,7 +757,7 @@ local function CreatePluginFrames() local line_in_use = line.in_use or 1 local content_in_use = StreamOverlay.battle_content[i] and StreamOverlay.battle_content[i].CastStart or 1 - if (max (line_in_use, content_in_use) + 60 < now) then + if (max(line_in_use, content_in_use) + 60 < now) then fader (nil, StreamOverlay.squares[i], "in") else fader (nil, StreamOverlay.squares[i], "out") @@ -961,7 +961,7 @@ local DefaultColor = {r=1, g=1, b=1} local PetCoords = {0.25, 0.49609375, 0.75, 1} local parse_target_name = function(target) - return StreamOverlay:GetOnlyName (target) + return StreamOverlay:GetOnlyName(target) end local parse_target_icon = function(targetObject, target) @@ -1042,7 +1042,7 @@ function StreamOverlay:CastStart (castGUID) local icon, backgroundcolor, bordercolor = StreamOverlay:GetSpellInformation (spellid) local spellname, _, spellicon = GetSpellInfo(spellid) - local targetObject = Details:GetActor ("current", 1, target) or Details:GetActor ("current", 2, target) + local targetObject = Details:GetActor("current", 1, target) or Details:GetActor("current", 2, target) local icon2, icon2coords, class = parse_target_icon (targetObject, target) local color2 @@ -1080,7 +1080,7 @@ function StreamOverlay:CastFinished (castid) local icon, backgroundcolor, bordercolor = StreamOverlay:GetSpellInformation (spellid) local spellname, _, spellicon = GetSpellInfo(spellid) - local targetObject = Details:GetActor ("current", 1, target) or Details:GetActor ("current", 2, target) + local targetObject = Details:GetActor("current", 1, target) or Details:GetActor("current", 2, target) local icon2, icon2coords, class = parse_target_icon (targetObject, target) @@ -1123,7 +1123,7 @@ eventFrame.track_spell_cast = function() elseif (castinfo.Interrupted) then --has been interrupted castinfo.Done = true - line.spark:SetVertexColor (1, 0.7, 0) + line.spark:SetVertexColor(1, 0.7, 0) elseif (castinfo.IsChanneled) then --casting a channeled spell @@ -1136,7 +1136,7 @@ eventFrame.track_spell_cast = function() local diff = endTime - startTime local current = GetTime() - startTime local percent = current / diff * 100 - percent = math.abs (percent - 100) + percent = math.abs(percent - 100) castinfo.Percent = percent line.statusbar:SetValue(percent) if (StreamOverlay.db.use_spark) then @@ -1197,7 +1197,7 @@ eventFrame.track_spell_cast = function() line.spark:Hide() end - line.spark:SetVertexColor (1, 1, 1, 1) + line.spark:SetVertexColor(1, 1, 1, 1) line.spark:SetPoint("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0) end end @@ -1241,7 +1241,7 @@ eventFrame.track_spell_cast = function() local diff = endTime - startTime local current = GetTime() - startTime local percent = current / diff * 100 - percent = math.abs (percent - 100) + percent = math.abs(percent - 100) castinfo.Percent = percent StreamOverlay:UpdateCooldownFrame(line, true, startTime, endTime, castinfo) end @@ -1335,7 +1335,7 @@ local lastChannelSpell = "" local APM = 0 local ACTIONS = 0 local ACTIONS_EVENT_TIME = {} -local AMP_Tick = C_Timer.NewTicker (1, function() +local AMP_Tick = C_Timer.NewTicker(1, function() APM = ACTIONS * 60 ACTIONS = 0 end) @@ -1471,7 +1471,7 @@ local format_time = function(v) return "-" .. format ("%.2f", v) end --when the player die, show the events before the death function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at_combattime, max_health) - if (alvo_serial ~= UnitGUID ("player")) then + if (alvo_serial ~= UnitGUID("player")) then return end @@ -1479,7 +1479,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 + if (ev and type(ev) == "table" and ev[1] and type(ev[1]) == "boolean") then --it's a damage local spellid = ev[2] local amount = ev[3] @@ -1489,7 +1489,7 @@ function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, local absorbed = ev[7] --get the actor from details - local sourceObject = Details:GetActor ("current", 1, source) + local sourceObject = Details:GetActor("current", 1, source) local classIcon, l, r, t, b if (sourceObject) then classIcon, l, r, t, b = StreamOverlay:GetClassIcon (sourceObject.classe) @@ -1499,7 +1499,7 @@ function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, --spellname local spellname, _, spellicon = StreamOverlay.getspellinfo (spellid) - source = StreamOverlay:GetOnlyName (source) + source = StreamOverlay:GetOnlyName(source) local CastInfoIndex = i * -1 @@ -1553,14 +1553,14 @@ function StreamOverlay:SetLocked (state) DetailsStreamerTitlebar:Hide() DetailsStreamerLeftResizer:Hide() DetailsStreamerRightResizer:Hide() - SOF:EnableMouse (false) + SOF:EnableMouse(false) else --not locked StreamOverlay.db.main_frame_locked = false DetailsStreamerTitlebar:Show() DetailsStreamerLeftResizer:Show() DetailsStreamerRightResizer:Show() - SOF:EnableMouse (true) + SOF:EnableMouse(true) end StreamOverlay:UpdateDpsHpsFrameConfig() @@ -1573,7 +1573,7 @@ local screen_frame = CreateFrame("frame", "StreamerOverlayDpsHpsFrame", UIParent 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:SetMovable(true) screen_frame:Hide() screen_frame:SetPoint("center", UIParent, "center") screen_frame:SetScript("OnMouseDown", function(self) @@ -1602,7 +1602,7 @@ end) 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:AddLine("|cFFFF7700Left Click|r: Open Options\n|cFFFF7700Slash Command|r: /streamer") GameTooltip:Show() end) screen_frame:SetScript("OnLeave", function() @@ -1639,11 +1639,11 @@ function StreamOverlay:UpdateDpsHpsFrameConfig (PluginDisabled) if (StreamOverlay.db.main_frame_locked) then screen_frame:SetBackdrop(nil) - screen_frame:EnableMouse (false) + 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:EnableMouse (true) + screen_frame:EnableMouse(true) end if (db.enabled) then @@ -1652,7 +1652,7 @@ function StreamOverlay:UpdateDpsHpsFrameConfig (PluginDisabled) StreamOverlay.DpsHpsTick:Cancel() StreamOverlay.DpsHpsTick = nil end - StreamOverlay.DpsHpsTick = C_Timer.NewTicker (db.update_speed, StreamOverlay.UpdateDpsHpsFrame) + StreamOverlay.DpsHpsTick = C_Timer.NewTicker(db.update_speed, StreamOverlay.UpdateDpsHpsFrame) else screen_frame:Hide() if (StreamOverlay.DpsHpsTick) then @@ -1690,11 +1690,11 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) if (not StreamOverlayOptionsPanel) then local detailsFramework = Details:GetFramework() - local options_text_template = detailsFramework:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = detailsFramework:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = detailsFramework:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = detailsFramework:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = detailsFramework:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = detailsFramework:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = detailsFramework:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = detailsFramework:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local optionsFrame = StreamOverlay:CreatePluginOptionsFrame("StreamOverlayOptionsPanel", "Details! Streamer: Action Tracker", 1) optionsFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) @@ -2229,7 +2229,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) --set locked and the backdrop color StreamOverlay:SetLocked (StreamOverlay.db.main_frame_locked) - StreamOverlay:SetBackgroundColor (unpack (StreamOverlay.db.main_frame_color)) + StreamOverlay:SetBackgroundColor (unpack(StreamOverlay.db.main_frame_color)) --update the minimap icon if (LDBIcon) then @@ -2251,8 +2251,8 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) return t end - 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")) + 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) @@ -2282,7 +2282,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) 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 = 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) end @@ -2317,7 +2317,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) optionsFrame:SetScript("OnHide", function() if (StreamOverlay.FromOptionsPanel) then --reopen the options panel - C_Timer.After (0.2, function() + C_Timer.After(0.2, function() Details:OpenOptionsWindow(Details:GetInstance(1)) end) end @@ -2344,7 +2344,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel) StreamOverlay.FromOptionsPanel = fromOptionsPanel if (fromOptionsPanel) then if (DetailsOptionsWindow) then - C_Timer.After (0.2, function() + C_Timer.After(0.2, function() DetailsOptionsWindow:Hide() end) end @@ -2356,7 +2356,7 @@ end function StreamOverlay:OnEvent (_, event, ...) if (event == "ADDON_LOADED") then - local AddonName = select (1, ...) + local AddonName = select(1, ...) if (AddonName == "Details_Streamer") then playerName = UnitName ("player") @@ -2419,7 +2419,7 @@ function StreamOverlay:OnEvent (_, event, ...) --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 - print (install.error) + print(install.error) end Details_StreamerDB = Details_StreamerDB or {characters = {}, profiles = {}} @@ -2492,11 +2492,11 @@ function StreamOverlay:OnEvent (_, event, ...) welcomeWindow:Hide() end - local close = Details.gump:CreateButton (welcomeWindow, close_func, 120, 20, "Okay", nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + local close = Details.gump:CreateButton(welcomeWindow, close_func, 120, 20, "Okay", nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")) close:SetPoint("center", text3, "center", 0, -50) end - StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker (5, show_frame) + StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker(5, show_frame) end --wipe (StreamOverlay.db) @@ -2535,8 +2535,8 @@ function StreamOverlay:CreateMinimapIcon() StreamOverlay.minimap_icon_created = true - local LDB = LibStub ("LibDataBroker-1.1", true) - local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) + local LDB = LibStub("LibDataBroker-1.1", true) + local LDBIcon = LDB and LibStub("LibDBIcon-1.0", true) if LDB then local minimapIcon = LDB:NewDataObject ("DetailsStreamer", { @@ -2555,9 +2555,9 @@ function StreamOverlay:CreateMinimapIcon() end, OnTooltipShow = function(tooltip) - tooltip:AddLine ("Details!: Action Tracker", 1, 1, 1) - tooltip:AddLine ("|cFFFF7700Left Click|r: open options.") - tooltip:AddLine ("|cFFFF7700Right Click|r: hide this icon.") + tooltip:AddLine("Details!: Action Tracker", 1, 1, 1) + tooltip:AddLine("|cFFFF7700Left Click|r: open options.") + tooltip:AddLine("|cFFFF7700Right Click|r: hide this icon.") end, }) @@ -2597,7 +2597,7 @@ local harmful_spells = StreamOverlay.HarmfulSpells local helpful_spells = StreamOverlay.HelpfulSpells if (not harmful_spells [spellid] and not helpful_spells [spellid]) then - if (bit.band (who_flags, 0x00000400) ~= 0 and who_name) then + if (bit.band(who_flags, 0x00000400) ~= 0 and who_name) then local text = editbox:GetText() if (not list:find (spellid) and not text:find (spellid)) then diff --git a/plugins/Details_TinyThreat/Details_TinyThreat.lua b/plugins/Details_TinyThreat/Details_TinyThreat.lua index 9370f996..9a681413 100644 --- a/plugins/Details_TinyThreat/Details_TinyThreat.lua +++ b/plugins/Details_TinyThreat/Details_TinyThreat.lua @@ -1,4 +1,4 @@ -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details_Threat") local _GetNumSubgroupMembers = GetNumSubgroupMembers --wow api @@ -10,12 +10,12 @@ local _IsInGroup = IsInGroup --wow api local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --wow api local GetUnitName = GetUnitName -local _ipairs = ipairs --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 +local abs = math.abs local RAID_CLASS_COLORS = RAID_CLASS_COLORS @@ -98,7 +98,7 @@ local function CreatePluginFrames (data) ThreatMeter:SizeChanged() - player = GetUnitName ("player", true) + player = GetUnitName("player", true) ThreatMeter.Actived = false @@ -118,21 +118,21 @@ local function CreatePluginFrames (data) elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then - local what_window = select (1, ...) + local what_window = select(1, ...) if (what_window == instance) then ThreatMeter:SizeChanged() ThreatMeter:RefreshRows() end elseif (event == "DETAILS_OPTIONS_MODIFIED") then - local what_window = select (1, ...) + local what_window = select(1, ...) if (what_window == instance) then ThreatMeter:RefreshRows() end elseif (event == "DETAILS_INSTANCE_STARTSTRETCH") then ThreatMeterFrame:SetFrameStrata("TOOLTIP") - ThreatMeterFrame:SetFrameLevel (instance.baseframe:GetFrameLevel()+1) + ThreatMeterFrame:SetFrameLevel(instance.baseframe:GetFrameLevel()+1) elseif (event == "DETAILS_INSTANCE_ENDSTRETCH") then ThreatMeterFrame:SetFrameStrata("MEDIUM") @@ -153,19 +153,19 @@ local function CreatePluginFrames (data) 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 @@ -189,7 +189,7 @@ local function CreatePluginFrames (data) ThreatMeterFrame:SetWidth(w) ThreatMeterFrame:SetHeight(h) ThreatMeter.RowHeight = instance.row_info.height - ThreatMeter.CanShow = math.floor ( h / (instance.row_info.height+1)) + ThreatMeter.CanShow = math.floor( h / (instance.row_info.height+1)) for i = #ThreatMeter.Rows+1, ThreatMeter.CanShow do ThreatMeter:NewRow (i) @@ -326,7 +326,7 @@ local function CreatePluginFrames (data) if (_IsInRaid()) then for i = 1, _GetNumGroupMembers(), 1 do - local thisplayer_name = GetUnitName ("raid"..i, true) + local thisplayer_name = GetUnitName("raid"..i, true) local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name] local threat_table = ThreatMeter.player_list_indexes [threat_table_index] @@ -342,7 +342,7 @@ local function CreatePluginFrames (data) elseif (_IsInGroup()) then for i = 1, _GetNumGroupMembers()-1, 1 do - local thisplayer_name = GetUnitName ("party"..i, true) + local thisplayer_name = GetUnitName("party"..i, true) local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name] local threat_table = ThreatMeter.player_list_indexes [threat_table_index] @@ -356,7 +356,7 @@ local function CreatePluginFrames (data) end - local thisplayer_name = GetUnitName ("player", true) + 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] @@ -365,7 +365,7 @@ local function CreatePluginFrames (data) else --player - local thisplayer_name = GetUnitName ("player", true) + 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] @@ -373,7 +373,7 @@ local function CreatePluginFrames (data) --pet if (UnitExists ("pet")) then - local thisplayer_name = GetUnitName ("pet", true) .. " *PET*" + local thisplayer_name = GetUnitName("pet", true) .. " *PET*" local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name] local threat_table = ThreatMeter.player_list_indexes [threat_table_index] @@ -390,7 +390,7 @@ local function CreatePluginFrames (data) --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 @@ -426,7 +426,7 @@ local function CreatePluginFrames (data) --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 @@ -501,7 +501,7 @@ local function CreatePluginFrames (data) if needMainTankDummyBar and ((not threatActor) or (not useAbsoluteMode) or (threatActor[6] < mainTankAbsoluteThreat)) then thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) - thisRow._icon:SetTexCoord (_unpack (RoleIconCoord ["TANK"])) + thisRow._icon:SetTexCoord (_unpack(RoleIconCoord ["TANK"])) thisRow:SetLeftText ("Current Tank") thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat) .. " (100.0%)") @@ -509,10 +509,10 @@ 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) + r,g = (otherPct*0.01), (abs(otherPct-100)*0.01) break end end @@ -551,9 +551,9 @@ local function CreatePluginFrames (data) if (threatActor) then local role = threatActor[4] thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]]) - thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role])) + thisRow._icon:SetTexCoord (_unpack(RoleIconCoord [role])) - thisRow:SetLeftText (ThreatMeter:GetOnlyName (threatActor [1])) + thisRow:SetLeftText (ThreatMeter:GetOnlyName(threatActor [1])) local pct = threatActor [useAbsoluteMode and 7 or 2] @@ -561,7 +561,7 @@ local function CreatePluginFrames (data) thisRow:SetValue(pct/barValueUnit) if (options.useplayercolor and threatActor [1] == player) then - thisRow:SetColor (_unpack (options.playercolor)) + thisRow:SetColor (_unpack(options.playercolor)) elseif (options.useclasscolors) then local color = RAID_CLASS_COLORS [threatActor [5]] @@ -574,10 +574,10 @@ 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) + r,g = (otherPct*0.01), (abs(otherPct-100)*0.01) break end end @@ -608,15 +608,15 @@ local function CreatePluginFrames (data) if (threat_actor [2] and threat_actor [2] > 0.1) then local thisRow = ThreatMeter.ShownRows [#ThreatMeter.ShownRows] thisRow:SetLeftText (player) - --thisRow.textleft:SetTextColor (unpack (RAID_CLASS_COLORS [threat_actor [5]])) + --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:SetTexCoord (_unpack (RoleIconCoord [role])) + thisRow._icon:SetTexCoord (_unpack(RoleIconCoord [role])) thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)") thisRow:SetValue(threat_actor [2]) if (options.useplayercolor) then - thisRow:SetColor (_unpack (options.playercolor)) + thisRow:SetColor (_unpack(options.playercolor)) else local r, g = ThreatMeter:percent_color (threat_actor [2], true) thisRow:SetColor (r, g, 0, .3) @@ -625,7 +625,7 @@ local function CreatePluginFrames (data) end end else - --print ("nao tem target") + --print("nao tem target") end end @@ -653,7 +653,7 @@ local function CreatePluginFrames (data) ThreatMeter:HideBars() if (ThreatMeter.Actived) then if (ThreatMeter.job_thread) then - ThreatMeter:CancelTimer (ThreatMeter.job_thread) + ThreatMeter:CancelTimer(ThreatMeter.job_thread) ThreatMeter.job_thread = nil end @@ -663,8 +663,8 @@ local function CreatePluginFrames (data) --pre build player list if (_IsInRaid()) then for i = 1, _GetNumGroupMembers(), 1 do - local thisplayer_name = GetUnitName ("raid"..i, true) - local role = _UnitGroupRolesAssigned (thisplayer_name) + local thisplayer_name = GetUnitName("raid"..i, true) + local role = _UnitGroupRolesAssigned(thisplayer_name) local _, class = UnitClass (thisplayer_name) local t = {thisplayer_name, 0, false, role, class, 0, 0} ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t @@ -673,30 +673,30 @@ local function CreatePluginFrames (data) elseif (_IsInGroup()) then for i = 1, _GetNumGroupMembers()-1, 1 do - local thisplayer_name = GetUnitName ("party"..i, true) - local role = _UnitGroupRolesAssigned (thisplayer_name) + local thisplayer_name = GetUnitName("party"..i, true) + local role = _UnitGroupRolesAssigned(thisplayer_name) local _, class = UnitClass (thisplayer_name) local t = {thisplayer_name, 0, false, role, class, 0, 0} ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes end - local thisplayer_name = GetUnitName ("player", true) - local role = _UnitGroupRolesAssigned (thisplayer_name) + local thisplayer_name = GetUnitName("player", true) + local role = _UnitGroupRolesAssigned(thisplayer_name) local _, class = UnitClass (thisplayer_name) local t = {thisplayer_name, 0, false, role, class, 0, 0} ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes else - local thisplayer_name = GetUnitName ("player", true) - local role = _UnitGroupRolesAssigned (thisplayer_name) + local thisplayer_name = GetUnitName("player", true) + local role = _UnitGroupRolesAssigned(thisplayer_name) local _, class = UnitClass (thisplayer_name) local t = {thisplayer_name, 0, false, role, class, 0, 0} ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes if (UnitExists ("pet")) then - local thispet_name = GetUnitName ("pet", true) .. " *PET*" + local thispet_name = GetUnitName("pet", true) .. " *PET*" local role = "DAMAGER" local t = {thispet_name, 0, false, role, class, 0, 0} ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t @@ -712,7 +712,7 @@ local function CreatePluginFrames (data) function ThreatMeter:End() ThreatMeter:HideBars() if (ThreatMeter.job_thread) then - ThreatMeter:CancelTimer (ThreatMeter.job_thread) + ThreatMeter:CancelTimer(ThreatMeter.job_thread) ThreatMeter.job_thread = nil end end @@ -720,7 +720,7 @@ local function CreatePluginFrames (data) function ThreatMeter:Cancel() ThreatMeter:HideBars() if (ThreatMeter.job_thread) then - ThreatMeter:CancelTimer (ThreatMeter.job_thread) + ThreatMeter:CancelTimer(ThreatMeter.job_thread) ThreatMeter.job_thread = nil end ThreatMeter.Actived = false @@ -834,15 +834,15 @@ function ThreatMeter:OnEvent (_, event, ...) elseif (event == "PLAYER_REGEN_DISABLED") then ThreatMeter.Actived = true ThreatMeter:Start() - --print ("tiny theat: regen disabled") + --print("tiny theat: regen disabled") elseif (event == "PLAYER_REGEN_ENABLED") then ThreatMeter:End() ThreatMeter.Actived = false - --print ("tiny theat: regen enabled") + --print("tiny theat: regen enabled") elseif (event == "ADDON_LOADED") then - local AddonName = select (1, ...) + local AddonName = select(1, ...) if (AddonName == "Details_TinyThreat") then if (_G._detalhes) then @@ -859,7 +859,7 @@ function ThreatMeter:OnEvent (_, event, ...) --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 - print (install.error) + print(install.error) end --Register needed events @@ -915,17 +915,17 @@ function ThreatMeter:OnEvent (_, event, ...) end ThreatMeter.saveddata.updatespeed = speed - ThreatMeter:Msg (Loc ["STRING_SLASH_SPEED_CHANGED"] .. speed) + ThreatMeter:Msg(Loc ["STRING_SLASH_SPEED_CHANGED"] .. speed) else - ThreatMeter:Msg (Loc ["STRING_SLASH_SPEED_CURRENT"] .. ThreatMeter.saveddata.updatespeed) + ThreatMeter:Msg(Loc ["STRING_SLASH_SPEED_CURRENT"] .. ThreatMeter.saveddata.updatespeed) end end elseif (command == Loc ["STRING_SLASH_AMOUNT"]) then else - ThreatMeter:Msg (Loc ["STRING_COMMAND_LIST"]) - print ("|cffffaeae/tinythreat " .. Loc ["STRING_SLASH_SPEED"] .. "|r: " .. Loc ["STRING_SLASH_SPEED_DESC"]) + ThreatMeter:Msg(Loc ["STRING_COMMAND_LIST"]) + print("|cffffaeae/tinythreat " .. Loc ["STRING_SLASH_SPEED"] .. "|r: " .. Loc ["STRING_SLASH_SPEED_DESC"]) end end diff --git a/plugins/Details_Vanguard/Details_Vanguard.lua b/plugins/Details_Vanguard/Details_Vanguard.lua index 6fc322b2..a2a2f17a 100644 --- a/plugins/Details_Vanguard/Details_Vanguard.lua +++ b/plugins/Details_Vanguard/Details_Vanguard.lua @@ -4,7 +4,7 @@ if (DetailsFramework.IsTBCWow() or DetailsFramework.IsWotLKWow()) then return end -local AceLocale = LibStub ("AceLocale-3.0") +local AceLocale = LibStub("AceLocale-3.0") local Loc = AceLocale:GetLocale ("Details") local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") local DF = _G.DetailsFramework @@ -38,10 +38,10 @@ 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 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 abs = math.abs --lua library local local _math_min = math.min --lua library local local _table_sort = table.sort @@ -102,8 +102,8 @@ local function CreatePluginFrames (data) 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")) + 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) @@ -118,10 +118,10 @@ local function CreatePluginFrames (data) Vanguard:ResetBars() Vanguard:IdentifyTanks() - Vanguard.CurrentCombat = _detalhes:GetCombat ("current") + Vanguard.CurrentCombat = _detalhes:GetCombat("current") VanguardFrame:SetFrameStrata(Vanguard.CurrentInstance.baseframe:GetFrameStrata()) - VanguardFrame:SetFrameLevel (Vanguard.CurrentInstance.baseframe:GetFrameLevel()+5) + VanguardFrame:SetFrameLevel(Vanguard.CurrentInstance.baseframe:GetFrameLevel()+5) if (Vanguard:IsInCombat()) then Vanguard:CombatStart() @@ -133,14 +133,14 @@ local function CreatePluginFrames (data) elseif (event == "COMBAT_PLAYER_ENTER") then --a new combat has been started Vanguard.CurrentInstance = Vanguard:GetInstance(Vanguard.instance_id) - Vanguard.CurrentCombat = select (1, ...) + Vanguard.CurrentCombat = select(1, ...) Vanguard.Running = true Vanguard:CombatStart() elseif (event == "COMBAT_PLAYER_LEAVE") then --current combat has finished - Vanguard.CurrentCombat = select (1, ...) + Vanguard.CurrentCombat = select(1, ...) Vanguard:CombatEnd() Vanguard:ResetBars() @@ -196,7 +196,7 @@ local function CreatePluginFrames (data) if (IsInRaid()) then for i = 1, GetNumGroupMembers(), 1 do - local role = _UnitGroupRolesAssigned ("raid" .. i) + local role = _UnitGroupRolesAssigned("raid" .. i) if (role == "TANK") then local name, realm = UnitName ("raid"..i) if (realm) then @@ -216,7 +216,7 @@ local function CreatePluginFrames (data) elseif (IsInGroup()) then for i = 1, GetNumGroupMembers()-1, 1 do - local role = _UnitGroupRolesAssigned ("party"..i) + local role = _UnitGroupRolesAssigned("party"..i) if (role == "TANK") then local name, realm = UnitName ("party"..i) if (realm) then @@ -233,7 +233,7 @@ local function CreatePluginFrames (data) end end - local role = _UnitGroupRolesAssigned ("player") + local role = _UnitGroupRolesAssigned("player") if (role == "TANK") then local name, realm = UnitName ("player") if (realm) then @@ -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 @@ -325,7 +325,7 @@ local function CreatePluginFrames (data) if (spec) then self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.spec_file) - self.specicon:SetTexCoord (_unpack (Vanguard.class_specs_coords [spec])) + self.specicon:SetTexCoord (_unpack(Vanguard.class_specs_coords [spec])) else self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.icon_file) self.specicon:SetTexCoord (left, right, top, bottom) @@ -339,13 +339,13 @@ local function CreatePluginFrames (data) bar.lefticon = Vanguard.CurrentInstance.row_info.icon_file bar.iconleft:SetTexCoord (left, right, top, bottom) - bar:SetLeftText (Vanguard:GetOnlyName (name)) + bar:SetLeftText (Vanguard:GetOnlyName(name)) bar:SetLeftText (name) local width = Vanguard.db.tank_block_size self:SetWidth(width) - self:SetBackdropColor(unpack (Vanguard.db.tank_block_color)) - self.unitFrame.healthBar.background:SetColorTexture(unpack (Vanguard.db.tank_block_color)) + 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 @@ -397,7 +397,7 @@ local function CreatePluginFrames (data) 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:SetBackdropColor(unpack(Vanguard.db.tank_block_color)) f:SetBackdropBorderColor(0, 0, 0, 1) --debuff icons @@ -466,7 +466,7 @@ local function CreatePluginFrames (data) for i = 1, CONST_DEBUFF_AMOUNT do local support_frame = CreateFrame("frame", "VanguardSupportFrame_"..index.."_"..i, f.unitFrame, "BackdropTemplate") - support_frame:SetFrameLevel (f.unitFrame:GetFrameLevel()+10) + support_frame:SetFrameLevel(f.unitFrame:GetFrameLevel()+10) support_frame:SetSize(24, 24) support_frame:SetScript("OnMouseUp", on_click) @@ -481,7 +481,7 @@ local function CreatePluginFrames (data) support_frame:SetPoint("left", f, "left", 5 + xOffSet, -8) local dblock = CreateFrame("cooldown", "VanguardTankDebuffCooldown" .. index.. "_" .. i, support_frame, "CooldownFrameTemplate, BackdropTemplate") - dblock:SetAlpha (0.7) + dblock:SetAlpha(0.7) dblock:SetPoint("topleft", texture, "topleft") dblock:SetPoint("bottomright", texture, "bottomright") @@ -680,7 +680,7 @@ local function CreatePluginFrames (data) function Vanguard.AnimateLeftWithAccel(self, deltaTime) local distance = (self.AnimationStart - self.AnimationEnd) / self.CurrentHealthMax * 100 --scale 1 - 100 local minTravel = min (distance / 10, 3) -- 10 = trigger distance to max speed 3 = speed scale on max travel - local maxTravel = max (minTravel, 0.45) -- 0.45 = min scale speed on low travel speed + local maxTravel = max(minTravel, 0.45) -- 0.45 = min scale speed on low travel speed local calcAnimationSpeed = (self.CurrentHealthMax * (deltaTime * DB_ANIMATION_TIME_DILATATION)) * maxTravel --re-scale back to unit health, scale with delta time and scale with the travel speed self.AnimationStart = self.AnimationStart - (calcAnimationSpeed) @@ -705,7 +705,7 @@ local function CreatePluginFrames (data) function Vanguard.AnimateRightWithAccel(self, deltaTime) local distance = (self.AnimationEnd - self.AnimationStart) / self.CurrentHealthMax * 100 --scale 1 - 100 basis local minTravel = math.min (distance / 10, 3) -- 10 = trigger distance to max speed 3 = speed scale on max travel - local maxTravel = math.max (minTravel, 0.45) -- 0.45 = min scale speed on low travel speed + local maxTravel = math.max(minTravel, 0.45) -- 0.45 = min scale speed on low travel speed local calcAnimationSpeed = (self.CurrentHealthMax * (deltaTime * DB_ANIMATION_TIME_DILATATION)) * maxTravel --re-scale back to unit health, scale with delta time and scale with the travel speed self.AnimationStart = self.AnimationStart + (calcAnimationSpeed) @@ -768,16 +768,16 @@ local function CreatePluginFrames (data) if (taken > 0 and heals > 0) then if (taken > heals) then local p = heals / taken * 100 - p = _math_abs (p - 100) + p = abs(p - 100) p = p / 2 p = p + 50 - p = _math_abs (p - 100) + p = abs(p - 100) --tframe.heal_inc:SetSplit (p) currentValue = p else local p = taken / heals * 100 - p = _math_abs (p - 100) + p = abs(p - 100) p = p / 2 p = p + 50 @@ -822,7 +822,7 @@ local function CreatePluginFrames (data) end if (Vanguard.track_incoming) then - Vanguard:CancelTimer (Vanguard.track_incoming) + Vanguard:CancelTimer(Vanguard.track_incoming) end Vanguard.track_incoming = Vanguard:ScheduleRepeatingTimer ("TrackIncoming", 0.1) @@ -839,7 +839,7 @@ local function CreatePluginFrames (data) end if (Vanguard.track_incoming) then - Vanguard:CancelTimer (Vanguard.track_incoming) + Vanguard:CancelTimer(Vanguard.track_incoming) end onUpdateFrame:SetScript("OnUpdate", nil) @@ -849,11 +849,11 @@ local function CreatePluginFrames (data) local formatTime = function(time) if (time >= 3600) then - return floor (time / 3600) .. "h" + return floor(time / 3600) .. "h" elseif (time >= 60) then - return floor (time / 60) .. "m" + return floor(time / 60) .. "m" else - return floor (time) + return floor(time) end end @@ -949,11 +949,11 @@ local build_options_panel = function() local tank_texture_menu = texTable --templates - local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE") - local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") - local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE") - local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") + local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE") + local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") + local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE") + local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE") + local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE") local menu = { { @@ -1129,7 +1129,7 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh 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 - print (install.error) + print(install.error) end --Vanguard.db.first_run = false --debug diff --git a/startup.lua b/startup.lua index 60b5dfc3..2afb0216 100644 --- a/startup.lua +++ b/startup.lua @@ -398,7 +398,7 @@ function Details:StartMeUp() --I'll never stop! function Details:OpenOptionsWindowAtStart() --Details:OpenOptionsWindow (Details.tabela_instancias[1]) - --print (_G ["DetailsClearSegmentsButton1"]:GetSize()) + --print(_G ["DetailsClearSegmentsButton1"]:GetSize()) --Details:OpenCustomDisplayWindow() --Details:OpenWelcomeWindow() end @@ -492,7 +492,7 @@ function Details:StartMeUp() --I'll never stop! if (not DetailsFramework.IsClassicWow()) then --i'm not in classc wow else - print ("|CFFFFFF00[Details!]: you're using Details! for RETAIL on Classic WOW, please get the classic version (Details! Damage Meter Classic WoW), if you need help see our Discord (/details discord).") + print("|CFFFFFF00[Details!]: you're using Details! for RETAIL on Classic WOW, please get the classic version (Details! Damage Meter Classic WoW), if you need help see our Discord (/details discord).") end Details:InstallHook("HOOK_DEATH", Details.Coach.Client.SendMyDeath)