diff --git a/boot.lua b/boot.lua index e3deb74f..942ff724 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 = 2483 --it's 2483 for release - _detalhes.userversion = "v4.3.3" + _detalhes.build_counter = 2485 --it's 2485 for release + _detalhes.userversion = "v4.3.4" _detalhes.realversion = 80 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,12 +21,13 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|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.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 --]] -- - Loc ["STRING_VERSION_LOG"] = "|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.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars." + Loc ["STRING_VERSION_LOG"] = "|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.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 5844e01c..2ce0da4d 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -2,10 +2,11 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0") local LDB = LibStub ("LibDataBroker-1.1", true) local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) +local LibWindow = LibStub ("LibWindow-1.1") --> create the plugin object local StreamOverlay = _detalhes:NewPluginObject ("Details_StreamOverlay", DETAILSPLUGIN_ALWAYSENABLED) -tinsert (UISpecialFrames, "Details_StreamOverlays") +--tinsert (UISpecialFrames, "Details_StreamOverlays") --> main frame (shortcut) local SOF = StreamOverlay.Frame --> shortcut for details framework @@ -82,10 +83,9 @@ local function CreatePluginFrames() --> show the frame and restore position SOF:Show() - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (SOF, StreamOverlay.db) - LibWindow.RestorePosition (SOF) - LibWindow.SavePosition (SOF) + + --> restore size and location + StreamOverlay:RestoreWindowSizeAndLocation() --> refresh the frame StreamOverlay:Refresh() @@ -123,10 +123,8 @@ local function CreatePluginFrames() LDBIcon:Refresh ("DetailsStreamer", StreamOverlay.db.minimap) StreamOverlay.db.minimap.hide = realstate - --> save position and hide the frame - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (SOF, StreamOverlay.db) - LibWindow.SavePosition (SOF) + --> save position, size and hide the frame + StreamOverlay:SaveWindowSizeAnLocation() SOF:Hide() end @@ -150,9 +148,6 @@ local function CreatePluginFrames() GameTooltip:Hide() end) - - - SOF:SetScript ("OnMouseDown", function (self) end) @@ -160,7 +155,6 @@ local function CreatePluginFrames() end) - titlebar:SetScript ("OnMouseDown", function (self, button) if (not SOF.moving and not StreamOverlay.db.main_frame_locked) then SOF:StartMoving() @@ -175,8 +169,7 @@ local function CreatePluginFrames() if (SOF.moving) then SOF.moving = false SOF:StopMovingOrSizing() - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.SavePosition (SOF) + StreamOverlay:SaveWindowSizeAnLocation() end if (SOF.movingAt+0.200 < GetTime()) then @@ -207,6 +200,25 @@ local function CreatePluginFrames() SOF:SetClampedToScreen (true) SOF:SetMinResize (150, 40) SOF:SetMaxResize (800, 1024) + + function StreamOverlay:SaveWindowSizeAnLocation() + --> save size first + StreamOverlay.db.main_frame_size [1] = SOF:GetWidth() + StreamOverlay.db.main_frame_size [2] = SOF:GetHeight() + --> save position + LibWindow.RegisterConfig (SOF, StreamOverlay.db) + LibWindow.SavePosition (SOF) + end + function StreamOverlay:RestoreWindowSizeAndLocation() + --> restore the size first + SOF:SetSize (unpack (StreamOverlay.db.main_frame_size)) + --> set the window location + LibWindow.RegisterConfig (SOF, StreamOverlay.db) + LibWindow.RestorePosition (SOF) + LibWindow.SavePosition (SOF) + --> set the frame strata + SOF:SetFrameStrata (StreamOverlay.db.main_frame_strata) + end --> two resizers local left_resize = CreateFrame ("button", "DetailsStreamerLeftResizer", SOF) @@ -236,8 +248,8 @@ local function CreatePluginFrames() SOF.resizing = false SOF:StopMovingOrSizing() StreamOverlay:Refresh() - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.SavePosition (SOF) + + StreamOverlay:SaveWindowSizeAnLocation() end end) right_resize:SetScript ("OnMouseDown", function (self) @@ -251,8 +263,8 @@ local function CreatePluginFrames() SOF.resizing = false SOF:StopMovingOrSizing() StreamOverlay:Refresh() - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.SavePosition (SOF) + + StreamOverlay:SaveWindowSizeAnLocation() end end) @@ -270,8 +282,8 @@ local function CreatePluginFrames() if (SOF.moving) then SOF.moving = false SOF:StopMovingOrSizing() - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.SavePosition (SOF) + + StreamOverlay:SaveWindowSizeAnLocation() end end) @@ -1162,7 +1174,7 @@ 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 (340) + options_frame:SetHeight (360) -- select texture local set_row_texture = function (_, _, value) @@ -1225,6 +1237,18 @@ function StreamOverlay.OpenOptionsPanel() arrowIconTable[#arrowIconTable+1] = {value = arrow, label = arrow:gsub ("Interface(.*)\\", ""), onclick = set_arrow_texture, icon = arrow} end -- + local set_window_strata = function (_, _, strata) + StreamOverlay.db.main_frame_strata = strata + SOF: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}, + {value = "LOW", label = "Low", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Green]] , texcoord = nil}, + {value = "MEDIUM", label = "Medium", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Yellow]] , texcoord = nil}, + {value = "HIGH", label = "High", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Yellow]] , iconcolor = {1, .7, 0, 1}, texcoord = nil}, + {value = "DIALOG", label = "Dialog", onclick = set_window_strata, icon = [[Interface\Buttons\UI-MicroStream-Red]] , iconcolor = {1, 0, 0, 1}, texcoord = nil}, + } + -- local options = { { @@ -1395,11 +1419,43 @@ function StreamOverlay.OpenOptionsPanel() desc = "Adjust the arrow positioning on Y axis.", name = "Arrow Anchor Y", }, + + {type = "space"}, + + { + type = "range", + get = function() return StreamOverlay.db.main_frame_size[1] end, + set = function (self, fixedparam, value) StreamOverlay.db.main_frame_size[1] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, + min = 150, + max = 800, + step = 1, + desc = "Adjust the window width.", + name = "Window Width", + }, + + { + type = "range", + get = function() return StreamOverlay.db.main_frame_size[2] end, + set = function (self, fixedparam, value) StreamOverlay.db.main_frame_size[2] = value; StreamOverlay:RestoreWindowSizeAndLocation() end, + min = 40, + max = 1024, + step = 1, + desc = "Adjust the window height.", + name = "Window Height", + }, + + { + type = "select", + get = function() return StreamOverlay.db.main_frame_strata end, + values = function() return strataTable end, + desc = "How high the frame is placed in your interface, high values makes it be shown above backpack, talents frame, etc.", + name = "Window Strata" + }, + + } - - - fw:BuildMenu (options_frame, options, 15, -100, 380, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + 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) --select profile dropdown local select_profile = function (_, _, profileName) @@ -1413,14 +1469,14 @@ function StreamOverlay.OpenOptionsPanel() --> get the selected profile and overwrite the settings local ptable = Details_StreamerDB.profiles [profileName] + + _detalhes.table.deploy (ptable, StreamOverlay.DefaultConfigTable) --update with any new config from the default table _detalhes.table.overwrite (StreamOverlay.db, ptable) --overwrite the local settings with the profile settings + Details_StreamerDB.characters [pname] = profileName - --> set the window location - local LibWindow = LibStub ("LibWindow-1.1") - LibWindow.RegisterConfig (SOF, StreamOverlay.db) - LibWindow.RestorePosition (SOF) - LibWindow.SavePosition (SOF) + --> restore size and location + StreamOverlay:RestoreWindowSizeAndLocation() --> set locked and the backdrop color StreamOverlay:SetLocked (StreamOverlay.db.main_frame_locked) @@ -1464,6 +1520,7 @@ function StreamOverlay.OpenOptionsPanel() --load dbtable Details_StreamerDB.profiles [pname] = {} _detalhes.table.overwrite (Details_StreamerDB.profiles [pname], StreamOverlay.db) + _detalhes.table.deploy (Details_StreamerDB.profiles [pname], StreamOverlay.DefaultConfigTable) --update with any new config from the default table --StreamOverlay.db = Details_StreamerDB.profiles [pname] --no can't change the local database table options_frame.NewProfileButton:Hide() @@ -1505,6 +1562,8 @@ function StreamOverlay:OnEvent (_, event, ...) local default_options_table = { main_frame_locked = false, main_frame_color = {0, 0, 0, .2}, + main_frame_size = {250, 230}, + main_frame_strata = "LOW", row_height = 20, row_spacement = 21, row_texture = "Details Serenity", @@ -1524,6 +1583,8 @@ function StreamOverlay:OnEvent (_, event, ...) is_first_run = true, } + StreamOverlay.DefaultConfigTable = default_options_table + --> Install local install, saveddata = _G._detalhes:InstallPlugin ("TOOLBAR", "Streamer", [[Interface\MINIMAP\MOVIERECORDINGICON]], StreamOverlay, "DETAILS_PLUGIN_STREAM_OVERLAY", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", StreamOverlay.CurrentVersion, default_options_table) if (type (install) == "table" and install.error) then