diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 4692e714..f447ab7d 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,5 @@ -local dversion = 56 +local dversion = 57 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index dfd2709a..bba0b4fa 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -3618,13 +3618,6 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- ~scrollbox - --- preciso de uma fauxscroll que seja facil de lidar --- ele cria scroll aqui, preciso falar a função que cria a linha e a função que atualiza --- precisa passsar o tamanho em height width quantas barras vai mostrar --- search box incluso opcionalmente - - DF.SortFunctions = {} local SortMember = "" @@ -3659,7 +3652,7 @@ DF.ScrollBoxFunctions.Refresh = function (self) offset = FauxScrollFrame_GetOffset (self) end - local okay, totalLines = pcall (self.refresh_func, self, self.data, offset, #self.Frames) + local okay, totalLines = pcall (self.refresh_func, self, self.data, offset, self.LineAmount) if (not okay) then error ("Details! FrameWork: Refresh(): " .. totalLines) end @@ -3674,6 +3667,19 @@ DF.ScrollBoxFunctions.Refresh = function (self) self:Show() + if (self.HideScrollBar) then + local frameName = self:GetName() + if (frameName) then + local scrollBar = _G [frameName .. "ScrollBar"] + if (scrollBar) then + scrollBar:Hide() + end + else + + end + + end + return self.Frames end @@ -3683,9 +3689,13 @@ DF.ScrollBoxFunctions.OnVerticalScroll = function (self, offset) end DF.ScrollBoxFunctions.CreateLine = function (self, func) + if (not func) then + func = self.CreateLineFunc + end local okay, newLine = pcall (func, self, #self.Frames+1) if (okay) then tinsert (self.Frames, newLine) + newLine.Index = #self.Frames return newLine else error ("Details! FrameWork: CreateLine(): " .. newLine) @@ -3707,14 +3717,85 @@ DF.ScrollBoxFunctions.GetData = function (self) return self.data end -function DF:CreateScrollBox (parent, name, refresh_func, data, width, height, line_amount, line_height) +DF.ScrollBoxFunctions.GetFrames = function (self) + return self.Frames +end + +DF.ScrollBoxFunctions.GetNumFramesCreated = function (self) + return #self.Frames +end + +DF.ScrollBoxFunctions.GetNumFramesShown = function (self) + return self.LineAmount +end + +DF.ScrollBoxFunctions.SetNumFramesShown = function (self, new_amount) + --> hide frames which won't be used + if (new_amount < #self.Frames) then + for i = new_amount+1, #self.Frames do + self.Frames [i]:Hide() + end + end + + --> set the new amount + self.LineAmount = new_amount +end + +DF.ScrollBoxFunctions.SetFramesHeight = function (self, new_height) + self.LineHeight = new_height + self:OnSizeChanged() + self:Refresh() +end + +DF.ScrollBoxFunctions.OnSizeChanged = function (self) + if (self.ReajustNumFrames) then + --> how many lines the scroll can show + local amountOfFramesToShow = floor (self:GetHeight() / self.LineHeight) + + --> how many lines the scroll already have + local totalFramesCreated = self:GetNumFramesCreated() + + --> how many lines are current shown + local totalFramesShown = self:GetNumFramesShown() + + --> the amount of frames increased + if (amountOfFramesToShow > totalFramesShown) then + for i = totalFramesShown+1, amountOfFramesToShow do + --> check if need to create a new line + if (i > totalFramesCreated) then + self:CreateLine (self.CreateLineFunc) + end + end + + --> the amount of frames decreased + elseif (amountOfFramesToShow < totalFramesShown) then + --> hide all frames above the new amount to show + for i = totalFramesCreated, amountOfFramesToShow, -1 do + if (self.Frames [i]) then + self.Frames [i]:Hide() + end + end + end + + --> set the new amount of frames + self:SetNumFramesShown (amountOfFramesToShow) + + --> refresh lines + self:Refresh() + end +end + +function DF:CreateScrollBox (parent, name, refresh_func, data, width, height, line_amount, line_height, create_line_func, auto_amount, no_scroll) local scroll = CreateFrame ("scrollframe", name, parent, "FauxScrollFrameTemplate") scroll:SetSize (width, height) scroll.LineAmount = line_amount scroll.LineHeight = line_height scroll.IsFauxScroll = true + scroll.HideScrollBar = no_scroll scroll.Frames = {} + scroll.ReajustNumFrames = auto_amount + scroll.CreateLineFunc = create_line_func DF:Mixin (scroll, DF.SortFunctions) DF:Mixin (scroll, DF.ScrollBoxFunctions) @@ -3723,9 +3804,38 @@ function DF:CreateScrollBox (parent, name, refresh_func, data, width, height, li scroll.data = data scroll:SetScript ("OnVerticalScroll", scroll.OnVerticalScroll) + scroll:SetScript ("OnSizeChanged", DF.ScrollBoxFunctions.OnSizeChanged) return scroll end +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- ~resizers +function DF:CreateResizeGrips (parent) + if (parent) then + local parentName = parent:GetName() + + local leftResizer = CreateFrame ("button", parentName and parentName .. "LeftResizer" or nil, parent) + local rightResizer = CreateFrame ("button", parentName and parentName .. "RightResizer" or nil, parent) + + leftResizer:SetPoint ("bottomleft", parent, "bottomleft") + rightResizer:SetPoint ("bottomright", parent, "bottomright") + leftResizer:SetSize (16, 16) + rightResizer:SetSize (16, 16) + + rightResizer:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + rightResizer:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + rightResizer:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + leftResizer:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]]) + leftResizer:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]]) + leftResizer:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]]) + + leftResizer:GetNormalTexture():SetTexCoord (1, 0, 0, 1) + leftResizer:GetHighlightTexture():SetTexCoord (1, 0, 0, 1) + leftResizer:GetPushedTexture():SetTexCoord (1, 0, 0, 1) + + return leftResizer, rightResizer + end +end diff --git a/boot.lua b/boot.lua index 8dfae69f..f558115c 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 4771 + _detalhes.build_counter = 4823 _detalhes.userversion = "v7.3.0." .. _detalhes.build_counter _detalhes.realversion = 126 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -21,13 +21,12 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v7.3.0.4723.126 (|cFFFFCC00Set 22th, 2017|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Fixed overall dungeon segments being added to overall data.\n\n +|cFFFFFF00v7.3.0.4823.126 (|cFFFFCC00Oct 09th, 2017|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added new options section: Streamer Settings, focused on adjustments for streamers and youtubers.\n\n +|cFFFFFF00-|r Animations now always run at the same speed regardless the framerate.\n\n --]] ---|cFFFFFF00v7.3.0.4705.126 (|cFFFFCC00Set 19th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed damage taken tooltip for Brewmaster Monk where sometimes the tooltip didn't open.\n\n|cFFFFFF00-|r Fixed overall data on mythic dungeon not adding trash segments even with the option enabled on the options panel.\n\n|cFFFFFF00-|r Fixed the guild selection dropdown reseting everytime the Guild Rank window is opened.\n\n - - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.3.0.4723.126 (|cFFFFCC00Set 22th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed overall dungeon segments being added to overall data.\n\n|cFFFFFF00v7.3.0.4705.126 (|cFFFFCC00Set 19th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed damage taken tooltip for Brewmaster Monk where sometimes the tooltip didn't open.\n\n|cFFFFFF00-|r Fixed overall data on mythic dungeon not adding trash segments even with the option enabled on the options panel.\n\n|cFFFFFF00-|r Fixed the guild selection dropdown reseting everytime the Guild Rank window is opened.\n\n|cFFFFFF00v7.3.0.4677.126 (|cFFFFCC00Set 10th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r During mythic dungeons, the trash segments will be merged into a new segment at the end of the boss encounter (instead of merging on the fly while cleaning up).\n\n|cFFFFFF00v7.3.0.4615.125 (|cFFFFCC00Set 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Setting up the dungeon stuff as opt-in for early adopters while we continue to make improvements on the system.\n\n|cFFFFFF00v7.3.0.4586.125 (|cFFFFCC00Set 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Formating mythic+ dungeon segments, each segment should count the boss trash + boss fight.\n\n|cFFFFFF00-|r At the end of the mythic+ dungeon, it should create a new segment adding up all segments described above.\n\n|cFFFFFF00v7.3.0.4499.124 (|cFFFFCC00Set 05th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to always show all players when using the standard mode. Option under PvP/PvE bracket on the options panel.\n\n|cFFFFFF00-|r Added a setting to exclude healing done lines from the death log below a certain healing amount. This options is also under PvP/PvE bracket.\n\n|cFFFFFF00-|r Fixed the guild selection on the ranking panel.\n\n|cFFFFFF00v7.3.0.4467.124 (|cFFFFCC00August 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Damage or Healing record for the encounter should be printed on chat on the boss pull.\nUse /run Details.announce_damagerecord.enabled = false; to disable.\n\n|cFFFFFF00v7.2.5.4437.124 (|cFFFFCC00August 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added healing done cap for death log. Use /run Details.deathlog_healingdone_min = 10000\n\n|cFFFFFF00-|r Fixed an issue where the alpha from the fixed bar color was used even when this option was disabled.\n\n|cFFFFFF00v7.2.5.4436.124 (|cFFFFCC00August 17th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix the issue where the window doesn't update after entering a raid or reseting data.\n\n|cFFFFFF00v7.2.5.4434.124 (|cFFFFCC00August 10th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to create an aura at Aura tab on the Player Details window.\n\n|cFFFFFF00-|r Fixes and improvements on the damage rank panel.\n\n|cFFFFFF00-|r Best damage or healing for the player on the current boss encounter is now shown on the spec icon tooltip.\n\n|cFFFFFF00-|r Major revamp on the aura creation panel.\n\n|cFFFFFF00v7.2.5.4369.124 (|cFFFFCC00August 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! can now track debuff applications (stack) and refreshes.\n\n|cFFFFFF00-|r Added new tab on Player Detail Window called 'Auras', you can see your buffs and debuffs from there.\n\n|cFFFFFF00-|r Death log now show debuff applications.\n\n|cFFFFFF00v7.2.5.4275.123 (|cFFFFCC00July 18th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed some issues with tooltiops popup when the user press SHIFT.\n\n|cFFFFFF00-|r Now is possible to change the bar durating when selecting Cast Start trigger on Details! Forge.\n\n|cFFFFFF00-|r Kil'Jaeden adds should be consolidated into only one actor instead of having one for each player targeted.\n\n|cFFFFFF00v7.2.5.4236.122 (|cFFFFCC00July 05th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r The alert to open the raid ranking after a boss kill, is now shown for 10 seconds (down from 40).\n\n|cFFFFFF00-|r Added a report button on the raid ranking panel and boss are sort alphabetically.\n\n|cFFFFFF00-|r Fixed some issues on the combatlog introduced on the wow patch 7.2.5 where sometimes the source of an event has no name.\n\n|cFFFFFF00-|r Ticket #209, fixed more issues with the comparison panel where are pets involved.\n\n|cFFFFFF00v7.2.5.4201.121 (|cFFFFCC00June 26th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk Stagger where it was only shown on the friendly fire and not under the Damage Taken display.\n\n|cFFFFFF00-|r Added Forge and Ranking options on the main menu (orange cogwheel).\n\n|cFFFFFF00v7.2.5.4102.121 (|cFFFFCC00June 22th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! Forge has updated and now is more usder friendly.\n\n|cFFFFFF00-|r Fixed an issue with player buff uptime where sometimes some buffs wans't showing in the tooltip.\n\n|cFFFFFF00v7.2.5.3968.120 (|cFFFFCC00June 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r New Guild Damage and Heal rank on '/details ranking' panel.\n\n|cFFFFFF00-|r Added a Guild Sync button on the Details! Ranking Panel.\n\n|cFFFFFF00-|r Added Custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Sisters of the Moon 'Embrace of the Eclipse' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket, it shows the total of alternate power gain from each player, useful for encounters such as Demonic Inquisition.\n\n|cFFFFFF00-|r 'First Hit' message after pulling a boss, now also shows who the boss is targeting (almost always is who pulled).\n\n|cFFFFFF00-|r Raid Dps {rdps} and Hps {rhps} can now be used on the Broker Data Feed..\n\n|cFFFFFF00-|r Fixed an issue with Chromie from the scenario 'The Deaths of Chromie' where she wasn't being shown on the meter.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n|cFFFFFF00-|r Ticket #198 'Script Error' Fixed.\n\n|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.3.0.4823.126 (|cFFFFCC00Oct 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new options section: Streamer Settings, focused on adjustments for streamers and youtubers.\n\n|cFFFFFF00-|r Animations now always run at the same speed regardless the framerate.\n\n|cFFFFFF00v7.3.0.4723.126 (|cFFFFCC00Set 22th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed overall dungeon segments being added to overall data.\n\n|cFFFFFF00v7.3.0.4705.126 (|cFFFFCC00Set 19th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed damage taken tooltip for Brewmaster Monk where sometimes the tooltip didn't open.\n\n|cFFFFFF00-|r Fixed overall data on mythic dungeon not adding trash segments even with the option enabled on the options panel.\n\n|cFFFFFF00-|r Fixed the guild selection dropdown reseting everytime the Guild Rank window is opened.\n\n|cFFFFFF00v7.3.0.4677.126 (|cFFFFCC00Set 10th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r During mythic dungeons, the trash segments will be merged into a new segment at the end of the boss encounter (instead of merging on the fly while cleaning up).\n\n|cFFFFFF00v7.3.0.4615.125 (|cFFFFCC00Set 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Setting up the dungeon stuff as opt-in for early adopters while we continue to make improvements on the system.\n\n|cFFFFFF00v7.3.0.4586.125 (|cFFFFCC00Set 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Formating mythic+ dungeon segments, each segment should count the boss trash + boss fight.\n\n|cFFFFFF00-|r At the end of the mythic+ dungeon, it should create a new segment adding up all segments described above.\n\n|cFFFFFF00v7.3.0.4499.124 (|cFFFFCC00Set 05th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to always show all players when using the standard mode. Option under PvP/PvE bracket on the options panel.\n\n|cFFFFFF00-|r Added a setting to exclude healing done lines from the death log below a certain healing amount. This options is also under PvP/PvE bracket.\n\n|cFFFFFF00-|r Fixed the guild selection on the ranking panel.\n\n|cFFFFFF00v7.3.0.4467.124 (|cFFFFCC00August 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Damage or Healing record for the encounter should be printed on chat on the boss pull.\nUse /run Details.announce_damagerecord.enabled = false; to disable.\n\n|cFFFFFF00v7.2.5.4437.124 (|cFFFFCC00August 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added healing done cap for death log. Use /run Details.deathlog_healingdone_min = 10000\n\n|cFFFFFF00-|r Fixed an issue where the alpha from the fixed bar color was used even when this option was disabled.\n\n|cFFFFFF00v7.2.5.4436.124 (|cFFFFCC00August 17th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix the issue where the window doesn't update after entering a raid or reseting data.\n\n|cFFFFFF00v7.2.5.4434.124 (|cFFFFCC00August 10th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to create an aura at Aura tab on the Player Details window.\n\n|cFFFFFF00-|r Fixes and improvements on the damage rank panel.\n\n|cFFFFFF00-|r Best damage or healing for the player on the current boss encounter is now shown on the spec icon tooltip.\n\n|cFFFFFF00-|r Major revamp on the aura creation panel.\n\n|cFFFFFF00v7.2.5.4369.124 (|cFFFFCC00August 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! can now track debuff applications (stack) and refreshes.\n\n|cFFFFFF00-|r Added new tab on Player Detail Window called 'Auras', you can see your buffs and debuffs from there.\n\n|cFFFFFF00-|r Death log now show debuff applications.\n\n|cFFFFFF00v7.2.5.4275.123 (|cFFFFCC00July 18th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed some issues with tooltiops popup when the user press SHIFT.\n\n|cFFFFFF00-|r Now is possible to change the bar durating when selecting Cast Start trigger on Details! Forge.\n\n|cFFFFFF00-|r Kil'Jaeden adds should be consolidated into only one actor instead of having one for each player targeted.\n\n|cFFFFFF00v7.2.5.4236.122 (|cFFFFCC00July 05th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r The alert to open the raid ranking after a boss kill, is now shown for 10 seconds (down from 40).\n\n|cFFFFFF00-|r Added a report button on the raid ranking panel and boss are sort alphabetically.\n\n|cFFFFFF00-|r Fixed some issues on the combatlog introduced on the wow patch 7.2.5 where sometimes the source of an event has no name.\n\n|cFFFFFF00-|r Ticket #209, fixed more issues with the comparison panel where are pets involved.\n\n|cFFFFFF00v7.2.5.4201.121 (|cFFFFCC00June 26th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Monk Stagger where it was only shown on the friendly fire and not under the Damage Taken display.\n\n|cFFFFFF00-|r Added Forge and Ranking options on the main menu (orange cogwheel).\n\n|cFFFFFF00v7.2.5.4102.121 (|cFFFFCC00June 22th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! Forge has updated and now is more usder friendly.\n\n|cFFFFFF00-|r Fixed an issue with player buff uptime where sometimes some buffs wans't showing in the tooltip.\n\n|cFFFFFF00v7.2.5.3968.120 (|cFFFFCC00June 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r New Death Recap implemented! replaces the default from Blizzard and can be configured at Options > Raid Tools.\n\n|cFFFFFF00-|r New Guild Damage and Heal rank on '/details ranking' panel.\n\n|cFFFFFF00-|r Added a Guild Sync button on the Details! Ranking Panel.\n\n|cFFFFFF00-|r Added Custom display 'Damage on Shields', useful for encounter like Maiden of Vigilance where there's big shields to be removed and you want to know who is doing more damage to it.\n\n|cFFFFFF00-|r Added Heal Absorbed display under Heal bracket.\n\nHeal Absorb are the heal denied by abilities such like DK's Necrotic Strike or raid boss Sisters of the Moon 'Embrace of the Eclipse' ability.\nThe tooltip of this display shows which players got heal denied, which abilities absorbed the heal, which abilities tried to heal but got the heal denied.\n\n|cFFFFFF00-|r Added Alternate Power display under Energy bracket, it shows the total of alternate power gain from each player, useful for encounters such as Demonic Inquisition.\n\n|cFFFFFF00-|r 'First Hit' message after pulling a boss, now also shows who the boss is targeting (almost always is who pulled).\n\n|cFFFFFF00-|r Raid Dps {rdps} and Hps {rhps} can now be used on the Broker Data Feed..\n\n|cFFFFFF00-|r Fixed an issue with Chromie from the scenario 'The Deaths of Chromie' where she wasn't being shown on the meter.\n\n|cFFFFFF00-|r Fixed Paladin 'Light of the Martyr' damage to self.\n\n|cFFFFFF00-|r Ticket #198 'Script Error' Fixed.\n\n|cFFFFFF00v7.2.0.3703.119 (|cFFFFCC00May 29th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an error while killing low level mobs with warrior class.\n\n|cFFFFFF00v7.2.0.3693.118 (|cFFFFCC00May 25th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fury Warrior shouldn't be assigned as Protection any more.\n\n|cFFFFFF00-|r Some parser fixes.\n\n|cFFFFFF00v7.2.0.3673.118 (|cFFFFCC00May 09th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #187: Fixed an issue when comparing hunter pets on the player detail window.\n\n|cFFFFFF00-|r Ticket #189 #186: Fixed a taint issue for some classes when using friendly nameplates on.\n\n|cFFFFFF00v7.2.0.3512.116 (|cFFFFCC00April 27th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Havoc Demon Hunter: your fury energy is being shown under Mana Restored (don't ask me why, the combat log is telling us it's mana).\n\n|cFFFFFF00-|r Pets now are shown on damage tooltips.\n\n|cFFFFFF00-|r Pets are now also shown on the comparison panel.\n\n|cFFFFFF00v7.2.0.3474.116 (|cFFFFCC00April 20th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin: Raid Check > added some food buffs which wasn't being tracked.\n\n|cFFFFFF00v7.2.0.3467.116 (|cFFFFCC00April 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the custom display window where apply and cancel buttons where over the edit window.\n\n|cFFFFFF00-|r Fix for an issue on editing a bookmark.\n\n|cFFFFFF00v7.1.5.3459.116 (|cFFFFCC00Mar 21th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue on dynamic overall data where it wasn't showing DPS.\n\n|cFFFFFF00-|r Fixed an issue with Apply, Save and Cancel buttons when editing a custom display.\n\n|cFFFFFF00-|r Removed the Damage and Healing presets for custom displays, now is only possible create custom displays by scripting them.\n\n|cFFFFFF00v7.1.5.3431.116 (|cFFFFCC00Mar 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with bar orientation right to left where fixed bar color isn't working.\n\n|cFFFFFF00-|r The nickname field now use FrizQuadrataTT font and shall be compatible with Cyrillic.\n\n|cFFFFFF00v7.1.5.3418.116 (|cFFFFCC00Mar 1st, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #167 fix: Light of the Martyr self-damage now does reduce the healing done (following WCL method).\n\n|cFFFFFF00-|r Ticket #169 fix: Damage Prevented is now working for new segments.\n\n|cFFFFFF00-|r Fixed an issue where sometimes BeastMaster's Hati pet wasn't detected correctly.\n\n|cFFFFFF00v7.1.5.3369.116 (|cFFFFCC00Feb 07th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'Dynamic Overall Damage' for mythic dungeons.\n\n|cFFFFFF00-|r Fix for Ticket #168: 'Auto Hide While [Not] Inside Instance is broken'.\n\n|cFFFFFF00-|r The bar truncate frame 'DetailsLeftTextAntiTruncate' is now created on Details! load instead on demand.\n\n|cFFFFFF00v7.1.5.3315.116 (|cFFFFCC00Jan 23th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Ticket #162: 'no Monochrome font' available, added an experimental slash command: /run _detalhes:UseOutline ('MONOCHROME').\n\n|cFFFFFF00-|r Ticket #158: 'no elapsed time shown on report to chat', added the elapsed time when reporting a segment.\n\n|cFFFFFF00-|r Ticket #164: 'error when browsing segments', an attempt to fix the problem has been made.\n\n|cFFFFFF00v7.1.5.3305.116 (|cFFFFCC00Jan 15th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Another fix for mythic dungeons overall data reset (thanks Tharai @ Curseforge).\n\n|cFFFFFF00-|r Fix for spec detection on PvP Arenas (thanks Pas06 @ Curseforge).\n\n|cFFFFFF00v7.1.0.3276.115 (|cFFFFCC00Jan 08th, 2017|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the overall data not reseting when starting a new mythic+ dungeon.\n\n|cFFFFFF00v7.1.0.3266.115 (|cFFFFCC00Dec 29th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data not updating correctly at the end of the combat.\n\n|cFFFFFF00-|r Added a tutorial line on the window when the user access overall data.\n\n|cFFFFFF00v7.1.0.3236.115 (|cFFFFCC00Dec 19th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Integration with BigWigs should be working okay now.\n\n|cFFFFFF00v7.1.0.3231.115 (|cFFFFCC00Dec 15th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Disabled the link with BigWigs to avoid the 'RegisterMessage' error on every login.\n\n|cFFFFFF00v7.1.0.3229.115 (|cFFFFCC00Dec 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r When a window is locked, resize grips shouldn't be enabled messing with bar mouse over.\n\n|cFFFFFF00v7.0.3.3222.115 (|cFFFFCC00November 28th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Unstable Affliction to common spells with the same name.\n\n|cFFFFFF00-|r Fixed few issues with built-in plugins.\n\n|cFFFFFF00v7.0.3.3202.115 (|cFFFFCC00November 08th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Weakauras creator from the Encounter Details plugin and '/details forge' shall work correctly now with Trials of Valor.\n\n|cFFFFFF00-|r Raid history should now be recording your Trials of Valor kills.\n\n|cFFFFFF00-|r Added Trials of Valor raid info, good luck and have fun!.\n\n|cFFFFFF00v7.0.3.3201.115 (|cFFFFCC00November 04th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Paladin holy icon.\n\n|cFFFFFF00-|r Fix for Rogue outlaw icon.\n\n|cFFFFFF00-|r Fixed misc displays with bar sorted by ascending order.\n\n|cFFFFFF00-|r Fix for '/details show' command while the window is on auto hide.\n\n|cFFFFFF00v7.0.3.3114.115 (|cFFFFCC00October 26th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): tooltip tutorial is now clamped to screen and its close button should be visible.\n\n|cFFFFFF00-|r Raid Check (plugin): now also works on dungeons.\n\n|cFFFFFF00-|r Added Potion of the Prolongued Power to the tracker.\n\n|cFFFFFF00v7.1.0.3097.115 (|cFFFFCC00October 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r renamed 'report history' to 'latest reports'.\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 949865dd..45b4bd54 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -160,11 +160,21 @@ if (have_cached) then novo_objeto.spec = have_cached --> check is didn't changed the spec: + if (_detalhes.streamer_config.quick_detection) then + --> validate the spec more times if on quick detection + _detalhes:ScheduleTimer ("ReGuessSpec", 2, {novo_objeto, self}) + _detalhes:ScheduleTimer ("ReGuessSpec", 4, {novo_objeto, self}) + _detalhes:ScheduleTimer ("ReGuessSpec", 6, {novo_objeto, self}) + end _detalhes:ScheduleTimer ("ReGuessSpec", 15, {novo_objeto, self}) --print (nome, "spec em cache:", have_cached) else - _detalhes:ScheduleTimer ("GuessSpec", 3, {novo_objeto, self, 1}) - --print (nome, "nao tem") + if (_detalhes.streamer_config.quick_detection) then + --> shoot detection early if in quick detection + _detalhes:ScheduleTimer ("GuessSpec", 1, {novo_objeto, self, 1}) + else + _detalhes:ScheduleTimer ("GuessSpec", 3, {novo_objeto, self, 1}) + end end end diff --git a/classes/container_historico.lua b/classes/container_historico.lua index d336d245..7a6f4c6f 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -424,6 +424,9 @@ function historico:resetar_overall() end end + --> stop bar testing if any + _detalhes:StopTestBarUpdate() + _detalhes:ClockPluginTickOnSegment() end @@ -433,6 +436,9 @@ function historico:resetar() _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) end diff --git a/core/control.lua b/core/control.lua index 2ab0f7e4..0f6ec497 100644 --- a/core/control.lua +++ b/core/control.lua @@ -415,6 +415,9 @@ _detalhes:CheckSwitchToCurrent() _detalhes:CheckForTextTimeCounter (true) + + --> stop bar testing if any + _detalhes:StopTestBarUpdate() end function _detalhes:DelayedSyncAlert() @@ -900,6 +903,7 @@ _detalhes.tabela_vigente.arena = true _detalhes.tabela_vigente.is_arena = {name = _detalhes.zone_name, zone = _detalhes.zone_name, mapid = _detalhes.zone_id} + _detalhes:SendEvent ("COMBAT_ARENA_START") end function _detalhes:StartArenaSegment (...) @@ -946,6 +950,7 @@ _detalhes:TimeDataUnregister ("Your Team Healing") _detalhes:TimeDataUnregister ("Enemy Team Healing") + _detalhes:SendEvent ("COMBAT_ARENA_END") end local validSpells = { diff --git a/core/gears.lua b/core/gears.lua index 76ac105e..8249484b 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -461,17 +461,34 @@ function _detalhes:ResetSpecCache (forced) end +function _detalhes:RefreshUpdater (suggested_interval) + local updateInterval = suggested_interval or _detalhes.update_speed + + if (_detalhes.streamer_config.faster_updates) then + --> force 60 updates per second + updateInterval = 0.016 + end + + if (_detalhes.atualizador) then + _detalhes:CancelTimer (_detalhes.atualizador) + end + _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", updateInterval, -1) +end + function _detalhes:SetWindowUpdateSpeed (interval, nosave) if (not interval) then interval = _detalhes.update_speed end + + if (type (interval) ~= "number") then + interval = _detalhes.update_speed or 0.3 + end if (not nosave) then _detalhes.update_speed = interval end - _detalhes:CancelTimer (_detalhes.atualizador) - _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", interval, -1) + _detalhes:RefreshUpdater (interval) end function _detalhes:SetUseAnimations (enabled, nosave) diff --git a/core/parser.lua b/core/parser.lua index f01d285f..f695b7fe 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -4060,6 +4060,13 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _detalhes.time_type = 1 end + if (not _detalhes.is_in_arena) then + --> reset spec cache if broadcaster requested + if (_detalhes.streamer_config.reset_spec_cache) then + wipe (_detalhes.cached_specs) + end + end + _detalhes.is_in_arena = true _detalhes:EnteredInArena() diff --git a/core/windows.lua b/core/windows.lua index 637f7cd3..8981561a 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -10,6 +10,7 @@ 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 _GetScreenWidth = GetScreenWidth --wow api local @@ -24,6 +25,15 @@ local end_window_spacement = 0 +--> settings + + local animation_speed = 33 + local animation_speed_hightravel_trigger = 5 + local animation_speed_hightravel_maxspeed = 3 + local animation_speed_lowtravel_minspeed = 0.33 + local animation_func_left + local animation_func_right + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> core @@ -61,9 +71,10 @@ end self.proximo_update = 0 end + + function _detalhes:fazer_animacoes (amt_barras) - --aqui if (self.bars_sort_direction == 2) then @@ -140,20 +151,10 @@ end - function _detalhes:AnimarBarra (esta_barra, fim) - esta_barra.inicio = esta_barra.statusbar.value - esta_barra.fim = fim - esta_barra.tem_animacao = true - - if (esta_barra.fim > esta_barra.inicio) then - esta_barra:SetScript ("OnUpdate", self.FazerAnimacao_Direita) - else - esta_barra:SetScript ("OnUpdate", self.FazerAnimacao_Esquerda) - end - end - function _detalhes:FazerAnimacao_Esquerda (elapsed) - self.inicio = self.inicio - 1 + --> simple left and right animations by delta time + local animation_left_simple = function (self, deltaTime) + self.inicio = self.inicio - (animation_speed * deltaTime) self:SetValue (self.inicio) if (self.inicio-1 <= self.fim) then self.tem_animacao = false @@ -161,10 +162,85 @@ end end - function _detalhes:FazerAnimacao_Direita (elapsed) - self.inicio = self.inicio + 1 + local animation_right_simple = function (self, deltaTime) + self.inicio = self.inicio + (animation_speed * deltaTime) self:SetValue (self.inicio) - if (self.inicio+1 >= self.fim) then + if (self.inicio+0.1 >= self.fim) then + self.tem_animacao = false + self:SetScript ("OnUpdate", nil) + end + end + + --> animation with acceleration + local animation_left_with_accel = function (self, deltaTime) + local distance = self.inicio - self.fim + local calcAnimationSpeed = animation_speed * _math_max (_math_min (distance/animation_speed_hightravel_trigger, animation_speed_hightravel_maxspeed), animation_speed_lowtravel_minspeed) + + self.inicio = self.inicio - (calcAnimationSpeed * deltaTime) + self:SetValue (self.inicio) + if (self.inicio-0.1 <= self.fim) then + self.tem_animacao = false + self:SetScript ("OnUpdate", nil) + end + end + + local animation_right_with_accel = function (self, deltaTime) + local distance = self.fim - self.inicio + local calcAnimationSpeed = animation_speed * _math_max (_math_min (distance/animation_speed_hightravel_trigger, animation_speed_hightravel_maxspeed), animation_speed_lowtravel_minspeed) + + self.inicio = self.inicio + (calcAnimationSpeed * deltaTime) + self:SetValue (self.inicio) + if (self.inicio+0.1 >= self.fim) then + self.tem_animacao = false + self:SetScript ("OnUpdate", nil) + end + end + + --> initiate with defaults + animation_func_left = animation_left_simple + animation_func_right = animation_right_simple + + function _detalhes:AnimarBarra (esta_barra, fim) + esta_barra.inicio = esta_barra.statusbar.value + esta_barra.fim = fim + esta_barra.tem_animacao = true + + if (esta_barra.fim > esta_barra.inicio) then + esta_barra:SetScript ("OnUpdate", animation_func_right) + else + esta_barra:SetScript ("OnUpdate", animation_func_left) + end + end + + function _detalhes:RefreshAnimationFunctions() + if (_detalhes.streamer_config.use_animation_accel) then + animation_func_left = animation_left_with_accel + animation_func_right = animation_right_with_accel + + else + animation_func_left = animation_left_simple + animation_func_right = animation_right_simple + end + + animation_speed = _detalhes.animation_speed + animation_speed_hightravel_trigger = _detalhes.animation_speed_triggertravel + animation_speed_hightravel_maxspeed = _detalhes.animation_speed_maxtravel + animation_speed_lowtravel_minspeed = _detalhes.animation_speed_mintravel + end + + --deprecated + function _detalhes:FazerAnimacao_Esquerda (deltaTime) + self.inicio = self.inicio - (animation_speed * deltaTime) + self:SetValue (self.inicio) + if (self.inicio-1 <= self.fim) then + self.tem_animacao = false + self:SetScript ("OnUpdate", nil) + end + end + function _detalhes:FazerAnimacao_Direita (deltaTime) + self.inicio = self.inicio + (animation_speed * deltaTime) + self:SetValue (self.inicio) + if (self.inicio+0.1 >= self.fim) then self.tem_animacao = false self:SetScript ("OnUpdate", nil) end @@ -3421,12 +3497,12 @@ function _detalhes:TestBarsUpdate() local current_combat = _detalhes:GetCombat ("current") for index, actor in current_combat[1]:ListActors() do - actor.total = actor.total + (actor.total / 100 * math.random (1, 5)) - actor.total = actor.total - (actor.total / 100 * math.random (1, 5)) + actor.total = actor.total + (actor.total / 100 * math.random (1, 10)) + actor.total = actor.total - (actor.total / 100 * math.random (1, 10)) end for index, actor in current_combat[2]:ListActors() do - actor.total = actor.total + (actor.total / 100 * math.random (1, 5)) - actor.total = actor.total - (actor.total / 100 * math.random (1, 5)) + actor.total = actor.total + (actor.total / 100 * math.random (1, 10)) + actor.total = actor.total - (actor.total / 100 * math.random (1, 10)) end current_combat[1].need_refresh = true current_combat[2].need_refresh = true @@ -4649,4 +4725,1546 @@ end background_up:SetDesaturated (true) background_down:SetDesaturated (true) ---]] \ No newline at end of file +--]] + + +local CreateCurrentDpsFrame = function (parent, name) + + local DF = _detalhes.gump + local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") + + --> some constants + local header_size = 12 --title bar size + local spacing_vertical = -6 --vertical space between the group anchor and the group dps + local green_team_color = {.5, 1, .5, 1} + local yellow_team_color = {1, 1, .5, 1} + + --> main farame + local f = CreateFrame ("frame", name, parent or UIParent) + f:SetPoint ("center", UIParent, "center") + f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.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.current_dps_meter.frame.backdrop_color)) + f:EnableMouse (true) + f:SetMovable (true) + f:SetClampedToScreen (true) + + f.PlayerTeam = 0 + + local LibWindow = LibStub ("LibWindow-1.1") + LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame) + LibWindow.MakeDraggable (f) + LibWindow.RestorePosition (f) + + --> title bar + local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal") + TitleString:SetPoint ("top", f, "top", 0, -1) + TitleString:SetText ("Dps on Last 5 Seconds") + DF:SetFontSize (TitleString, 9) + local TitleBackground = f:CreateTexture (nil, "artwork") + TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) + TitleBackground:SetVertexColor (.1, .1, .1, .9) + TitleBackground:SetPoint ("topleft", f, "topleft") + TitleBackground:SetPoint ("topright", f, "topright") + TitleBackground:SetHeight (header_size) + + --> labels for arena + local labelPlayerTeam = f:CreateFontString (nil, "overlay", "GameFontNormal") + local labelYellowTeam = f:CreateFontString (nil, "overlay", "GameFontNormal") + labelPlayerTeam:SetText ("Player Team") + labelYellowTeam:SetText ("Enemy Team") + DF:SetFontSize (labelPlayerTeam, 14) + DF:SetFontSize (labelYellowTeam, 14) + DF:SetFontOutline (labelPlayerTeam, "NONE") + DF:SetFontOutline (labelYellowTeam, "NONE") + + local labelPlayerTeam_DPS = f:CreateFontString (nil, "overlay", "GameFontNormal") + local labelYellowTeam_DPS = f:CreateFontString (nil, "overlay", "GameFontNormal") + labelPlayerTeam_DPS:SetText ("0") + labelYellowTeam_DPS:SetText ("0") + + local labelPlayerTeam_DPS_Icon = f:CreateTexture (nil, "overlay") + local labelYellowTeam_DPS_Icon = f:CreateTexture (nil, "overlay") + labelPlayerTeam_DPS_Icon:SetTexture ([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]]) + labelYellowTeam_DPS_Icon:SetTexture ([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]]) + labelPlayerTeam_DPS_Icon:SetTexCoord (72/256, 130/256, 69/256, 127/256) + labelYellowTeam_DPS_Icon:SetTexCoord (72/256, 130/256, 69/256, 127/256) + local icon_size = 16 + labelPlayerTeam_DPS_Icon:SetSize (icon_size, icon_size) + labelYellowTeam_DPS_Icon:SetSize (icon_size, icon_size) + + labelPlayerTeam:SetPoint ("left", f, "left", 5, 10) + labelYellowTeam:SetPoint ("right", f, "right", -5, 10) + + labelPlayerTeam_DPS_Icon:SetPoint ("topleft", labelPlayerTeam, "bottomleft", 0, -4) + labelYellowTeam_DPS_Icon:SetPoint ("topleft", labelYellowTeam, "bottomleft", 0, -4) + + labelPlayerTeam_DPS:SetPoint ("left", labelPlayerTeam_DPS_Icon, "right", 4, 0) + labelYellowTeam_DPS:SetPoint ("left", labelYellowTeam_DPS_Icon, "right", 4, 0) + + labelPlayerTeam:SetTextColor (unpack (green_team_color)) + labelYellowTeam:SetTextColor (unpack (yellow_team_color)) + + function f.SwapArenaTeamColors() + if (f.PlayerTeam == 0) then + 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)) + end + end + + --> labels for mythic dungeon / group party + local labelGroupDamage = f:CreateFontString (nil, "overlay", "GameFontNormal") + labelGroupDamage:SetText ("Group DPS") + DF:SetFontSize (labelGroupDamage, 14) + DF:SetFontOutline (labelGroupDamage, "NONE") + + local labelGroupDamage_DPS = f:CreateFontString (nil, "overlay", "GameFontNormal") + labelGroupDamage_DPS:SetText ("0") + + labelGroupDamage:SetPoint ("center", f, "center", 0, 10) + labelGroupDamage_DPS:SetPoint ("center", labelGroupDamage, "center") + labelGroupDamage_DPS:SetPoint ("top", labelGroupDamage, "bottom", 0, spacing_vertical) + + --[=[ + local labelGroupDamage_DPS_Icon = f:CreateTexture (nil, "overlay") + labelGroupDamage_DPS_Icon:SetTexture ([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]]) + labelGroupDamage_DPS_Icon:SetTexCoord (72/256, 130/256, 69/256, 127/256) + labelGroupDamage_DPS_Icon:SetSize (icon_size, icon_size) + labelGroupDamage_DPS_Icon:SetPoint ("topleft", labelPlayerTeam, "bottomleft", 0, -4) + --]=] + + --> frame update function + + --> update + local time_fraction = 100/1000 --one tick per 100ms + f.NextUpdate = time_fraction --when the next tick occur + f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval --when the labels on the frame receive update + + --> arena + f.PlayerTeamBuffer = {} + f.YellowTeamBuffer = {} + f.PlayerTeamDamage = 0 + f.YellowDamage = 0 + f.LastPlayerTeamDamage = 0 + f.LastYellowDamage = 0 + + --> mythic dungeon / party group + f.GroupBuffer = {} + f.GroupTotalDamage = 0 + f.LastTickGroupDamage = 0 + + --> general + f.SampleSize = _detalhes.current_dps_meter.sample_size + f.MaxBufferIndex = 1 + f.ShowingArena = false + + function _detalhes:UpdateTheRealCurrentDPSFrame (scenario) + --> don't run if the featured hasn't loaded + if (not f) then + return + end + + if (not _detalhes.current_dps_meter.enabled) then + f:Hide() + return + end + + if (not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled) then + f:Hide() + return + end + + --> where the player are + if (scenario == "arena") then + labelPlayerTeam_DPS:Show() + labelYellowTeam_DPS:Show() + labelPlayerTeam:Show() + labelYellowTeam:Show() + labelPlayerTeam_DPS_Icon:Show() + labelYellowTeam_DPS_Icon:Show() + + --> update arena labels + DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_color) + DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_face) + DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_size) + DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_shadow) + + DF:SetFontColor (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_color) + DF:SetFontFace (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_face) + DF:SetFontSize (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_size) + DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_shadow) + + --> wipe current data for arena + wipe (f.PlayerTeamBuffer) + wipe (f.YellowTeamBuffer) + + --> reset damage + f.PlayerTeamDamage = 0 + f.YellowDamage = 0 + + --> reset last tick damage + f.LastPlayerTeamDamage = 0 + f.LastYellowDamage = 0 + + f:Show() + else + --> isn't arena, hide arena labels + labelPlayerTeam_DPS:Hide() + labelYellowTeam_DPS:Hide() + labelPlayerTeam:Hide() + labelYellowTeam:Hide() + labelPlayerTeam_DPS_Icon:Hide() + labelYellowTeam_DPS_Icon:Hide() + end + + if (scenario == "mythicdungeon") then + labelGroupDamage:Show() + labelGroupDamage_DPS:Show() + + DF:SetFontColor (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_color) + DF:SetFontFace (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_face) + DF:SetFontSize (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_size) + DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_shadow) + + --> wipe current data for mythic dungeon + f.GroupBuffer = {} + + --> reset damage + f.GroupTotalDamage = 0 + + --> reset last tick damage + f.LastTickGroupDamage = 0 + + f:Show() + else + labelGroupDamage:Hide() + labelGroupDamage_DPS:Hide() + end + + --> frame position + f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height) + LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame) + LibWindow.RestorePosition (f) + + --> backdrop color + f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color)) + + --> set frame size + f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height) + + --> frame is locked + if (_detalhes.current_dps_meter.frame.locked) then + f:EnableMouse (false) + else + f:EnableMouse (true) + end + + --> frame can show title + if (_detalhes.current_dps_meter.frame.show_title) then + TitleString:Show() + TitleBackground:Show() + else + TitleString:Hide() + TitleBackground:Hide() + end + + --> frame strata + f:SetFrameStrata (_detalhes.current_dps_meter.frame.strata) + + --> calcule buffer size + f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds + + --> interval to update the frame + f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval + end + + _detalhes:UpdateTheRealCurrentDPSFrame() + + local on_tick = function (self, deltaTime) + + self.NextUpdate = self.NextUpdate - deltaTime + + if (self.NextUpdate <= 0) then + --> update string + local currentCombat = _detalhes:GetCombat() + local damageContainer = currentCombat:GetContainer (DETAILS_ATTRIBUTE_DAMAGE) + + --> show the current dps during an arena match + if (self.ShowingArena) then + --> the team damage done at this tick + local thisTickPlayerTeamDamage = 0 + local thisTickYellowDamage = 0 + + for i, actor in damageContainer:ListActors() do + --actor.arena_team = actor.arena_team or 0 --debug + if (actor:IsPlayer() and actor.arena_team) then + if (actor.arena_team == 0) then + --green team / player team + thisTickPlayerTeamDamage = thisTickPlayerTeamDamage + actor.total + else + --yellow + thisTickYellowDamage = thisTickYellowDamage + actor.total + end + + if (actor.nome == _detalhes.playername) then + --> if player isn't in green team > swap colors + if (f.PlayerTeam ~= actor.arena_team) then + f.SwapArenaTeamColors() + f.PlayerTeam = actor.arena_team + end + end + end + end + + --> calculate how much damage the team made on this tick + local playerTeamDamageDone = thisTickPlayerTeamDamage - f.LastPlayerTeamDamage + local yellowDamageDone = thisTickYellowDamage - f.LastYellowDamage + + --> add the damage to buffer + tinsert (f.PlayerTeamBuffer, 1, playerTeamDamageDone) + tinsert (f.YellowTeamBuffer, 1, yellowDamageDone) + + --> save the current damage amount + f.LastPlayerTeamDamage = thisTickPlayerTeamDamage + f.LastYellowDamage = thisTickYellowDamage + + --> add the damage to current total damage + f.PlayerTeamDamage = f.PlayerTeamDamage + playerTeamDamageDone + f.YellowDamage = f.YellowDamage + yellowDamageDone + + --> remove player team damage + local removedDamage = tremove (f.PlayerTeamBuffer, f.MaxBufferIndex+1) + if (removedDamage) then + f.PlayerTeamDamage = f.PlayerTeamDamage - removedDamage + --> be save + f.PlayerTeamDamage = max (0, f.PlayerTeamDamage) + end + + --> remove yellow damage + local removedDamage = tremove (f.YellowTeamBuffer, f.MaxBufferIndex+1) + if (removedDamage) then + f.YellowDamage = f.YellowDamage - removedDamage + --> be save + f.YellowDamage = max (0, f.YellowDamage) + end + + self.NextScreenUpdate = self.NextScreenUpdate - time_fraction + if (self.NextScreenUpdate <= 0) then + if (f.PlayerTeam == 0) then + labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) + labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) + else + labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize)) + labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize)) + end + f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval + end + + elseif (self.ShowingMythicDungeon) then + + --iniciava um novo combate e tinha o buffer do combate anterior + --então dava o total de dano do combate recente menos o que tinha no buffer do round anterior + + --> the party damage done at this tick + local thisTickGroupDamage = 0 + + for i, actor in damageContainer:ListActors() do + if (actor:IsPlayer() and actor:IsGroupPlayer()) then + thisTickGroupDamage = thisTickGroupDamage + actor.total + end + end + + --> calculate how much damage the team made on this tick + local groupDamageDoneOnThisTick = thisTickGroupDamage - f.LastTickGroupDamage + + --> add the damage to buffer + tinsert (f.GroupBuffer, 1, groupDamageDoneOnThisTick) + + --> save the current damage amount + f.LastTickGroupDamage = thisTickGroupDamage + + --> add the damage to current total damage + f.GroupTotalDamage = f.GroupTotalDamage + groupDamageDoneOnThisTick + + --> cicle buffer removing the last index and subtract its damage + local removedDamage = tremove (f.GroupBuffer, f.MaxBufferIndex+1) + if (removedDamage) then + --> remove the value from the total damage + f.GroupTotalDamage = f.GroupTotalDamage - removedDamage + --> be save + f.GroupTotalDamage = max (0, f.GroupTotalDamage) + end + + self.NextScreenUpdate = self.NextScreenUpdate - time_fraction + if (self.NextScreenUpdate <= 0) then + labelGroupDamage_DPS:SetText (_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize)) + f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval + end + + end + + --> set next update time + self.NextUpdate = time_fraction + end + end + + f:SetScript ("OnHide", function() + f.ShowingArena = false + f.ShowingMythicDungeon = false + f:SetScript ("OnUpdate", nil) + end) + + function f:StartForArenaMatch() + if (not f.ShowingArena) then + _detalhes:UpdateTheRealCurrentDPSFrame ("arena") + f.ShowingArena = true + f:SetScript ("OnUpdate", on_tick) + end + end + + function f:StartForMythicDungeon() + if (not f.ShowingMythicDungeon) then + _detalhes:UpdateTheRealCurrentDPSFrame ("mythicdungeon") + f.ShowingMythicDungeon = true + f:SetScript ("OnUpdate", on_tick) + end + end + + local eventListener = _detalhes:CreateEventListener() + + function eventListener:ArenaStarted() + if (_detalhes.current_dps_meter.arena_enabled) then + f:StartForArenaMatch() + end + end + + function eventListener:MythicDungeonStarted() + if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then + f:StartForMythicDungeon() + end + end + + function eventListener:ArenaEnded() + f:Hide() + end + + function eventListener:MythicDungeonEnded() + f:Hide() + end + + function eventListener:ResetBuffer() + if (f:IsShown()) then + wipe (f.PlayerTeamBuffer) + wipe (f.YellowTeamBuffer) + wipe (f.GroupBuffer) + f.GroupTotalDamage = 0 + f.PlayerTeamDamage = 0 + f.YellowDamage = 0 + f.LastTickGroupDamage = 0 + f.LastPlayerTeamDamage = 0 + f.LastYellowDamage = 0 + end + end + + eventListener:RegisterEvent ("COMBAT_ARENA_START", "ArenaStarted") + eventListener:RegisterEvent ("COMBAT_ARENA_END", "ArenaEnded") + eventListener:RegisterEvent ("COMBAT_MYTHICDUNGEON_START", "MythicDungeonStarted") + eventListener:RegisterEvent ("COMBAT_MYTHICDUNGEON_END", "MythicDungeonEnded") + eventListener:RegisterEvent ("COMBAT_PLAYER_ENTER", "ResetBuffer") + + _detalhes.Broadcaster_CurrentDpsLoaded = true + _detalhes.Broadcaster_CurrentDpsFrame = f + f:Hide() +end + +local CreateEventTrackerFrame = function (parent, name) + + local DF = _detalhes.gump + local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") + + --> main farame + local f = CreateFrame ("frame", name, parent or UIParent) + f:SetPoint ("center", UIParent, "center") + f:SetMinResize (150, 40) + f:SetMaxResize (800, 1024) + 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:SetResizable (true) + f:SetClampedToScreen (true) + + local LibWindow = LibStub ("LibWindow-1.1") + LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame) + LibWindow.MakeDraggable (f) + LibWindow.RestorePosition (f) + + --> two resizers + + local left_resize, right_resize = DF:CreateResizeGrips (f) + + left_resize:SetScript ("OnMouseDown", function (self) + if (not f.resizing and not _detalhes.event_tracker.frame.locked) then + f.resizing = true + f:StartSizing ("bottomleft") + end + end) + left_resize:SetScript ("OnMouseUp", function (self) + if (f.resizing) then + f.resizing = false + f:StopMovingOrSizing() + _detalhes.event_tracker.frame.width = f:GetWidth() + _detalhes.event_tracker.frame.height = f:GetHeight() + end + end) + right_resize:SetScript ("OnMouseDown", function (self) + if (not f.resizing and not _detalhes.event_tracker.frame.locked) then + f.resizing = true + f:StartSizing ("bottomright") + end + end) + right_resize:SetScript ("OnMouseUp", function (self) + if (f.resizing) then + f.resizing = false + f:StopMovingOrSizing() + _detalhes.event_tracker.frame.width = f:GetWidth() + _detalhes.event_tracker.frame.height = f:GetHeight() + end + end) + + f:SetScript ("OnSizeChanged", function (self) + + end) + + --> scroll frame + + --> frame config + + local scroll_line_amount = 1 + local scroll_width = 195 + local header_size = 20 + + --> on tick script + local lineOnTick = function (self, deltaTime) + --> when this event occured on combat log + local gameTime = self.GameTime + + --> calculate how much time elapsed since the event got triggered + local elapsedTime = GetTime() - gameTime + + --> set the bar animation: + local animationPercent = min (elapsedTime, 1) + self.Statusbar:SetValue (animationPercent) + + --> set the spark location + if (animationPercent < 1) then + self.Spark:SetPoint ("left", self, "left", (self:GetWidth() * animationPercent) - 10, 0) + if (not self.Spark:IsShown()) then + self.Spark:Show() + end + else + if (self.Spark:IsShown()) then + self.Spark:Hide() + end + end + end + + --> create a line on the scroll frame + local scroll_createline = function (self, index) + + local line = CreateFrame ("frame", "$parentLine" .. index, self) + 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 + line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + line:SetBackdropColor (1, 1, 1, 0.75) + + --> statusbar + local statusbar = CreateFrame ("statusbar", "$parentStatusBar", line) + statusbar:SetAllPoints() + local statusbartexture = statusbar:CreateTexture (nil, "border") + statusbar:SetStatusBarTexture (statusbartexture) + statusbar:SetMinMaxValues (0, 1) + statusbar:SetValue (0) + + local statusbarspark = statusbar:CreateTexture (nil, "artwork") + statusbarspark:SetTexture ([[Interface\CastingBar\UI-CastingBar-Spark]]) + statusbarspark:SetSize (16, 30) + statusbarspark:SetBlendMode ("ADD") + statusbarspark:Hide() + + --> create the icon textures and texts - they are all statusbar childs + local lefticon = statusbar:CreateTexture ("$parentLeftIcon", "overlay") + lefticon:SetPoint ("left", line, "left", 0, 0) + + local righticon = statusbar:CreateTexture ("$parentRightIcon", "overlay") + righticon:SetPoint ("right", line, "right", 0, 0) + + local lefttext = statusbar:CreateFontString ("$parentLeftText", "overlay", "GameFontNormal") + DF:SetFontSize (lefttext, 9) + lefttext:SetPoint ("left", lefticon, "right", 2, 0) + + local righttext = statusbar:CreateFontString ("$parentRightText", "overlay", "GameFontNormal") + DF:SetFontSize (righttext, 9) + righttext:SetPoint ("right", righticon, "left", -2, 0) + + lefttext:SetJustifyH ("left") + righttext:SetJustifyH ("right") + + local actionicon = statusbar:CreateTexture ("$parentRightIcon", "overlay") + actionicon:SetPoint ("center", line, "center") + + --> set members + line.LeftIcon = lefticon + line.RightIcon = righticon + line.LeftText = lefttext + line.RightText = righttext + line.Statusbar = statusbar + line.StatusbarTexture = statusbartexture + line.Spark = statusbarspark + line.ActionIcon = actionicon + + --> set some parameters + _detalhes:UpdateWorldTrackerLines (line) + + --> set scripts + line:SetScript ("OnUpdate", lineOnTick) + + return line + end + + --> some consts to help work with indexes + local SPELLTYPE_COOLDOWN = "cooldown" + local SPELLTYPE_INTERRUPT = "interrupt" + local SPELLTYPE_OFFENSIVE = "offensive" + local SPELLTYPE_CROWDCONTROL = "crowdcontrol" + + local ABILITYTABLE_SPELLTYPE = 1 + local ABILITYTABLE_SPELLID = 2 + local ABILITYTABLE_CASTERNAME = 3 + local ABILITYTABLE_TARGETNAME = 4 + local ABILITYTABLE_TIME = 5 + local ABILITYTABLE_EXTRASPELLID = 6 + local ABILITYTABLE_GAMETIME = 7 + local ABILITYTABLE_CASTERSERIAL = 8 + local ABILITYTABLE_ISENEMY = 9 + local ABILITYTABLE_TARGETSERIAL = 10 + + local get_spec_or_class = function (serial, name) + local class + local spec = _detalhes.cached_specs [serial] + if (not spec) then + local _, engClass = UnitClass (name) + if (engClass) then + class = engClass + else + local locClass, engClass, locRace, engRace, gender = GetPlayerInfoByGUID (serial) + if (engClass) then + class = engClass + end + end + end + + return spec, class + end + + local get_player_icon = function (spec, class) + if (spec) then + return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack (_detalhes.class_specs_coords [spec]) + elseif (class) then + 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 + end + + local add_role_and_class_color = function (player_name, player_serial) + + --> get the actor object + local actor = _detalhes.tabela_vigente[1]:GetActor (player_name) + + if (actor) then + --> remove realm name + player_name = _detalhes:GetOnlyName (player_name) + + local class, spec, role = actor.classe, actor.spec, actor.role + if (not class) then + spec, class = get_spec_or_class (player_serial, player_name) + end + + --> add the class color + if (_detalhes.player_class [class]) then + --> is a player, add the class color + player_name = _detalhes:AddColorString (player_name, class) + end + + --add the role icon + if (role ~= "NONE") then + --> have a role + player_name = _detalhes:AddRoleIcon (player_name, role, _detalhes.event_tracker.line_height) + end + + else + local spec, class = get_spec_or_class (player_serial, player_name) + player_name = _detalhes:GetOnlyName (player_name) + + if (class) then + --> add the class color + if (_detalhes.player_class [class]) then + --> is a player, add the class color + player_name = _detalhes:AddColorString (player_name, class) + end + end + end + + return player_name + end + + local get_text_size = function() + local iconsSpace = _detalhes.event_tracker.line_height * 3 + local textSpace = 4 + local saveSpace = 14 + + local availableSpace = (f:GetWidth() - iconsSpace - textSpace - saveSpace) / 2 + + return availableSpace + end + + local shrink_string = function (fontstring, size) + local text = fontstring:GetText() + local loops = 20 + while (fontstring:GetStringWidth() > size and loops > 0) do + text = strsub (text, 1, #text-1) + fontstring:SetText (text) + loops = loops - 1 + end + + return fontstring + end + + --refresh the scroll frame + local scroll_refresh = function (self, data, offset, total_lines) + + local textSize = get_text_size() + + for i = 1, total_lines do + local index = i + offset + local ability = data [index] + + if (ability) then + local line = self:GetLine (i) + + local spec, class = get_spec_or_class (ability [ABILITYTABLE_CASTERSERIAL], ability [ABILITYTABLE_CASTERNAME]) + local texture, L, R, T, B = get_player_icon (spec, class) + line.LeftIcon:SetTexture (texture) + line.LeftIcon:SetTexCoord (L, R, T, B) + line.LeftText:SetText (_detalhes:GetOnlyName (ability [ABILITYTABLE_CASTERNAME])) + + if (ability [ABILITYTABLE_ISENEMY]) then + line:SetBackdropColor (1, .3, .3, 0.75) + else + line:SetBackdropColor (1, 1, 1, 0.75) + end + + if (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_COOLDOWN) then + local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexCoord (.06, .94, .06, .94) + + local targetName = ability [ABILITYTABLE_TARGETNAME] + if (targetName) then + local targetSerial = ability [ABILITYTABLE_TARGETSERIAL] + targetName = add_role_and_class_color (targetName, targetSerial) + end + + line.RightText:SetText (targetName or spellName) + + line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexCoord (0, 0.125, 0, 1) + + elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_OFFENSIVE) then + local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexCoord (.06, .94, .06, .94) + line.RightText:SetText (spellName) + + line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexCoord (0.127, 0.25, 0, 1) + + elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_INTERRUPT) then + local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo (ability [ABILITYTABLE_EXTRASPELLID]) + line.RightIcon:SetTexture (spellIconInterrupted) + line.RightIcon:SetTexCoord (.06, .94, .06, .94) + line.RightText:SetText (spellNameInterrupted) + + line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexCoord (0.251, 0.375, 0, 1) + + elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_CROWDCONTROL) then + local spellName, _, spellIcon = GetSpellInfo (ability [ABILITYTABLE_SPELLID]) + line.RightIcon:SetTexture (spellIcon) + line.RightIcon:SetTexCoord (.06, .94, .06, .94) + + local targetName = ability [ABILITYTABLE_TARGETNAME] + if (targetName) then + local targetSerial = ability [ABILITYTABLE_TARGETSERIAL] + targetName = add_role_and_class_color (targetName, targetSerial) + end + + line.RightText:SetText (targetName or "unknown target") + + line.ActionIcon:SetTexture ([[Interface\AddOns\Details\images\event_tracker_icons]]) + line.ActionIcon:SetTexCoord (0.376, 0.5, 0, 1) + + end + + shrink_string (line.LeftText, textSize) + shrink_string (line.RightText, textSize) + + --> set when the ability was registered on combat log + line.GameTime = ability [ABILITYTABLE_GAMETIME] + line:Show() + end + end + end + + --title text + local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal") + TitleString:SetPoint ("top", f, "top", 0, -3) + TitleString:SetText ("Details!: Event Tracker") + local TitleBackground = f:CreateTexture (nil, "artwork") + TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]]) + TitleBackground:SetVertexColor (.1, .1, .1, .9) + TitleBackground:SetPoint ("topleft", f, "topleft") + TitleBackground:SetPoint ("topright", f, "topright") + TitleBackground:SetHeight (header_size) + + --> table with spells showing on the scroll frame + local CurrentShowing = {} + + --> scrollframe + local scrollframe = DF:CreateScrollBox (f, "$parentScrollFrame", scroll_refresh, CurrentShowing, scroll_width, 400, scroll_line_amount, _detalhes.event_tracker.line_height, scroll_createline, true, true) + scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size) + scrollframe:SetPoint ("topright", f, "topright", 0, -header_size) + scrollframe:SetPoint ("bottomleft", f, "bottomleft", 0, 0) + scrollframe:SetPoint ("bottomright", f, "bottomright", 0, 0) + + --> update line - used by 'UpdateWorldTrackerLines' function + local update_line = function (line) + + --> get the line index + local index = line.Index + + --> update left text + DF:SetFontColor (line.LeftText, _detalhes.event_tracker.font_color) + DF:SetFontFace (line.LeftText, _detalhes.event_tracker.font_face) + DF:SetFontSize (line.LeftText, _detalhes.event_tracker.font_size) + DF:SetFontOutline (line.LeftText, _detalhes.event_tracker.font_shadow) + + --> update right text + DF:SetFontColor (line.RightText, _detalhes.event_tracker.font_color) + DF:SetFontFace (line.RightText, _detalhes.event_tracker.font_face) + DF:SetFontSize (line.RightText, _detalhes.event_tracker.font_size) + DF:SetFontOutline (line.RightText, _detalhes.event_tracker.font_shadow) + + --> adjust where the line is anchored + line:SetPoint ("topleft", line:GetParent(), "topleft", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) + line:SetPoint ("topright", line:GetParent(), "topright", 0, -((index-1)*(_detalhes.event_tracker.line_height+1))) + + --> set its height + line:SetHeight (_detalhes.event_tracker.line_height) + + --> 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)) + + --> set icon size + line.LeftIcon:SetSize (_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) + line.RightIcon:SetSize (_detalhes.event_tracker.line_height, _detalhes.event_tracker.line_height) + line.ActionIcon:SetSize (_detalhes.event_tracker.line_height-4, _detalhes.event_tracker.line_height-4) + line.ActionIcon:SetAlpha (0.65) + end + + -- /run _detalhes.event_tracker.font_shadow = 24 + -- /run _detalhes:UpdateWorldTrackerLines() + + function _detalhes:UpdateWorldTrackerLines (line) + --> don't run if the featured hasn't loaded + if (not f) then + return + end + + if (line) then + update_line (line) + else + --> update all lines + for index, line in ipairs (scrollframe:GetFrames()) do + update_line (line) + end + scrollframe:SetFramesHeight (_detalhes.event_tracker.line_height) + scrollframe:Refresh() + end + end + + function _detalhes:UpdateEventTrackerFrame() + --> don't run if the featured hasn't loaded + if (not f) then + return + end + + f:SetSize (_detalhes.event_tracker.frame.width, _detalhes.event_tracker.frame.height) + LibWindow.RegisterConfig (f, _detalhes.event_tracker.frame) + LibWindow.RestorePosition (f) + scrollframe:OnSizeChanged() + + if (_detalhes.event_tracker.frame.locked) then + f:EnableMouse (false) + left_resize:Hide() + right_resize:Hide() + else + f:EnableMouse (true) + left_resize:Show() + right_resize:Show() + end + + if (_detalhes.event_tracker.frame.show_title) then + TitleString:Show() + TitleBackground:Show() + scrollframe:SetPoint ("topleft", f, "topleft", 0, -header_size) + scrollframe:SetPoint ("topright", f, "topright", 0, -header_size) + else + TitleString:Hide() + TitleBackground:Hide() + scrollframe:SetPoint ("topleft", f, "topleft", 0, 0) + scrollframe:SetPoint ("topright", f, "topright", 0, 0) + end + + f:SetBackdropColor (unpack (_detalhes.event_tracker.frame.backdrop_color)) + f:SetFrameStrata (_detalhes.event_tracker.frame.strata) + + _detalhes:UpdateWorldTrackerLines() + scrollframe:Refresh() + end + + --create the first line + for i = 1, 1 do + scrollframe:CreateLine (scroll_createline) + end + f.scrollframe = scrollframe + scrollframe:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16}) + scrollframe:SetBackdropColor (0, 0, 0, 0) + + --> get tables used inside the combat parser + local cooldownList1 = _detalhes.DefensiveCooldownSpellsNoBuff + local cooldownList2 = _detalhes.DefensiveCooldownSpells + + local attackCooldownsList1 = _detalhes.AttackCooldownSpells + + local crowdControlList1 = _detalhes.CrowdControlSpells + + --> remove thise spells on shipping + --cooldownList1 [194679] = {60, 10} + --cooldownList1 [221699] = {60, 10} + + local combatLog = CreateFrame ("frame") + combatLog:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") + local OBJECT_TYPE_PLAYER = 0x00000400 + local OBJECT_TYPE_ENEMY = 0x00000040 + + --> combat parser + local is_player = function (flag) + return bit.band (flag, OBJECT_TYPE_PLAYER) ~= 0 + end + local is_enemy = function (flag) + return bit.band (flag, OBJECT_TYPE_ENEMY) ~= 0 + end + combatLog:SetScript ("OnEvent", function (self, event, time, token, hidding, caster_serial, caster_name, caster_flags, caster_flags2, target_serial, target_name, target_flags, target_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool) + + local added = false + + --> defensive cooldown + if (token == "SPELL_CAST_SUCCESS" and (cooldownList1 [spellid] or cooldownList2 [spellid]) and is_player (caster_flags)) then + tinsert (CurrentShowing, 1, {SPELLTYPE_COOLDOWN, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) + added = true + + --> offensive cooldown + elseif (token == "SPELL_CAST_SUCCESS" and (attackCooldownsList1 [spellid]) and is_player (caster_flags)) then + tinsert (CurrentShowing, 1, {SPELLTYPE_OFFENSIVE, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) + added = true + + --> crowd control + elseif (token == "SPELL_AURA_APPLIED" and (crowdControlList1 [spellid])) then + tinsert (CurrentShowing, 1, {SPELLTYPE_CROWDCONTROL, spellid, caster_name, target_name, time, false, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) + added = true + + --> spell interrupt + elseif (token == "SPELL_INTERRUPT") then + tinsert (CurrentShowing, 1, {SPELLTYPE_INTERRUPT, spellid, caster_name, target_name, time, extraSpellID, GetTime(), caster_serial, is_enemy (caster_flags), target_serial}) + added = true + + end + + if (added) then + local amountOfLines = scrollframe:GetNumFramesShown() + local amountToShow = #CurrentShowing + + if (amountToShow > amountOfLines) then + tremove (CurrentShowing, amountToShow) + end + scrollframe:Refresh() + end + + end) + + _detalhes.Broadcaster_EventTrackerLoaded = true + _detalhes.Broadcaster_EventTrackerFrame = f + f:Hide() + +end + +function Details:LoadFramesForBroadcastTools() + --> event tracker + --> if enabled and not loaded, load it + if (_detalhes.event_tracker.enabled and not _detalhes.Broadcaster_EventTrackerLoaded) then + CreateEventTrackerFrame (UIParent, "DetailsEventTracker") + end + + --> if enabled and loaded, refresh and show + if (_detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then + _detalhes:UpdateEventTrackerFrame() + DetailsEventTracker:Show() + end + + --> if not enabled but loaded, hide it + if (not _detalhes.event_tracker.enabled and _detalhes.Broadcaster_EventTrackerLoaded) then + DetailsEventTracker:Hide() + end + + --> current dps + local bIsEnabled = _detalhes.current_dps_meter.enabled and (_detalhes.current_dps_meter.arena_enabled or _detalhes.current_dps_meter.mythic_dungeon_enabled) + + --> if enabled and not loaded, load it + if (bIsEnabled and not _detalhes.Broadcaster_CurrentDpsLoaded) then + CreateCurrentDpsFrame (UIParent, "DetailsCurrentDpsMeter") + end + + --> if enabled, check if can show + if (bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then + if (_detalhes.current_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 + DetailsCurrentDpsMeter:StartForMythicDungeon() + end + end + + if (_detalhes.current_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 + DetailsCurrentDpsMeter:StartForArenaMatch() + end + end + end + + --> if not enabled but loaded, hide it + if (not bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then + DetailsCurrentDpsMeter:Hide() + end + +end + +function Details:OpenCurrentRealDPSOptions (from_options_panel) + + if (not DetailsCurrentRealDPSOptions) then + + local DF = _detalhes.gump + + local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! The Current Real DPS Options", "DetailsCurrentRealDPSOptions") + f:SetPoint ("center", UIParent, "center") + f:SetScript ("OnMouseDown", nil) + f:SetScript ("OnMouseUp", nil) + local LibWindow = LibStub ("LibWindow-1.1") + LibWindow.RegisterConfig (f, _detalhes.current_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 testUsing = "arena" --mythicdungeon + + --> frame strata options + local set_frame_strata = function (_, _, strata) + Details.current_dps_meter.frame.strata = strata + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end + local strataTable = {} + strataTable [1] = {value = "BACKGROUND", label = "BACKGROUND", onclick = set_frame_strata} + strataTable [2] = {value = "LOW", label = "LOW", onclick = set_frame_strata} + strataTable [3] = {value = "MEDIUM", label = "MEDIUM", onclick = set_frame_strata} + strataTable [4] = {value = "HIGH", label = "HIGH", onclick = set_frame_strata} + strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} + + --> font options + local set_font_shadow= function (_, _, shadow) + Details.current_dps_meter.font_shadow = shadow + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end + local fontShadowTable = {} + fontShadowTable [1] = {value = "NONE", label = "None", onclick = set_font_shadow} + fontShadowTable [2] = {value = "OUTLINE", label = "Outline", onclick = set_font_shadow} + fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow} + + local on_select_text_font = function (self, fixed_value, value) + Details.current_dps_meter.font_face = value + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end + + --> options table + local options = { + + {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + --enabled + { + type = "toggle", + get = function() return Details.current_dps_meter.enabled end, + set = function (self, fixedparam, value) + Details.current_dps_meter.enabled = not Details.current_dps_meter.enabled + Details:LoadFramesForBroadcastTools() + end, + desc = "Enabled", + name = "Enabled", + text_template = options_text_template, + }, + --locked + { + type = "toggle", + get = function() return Details.current_dps_meter.frame.locked end, + set = function (self, fixedparam, value) + Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + desc = "Locked", + name = "Locked", + text_template = options_text_template, + }, + --showtitle + { + type = "toggle", + get = function() return Details.current_dps_meter.frame.show_title end, + set = function (self, fixedparam, value) + Details.current_dps_meter.frame.show_title = not Details.current_dps_meter.frame.show_title + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + desc = "Show Title", + name = "Show Title", + text_template = options_text_template, + }, + --backdrop color + { + type = "color", + get = function() + return {Details.current_dps_meter.frame.backdrop_color[1], Details.current_dps_meter.frame.backdrop_color[2], Details.current_dps_meter.frame.backdrop_color[3], Details.current_dps_meter.frame.backdrop_color[4]} + end, + set = function (self, r, g, b, a) + local color = Details.current_dps_meter.frame.backdrop_color + color[1], color[2], color[3], color[4] = r, g, b, a + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + desc = "Backdrop Color", + name = "Backdrop Color", + text_template = options_text_template, + }, + --statra + { + type = "select", + get = function() return Details.current_dps_meter.frame.strata end, + values = function() return strataTable end, + name = "Frame Strata" + }, + --width + { + type = "range", + get = function() return Details.current_dps_meter.frame.width end, + set = function (self, fixedparam, value) + Details.current_dps_meter.frame.width = value + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + min = 1, + max = 300, + step = 1, + name = "Width", + text_template = options_text_template, + }, + --height + { + type = "range", + get = function() return Details.current_dps_meter.frame.height end, + set = function (self, fixedparam, value) + Details.current_dps_meter.frame.height = value + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + min = 1, + max = 300, + step = 1, + name = "Height", + text_template = options_text_template, + }, + + {type = "breakline"}, + {type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + --arenas + { + type = "toggle", + get = function() return Details.current_dps_meter.arena_enabled end, + set = function (self, fixedparam, value) + Details.current_dps_meter.arena_enabled = not Details.current_dps_meter.arena_enabled + Details:LoadFramesForBroadcastTools() + end, + name = "Arena Matches", + text_template = options_text_template, + }, + --mythic dungeon + { + type = "toggle", + get = function() return Details.current_dps_meter.mythic_dungeon_enabled end, + set = function (self, fixedparam, value) + Details.current_dps_meter.mythic_dungeon_enabled = not Details.current_dps_meter.mythic_dungeon_enabled + Details:LoadFramesForBroadcastTools() + end, + name = "Mythic Dungeons", + text_template = options_text_template, + }, + + {type = "breakline"}, + {type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + --font size + { + type = "range", + get = function() return Details.current_dps_meter.font_size end, + set = function (self, fixedparam, value) + Details.current_dps_meter.font_size = value + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + min = 4, + max = 32, + step = 1, + name = "Font Size", + text_template = options_text_template, + }, + --font color + { + type = "color", + get = function() + return {Details.current_dps_meter.font_color[1], Details.current_dps_meter.font_color[2], Details.current_dps_meter.font_color[3], Details.current_dps_meter.font_color[4]} + end, + set = function (self, r, g, b, a) + local color = Details.current_dps_meter.font_color + color[1], color[2], color[3], color[4] = r, g, b, a + Details:UpdateTheRealCurrentDPSFrame (testUsing) + end, + desc = "Font Color", + name = "Font Color", + text_template = options_text_template, + }, + --font shadow + { + type = "select", + get = function() return Details.current_dps_meter.font_shadow end, + values = function() return fontShadowTable end, + name = "Font Shadow" + }, + --font face + { + type = "select", + get = function() return Details.current_dps_meter.font_face end, + values = function() return DF:BuildDropDownFontList (on_select_text_font) end, + name = "Font Face", + text_template = options_text_template, + }, + + + } + + DF:BuildMenu (f, options, 7, -30, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + + f:SetScript ("OnHide" , function() + if (DetailsCurrentDpsMeter) then + --> check if can hide the main frame as well + --> we force show the main frame for the user see the frame while editing the options + local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() + if ((instanceType ~= "party" and difficultyID ~= 8) and instanceType ~= "arena") then + DetailsCurrentDpsMeter:Hide() + end + end + + --> reopen the options panel + if (f.FromOptionsPanel) then + C_Timer.After (0.2, function() + Details:OpenOptionsWindow(Details:GetInstance(1)) + end) + end + end) + + end + + --> check if the frame was been created + if (not DetailsCurrentDpsMeter) then + CreateCurrentDpsFrame (UIParent, "DetailsCurrentDpsMeter") + end + + --> show the options + DetailsCurrentRealDPSOptions:Show() + DetailsCurrentRealDPSOptions:RefreshOptions() + DetailsCurrentRealDPSOptions.FromOptionsPanel = from_options_panel + + --> start the frame for viewing while editing the options + DetailsCurrentDpsMeter:StartForArenaMatch() + +end + +function Details:OpenEventTrackerOptions (from_options_panel) + + if (not DetailsEventTrackerOptions) then + + local DF = _detalhes.gump + + local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Event Tracker Options", "DetailsEventTrackerOptions") + f:SetPoint ("center", UIParent, "center") + f:SetScript ("OnMouseDown", nil) + f:SetScript ("OnMouseUp", nil) + local LibWindow = LibStub ("LibWindow-1.1") + 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") + + --> frame strata options + local set_frame_strata = function (_, _, strata) + Details.event_tracker.frame.strata = strata + Details:UpdateEventTrackerFrame() + end + local strataTable = {} + strataTable [1] = {value = "BACKGROUND", label = "BACKGROUND", onclick = set_frame_strata} + strataTable [2] = {value = "LOW", label = "LOW", onclick = set_frame_strata} + strataTable [3] = {value = "MEDIUM", label = "MEDIUM", onclick = set_frame_strata} + strataTable [4] = {value = "HIGH", label = "HIGH", onclick = set_frame_strata} + strataTable [5] = {value = "DIALOG", label = "DIALOG", onclick = set_frame_strata} + + --> font options + local set_font_shadow= function (_, _, shadow) + Details.event_tracker.font_shadow = shadow + Details:UpdateEventTrackerFrame() + end + local fontShadowTable = {} + fontShadowTable [1] = {value = "NONE", label = "None", onclick = set_font_shadow} + fontShadowTable [2] = {value = "OUTLINE", label = "Outline", onclick = set_font_shadow} + fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow} + + local on_select_text_font = function (self, fixed_value, value) + Details.event_tracker.font_face = value + Details:UpdateEventTrackerFrame() + end + + --> texture options + local set_bar_texture = function (_, _, value) + Details.event_tracker.line_texture = value + Details:UpdateEventTrackerFrame() + end + + local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") + local textures = SharedMedia:HashTable ("statusbar") + local texTable = {} + for name, texturePath in pairs (textures) do + texTable [#texTable + 1] = {value = name, label = name, statusbar = texturePath, onclick = set_bar_texture} + end + table.sort (texTable, function (t1, t2) return t1.label < t2.label end) + + --> options table + local options = { + + {type = "label", get = function() return "Frame Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + --enabled + { + type = "toggle", + get = function() return Details.event_tracker.enabled end, + set = function (self, fixedparam, value) + Details.event_tracker.enabled = not Details.event_tracker.enabled + Details:LoadFramesForBroadcastTools() + end, + desc = "Enabled", + name = "Enabled", + text_template = options_text_template, + }, + --locked + { + type = "toggle", + get = function() return Details.event_tracker.frame.locked end, + set = function (self, fixedparam, value) + Details.event_tracker.frame.locked = not Details.event_tracker.frame.locked + Details:UpdateEventTrackerFrame() + end, + desc = "Locked", + name = "Locked", + text_template = options_text_template, + }, + --showtitle + { + type = "toggle", + get = function() return Details.event_tracker.frame.show_title end, + set = function (self, fixedparam, value) + Details.event_tracker.frame.show_title = not Details.event_tracker.frame.show_title + Details:UpdateEventTrackerFrame() + end, + desc = "Show Title", + name = "Show Title", + text_template = options_text_template, + }, + --backdrop color + { + type = "color", + get = function() + return {Details.event_tracker.frame.backdrop_color[1], Details.event_tracker.frame.backdrop_color[2], Details.event_tracker.frame.backdrop_color[3], Details.event_tracker.frame.backdrop_color[4]} + end, + set = function (self, r, g, b, a) + local color = Details.event_tracker.frame.backdrop_color + color[1], color[2], color[3], color[4] = r, g, b, a + Details:UpdateEventTrackerFrame() + end, + desc = "Backdrop Color", + name = "Backdrop Color", + text_template = options_text_template, + }, + --statra + { + type = "select", + get = function() return Details.event_tracker.frame.strata end, + values = function() return strataTable end, + name = "Frame Strata" + }, + {type = "breakline"}, + {type = "label", get = function() return "Line Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")}, + --line height + { + type = "range", + get = function() return Details.event_tracker.line_height end, + set = function (self, fixedparam, value) + Details.event_tracker.line_height = value + Details:UpdateEventTrackerFrame() + end, + min = 4, + max = 32, + step = 1, + name = "Line Height", + text_template = options_text_template, + }, + --line texture + { + type = "select", + get = function() return Details.event_tracker.line_texture end, + values = function() return texTable end, + name = "Line Texture", + }, + --line color + { + type = "color", + get = function() + return {Details.event_tracker.line_color[1], Details.event_tracker.line_color[2], Details.event_tracker.line_color[3], Details.event_tracker.line_color[4]} + end, + set = function (self, r, g, b, a) + local color = Details.event_tracker.line_color + color[1], color[2], color[3], color[4] = r, g, b, a + Details:UpdateEventTrackerFrame() + end, + desc = "Line Color", + name = "Line Color", + text_template = options_text_template, + }, + --font size + { + type = "range", + get = function() return Details.event_tracker.font_size end, + set = function (self, fixedparam, value) + Details.event_tracker.font_size = value + Details:UpdateEventTrackerFrame() + end, + min = 4, + max = 32, + step = 1, + name = "Font Size", + text_template = options_text_template, + }, + --font color + { + type = "color", + get = function() + return {Details.event_tracker.font_color[1], Details.event_tracker.font_color[2], Details.event_tracker.font_color[3], Details.event_tracker.font_color[4]} + end, + set = function (self, r, g, b, a) + local color = Details.event_tracker.font_color + color[1], color[2], color[3], color[4] = r, g, b, a + Details:UpdateEventTrackerFrame() + end, + desc = "Font Color", + name = "Font Color", + text_template = options_text_template, + }, + --font shadow + { + type = "select", + get = function() return Details.event_tracker.font_shadow end, + values = function() return fontShadowTable end, + name = "Font Shadow" + }, + --font face + { + type = "select", + get = function() return Details.event_tracker.font_face end, + values = function() return DF:BuildDropDownFontList (on_select_text_font) end, + name = "Font Face", + text_template = options_text_template, + }, + } + + DF:BuildMenu (f, options, 7, -30, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + + f:SetScript ("OnHide", function() + --> reopen the options panel + if (f.FromOptionsPanel) then + C_Timer.After (0.2, function() + Details:OpenOptionsWindow(Details:GetInstance(1)) + end) + end + end) + end + + DetailsEventTrackerOptions:RefreshOptions() + DetailsEventTrackerOptions:Show() + + DetailsEventTrackerOptions.FromOptionsPanel = from_options_panel + +end + +-- fazer painel de opções +-- fazer um painel de opções "broadcaster settings" + +C_Timer.After (1, function() + --Details:OpenOptionsWindow(Details:GetInstance(1)) +end) diff --git a/functions/events.lua b/functions/events.lua index c1292a3b..5b934591 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -39,7 +39,11 @@ ["COMBAT_CHARTTABLES_CREATING"] = {}, ["COMBAT_CHARTTABLES_CREATED"] = {}, ["COMBAT_ENCOUNTER_PHASE_CHANGED"] = {}, - + ["COMBAT_ARENA_START"] = {}, + ["COMBAT_ARENA_END"] = {}, + ["COMBAT_MYTHICDUNGEON_START"] = {}, + ["COMBAT_MYTHICDUNGEON_END"] = {}, + --> area ["ZONE_TYPE_CHANGED"] = {}, @@ -96,6 +100,10 @@ local common_events = { ["COMBAT_CHARTTABLES_CREATING"] = true, ["COMBAT_CHARTTABLES_CREATED"] = true, ["COMBAT_ENCOUNTER_PHASE_CHANGED"] = true, + ["COMBAT_ARENA_START"] = true, + ["COMBAT_ARENA_END"] = true, + ["COMBAT_MYTHICDUNGEON_START"] = true, + ["COMBAT_MYTHICDUNGEON_END"] = true, ["GROUP_ONENTER"] = true, ["GROUP_ONLEAVE"] = true, ["ZONE_TYPE_CHANGED"] = true, diff --git a/functions/playerclass.lua b/functions/playerclass.lua index 648ac9e9..c97714c3 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -459,13 +459,50 @@ do return spec end - - if (tries and tries < 10) then - t[3] = tries + 1 - _detalhes:ScheduleTimer ("GuessSpec", 3, t) + + if (_detalhes.streamer_config.quick_detection) then + if (tries and tries < 30) then + t[3] = tries + 1 + _detalhes:ScheduleTimer ("GuessSpec", 1, t) + end + else + if (tries and tries < 10) then + t[3] = tries + 1 + _detalhes:ScheduleTimer ("GuessSpec", 3, t) + end end return false end end + + +function _detalhes:AddColorString (player_name, class) + --> check if the class colors exists + local classColors = _G.RAID_CLASS_COLORS + if (classColors) then + local color = classColors [class] + --> check if the player name is valid + if (type (player_name) == "string" and color) then + player_name = "|c" .. color.colorStr .. player_name .. "|r" + return player_name + end + end + + --> if failed, return the player name without modifications + return player_name +end + +function _detalhes:AddRoleIcon (player_name, role, size) + --> check if is a valid role + local roleIcon = _detalhes.role_texcoord [role] + if (type (player_name) == "string" and roleIcon and role ~= "NONE") then + --> add the role icon + size = size or 14 + player_name = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. roleIcon .. "|t " .. player_name + return player_name + end + + return player_name +end diff --git a/functions/profiles.lua b/functions/profiles.lua index ba85abd3..f310e8b0 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -234,14 +234,20 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --> update profile keys before go for key, value in pairs (_detalhes.default_profile) do + --> the entire key doesn't exist if (profile [key] == nil) then if (type (value) == "table") then profile [key] = table_deepcopy (_detalhes.default_profile [key]) else profile [key] = value end - + + --> the key exist and is a table, check for missing values on sub tables elseif (type (value) == "table") then + --> deploy only copy non existing data + _detalhes.table.deploy (profile [key], value) + + --[=[ for key2, value2 in pairs (value) do if (profile [key] [key2] == nil) then if (type (value2) == "table") then @@ -251,7 +257,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) end end end - + --]=] end end @@ -542,6 +548,15 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --> update the numerical system _detalhes:SelectNumericalSystem() + + --> refresh the update interval + _detalhes:RefreshUpdater() + + --> refresh animation functions + _detalhes:RefreshAnimationFunctions() + + --> refresh broadcaster tools + _detalhes:LoadFramesForBroadcastTools() if (_detalhes.initializing) then _detalhes.profile_loaded = true @@ -864,14 +879,14 @@ local default_profile = { 0.23, -- [3] }, ["ARENA_GREEN"] = { - 0.1, -- [1] - 0.85, -- [2] - 0.1, -- [3] + 0.4, -- [1] + 1, -- [2] + 0.4, -- [3] }, ["ARENA_YELLOW"] = { - 0.90, -- [1] - 0.90, -- [2] - 0, -- [3] + 1, -- [1] + 1, -- [2] + 0.25, -- [3] }, ["NEUTRAL"] = { 1, -- [1] @@ -942,6 +957,10 @@ local default_profile = { --> performance use_row_animations = false, + animation_speed = 33, + animation_speed_triggertravel = 5, + animation_speed_mintravel = 0.45, + animation_speed_maxtravel = 3, animate_scroll = false, use_scroll = false, scroll_speed = 2, @@ -1013,7 +1032,64 @@ local default_profile = { tab_name = "", single_window = false, }, + + --> broadcaster options + broadcaster_enabled = false, + --> event tracker + event_tracker = { + frame = { + locked = false, + width = 250, + height = 300, + backdrop_color = {0, 0, 0, 0.2}, + show_title = true, + strata = "LOW", + }, + options_frame = {}, + enabled = false, + font_size = 10, + font_color = {1, 1, 1, 1}, + font_shadow = "NONE", + font_face = "Friz Quadrata TT", + line_height = 16, + line_texture = "Details Serenity", + line_color = {.1, .1, .1, 0.3}, + }, + + --> current damage + current_dps_meter = { + frame = { + locked = false, + width = 220, + height = 65, + backdrop_color = {0, 0, 0, 0.2}, + show_title = false, + strata = "LOW", + }, + options_frame = {}, + enabled = false, + arena_enabled = true, + mythic_dungeon_enabled = true, + font_size = 18, + font_color = {1, 1, 1, 1}, + font_shadow = "NONE", + font_face = "Friz Quadrata TT", + update_interval = 0.10, + sample_size = 5, --in seconds + }, + + --> streamer +-- _detalhes.streamer_config. + streamer_config = { + reset_spec_cache = false, + disable_mythic_dungeon = false, + no_alerts = false, + quick_detection = false, + faster_updates = false, + use_animation_accel = false, + }, + --> tooltip tooltip = { fontface = "Friz Quadrata TT", @@ -1303,6 +1379,11 @@ local default_global_data = { _detalhes.default_global_data = default_global_data function _detalhes:GetTutorialCVar (key, default) + --> is disabling all popups from the streamer options + if (_detalhes.streamer_config.no_alerts) then + return true + end + local value = _detalhes.tutorial [key] if (value == nil and default) then _detalhes.tutorial [key] = default @@ -1401,6 +1482,10 @@ function _detalhes:RestoreState_CurrentMythicDungeonRun() _detalhes.MythicPlus.PreviousBossKilledAt = savedTable.previous_boss_killed_at _detalhes.MythicPlus.IsRestoredState = true DetailsMythicPlusFrame.IsDoingMythicDungeon = true + + C_Timer.After (2, function() + _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_START") + end) return end end diff --git a/functions/spells.lua b/functions/spells.lua index 6c0aedc8..25374532 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -135,14 +135,14 @@ do -- Restoration Druid: - [145518] = 105, -- Genesis + [145518] = 105, -- Genesis --no exists [145205] = 105, -- Wild Mushroom [48438] = 105, -- Wild Growth [740] = 105, -- Tranquility [102342] = 105, -- Ironbark [33763] = 105, -- Lifebloom [88423] = 105, -- Nature's Cure - [8936] = 105, -- Regrowth + --[8936] = 105, -- Regrowth -overlap [18562] = 105, -- Swiftmend -- Beast Mastery Hunter: @@ -1572,6 +1572,34 @@ do --[29842] = "WARRIOR", --undribled wrath } + _detalhes.HardCrowdControlSpells = { + --> death knight + + --> deamon hunter + + --> druid + [33786] = true, -- Cyclone + + --> hunter + + --> mage + + --> monk + + --> paladin + + --> priest + + --> rogue + + --> shaman + + --> warlock + + --> warrior + + } + -- updated on 25/04/2015 (@Tonyleila - WoWInterface) _detalhes.CrowdControlSpells = { diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index a07ae5d1..fffa4bd2 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -20,7 +20,7 @@ 15 - custom spells 16 - data for charts 17 - automatization settings - 18 - misc settings + 18 - broadcaster options 19 - externals widgets (data feed) 20 - tooltip --]] @@ -478,8 +478,16 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) local extra_buttons_on_leave = function (self, capsule) capsule.textcolor = "C_OptionsButtonOrange" end - - local fillbars = g:NewButton (window, _, "$parentCreateExampleBarsButton", nil, 110, 14, _detalhes.CreateTestBars, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) + + local create_test_bars_func = function() + _detalhes.CreateTestBars() + if (not _detalhes.test_bar_update) then + _detalhes:StartTestBarUpdate() + else + _detalhes:StopTestBarUpdate() + end + end + local fillbars = g:NewButton (window, _, "$parentCreateExampleBarsButton", nil, 110, 14, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1) fillbars:SetPoint ("bottomleft", window.widget, "bottomleft", 41, 12) fillbars.textalign = "left" fillbars.textcolor = "C_OptionsButtonOrange" @@ -566,7 +574,7 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) 17, --auto hide settings 9, --wallpaper - 18, --misc + 18, --streamer options --advanced 11, --raid tools @@ -600,7 +608,7 @@ local menus = { --labels nos menus Loc ["STRING_OPTIONSMENU_AUTOMATIC"], Loc ["STRING_OPTIONSMENU_WALLPAPER"], - "-- -- --", --Loc ["STRING_OPTIONSMENU_MISC"] + "Streamer Settings", --Loc ["STRING_OPTIONSMENU_MISC"] }, { @@ -631,7 +639,7 @@ local menus2 = { Loc ["STRING_OPTIONSMENU_DATACHART"], --16 Loc ["STRING_OPTIONSMENU_AUTOMATIC"], --17 --Loc ["STRING_OPTIONSMENU_MISC"], --18 - "-- -- --", --18 + "Streamer Settings", --18 Loc ["STRING_OPTIONSMENU_DATAFEED"], --19 Loc ["STRING_OPTIONSMENU_TOOLTIP"], --20 } @@ -647,10 +655,13 @@ local menus2 = { [9] = true, [14] = true, [17] = true, - [18] = true, + --[18] = true, } window.is_window_settings = is_window_settings - + + local newIcon = g:CreateImage (window, [[Interface\AddOns\Details\images\icons2]], 62*0.6, 40*0.6, "overlay", {443/512, 505/512, 306/512, 346/512}) + newIcon:SetPoint ("topleft", window.widget, "topleft", 135, -351) + local select_options = function (options_type, true_index) window.current_selected = options_type @@ -2198,7 +2209,7 @@ function window:CreateFrame19() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Advanced Settings - Miscellaneous ~18 +-- Advanced Settings - options for broadcasters ~18 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame18() @@ -2209,19 +2220,287 @@ function window:CreateFrame18() titulo_misc_settings_desc.width = 350 titulo_misc_settings_desc.height = 20 - local right_side = { - --{"instancesMiscLabel", 1, true}, - --{"deleteInstanceLabel", 2}, - - --{"DisableGroupsLabel", 5, true}, - --{"DisableLockResizeUngroupLabel", 7}, - --{"DisableStretchButtonLabel", 8}, - --{"DisableBarHighlightLabel", 9}, - --{"DisableAllDisplaysWindowLabel", 10}, - --{"DamageTakenEverythingLabel", 10}, + --> + local button_width = 180 + + local titleFrame18 = g:NewLabel (frame18, _, "$parentTitleText", "TitleTextLabel", "Streamer Settings", "GameFontNormal", 16) + local titleFrame18Desc = g:NewLabel (frame18, _, "$parentTitleDescText", "TitleDescTextLabel", "Set of tools for streamers, youtubers and broadcasters in general", "GameFontNormal", 10, "white") + titleFrame18Desc:SetSize (450, 20) + + --fazer os headers com espaço para images + --fazer o botão para abrir o painel de opçopoes + + --> streamer plugin - a.k.a. player spell tracker + --> title anchor + g:NewLabel (frame18, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Streamer Plugin: Action Tracker", "GameFontNormal") + local streamerTitleDesc = g:NewLabel (frame18, _, "$parentStreamerTitleDescText", "StreamerTitleDescTextLabel", "Show the spells you are casting, allowing the viewer to follow your decision making and learn your rotation.", "GameFontNormal", 10, "white") + streamerTitleDesc:SetSize (270, 40) + streamerTitleDesc:SetJustifyV ("top") + streamerTitleDesc:SetPoint ("topleft", frame18.streamerPluginAnchor, "bottomleft", 0, -4) - --{"scrollLabel", 11, true}, + local streamerTitleImage = g:CreateImage (frame18, [[Interface\AddOns\Details\images\icons2]], 256, 41, "overlay", {0.5, 1, 0.49, 0.57}) + streamerTitleImage:SetPoint ("topleft", frame18.streamerPluginAnchor, "bottomleft", 0, -40) + + --> get the plugin object + local StreamerPlugin = _detalhes:GetPlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") + if (StreamerPlugin) then + --> get the plugin settings table + local tPluginSettings = _detalhes:GetPluginSavedTable ("DETAILS_PLUGIN_STREAM_OVERLAY") + if (tPluginSettings) then + local bIsPluginEnabled = tPluginSettings.enabled + --> plugin already enabled + if (bIsPluginEnabled) then + --> config button + local configure_streamer_plugin = function() + StreamerPlugin.OpenOptionsPanel (true) + C_Timer.After (0.2, function() + window:Hide() + end) + end + local configurePluginButton = g:NewButton (frame18, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template) + configurePluginButton:SetWidth (button_width) + configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7) + + --> text telling how to disable + local pluginAlreadyEnabled = g:NewLabel (frame18, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white") + pluginAlreadyEnabled:SetJustifyV ("top") + pluginAlreadyEnabled:SetSize (270, 40) + pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7) + else + --> plugin isnt enabled, create the enable button + local enable_streamer_plugin = function() + tPluginSettings.enabled = true + StreamerPlugin.__enabled = true + _detalhes:SendEvent ("PLUGIN_ENABLED", StreamerPlugin) + + frame18.enableStreamerPluginButton:Hide() + + --> config button + local configure_streamer_plugin = function() + StreamerPlugin.OpenOptionsPanel() + end + local configurePluginButton = g:NewButton (frame18, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template) + configurePluginButton:SetWidth (button_width) + configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7) + + --> text telling how to disable + local pluginAlreadyEnabled = g:NewLabel (frame18, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white") + pluginAlreadyEnabled:SetJustifyV ("top") + pluginAlreadyEnabled:SetSize (270, 40) + pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7) + end + + local enablePluginButton = g:NewButton (frame18, _, "$parentEnableStreamerPluginButton", "enableStreamerPluginButton", 100, 20, enable_streamer_plugin, nil, nil, nil, "Enable Plugin", nil, options_button_template) + enablePluginButton:SetWidth (button_width) + enablePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -5) + end + end + else + --> plugin is disabled at the addon control panel + local pluginDisabled = g:NewLabel (frame18, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Details!: Streamer Plugin is disabled on the AddOns Control Panel.", "GameFontNormal", 10, "red") + pluginDisabled:SetSize (270, 40) + pluginDisabled:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -2) + end + + + --> event tracker + g:NewLabel (frame18, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal") + local eventTrackerTitleDesc = g:NewLabel (frame18, _, "$parentEventTrackerTitleDescText", "EventTrackerTitleDescTextLabel", "Show what's happening near you so the viewer can follow what's going on. Show cooldowns, CC, spell interruption. Useful on any group content.", "GameFontNormal", 10, "white") + eventTrackerTitleDesc:SetJustifyV ("top") + eventTrackerTitleDesc:SetSize (270, 40) + eventTrackerTitleDesc:SetPoint ("topleft", frame18.eventTrackerAnchor, "bottomleft", 0, -4) + + local eventTrackerTitleImage = g:CreateImage (frame18, [[Interface\AddOns\Details\images\icons2]], 256, 50, "overlay", {0.5, 1, 134/512, 184/512}) + eventTrackerTitleImage:SetPoint ("topleft", frame18.eventTrackerAnchor, "bottomleft", 0, -40) + + --> enable feature checkbox + g:NewLabel (frame18, _, "$parentEnableEventTrackerLabel", "EventTrackerLabel", "Enable Event Tracker", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentEventTrackerSlider", "EventTrackerSlider", 60, 20, _, _, _detalhes.event_tracker.enabled, nil, nil, nil, nil, options_switch_template) + frame18.EventTrackerSlider:SetPoint ("left", frame18.EventTrackerLabel, "right", 2) + frame18.EventTrackerSlider:SetAsCheckBox() + frame18.EventTrackerSlider.OnSwitch = function (_, _, value) + _detalhes.event_tracker.enabled = not _detalhes.event_tracker.enabled + Details:LoadFramesForBroadcastTools() + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "EventTrackerSlider", "EventTrackerLabel", "Enable Event Tracker") + + frame18.EventTrackerLabel:SetPoint ("topleft", eventTrackerTitleImage, "bottomleft", 0, -10) + frame18.EventTrackerSlider:SetPoint ("left", frame18.EventTrackerLabel, "right", 2, 0) + + --> configure feature button + local configure_event_tracker = function() + _detalhes:OpenEventTrackerOptions (true) + C_Timer.After (0.2, function() + window:Hide() + end) + end + local configureEventTrackerButton = g:NewButton (frame18, _, "$parentConfigureEventTrackerButton", "configureEventTracker", 100, 20, configure_event_tracker, nil, nil, nil, "Event Tracker Options", nil, options_button_template) + configureEventTrackerButton:SetWidth (button_width) + configureEventTrackerButton:SetPoint ("topleft", frame18.EventTrackerLabel, "bottomleft", 0, -7) + + + --> current dps + g:NewLabel (frame18, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "The Real Current DPS", "GameFontNormal") + local currentDPSTitleDesc = g:NewLabel (frame18, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a frame with DPS done only in the last 5 seconds, making it change very quickly when the group uses attack cooldowns.", "GameFontNormal", 10, "white") + currentDPSTitleDesc:SetJustifyV ("top") + currentDPSTitleDesc:SetSize (270, 40) + currentDPSTitleDesc:SetPoint ("topleft", frame18.currentDPSAnchor, "bottomleft", 0, -4) + + local currentDPSTitleImage = g:CreateImage (frame18, [[Interface\AddOns\Details\images\icons2]], 250, 61, "overlay", {259/512, 509/512, 186/512, 247/512}) + currentDPSTitleImage:SetPoint ("topleft", frame18.currentDPSAnchor, "bottomleft", 0, -40) + + --> enable feature checkbox + g:NewLabel (frame18, _, "$parentEnableCurrentDPSLabel", "CurrentDPSLabel", "Enable The Real Current Dps", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentCurrentDPSSlider", "CurrentDPSSlider", 60, 20, _, _, _detalhes.current_dps_meter.enabled, nil, nil, nil, nil, options_switch_template) + + frame18.CurrentDPSSlider:SetPoint ("left", frame18.CurrentDPSLabel, "right", 2) + frame18.CurrentDPSSlider:SetAsCheckBox() + frame18.CurrentDPSSlider.OnSwitch = function (_, _, value) + _detalhes.current_dps_meter.enabled = not _detalhes.current_dps_meter.enabled + Details:LoadFramesForBroadcastTools() + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "CurrentDPSSlider", "CurrentDPSLabel", "Enable The Real Current Dps") + + frame18.CurrentDPSLabel:SetPoint ("topleft", currentDPSTitleImage, "bottomleft", 0, -10) + frame18.CurrentDPSSlider:SetPoint ("left", frame18.CurrentDPSLabel, "right", 2, 0) + + --> configure feature button + local configure_current_dps = function() + _detalhes:OpenCurrentRealDPSOptions (true) + C_Timer.After (0.2, function() + window:Hide() + end) + end + local configureCurrentDPSButton = g:NewButton (frame18, _, "$parentConfigureCurrentDPSButton", "configureCurrentDPS", 100, 20, configure_current_dps, nil, nil, nil, "Current Real DPS Options", nil, options_button_template) + configureCurrentDPSButton:SetWidth (button_width) + configureCurrentDPSButton:SetPoint ("topleft", frame18.CurrentDPSLabel, "bottomleft", 0, -7) + + + --> suppress alerts and tutorial popups + g:NewLabel (frame18, _, "$parentAlertsAndPopupsAnchor", "alertsAndPopupsAnchor", "Settings:", "GameFontNormal") + + + + --> no alerts + g:NewLabel (frame18, _, "$parentNoAlertsLabel", "NoAlertsLabel", "No Window Alerts", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentNoAlertsSlider", "NoAlertsSlider", 60, 20, _, _, _detalhes.streamer_config.no_alerts, nil, nil, nil, nil, options_switch_template) + + frame18.NoAlertsSlider:SetPoint ("left", frame18.NoAlertsLabel, "right", 2) + frame18.NoAlertsSlider:SetAsCheckBox() + frame18.NoAlertsSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.no_alerts = not _detalhes.streamer_config.no_alerts + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "NoAlertsSlider", "NoAlertsLabel", "Don't show alerts in the bottom of the window and avoid show tutorial popups.") + + --> faster updates + g:NewLabel (frame18, _, "$parentFasterUpdatesLabel", "FasterUpdatesLabel", "60 Updates Per Second", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentFasterUpdatesSlider", "FasterUpdatesSlider", 60, 20, _, _, _detalhes.streamer_config.faster_updates, nil, nil, nil, nil, options_switch_template) + + frame18.FasterUpdatesSlider:SetPoint ("left", frame18.FasterUpdatesLabel, "right", 2) + frame18.FasterUpdatesSlider:SetAsCheckBox() + frame18.FasterUpdatesSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.faster_updates = not _detalhes.streamer_config.faster_updates + _detalhes:RefreshUpdater() + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "FasterUpdatesSlider", "FasterUpdatesLabel", "Increase the refresh rate to 60 times per second.") + + --> quick detection + g:NewLabel (frame18, _, "$parentQuickDetectionLabel", "QuickDetectionLabel", "Quick Player Info", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentQuickDetectionSlider", "QuickDetectionSlider", 60, 20, _, _, _detalhes.streamer_config.quick_detection, nil, nil, nil, nil, options_switch_template) + + frame18.QuickDetectionSlider:SetPoint ("left", frame18.QuickDetectionLabel, "right", 2) + frame18.QuickDetectionSlider:SetAsCheckBox() + frame18.QuickDetectionSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.quick_detection = not _detalhes.streamer_config.quick_detection + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "QuickDetectionSlider", "QuickDetectionLabel", "Attempt to acquire player information such as class, spec or item level faster.") + + --> disable mythic dungeon + g:NewLabel (frame18, _, "$parentDisableMythicDungeonLabel", "DisableMythicDungeonLabel", "No Mythic Dungeon Shenanigans", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentDisableMythicDungeonSlider", "DisableMythicDungeonSlider", 60, 20, _, _, _detalhes.streamer_config.disable_mythic_dungeon, nil, nil, nil, nil, options_switch_template) + + frame18.DisableMythicDungeonSlider:SetPoint ("left", frame18.DisableMythicDungeonLabel, "right", 2) + frame18.DisableMythicDungeonSlider:SetAsCheckBox() + frame18.DisableMythicDungeonSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.disable_mythic_dungeon = not _detalhes.streamer_config.disable_mythic_dungeon + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "DisableMythicDungeonSlider", "DisableMythicDungeonLabel", "Threat mythic dungeon as a normal dungeon: no trash merge, no mythic run overall segment.") + + --> clear cache + g:NewLabel (frame18, _, "$parentClearCacheLabel", "ClearCacheLabel", "Clear Cache on New Event", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentClearCacheSlider", "ClearCacheSlider", 60, 20, _, _, _detalhes.streamer_config.reset_spec_cache, nil, nil, nil, nil, options_switch_template) + + frame18.ClearCacheSlider:SetPoint ("left", frame18.ClearCacheLabel, "right", 2) + frame18.ClearCacheSlider:SetAsCheckBox() + frame18.ClearCacheSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.reset_spec_cache = not _detalhes.streamer_config.reset_spec_cache + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "ClearCacheSlider", "ClearCacheLabel", "Reduces the chance of getting a serial number overlap when working with multiple realms.") + + --> advanced animations + g:NewLabel (frame18, _, "$parentAdvancedAnimationsLabel", "AdvancedAnimationsLabel", "Use Animation Acceleration", "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentAdvancedAnimationsSlider", "AdvancedAnimationsSlider", 60, 20, _, _, _detalhes.streamer_config.use_animation_accel, nil, nil, nil, nil, options_switch_template) + + frame18.AdvancedAnimationsSlider:SetPoint ("left", frame18.AdvancedAnimationsLabel, "right", 2) + frame18.AdvancedAnimationsSlider:SetAsCheckBox() + frame18.AdvancedAnimationsSlider.OnSwitch = function (_, _, value) + _detalhes.streamer_config.use_animation_accel = not _detalhes.streamer_config.use_animation_accel + _detalhes:RefreshAnimationFunctions() + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "AdvancedAnimationsSlider", "AdvancedAnimationsLabel", "Animation speed changes accordly to the amount of space the bar needs to travel.") + + + --> anchoring + local x = window.left_start_at + titleFrame18:SetPoint (x, window.title_y_pos) + titleFrame18Desc:SetPoint (x, window.title_y_pos2) + + local a = frame18:CreateFontString (nil, "overlay", "GameFontNormal") + frame18.a = a + + local left_side = { + {"streamerPluginAnchor", 0, true}, + + {"eventTrackerAnchor", 0, true}, + {"eventTrackerAnchor", 0, true}, + {"eventTrackerAnchor", 0, true}, + {"eventTrackerAnchor", 0, true}, + {"eventTrackerAnchor", 0, true}, + + } + + window:arrange_menu (frame18, left_side, x, window.top_start_at) + + local right_side = { + {"currentDPSAnchor", 0, true}, + {"alertsAndPopupsAnchor", 0, true}, + {"alertsAndPopupsAnchor", 0, true}, + {"alertsAndPopupsAnchor", 0, true}, + {"alertsAndPopupsAnchor", 0, true}, + {"alertsAndPopupsAnchor", 0, true}, + {"NoAlertsLabel"}, + {"FasterUpdatesLabel"}, + {"QuickDetectionLabel"}, + {"DisableMythicDungeonLabel"}, + {"ClearCacheLabel"}, + {"AdvancedAnimationsLabel"}, } window:arrange_menu (frame18, right_side, window.right_start_at, window.top_start_at) @@ -11339,6 +11618,16 @@ end --> if not window --> window 16 _G.DetailsOptionsWindow16UserTimeCapturesFillPanel.MyObject:Refresh() + --> window 18 + _G.DetailsOptionsWindow18EventTrackerSlider.MyObject:SetValue (_detalhes.event_tracker.enabled) + _G.DetailsOptionsWindow18CurrentDPSSlider.MyObject:SetValue (_detalhes.current_dps_meter.enabled) + _G.DetailsOptionsWindow18NoAlertsSlider.MyObject:SetValue (_detalhes.streamer_config.no_alerts) + _G.DetailsOptionsWindow18FasterUpdatesSlider.MyObject:SetValue (_detalhes.streamer_config.faster_updates) + _G.DetailsOptionsWindow18QuickDetectionSlider.MyObject:SetValue (_detalhes.streamer_config.quick_detection) + _G.DetailsOptionsWindow18DisableMythicDungeonSlider.MyObject:SetValue (_detalhes.streamer_config.disable_mythic_dungeon) + _G.DetailsOptionsWindow18ClearCacheSlider.MyObject:SetValue (_detalhes.streamer_config.reset_spec_cache) + _G.DetailsOptionsWindow18AdvancedAnimationsSlider.MyObject:SetValue (_detalhes.streamer_config.use_animation_accel) + --> window 17 _G.DetailsOptionsWindow17CombatAlphaDropdown.MyObject:Select (editing_instance.hide_in_combat_type, true) _G.DetailsOptionsWindow17HideOnCombatAlphaSlider.MyObject:SetFixedParameter (editing_instance) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index f0d2cb89..784777c1 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -1493,8 +1493,7 @@ local resize_scripts_onmousedown = function (self, button) _detalhes:SendEvent ("DETAILS_INSTANCE_STARTRESIZE", nil, self._instance) if (_detalhes.update_speed > 0.3) then - _detalhes:CancelTimer (_detalhes.atualizador) - _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", 0.3, -1) + _detalhes:SetWindowUpdateSpeed (0.3, true) _detalhes.resize_changed_update_speed = true end @@ -1591,8 +1590,7 @@ local resize_scripts_onmouseup = function (self, button) end if (_detalhes.resize_changed_update_speed) then - _detalhes:CancelTimer (_detalhes.atualizador) - _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + _detalhes:SetWindowUpdateSpeed (false, true) _detalhes.resize_changed_update_speed = nil end @@ -2636,8 +2634,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) --> change the update speed if (_detalhes.update_speed > 0.3) then - _detalhes:CancelTimer (_detalhes.atualizador) - _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", 0.3, -1) + _detalhes:SetWindowUpdateSpeed (0.3, true) _detalhes.stretch_changed_update_speed = true end @@ -2723,8 +2720,7 @@ local function button_stretch_scripts (baseframe, backgrounddisplay, instancia) _detalhes:SendEvent ("DETAILS_INSTANCE_ENDSTRETCH", nil, instancia) if (_detalhes.stretch_changed_update_speed) then - _detalhes:CancelTimer (_detalhes.atualizador) - _detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + _detalhes:SetWindowUpdateSpeed (false, true) _detalhes.stretch_changed_update_speed = nil end @@ -2991,6 +2987,10 @@ end function _detalhes:InstanceAlert (msg, icon, time, clickfunc, doflash) + if (_detalhes.streamer_config.no_alerts) then + return + end + if (not self.meu_id) then local lower = _detalhes:GetLowerInstanceNumber() if (lower) then diff --git a/images/icons2.blp b/images/icons2.blp index 69f4e6cf..5168909a 100644 Binary files a/images/icons2.blp and b/images/icons2.blp differ diff --git a/startup.lua b/startup.lua index 51271bfe..da09819d 100644 --- a/startup.lua +++ b/startup.lua @@ -133,7 +133,7 @@ function _G._detalhes:Start() end self:AtualizaGumpPrincipal (-1, true) - self.atualizador = self:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", _detalhes.update_speed, -1) + _detalhes:RefreshUpdater() for index = 1, #self.tabela_instancias do local instance = self.tabela_instancias [index] @@ -571,6 +571,7 @@ function _G._detalhes:Start() local segment = segmentsToMerge [i] if (segment == _detalhes.tabela_vigente) then _detalhes:Msg ("unhandled exception > merged trash segment is current segment > MergeTrashCleanup() is scheduled:", isFromSchedule) + --happened after killing one mob and leaving the dungeon, lots of /reload has done inside the dungeon end end @@ -1040,10 +1041,27 @@ function _G._detalhes:Start() elseif (event == "CHALLENGE_MODE_START") then --> CHALLENGE_MODE_START does trigger every time the player enters a mythic dungeon already in progress - + + --> send mythic dungeon start event + local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() + if (difficultyID == 8) then + _detalhes:SendEvent ("COMBAT_MYTHICDUNGEON_START") + end + if (newFrame.DevelopmentDebug) then print ("Details!", event, ...) end + + --> reset spec cache if broadcaster requested + if (_detalhes.streamer_config.reset_spec_cache) then + wipe (_detalhes.cached_specs) + end + + --> ignore the event if ignoring mythic dungeon special treatment + if (_detalhes.streamer_config.disable_mythic_dungeon) then + return + end + C_Timer.After (0.5, newFrame.OnChallengeModeStart) elseif (event == "CHALLENGE_MODE_COMPLETED") then @@ -1051,6 +1069,17 @@ function _G._detalhes:Start() print ("Details!", event, ...) end + --> 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 + + --> 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, newFrame.MythicDungeonFinished) @@ -1060,6 +1089,11 @@ function _G._detalhes:Start() print ("Details!", event, ...) end + --> ignore the event if ignoring mythic dungeon special treatment + if (_detalhes.streamer_config.disable_mythic_dungeon) then + return + end + if (newFrame.IsDoingMythicDungeon) then local encounterID, encounterName, difficultyID, raidSize, endStatus = ... if (endStatus == 1) then @@ -1100,11 +1134,21 @@ function _G._detalhes:Start() 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 ~= self.MythicPlus.DungeonID) then if (newFrame.DevelopmentDebug) then 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 newFrame.BossDefeated (true) @@ -1450,6 +1494,9 @@ function _G._detalhes:Start() _detalhes:OpenWelcomeWindow() end + --> load broadcaster tools + _detalhes:LoadFramesForBroadcastTools() + --_detalhes:OpenWelcomeWindow() --debug -- /run _detalhes:OpenWelcomeWindow()