From 742dd3983d7d031a20b2f03d95b1e3d54bbbf75d Mon Sep 17 00:00:00 2001 From: Tercioo Date: Mon, 8 Feb 2016 15:02:06 -0200 Subject: [PATCH] - global profiles got a revamp, now you can select which profile is used on all characters. - you also can overwrite the global profile on any ton by just selecting a profile for that character. --- boot.lua | 10 +- core/windows.lua | 2 +- functions/loaddata.lua | 20 +++- functions/profiles.lua | 2 + gumps/janela_options.lua | 234 +++++++++++++++++++++++++++++---------- gumps/switch.lua | 2 +- 6 files changed, 203 insertions(+), 67 deletions(-) diff --git a/boot.lua b/boot.lua index 8d0156dc..2f9a4a40 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 2221 --it's 2221 for release - _detalhes.userversion = "v4.2.8" - _detalhes.realversion = 79 --core version + _detalhes.userversion = "v4.2.9" + _detalhes.realversion = 80 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -22,6 +22,10 @@ do --[[ |cFFFFFF00v4.2.7 (|cFFFFCC00Jan 25, 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 Warlock's Burning Rush won't be counted when the player is out of combat.\n\n |cFFFFFF00-|r Bookmark now supports Plugins.\n\n @@ -36,7 +40,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.2.8 (|cFFFFCC00Feb 6, 2016|r|cFFFFFF00)|r:\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.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.2.9 (|cFFFFCC00Feb 8, 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.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/core/windows.lua b/core/windows.lua index 3908b8be..db89dcca 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -2700,7 +2700,7 @@ return elseif (_detalhes.is_first_run) then return - elseif (_detalhes.always_use_profile and type (_detalhes.always_use_profile) == "string") then + elseif (_detalhes.always_use_profile) then -- and type (_detalhes.always_use_profile) == "string" return else --> check is this is the first run of the addon (after being installed) diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 9c9cd51b..d9d0373e 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -320,10 +320,26 @@ function _detalhes:LoadConfig() --> profile + local unitname = UnitName ("player") + + --> fix for old versions + if (type (_detalhes.always_use_profile) == "string") then + _detalhes.always_use_profile_name = _detalhes.always_use_profile + _detalhes.always_use_profile = true + end + --> check for "always use this profile" - if (_detalhes.always_use_profile and type (_detalhes.always_use_profile) == "string") then - _detalhes_database.active_profile = _detalhes.always_use_profile + if (_detalhes.always_use_profile and not _detalhes.always_use_profile_exception [unitname]) then + local profile_name = _detalhes.always_use_profile_name + if (profile_name and _detalhes:GetProfile (profile_name)) then + _detalhes_database.active_profile = profile_name + end end + + --> old version + -- if (_detalhes.always_use_profile and type (_detalhes.always_use_profile) == "string") then + -- _detalhes_database.active_profile = _detalhes.always_use_profile + -- end --> character first run if (_detalhes_database.active_profile == "") then diff --git a/functions/profiles.lua b/functions/profiles.lua index 9c5c1fe5..9fd95eb6 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1111,6 +1111,8 @@ local default_global_data = { --> profile pool __profiles = {}, always_use_profile = false, + always_use_profile_name = "", + always_use_profile_exception = {}, custom = {}, savedStyles = {}, savedCustomSpells = {}, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 29bdde48..c0f8a866 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -3848,24 +3848,6 @@ function window:CreateFrame1() window:CreateLineBackground2 (frame1, "realmNameSlider", "realmNameLabel", Loc ["STRING_OPTIONS_REALMNAME_DESC"]) - --> Max Segments - - local titulo_display = g:NewLabel (frame1, _, "$parentTituloDisplay", "tituloDisplayLabel", Loc ["STRING_OPTIONSMENU_DISPLAY"], "GameFontNormal", 16) --> localize-me - local titulo_display_desc = g:NewLabel (frame1, _, "$parentTituloDisplay2", "tituloDisplay2Label", Loc ["STRING_OPTIONSMENU_DISPLAY_DESC"], "GameFontNormal", 10, "white") --> localize-me - titulo_display_desc.width = 320 - - g:NewLabel (frame1, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS"], "GameFontHighlightLeft") - local s = g:NewSlider (frame1, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount, nil, nil, nil, options_slider_template) - --config_slider (s) - - frame1.segmentsSlider:SetPoint ("left", frame1.segmentsLabel, "right", 2, -1) - frame1.segmentsSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue - _detalhes.segments_amount = math.floor (amount) - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end) - - window:CreateLineBackground2 (frame1, "segmentsSlider", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS_DESC"]) - --> Segments Locked g:NewLabel (frame1, _, "$parentSegmentsLockedLabel", "SegmentsLockedLabel", Loc ["STRING_OPTIONS_LOCKSEGMENTS"], "GameFontHighlightLeft") @@ -4143,8 +4125,39 @@ function window:CreateFrame1() frame1.ClassColorsButton:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {430/512, 459/512, 4/512, 30/512}, nil, nil, 2) -- , "orange" frame1.ClassColorsButton:SetTextColor (button_color_rgb) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + --> Time Type + g:NewLabel (frame1, _, "$parentTimeTypeLabel", "timetypeLabel", Loc ["STRING_OPTIONS_TIMEMEASURE"], "GameFontHighlightLeft") + -- + local onSelectTimeType = function (_, _, timetype) + _detalhes.time_type = timetype + _detalhes.time_type_original = timetype + _detalhes:AtualizaGumpPrincipal (-1, true) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + local timetypeOptions = { + --localize-me + {value = 1, label = "Activity Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_Daily_08", iconcolor = {1, .9, .9}, texcoord = {0.078125, 0.921875, 0.078125, 0.921875}}, --, desc = "" + {value = 2, label = "Effective Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_08"} --, desc = "" + } + local buildTimeTypeMenu = function() + return timetypeOptions + end + local d = g:NewDropDown (frame1, _, "$parentTTDropdown", "timetypeDropdown", 160, dropdown_height, buildTimeTypeMenu, nil, options_dropdown_template) + + frame1.timetypeDropdown:SetPoint ("left", frame1.timetypeLabel, "right", 2, 0) + + window:CreateLineBackground2 (frame1, "timetypeDropdown", "timetypeLabel", Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"]) + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + --> anchors + local titulo_display = g:NewLabel (frame1, _, "$parentTituloDisplay", "tituloDisplayLabel", Loc ["STRING_OPTIONSMENU_DISPLAY"], "GameFontNormal", 16) --> localize-me + local titulo_display_desc = g:NewLabel (frame1, _, "$parentTituloDisplay2", "tituloDisplay2Label", Loc ["STRING_OPTIONSMENU_DISPLAY_DESC"], "GameFontNormal", 10, "white") --> localize-me + titulo_display_desc.width = 320 + g:NewLabel (frame1, _, "$parentGeneralAnchor", "GeneralAnchorLabel", Loc ["STRING_OPTIONS_GENERAL_ANCHOR"], "GameFontNormal") g:NewLabel (frame1, _, "$parentIdentityAnchor", "GeneralIdentityLabel", Loc ["STRING_OPTIONS_AVATAR_ANCHOR"], "GameFontNormal") @@ -4152,7 +4165,7 @@ function window:CreateFrame1() g:NewLabel (frame1, _, "$parentToolsAnchor", "ToolsLabel", Loc ["STRING_OPTIONS_TOOLS_ANCHOR"], "GameFontNormal") local w_start = 10 - + titulo_display:SetPoint (window.left_start_at, window.title_y_pos) titulo_display_desc:SetPoint (window.left_start_at, window.title_y_pos2) @@ -4175,6 +4188,8 @@ function window:CreateFrame1() --frame1.BookmarkButton:SetPoint (avatar_x_anchor, -315) --frame1.ClassColorsButton:SetPoint (avatar_x_anchor, -340) + + local x = avatar_x_anchor local right_side = { @@ -4195,8 +4210,8 @@ function window:CreateFrame1() {"WheelSpeedLabel", 4}, - {"SegmentsLockedLabel", 5, true}, - {"segmentsLabel", 6}, + {"SegmentsLockedLabel", 5}, + {"timetypeLabel", 6, true}, {"maxInstancesLabel", 7, true}, {"dpsAbbreviateLabel", 8}, @@ -4221,7 +4236,7 @@ function window:CreateFrame1() end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- General Settings - Combat ~2 +-- General Settings - Combat PvP PvE ~2 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function window:CreateFrame2() @@ -4247,30 +4262,7 @@ function window:CreateFrame2() end window:CreateLineBackground2 (frame2, "fragsPvpSlider", "fragsPvpLabel", Loc ["STRING_OPTIONS_PVPFRAGS_DESC"]) - - --> Time Type - g:NewLabel (frame2, _, "$parentTimeTypeLabel", "timetypeLabel", Loc ["STRING_OPTIONS_TIMEMEASURE"], "GameFontHighlightLeft") - -- - local onSelectTimeType = function (_, _, timetype) - _detalhes.time_type = timetype - _detalhes.time_type_original = timetype - _detalhes:AtualizaGumpPrincipal (-1, true) - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - local timetypeOptions = { - --localize-me - {value = 1, label = "Activity Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_Daily_08", iconcolor = {1, .9, .9}, texcoord = {0.078125, 0.921875, 0.078125, 0.921875}}, --, desc = "" - {value = 2, label = "Effective Time", onclick = onSelectTimeType, icon = "Interface\\Icons\\Achievement_Quests_Completed_08"} --, desc = "" - } - local buildTimeTypeMenu = function() - return timetypeOptions - end - local d = g:NewDropDown (frame2, _, "$parentTTDropdown", "timetypeDropdown", 160, dropdown_height, buildTimeTypeMenu, nil, options_dropdown_template) - - frame2.timetypeDropdown:SetPoint ("left", frame2.timetypeLabel, "right", 2, 0) - window:CreateLineBackground2 (frame2, "timetypeDropdown", "timetypeLabel", Loc ["STRING_OPTIONS_TIMEMEASURE_DESC"]) - --> death log limit g:NewLabel (frame2, _, "$parentDeathLogLimitLabel", "DeathLogLimitLabel", Loc ["STRING_OPTIONS_DEATHLIMIT"], "GameFontHighlightLeft") -- @@ -4503,7 +4495,7 @@ function window:CreateFrame2() {"GeneralAnchorLabel", 1, true}, {"fragsPvpLabel", 2}, --{"EraseChartDataLabel", 3}, - {"timetypeLabel", 4, true}, + --{"timetypeLabel", 4, true}, {"DeathLogLimitLabel", 5, }, {"DamageTakenEverythingLabel", 6, true}, @@ -4557,8 +4549,35 @@ function window:CreateFrame13() window:CreateLineBackground2 (frame13, info_holder_frame, current_profile_label.widget, Loc ["STRING_OPTIONS_PROFILES_CURRENT_DESC"]) + --> exclamation warning about an exception on this character for use profile on all characters + local exclamation_frame = CreateFrame ("frame", nil, frame13) + exclamation_frame:SetSize (16, 16) + local exclamation_frame_texture = exclamation_frame:CreateTexture (nil, "overlay") + exclamation_frame_texture:SetTexture ([[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) + exclamation_frame_texture:SetAllPoints() + exclamation_frame:SetScript ("OnEnter", function (self) + --show tooltip + _detalhes:CooltipPreset (2) + GameCooltip:AddLine (Loc ["STRING_OPTIONS_PROFILE_OVERWRITTEN"]) + GameCooltip:ShowCooltip (self, "tooltip") + end) + exclamation_frame:SetScript ("OnLeave", function() + --hide tooltip + GameCooltip:Hide() + end) + exclamation_frame:Hide() + exclamation_frame:SetFrameLevel (30) + --> select profile local profile_selected = function (_, instance, profile_name) + + if (_detalhes.always_use_profile) then + local unitname = UnitName ("player") + _detalhes.always_use_profile_exception [unitname] = true + --show a exclamation on the always use this profile + exclamation_frame:Show() + end + _detalhes:ApplyProfile (profile_name) _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], profile_name) _detalhes:OpenOptionsWindow (_G.DetailsOptionsWindow.instance) @@ -4577,27 +4596,99 @@ function window:CreateFrame13() local select_profile_label = g:NewLabel (frame13, _, "$parentSelectProfileLabel", "selectProfileLabel", Loc ["STRING_OPTIONS_PROFILES_SELECT"], "GameFontHighlightLeft") select_profile_dropdown:SetPoint ("left", select_profile_label, "right", 2, 0) - - window:CreateLineBackground2 (frame13, select_profile_dropdown, select_profile_label, Loc ["STRING_OPTIONS_PROFILES_SELECT_DESC"]) - - --> always use this profile - g:NewLabel (frame13, _, "$parentAlwaysUseLabel", "AlwaysUseLabel", Loc ["STRING_OPTIONS_ALWAYS_USE"], "GameFontHighlightLeft") + window:CreateLineBackground2 (frame13, select_profile_dropdown, select_profile_label, Loc ["STRING_OPTIONS_PROFILES_SELECT_DESC"]) + + --> always use this profile dropdown + local profile_selected_alwaysuse = function (_, instance, profile_name) + + --if (not _detalhes.always_use_profile or not profile_name) then + -- return + --end + + _detalhes.always_use_profile_name = profile_name + local unitname = UnitName ("player") + _detalhes.always_use_profile_exception [unitname] = nil + + _detalhes:ApplyProfile (profile_name) + + _detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], profile_name) + _detalhes:OpenOptionsWindow (_G.DetailsOptionsWindow.instance) + end + local build_profile_menu = function() + local menu = {} + for index, profile_name in ipairs (_detalhes:GetProfileList()) do + menu [#menu+1] = {value = profile_name, label = profile_name, onclick = profile_selected_alwaysuse, icon = "Interface\\MINIMAP\\Vehicle-HammerGold-3"} + end + return menu + end + + local select_alwaysuseprofile_dropdown = g:NewDropDown (frame13, _, "$parentSelectAlwaysuseprofileDropdown", "SelectAlwaysuseprofileDropdown", 160, dropdown_height, build_profile_menu, _detalhes.always_use_profile_name, options_dropdown_template) + select_alwaysuseprofile_dropdown:SetEmptyTextAndIcon ("Select Profile") + + local select_alwaysuseprofile_label = g:NewLabel (frame13, _, "$parentSelectAlwaysuseprofileLabel", "SelectAlwaysuseprofileLabel", "Select Profile", "GameFontHighlightLeft") + select_alwaysuseprofile_dropdown:SetPoint ("left", select_alwaysuseprofile_label, "right", 2, 0) + + window:CreateLineBackground2 (frame13, select_alwaysuseprofile_dropdown, select_alwaysuseprofile_label, Loc ["STRING_OPTIONS_PROFILE_GLOBAL"]) + + + --> always use this profile checkbox + g:NewLabel (frame13, _, "$parentAlwaysUseLabel", "AlwaysUseLabel", Loc ["STRING_OPTIONS_ALWAYS_USE"], "GameFontHighlightLeft") g:NewSwitch (frame13, _, "$parentAlwaysUseSlider", "AlwaysUseSlider", 60, 20, _, _, _detalhes.always_use_profile, nil, nil, nil, nil, options_switch_template) + --set the point of the exclamation image + exclamation_frame:SetPoint ("left", frame13.AlwaysUseSlider.widget, "right", 2, 0) + frame13.AlwaysUseSlider:SetPoint ("left", frame13.AlwaysUseLabel, "right", 2, -1) frame13.AlwaysUseSlider:SetAsCheckBox() frame13.AlwaysUseSlider.OnSwitch = function (self, _, value) if (value) then - _detalhes.always_use_profile = select_profile_dropdown:GetValue() + _detalhes.always_use_profile = true + _detalhes.always_use_profile_name = select_profile_dropdown:GetValue() + + --enable the dropdown + frame13.SelectAlwaysuseprofileDropdown:Enable() + + --set the dropdown value to the current profile selected + frame13.SelectAlwaysuseprofileDropdown:Select (_detalhes.always_use_profile_name) + + --remove this character from the exception list + local unitname = UnitName ("player") + _detalhes.always_use_profile_exception [unitname] = nil + exclamation_frame:Hide() else _detalhes.always_use_profile = false + --disable the dropdown + frame13.SelectAlwaysuseprofileDropdown:Disable() + + --remove this character from the exception list + local unitname = UnitName ("player") + _detalhes.always_use_profile_exception [unitname] = nil + exclamation_frame:Hide() end end frame13.AlwaysUseSlider:SetPoint ("left", frame13.AlwaysUseLabel, "right", 3, 0) window:CreateLineBackground2 (frame13, "AlwaysUseSlider", "AlwaysUseLabel", Loc ["STRING_OPTIONS_ALWAYS_USE_DESC"]) - - + + function frame13:update_profile_settings() + if (_detalhes.always_use_profile) then + frame13.SelectAlwaysuseprofileDropdown:Enable() + frame13.SelectAlwaysuseprofileDropdown:Select (_detalhes.always_use_profile_name) + + local unitname = UnitName ("player") + if (_detalhes.always_use_profile_exception [unitname]) then + exclamation_frame:Show() + else + exclamation_frame:Hide() + end + else + exclamation_frame:Hide() + frame13.SelectAlwaysuseprofileDropdown:Disable() + end + end + + + --> new profile local profile_name = g:NewTextEntry (frame13, _, "$parentProfileNameEntry", "profileNameEntry", 120, TEXTENTRY_HEIGHT, nil, nil, nil, nil, nil, options_dropdown_template) local profile_name_label = g:NewLabel (frame13, _, "$parentProfileNameLabel", "profileNameLabel", Loc ["STRING_OPTIONS_PROFILES_CREATE"], "GameFontHighlightLeft") @@ -4746,9 +4837,12 @@ function window:CreateFrame13() local left_side = { {"ProfileAnchorLabel", 1, true}, {current_profile_label, 2}, - {select_profile_label, 3, true}, - {"AlwaysUseLabel", 4}, - {"PosAndSizeLabel", 5}, + {select_profile_label, 3}, + + {"AlwaysUseLabel", 4, true}, + {select_alwaysuseprofile_label, 4}, + + {"PosAndSizeLabel", 5, true}, {profile_name_label, 6, true}, {select_profileCopy_label, 7}, {select_profileErase_label, 8}, @@ -9703,6 +9797,21 @@ function window:CreateFrame10() end window:CreateLineBackground2 (frame10, "EraseChartDataSlider", "EraseChartDataLabel", Loc ["STRING_OPTIONS_ERASECHARTDATA_DESC"]) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + --> Max Segments + + g:NewLabel (frame10, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS"], "GameFontHighlightLeft") + local s = g:NewSlider (frame10, _, "$parentSlider", "segmentsSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 1, 25, 1, _detalhes.segments_amount, nil, nil, nil, options_slider_template) + + frame10.segmentsSlider:SetPoint ("left", frame10.segmentsLabel, "right", 2, -1) + frame10.segmentsSlider:SetHook ("OnValueChange", function (self, _, amount) --> slider, fixedValue, sliderValue + _detalhes.segments_amount = math.floor (amount) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end) + + window:CreateLineBackground2 (frame10, "segmentsSlider", "segmentsLabel", Loc ["STRING_OPTIONS_MAXSEGMENTS_DESC"]) + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --> Anchors @@ -9736,6 +9845,7 @@ function window:CreateFrame10() local right_side = { {"PerformanceAnchorLabel", 1, true}, --{"memoryLabel", 1, true}, + {"segmentsLabel", 6}, {"segmentsSaveLabel", 2}, {"panicModeLabel", 3}, {"eraseTrashLabel", 4}, @@ -10660,7 +10770,6 @@ end --> if not window --> window 1 _G.DetailsOptionsWindow1RealmNameSlider.MyObject:SetValue (_detalhes.remove_realm_from_name) - _G.DetailsOptionsWindow1Slider.MyObject:SetValue (_detalhes.segments_amount) --segments _G.DetailsOptionsWindow1SegmentsLockedSlider.MyObject:SetValue (_detalhes.instances_segments_locked) --locked segments _G.DetailsOptionsWindow1NumericalSystemOfADropdown.MyObject:Select (_detalhes.numerical_system) @@ -10706,7 +10815,7 @@ end --> if not window --> window 2 _G.DetailsOptionsWindow2FragsPvpSlider.MyObject:SetValue (_detalhes.only_pvp_frags) - _G.DetailsOptionsWindow2TTDropdown.MyObject:Select (_detalhes.time_type) + _G.DetailsOptionsWindow1TTDropdown.MyObject:Select (_detalhes.time_type) _G.DetailsOptionsWindow2DeathLogLimitDropdown.MyObject:Select (_detalhes.deadlog_events) _G.DetailsOptionsWindow2OverallDataRaidBossSlider.MyObject:SetValue (bit.band (_detalhes.overall_flag, 0x1) ~= 0) @@ -10980,6 +11089,9 @@ end --> if not window _G.DetailsOptionsWindow10CloudAuraSlider.MyObject:SetValue (_detalhes.cloud_capture) --erase charts _G.DetailsOptionsWindow10EraseChartDataSlider.MyObject:SetValue (_detalhes.clear_graphic) + --segments amount + _G.DetailsOptionsWindow10Slider.MyObject:SetValue (_detalhes.segments_amount) --segments + --> window 11 @@ -10996,6 +11108,8 @@ end --> if not window _G.DetailsOptionsWindow13PosAndSizeSlider.MyObject:SetValue (_detalhes.profile_save_pos) --_G.DetailsOptionsWindow13AlwaysUseSlider.MyObject:SetValue (_detalhes.always_use_profile) + + _G.DetailsOptionsWindow13:update_profile_settings() --> window 14 @@ -11293,7 +11407,7 @@ end --> if not window _G.DetailsOptionsWindow5FixedTextColor.MyObject:SetColor (unpack (editing_instance.row_info.fixed_text_color)) _G.DetailsOptionsWindow1NicknameEntry.MyObject.text = _detalhes:GetNickname (UnitGUID ("player"), UnitName ("player"), true) or "" - _G.DetailsOptionsWindow2TTDropdown.MyObject:Select (_detalhes.time_type, true) + _G.DetailsOptionsWindow1TTDropdown.MyObject:Select (_detalhes.time_type, true) _G.DetailsOptionsWindow.MyObject.instance = instance diff --git a/gumps/switch.lua b/gumps/switch.lua index ca150e7d..5a0f550d 100644 --- a/gumps/switch.lua +++ b/gumps/switch.lua @@ -960,7 +960,7 @@ function _detalhes.switch:Config (_, _, atributo, sub_atributo) end _detalhes.switch.editing_bookmark = nil - + GameCooltip:Hide() _detalhes.switch:Update() end