From 231f61eca1f7e8715832812d8c7fb69c2e873f4f Mon Sep 17 00:00:00 2001 From: Tercioo Date: Fri, 4 Mar 2016 10:57:57 -0300 Subject: [PATCH] - added Dos/Hps display at the Streamer plugin. - disabled the timeattack tutorial. --- boot.lua | 10 +- plugins/Details_Streamer/Details_Streamer.lua | 251 +++++++++++++++++- .../Details_TimeAttack/Details_TimeAttack.lua | 3 +- 3 files changed, 253 insertions(+), 11 deletions(-) diff --git a/boot.lua b/boot.lua index cd2d4911..f340b8b0 100644 --- a/boot.lua +++ b/boot.lua @@ -3,8 +3,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 2490 --it's 2490 for release - _detalhes.userversion = "v4.3.6" + _detalhes.build_counter = 2498 --it's 2498 for release + _detalhes.userversion = "v4.3.7" _detalhes.realversion = 81 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,12 +21,12 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v4.3.6 (|cFFFFCC00Mar 02, 2016|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Details! Streamer (plugin): fixed an issue where sometimes the option panel won't open.\n\n +|cFFFFFF00v4.3.7 (|cFFFFCC00Mar 03, 2016|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Streamer (plugin): added Dps and Hps display (disabled by default).\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.3.6 (|cFFFFCC00Mar 02, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! Streamer (plugin): fixed an issue where sometimes the option panel won't open.\n\n|cFFFFFF00v4.3.5 (|cFFFFCC00Feb 29, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added block amount on the Avoidance tab at the Player Detail Window.\n\n|cFFFFFF00v4.3.4 (|cFFFFCC00Feb 28, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Streamer (plugin) now saves the window size inside the profile, this should fix some problems.\n\n|cFFFFFF00-|r Streamer (plugin) added an option for frame strata, default is now Low (from High).\n\n|cFFFFFF00v4.3.3 (|cFFFFCC00Feb 28, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Damage Taken by Spell when not showing total and percentage.\n\n|cFFFFFF00v4.3.2 (|cFFFFCC00Feb 25, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added profile option for Details!: Streamer plugin (close/reopen the game client after updating the addon).\n\n|cFFFFFF00-|r Fixed an issue with Streamer plugin where it auto deactive after a reload or logon.\n\n|cFFFFFF00v4.3.1 (|cFFFFCC00Feb 24, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Auto Switch now checks if there is more than two windows using the same plugin and warn the user about the issue.\n\n|cFFFFFF00v4.3 (|cFFFFCC00Feb 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Details!: Streamer plugin, if you are a streamer or youtuber, enable it at the Plugins Management on Options Panel.\n\n|cFFFFFF00v4.2.10 (|cFFFFCC00Feb 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major fixes on the Weakaura creator tool.\n\n|cFFFFFF00v4.2.9a (|cFFFFCC00Feb 10, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Global profiles got a revamp, now you can select which profile is used on all characters.\n\n|cFFFFFF00-|r You also can overwrite the global profile on any ton by just selecting a profile for that character.\n\n|cFFFFFF00-|r Added two new custom displays: Damage Done on targets marked with skull and Damage Done on targets marked with any other mark.\n\n|cFFFFFF00-|r Bookmark now also supports Plugins.\n\n|cFFFFFF00-|r Warlock's Burning Rush won't be counted when the player is out of combat.\n\n|cFFFFFF00-|r Added a Scale options to Encounter Details plugin window.\n\n|cFFFFFF00-|r Added a report button for targets of targets at the Player Details Window.\n\n|cFFFFFF00-|r Fixed the click to switch segment through segment button: left click changes up, right click changes down, middle mouse switch back to current segment.\n\n|cFFFFFF00-|r Advanced Damage Taken now also makes the damage Taken by tanks always be post-mitigated by shields.\n\n|cFFFFFF00-|r Fixed a gap when setting the bars to 'bottom to top' grow direction.\n\n|cFFFFFF00-|r Fixed an issue with the window size when hiding borders.\n\n|cFFFFFF00v4.1.6 (|cFFFFCC00Jan 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the size of the right margin on tooltips.\n\n|cFFFFFF00v4.1.5 (|cFFFFCC00Jan 10, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the weakauras creator for DBM and BidWigs Timers.\n\n|cFFFFFF00-|r Fix for an issue with dungeon bosses where sometimes Details! throw some error messages.\n\n|cFFFFFF00-|r Fixed the background color of All Displays window (right click the title bar).\n\n|cFFFFFF00-|r Attempt to fix a 'class undefined' bug.\n\n|cFFFFFF00v4.1.4 (|cFFFFCC00Jan 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with the segment plugin for the statusbar.\n\n|cFFFFFF00v4.1.3 (|cFFFFCC00Jan 01, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Small visual improvement on tooltips.\n\n|cFFFFFF00-|r Fixed an issue when closing solo plugins with the red X button.\n\n|cFFFFFF00v4.1.2 (|cFFFFCC00Dec 31, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for item level tracker.\n\n|cFFFFFF00v4.1.1 (|cFFFFCC00Dec 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using LibItemUpgradeInfo library to retrive the item level of upgraded items.\n\n|cFFFFFF00v4.1.0 (|cFFFFCC00Dec 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin preset: 'New Gray'.\n\n|cFFFFFF00-|r Added a Dark skin for the Options Panel.\n\n|cFFFFFF00-|r Fixed an issue with the Plugin DPS Tuning when reseting data on Details!.\n\n|cFFFFFF00-|r Removed realm names from player at the Comparison Panel.\n\n|cFFFFFF00v4.0.8 (|cFFFFCC00Dec 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Framework and functions update for the next version of the Advanced Death Logs plugin.\n\n|cFFFFFF00v4.0.7 (|cFFFFCC00Dec 07, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed some corner border for elvui skins.\n\n|cFFFFFF00-|r /run Details.death_tooltip_width = 500 makes the deathlog tooltip be 500 width.\n\n|cFFFFFF00v4.0.6e (|cFFFFCC00Nov 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes some actors are duplicated at the end of an encounter.\n\n|cFFFFFF00-|r Fixed bookmark for segments (shift+right click).\n\n|cFFFFFF00-|r Fixed an issue with Chat Tab Embed when embeding only one window.\n\n|cFFFFFF00v4.0.6c (|cFFFFCC00Nov 04, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for numeral system: Western/East Asian.\n\n|cFFFFFF00v4.0.5c (|cFFFFCC00Oct 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n|cFFFFFF00-|r Fixed pet battles auto hide.\n\n|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.3.7 (|cFFFFCC00Mar 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Streamer (plugin): added Dps and Hps display (disabled by default).\n\n|cFFFFFF00v4.3.7 (|cFFFFCC00Mar 02, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! Streamer (plugin): fixed an issue where sometimes the option panel won't open.\n\n|cFFFFFF00v4.3.5 (|cFFFFCC00Feb 29, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added block amount on the Avoidance tab at the Player Detail Window.\n\n|cFFFFFF00v4.3.4 (|cFFFFCC00Feb 28, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Streamer (plugin) now saves the window size inside the profile, this should fix some problems.\n\n|cFFFFFF00-|r Streamer (plugin) added an option for frame strata, default is now Low (from High).\n\n|cFFFFFF00v4.3.3 (|cFFFFCC00Feb 28, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed Damage Taken by Spell when not showing total and percentage.\n\n|cFFFFFF00v4.3.2 (|cFFFFCC00Feb 25, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added profile option for Details!: Streamer plugin (close/reopen the game client after updating the addon).\n\n|cFFFFFF00-|r Fixed an issue with Streamer plugin where it auto deactive after a reload or logon.\n\n|cFFFFFF00v4.3.1 (|cFFFFCC00Feb 24, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Auto Switch now checks if there is more than two windows using the same plugin and warn the user about the issue.\n\n|cFFFFFF00v4.3 (|cFFFFCC00Feb 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Details!: Streamer plugin, if you are a streamer or youtuber, enable it at the Plugins Management on Options Panel.\n\n|cFFFFFF00v4.2.10 (|cFFFFCC00Feb 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major fixes on the Weakaura creator tool.\n\n|cFFFFFF00v4.2.9a (|cFFFFCC00Feb 10, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Global profiles got a revamp, now you can select which profile is used on all characters.\n\n|cFFFFFF00-|r You also can overwrite the global profile on any ton by just selecting a profile for that character.\n\n|cFFFFFF00-|r Added two new custom displays: Damage Done on targets marked with skull and Damage Done on targets marked with any other mark.\n\n|cFFFFFF00-|r Bookmark now also supports Plugins.\n\n|cFFFFFF00-|r Warlock's Burning Rush won't be counted when the player is out of combat.\n\n|cFFFFFF00-|r Added a Scale options to Encounter Details plugin window.\n\n|cFFFFFF00-|r Added a report button for targets of targets at the Player Details Window.\n\n|cFFFFFF00-|r Fixed the click to switch segment through segment button: left click changes up, right click changes down, middle mouse switch back to current segment.\n\n|cFFFFFF00-|r Advanced Damage Taken now also makes the damage Taken by tanks always be post-mitigated by shields.\n\n|cFFFFFF00-|r Fixed a gap when setting the bars to 'bottom to top' grow direction.\n\n|cFFFFFF00-|r Fixed an issue with the window size when hiding borders.\n\n|cFFFFFF00v4.1.6 (|cFFFFCC00Jan 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the size of the right margin on tooltips.\n\n|cFFFFFF00v4.1.5 (|cFFFFCC00Jan 10, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the weakauras creator for DBM and BidWigs Timers.\n\n|cFFFFFF00-|r Fix for an issue with dungeon bosses where sometimes Details! throw some error messages.\n\n|cFFFFFF00-|r Fixed the background color of All Displays window (right click the title bar).\n\n|cFFFFFF00-|r Attempt to fix a 'class undefined' bug.\n\n|cFFFFFF00v4.1.4 (|cFFFFCC00Jan 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with the segment plugin for the statusbar.\n\n|cFFFFFF00v4.1.3 (|cFFFFCC00Jan 01, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Small visual improvement on tooltips.\n\n|cFFFFFF00-|r Fixed an issue when closing solo plugins with the red X button.\n\n|cFFFFFF00v4.1.2 (|cFFFFCC00Dec 31, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for item level tracker.\n\n|cFFFFFF00v4.1.1 (|cFFFFCC00Dec 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using LibItemUpgradeInfo library to retrive the item level of upgraded items.\n\n|cFFFFFF00v4.1.0 (|cFFFFCC00Dec 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin preset: 'New Gray'.\n\n|cFFFFFF00-|r Added a Dark skin for the Options Panel.\n\n|cFFFFFF00-|r Fixed an issue with the Plugin DPS Tuning when reseting data on Details!.\n\n|cFFFFFF00-|r Removed realm names from player at the Comparison Panel.\n\n|cFFFFFF00v4.0.8 (|cFFFFCC00Dec 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Framework and functions update for the next version of the Advanced Death Logs plugin.\n\n|cFFFFFF00v4.0.7 (|cFFFFCC00Dec 07, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed some corner border for elvui skins.\n\n|cFFFFFF00-|r /run Details.death_tooltip_width = 500 makes the deathlog tooltip be 500 width.\n\n|cFFFFFF00v4.0.6e (|cFFFFCC00Nov 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes some actors are duplicated at the end of an encounter.\n\n|cFFFFFF00-|r Fixed bookmark for segments (shift+right click).\n\n|cFFFFFF00-|r Fixed an issue with Chat Tab Embed when embeding only one window.\n\n|cFFFFFF00v4.0.6c (|cFFFFCC00Nov 04, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for numeral system: Western/East Asian.\n\n|cFFFFFF00v4.0.5c (|cFFFFCC00Oct 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n|cFFFFFF00-|r Fixed pet battles auto hide.\n\n|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index a5abf79b..5d79fda9 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -12,6 +12,7 @@ local StreamOverlay = _detalhes:NewPluginObject ("Details_StreamOverlay", DETAIL local SOF = StreamOverlay.Frame --> shortcut for details framework local fw = StreamOverlay.gump +local player_name StreamOverlay.CurrentVersion = "v1.1" @@ -105,6 +106,9 @@ local function CreatePluginFrames() --> enable the tick update listener:SetScript ("OnUpdate", listener.track_spell_cast) + + --> refresh dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() end function StreamOverlay:OnDisablePlugin() @@ -127,6 +131,9 @@ local function CreatePluginFrames() --> save position, size and hide the frame StreamOverlay:SaveWindowSizeAnLocation() SOF:Hide() + + --> refresh dps frame + StreamOverlay:UpdateDpsHpsFrameConfig (true) end --> title bar, only shown when the frame isn't locked @@ -206,21 +213,29 @@ local function CreatePluginFrames() --> save size first StreamOverlay.db.main_frame_size [1] = SOF:GetWidth() StreamOverlay.db.main_frame_size [2] = SOF:GetHeight() - --> save position + --> save main frame position LibWindow.RegisterConfig (SOF, StreamOverlay.db) LibWindow.SavePosition (SOF) + --> save the dps frame position + LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) + LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) end function StreamOverlay:RestoreWindowSizeAndLocation() --> restore the size first SOF:SetSize (unpack (StreamOverlay.db.main_frame_size)) - --> set the window location + --> set the main window location LibWindow.RegisterConfig (SOF, StreamOverlay.db) LibWindow.RestorePosition (SOF) LibWindow.SavePosition (SOF) + --> set the dps frame location + LibWindow.RegisterConfig (StreamerOverlayDpsHpsFrame, StreamOverlay.db.per_second) + LibWindow.RestorePosition (StreamerOverlayDpsHpsFrame) + LibWindow.SavePosition (StreamerOverlayDpsHpsFrame) --> set the frame strata SOF:SetFrameStrata (StreamOverlay.db.main_frame_strata) + StreamerOverlayDpsHpsFrame:SetFrameStrata (StreamOverlay.db.main_frame_strata) end - + --> two resizers local left_resize = CreateFrame ("button", "DetailsStreamerLeftResizer", SOF) local right_resize = CreateFrame ("button", "DetailsStreamerRightResizer", SOF) @@ -485,6 +500,10 @@ local function CreatePluginFrames() for i, row in ipairs (StreamOverlay.battle_lines) do StreamOverlay:SetBattleLineStyle (row, i) end + + --> update the dps hps frame text + StreamOverlay:SetFontFace (StreamerOverlayDpsHpsFrameText, SharedMedia:Fetch ("font", StreamOverlay.db.font_face)) + StreamOverlay:SetFontColor (StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) end function StreamOverlay:SetBattleLineStyle (row, index) @@ -1157,8 +1176,129 @@ function StreamOverlay:SetLocked (state) SOF:EnableMouse (true) end + StreamOverlay:UpdateDpsHpsFrameConfig() end +---------------------------------------------------------------------------------------------------------------------------------------------------------------- +--on screen hps dps + +local screen_frame = CreateFrame ("frame", "StreamerOverlayDpsHpsFrame", UIParent) +screen_frame:SetSize (70, 20) +screen_frame:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) +screen_frame:SetBackdropColor (.1, .1, .1, .9) +screen_frame:SetMovable (true) +screen_frame:Hide() +screen_frame:SetPoint ("center", UIParent, "center") +screen_frame:SetScript ("OnMouseDown", function (self) + if (not screen_frame.moving and not StreamOverlay.db.main_frame_locked) then + screen_frame:StartMoving() + screen_frame.moving = true + screen_frame.movingAt = GetTime() + end +end) +screen_frame:SetScript ("OnMouseUp", function (self) + if (screen_frame.movingAt) then + if (screen_frame.moving) then + screen_frame.moving = false + screen_frame:StopMovingOrSizing() + StreamOverlay:SaveWindowSizeAnLocation() + end + + if (screen_frame.movingAt+0.200 < GetTime()) then + return + end + screen_frame.movingAt = nil + + StreamOverlay.OpenOptionsPanel() + end +end) +screen_frame:SetScript ("OnEnter", function (self) + GameTooltip:SetOwner (self) + GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") + GameTooltip:AddLine ("|cFFFF7700Left Click|r: Open Options\n|cFFFF7700Slash Command|r: /streamer") + GameTooltip:Show() +end) +screen_frame:SetScript ("OnLeave", function() + GameTooltip:Hide() +end) + + +local screen_frame_text = screen_frame:CreateFontString ("StreamerOverlayDpsHpsFrameText", "overlay", "GameFontNormal") +screen_frame_text:SetPoint ("center", screen_frame, "center") +screen_frame.text = screen_frame_text + +local screen_frame_attribute = 1 +local format_function + +function StreamOverlay:UpdateDpsHpsFrameConfig (PluginDisabled) + + if (PluginDisabled) then + if (StreamOverlay.DpsHpsTick) then + StreamOverlay.DpsHpsTick:Cancel() + StreamOverlay.DpsHpsTick = nil + end + screen_frame:Hide() + return + end + + local db = StreamOverlay.db.per_second + + StreamOverlay:SetFontSize (screen_frame.text, db.size) + StreamOverlay:SetFontOutline (screen_frame.text, db.font_shadow) + screen_frame:SetScale (db.scale) + + screen_frame_attribute = db.attribute_type + format_function = Details:GetCurrentToKFunction() + + if (StreamOverlay.db.main_frame_locked) then + screen_frame:SetBackdrop (nil) + screen_frame:EnableMouse (false) + else + screen_frame:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) + screen_frame:SetBackdropColor (.1, .1, .1, .9) + screen_frame:EnableMouse (true) + end + + if (db.enabled) then + screen_frame:Show() + if (StreamOverlay.DpsHpsTick) then + StreamOverlay.DpsHpsTick:Cancel() + StreamOverlay.DpsHpsTick = nil + end + StreamOverlay.DpsHpsTick = C_Timer.NewTicker (db.update_speed, StreamOverlay.UpdateDpsHpsFrame) + else + screen_frame:Hide() + if (StreamOverlay.DpsHpsTick) then + StreamOverlay.DpsHpsTick:Cancel() + StreamOverlay.DpsHpsTick = nil + end + end + + --> update the dps hps frame text + StreamOverlay:SetFontFace (StreamerOverlayDpsHpsFrameText, SharedMedia:Fetch ("font", StreamOverlay.db.font_face)) + StreamOverlay:SetFontColor (StreamerOverlayDpsHpsFrameText, StreamOverlay.db.font_color) + +end + +function StreamOverlay:UpdateDpsHpsFrame() + --> low level actor parsing - we can just use Details:GetActor(), but is faster without having to call functions + local container = _detalhes.tabela_vigente [screen_frame_attribute] + local actor = container._ActorTable [container._NameIndexTable [player_name]] + + if (actor) then + screen_frame_text:SetText (format_function (_, actor.total / _detalhes.tabela_vigente:GetCombatTime())) + else + if (StreamOverlay.db.per_second.attribute_type == 1) then + screen_frame_text:SetText ("DPS") + else + screen_frame_text:SetText ("HPS") + end + end +end + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + function StreamOverlay.OpenOptionsPanel() if (not StreamOverlayOptionsPanel) then @@ -1175,7 +1315,8 @@ function StreamOverlay.OpenOptionsPanel() options_frame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) options_frame:SetBackdropColor (0, 0, 0, 0.5) options_frame:SetBackdropBorderColor (0, 0, 0, 1) - options_frame:SetHeight (360) + options_frame:SetWidth (520) + options_frame:SetHeight (500) -- select texture local set_row_texture = function (_, _, value) @@ -1241,6 +1382,7 @@ function StreamOverlay.OpenOptionsPanel() local set_window_strata = function (_, _, strata) StreamOverlay.db.main_frame_strata = strata SOF:SetFrameStrata (strata) + StreamerOverlayDpsHpsFrame:SetFrameStrata (strata) end local strataTable = { {value = "BACKGROUND", label = "Background", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Green]], iconcolor = {0, .5, 0, .8}, texcoord = nil}, @@ -1250,6 +1392,14 @@ function StreamOverlay.OpenOptionsPanel() {value = "DIALOG", label = "Dialog", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Red]] , iconcolor = {1, 0, 0, 1}, texcoord = nil}, } -- + local set_attribute= function (_, _, value) + StreamOverlay.db.per_second.attribute_type = value + end + local attributeTable = { + {value = 1, label = "DPS", onclick = set_attribute}, + {value = 2, label = "HPS", onclick = set_attribute}, + } + -- local options = { { @@ -1349,7 +1499,87 @@ function StreamOverlay.OpenOptionsPanel() desc = "Color used on texts.", name = "Text Color" }, + + {type = "space"}, + { + type = "toggle", + name = "Show Dps/Hps", + desc = "Show in the screen your current Dps or Hps.", + order = 1, + get = function() return StreamOverlay.db.per_second.enabled end, + set = function (self, val) + StreamOverlay.db.per_second.enabled = not StreamOverlay.db.per_second.enabled + -- update hps dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() + end, + }, + + { + type = "select", + get = function() return StreamOverlay.db.per_second.attribute_type end, + values = function() return attributeTable end, + desc = "Show DPS or HPS.", + name = "Show" + }, + + { + type = "range", + get = function() return StreamOverlay.db.per_second.size end, + set = function (self, fixedparam, value) StreamOverlay.db.per_second.size = value; + -- update hps dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() + end, + min = 8, + max = 32, + step = 1, + desc = "The size of the text.", + name = "Dps/Hps Text Size", + }, + + { + type = "range", + get = function() return StreamOverlay.db.per_second.scale end, + set = function (self, fixedparam, value) StreamOverlay.db.per_second.scale = value; + -- update hps dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() + end, + min = 0.65, + max = 1.5, + step = 1, + desc = "The size of the text.", + name = "Dps/Hps Scale", + usedecimals = true, + }, + + { + type = "range", + get = function() return StreamOverlay.db.per_second.update_speed end, + set = function (self, fixedparam, value) StreamOverlay.db.per_second.update_speed = value; + -- update hps dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() + end, + min = 0.016, + max = 1, + step = 0.016, + desc = "How fast the frame get updated.", + name = "Dps/Hps Update Speed", + usedecimals = true, + }, + + { + type = "toggle", + name = "Dps/Hps Text Shadow", + desc = "Enable text shadow.", + order = 1, + get = function() return StreamOverlay.db.per_second.font_shadow end, + set = function (self, val) + StreamOverlay.db.per_second.font_shadow = not StreamOverlay.db.per_second.font_shadow + -- update hps dps frame + StreamOverlay:UpdateDpsHpsFrameConfig() + end, + }, + {type = "space"}, { @@ -1456,7 +1686,7 @@ function StreamOverlay.OpenOptionsPanel() } - fw:BuildMenu (options_frame, options, 15, -100, 400, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + fw:BuildMenu (options_frame, options, 15, -100, 540, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) --select profile dropdown local select_profile = function (_, _, profileName) @@ -1552,6 +1782,8 @@ function StreamOverlay:OnEvent (_, event, ...) local AddonName = select (1, ...) if (AddonName == "Details_Streamer") then + player_name = UnitName ("player") + if (_G._detalhes) then --> create widgets @@ -1581,6 +1813,15 @@ function StreamOverlay:OnEvent (_, event, ...) minimap = {hide = false, radius = 160, minimapPos = 160}, + per_second = { + enabled = false, + size = 32, + scale = 1.5, + font_shadow = true, + attribute_type = 1, + update_speed = 0.05, + }, + is_first_run = true, } diff --git a/plugins/Details_TimeAttack/Details_TimeAttack.lua b/plugins/Details_TimeAttack/Details_TimeAttack.lua index 503c8d8d..41b561b9 100644 --- a/plugins/Details_TimeAttack/Details_TimeAttack.lua +++ b/plugins/Details_TimeAttack/Details_TimeAttack.lua @@ -910,7 +910,8 @@ end function TimeAttack:CheckTimeAttackTutorial() --TimeAttack:SetTutorialCVar ("TIME_ATTACK_TUTORIAL1", nil) if (not TimeAttack:GetTutorialCVar ("TIME_ATTACK_TUTORIAL1")) then - TimeAttackFrame:RegisterEvent ("PLAYER_TARGET_CHANGED") + --tutorial disabled + --TimeAttackFrame:RegisterEvent ("PLAYER_TARGET_CHANGED") end end