diff --git a/boot.lua b/boot.lua index bcfe4e36..1e60acb6 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 = 2470 --it's 2466 for release - _detalhes.userversion = "v4.3.1" + _detalhes.build_counter = 2480 --it's 2480 for release + _detalhes.userversion = "v4.3.2" _detalhes.realversion = 80 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,13 +21,13 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|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.2 (|cFFFFCC00Feb 25, 2016|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added profile option for Details!: Streamer plugin (reopen your game after update the addon).\n\n +|cFFFFFF00-|r Fixed an issue with Streamer plugin where it auto deactive after a reload or logon.\n\n --]] - -- - Loc ["STRING_VERSION_LOG"] = "|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.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done." + Loc ["STRING_VERSION_LOG"] = "|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.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 27449a8d..5844e01c 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -11,7 +11,7 @@ local SOF = StreamOverlay.Frame --> shortcut for details framework local fw = StreamOverlay.gump -StreamOverlay.CurrentVersion = "v1.0" +StreamOverlay.CurrentVersion = "v1.1" --> mantaing the tables for casts, has hash indexes of numbers pointing to tables, tables inside store data of the UNIT_CAST events --> also mantain information about the cast, if is done, interrupted, channeled, instant. @@ -79,6 +79,7 @@ local function CreatePluginFrames() end function StreamOverlay:OnEnablePlugin() + --> show the frame and restore position SOF:Show() local LibWindow = LibStub ("LibWindow-1.1") @@ -149,13 +150,50 @@ local function CreatePluginFrames() GameTooltip:Hide() end) + + + + SOF:SetScript ("OnMouseDown", function (self) + + end) + SOF:SetScript ("OnMouseUp", function (self) + + end) + + + titlebar:SetScript ("OnMouseDown", function (self, button) + if (not SOF.moving and not StreamOverlay.db.main_frame_locked) then + SOF:StartMoving() + SOF.moving = true + SOF.movingAt = GetTime() + end + end) + titlebar:SetScript ("OnMouseUp", function (self, button) + + if (SOF.movingAt) then + if (SOF.moving) then + SOF.moving = false + SOF:StopMovingOrSizing() + local LibWindow = LibStub ("LibWindow-1.1") + LibWindow.SavePosition (SOF) + end + + if (SOF.movingAt+0.200 < GetTime()) then + return + end + SOF.movingAt = nil + end + if (button == "LeftButton") then --open options StreamOverlay.OpenOptionsPanel() elseif (button == "RightButton") then --lock the frame StreamOverlay:SetLocked (not StreamOverlay.db.main_frame_locked) + if (StreamOverlayOptionsPanel) then + StreamOverlayOptionsPanel:RefreshOptions() + end end end) @@ -1108,7 +1146,6 @@ function StreamOverlay:SetLocked (state) end - function StreamOverlay.OpenOptionsPanel() if (not StreamOverlayOptionsPanel) then @@ -1362,7 +1399,88 @@ function StreamOverlay.OpenOptionsPanel() - fw:BuildMenu (options_frame, options, 15, -77, 340, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + 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) + + --select profile dropdown + local select_profile = function (_, _, profileName) + + local pname = UnitName ("player") .. " - " .. GetRealmName() + + --> save the current config on the profile + local current_profile = Details_StreamerDB.characters [pname] + local current_ptable = Details_StreamerDB.profiles [current_profile] + _detalhes.table.overwrite (current_ptable, StreamOverlay.db) --overwrite the profile with the local settings + + --> get the selected profile and overwrite the settings + local ptable = Details_StreamerDB.profiles [profileName] + _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) + + --> set locked and the backdrop color + StreamOverlay:SetLocked (StreamOverlay.db.main_frame_locked) + StreamOverlay:SetBackgroundColor (unpack (StreamOverlay.db.main_frame_color)) + + --> update the minimap icon + if (LDBIcon) then + LDBIcon:Refresh ("DetailsStreamer", StreamOverlay.db.minimap) + end + + --> update all settings + StreamOverlay:RefreshAllBattleLineStyle() + + --> update the options panel + options_frame:RefreshOptions() + end + + local select_profile_fill = function() + local t = {} + for profileName, _ in pairs (Details_StreamerDB.profiles) do + t [#t+1] = {value = profileName, label = profileName, onclick = select_profile} + end + return t + end + + local label_profile = Details.gump:CreateLabel (options_frame, "Profile" .. ": ", Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + local dropdown_profile = Details.gump:CreateDropDown (options_frame, select_profile_fill, _, 160, 20, "dropdown_profile", _, Details.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + dropdown_profile:SetPoint ("left", label_profile, "right", 2, 0) + label_profile:SetPoint ("topleft", options_frame, "topleft", 15, -65) + + local pname = UnitName ("player") .. " - " .. GetRealmName() + dropdown_profile:Select (Details_StreamerDB.characters [pname]) + + --> new profile button + if (not Details_StreamerDB.profiles [pname]) then + local add_profile = function() + --profile name + local pname = UnitName ("player") .. " - " .. GetRealmName() + --default if is first run + Details_StreamerDB.characters [pname] = pname + --load dbtable + Details_StreamerDB.profiles [pname] = {} + _detalhes.table.overwrite (Details_StreamerDB.profiles [pname], StreamOverlay.db) + --StreamOverlay.db = Details_StreamerDB.profiles [pname] --no can't change the local database table + + options_frame.NewProfileButton:Hide() + + --> update all settings + StreamOverlay:RefreshAllBattleLineStyle() + + --> update the options panel + options_frame:RefreshOptions() + dropdown_profile:Select (Details_StreamerDB.characters [pname]) + + end + options_frame.NewProfileButton = Details.gump:CreateButton (options_frame, add_profile, 60, 18, "New Profiile", _, _, _, _, _, _, Details.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"), Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")) + options_frame.NewProfileButton:SetPoint ("left", dropdown_profile, "right", 4, 0) + + end + end StreamOverlayOptionsPanel:Show() @@ -1412,12 +1530,19 @@ function StreamOverlay:OnEvent (_, event, ...) print (install.error) end + Details_StreamerDB = Details_StreamerDB or {characters = {}, profiles = {}} + StreamOverlay:CreateMinimapIcon() StreamOverlay:SetPluginDescription ("Show in real time the spells you are casting.\n\nThe viewer can now follow what you are doing, what spells you are casting, learn your rotation.\n\nAlso tells who is the target and its class/spec on raiding or role if you are in arena.\n\nWhen you die, the panel is filled with your death log.") if (StreamOverlay.db.is_first_run) then - Details:DisablePlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") + if (Details:GetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN")) then + Details:DisablePlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") + StreamOverlay.db.is_first_run = false + else + Details:DisablePlugin ("DETAILS_PLUGIN_STREAM_OVERLAY") + end end if (StreamOverlay.db.is_first_run and not Details:GetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN")) then @@ -1429,7 +1554,7 @@ function StreamOverlay:OnEvent (_, event, ...) end StreamOverlay.ShowWelcomeFrame:Cancel() - + local welcome_window = CreateFrame ("frame", "StreamOverlayWelcomeWindow", UIParent) welcome_window:SetPoint ("center", UIParent, "center") welcome_window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}) @@ -1454,7 +1579,7 @@ function StreamOverlay:OnEvent (_, event, ...) text1:SetPoint ("topleft", welcome_window, "topleft", 10, -120) text2:SetPoint ("topleft", welcome_window, "topleft", 10, -140) - + local close_func = function() StreamOverlay.db.is_first_run = false Details:SetTutorialCVar ("STREAMER_PLUGIN_FIRSTRUN", true) @@ -1466,13 +1591,33 @@ function StreamOverlay:OnEvent (_, event, ...) end StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker (5, show_frame) - + end --wipe (StreamOverlay.db) + SOF:RegisterEvent ("PLAYER_LOGOUT") + + --profile name + local pname = UnitName ("player") .. " - " .. GetRealmName() + --default if is first run + local next_pname = next (Details_StreamerDB.profiles or {}) + Details_StreamerDB.characters [pname] = Details_StreamerDB.characters [pname] or next_pname or pname + + --load dbtable + local ptable = Details_StreamerDB.profiles [ Details_StreamerDB.characters [pname] ] or {} --already existen config set or empty table + _detalhes.table.overwrite (StreamOverlay.db, ptable) --profile overwrite the local settings + _detalhes.table.deploy (ptable, StreamOverlay.db) --local settings deploy stuff which non exist on profile + + Details_StreamerDB.profiles [ Details_StreamerDB.characters [pname] ] = ptable end end + + elseif (event == "PLAYER_LOGOUT") then + + local pname = UnitName ("player") .. " - " .. GetRealmName() + Details_StreamerDB.profiles [ Details_StreamerDB.characters [pname] ] = StreamOverlay.db + end end diff --git a/plugins/Details_Streamer/Details_Streamer.toc b/plugins/Details_Streamer/Details_Streamer.toc index 23820f01..a32759f3 100644 --- a/plugins/Details_Streamer/Details_Streamer.toc +++ b/plugins/Details_Streamer/Details_Streamer.toc @@ -2,6 +2,7 @@ ## Title: Details!: Streamer (plugin) ## Notes: Show which spells you are casting, viewers can see what are you doing and follow your steps. ## RequiredDeps: Details +## SavedVariables: Details_StreamerDB #@no-lib-strip@ embeds.xml