diff --git a/boot.lua b/boot.lua index 983d2ccb..951d5fbb 100644 --- a/boot.lua +++ b/boot.lua @@ -3,9 +3,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 125 --it's 143 for release - _detalhes.userversion = "a2.1.4" - _detalhes.realversion = 34 + _detalhes.build_counter = 146 --it's 146 for release + _detalhes.userversion = "v2.1.5" + _detalhes.realversion = 35 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26,13 +26,10 @@ do |cFFFFFF00-|r Removed window button and added a new option for manage window under Mode Menu.\n\n |cFFFFFF00-|r Few changes on 'Default Skin' and 'ElvUI Frame Style BW'.\n\n |cFFFFFF00Important:|r If the menus is out of the position, just reaply the skin.\n\n - - - - +|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v2.1.4 (|cFFFFCC00Oct 20, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply).\n\n|cFFFFFF00- Important:|r If the menus is out of the position, just reaply the skin.\n\nv2.0.15 (|cFFFFCC00Oct 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltips where sometimes it wans't showing at all.\n\n|cFFFFFF00-|r Fixed the healing done amount on Malkorok encounter.\n\nv2.0.14 (|cFFFFCC00Oct 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added pre-potion recognition for WoD pots.\n\n|cFFFFFF00-|r Added spell list for Blackrock Foundry encounters.\n\n|cFFFFFF00-|r Added mouse wheel scroll speed option.\n\n|cFFFFFF00-|r Added support for healing multistrike and damage multistrike.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r When the windows is locked, trying to move the window through toolbar will stretch it instead.\n\n|cFFFFFF00-|r Renamed overheal for shields, now its called 'shield wasted'.\n\n|cFFFFFF00-|r Fine tuning on healing done, should have high accuracy now.\n\n|cFFFFFF00-|r Encounter Details plugin now supports Highmaul and Blackrock Foundry.\n\n|cFFFFFF00-|r New class cooldowns and spells recognition.\n\n|cFFFFFF00-|r Fixed few bugs on comparison panel and avoidance panel.\n\n|cFFFFFF00-|r Fixed encounter recognition, now it should show the encounter name over segments menu.\n\n|cFFFFFF00-|r Fixed Graphic part of Encounter Details Plugin, now he draws more accurately.\n\n|cFFFFFF00v1.29.3 (|cFFFFCC00Oct 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an addon crash bug when clicking directly on the sword button.\n\n|cFFFFFF00-|r Removed Flat Skin, added new skin: Serenity.\n\n|cFFFFFF00-|r Fixed many issues with bar animations.\n\n|cFFFFFF00-|r Fixed combat encounter start if the player already is in combat when the boss is pulled.\n\n|cFFFFFF00-|r Fixed wheel scroll when sometimes it move very slow or doesn't move the bars at all.\n\n|cFFFFFF00-|r Added option 'Always Show Me' which when enabled and you aren't at the top ranked players shown in the window, it forces to show you in the last bar.\n\n|cFFFFFF00-|r Added option 'First Hit' which when enabled show who did the first struck in the combat (normally is who pulled the boss).\n\n|cFFFFFF00-|r Added a panel to change class colors.\n\n|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|cFFFFFF00v1.25.1 (|cFFFFCC00Set 09, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to edit the total and percentage code for custom displays.\n\n|cFFFFFF00-|r Fixed a problem while report custom displays.\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v2.1.5 (|cFFFFCC00Oct 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added micro displays options on Window Settings bracket.\n\n|cFFFFFF00-|r Fixed the problem with bar's custom texts.\n\n|cFFFFFF00-|r Lua functions inside custom texts, Chart Data scripts and Custom Displays scripts are now protected calls and won't break the addon functionality if an error occurs. Unfortunately we still doesn't have a documentation for Details! API.\n\n|cFFFFFF00-|r Fixed an incomum bug with tank avoidance tables.\n\n|cFFFFFF00-|r Tiny Threat: added option to use class colors instead of green-to-red colors.\n\n|cFFFFFF00-|r Added option to enable shadows on toolbar's buttons.\n\n|cFFFFFF00-|r Added option to set the specing between each button on toolbar.\n\n|cFFFFFF00-|r Finally we merged the left and right menus into only one with 6 icons.\n\n|cFFFFFF00-|r Removed window button and added a new option bracket to manage windows under Mode Menu.\n\n|cFFFFFF00-|r Few changes on 'Default Skin', 'Minimalistic', 'Simple Gray' and 'ElvUI Frame Style BW' (need reaply).\n\n|cFFFFFF00- Important:|r If the menus is out of the position, just reaply the skin.\n\nv2.0.15 (|cFFFFCC00Oct 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltips where sometimes it wans't showing at all.\n\n|cFFFFFF00-|r Fixed the healing done amount on Malkorok encounter.\n\nv2.0.14 (|cFFFFCC00Oct 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added pre-potion recognition for WoD pots.\n\n|cFFFFFF00-|r Added spell list for Blackrock Foundry encounters.\n\n|cFFFFFF00-|r Added mouse wheel scroll speed option.\n\n|cFFFFFF00-|r Added support for healing multistrike and damage multistrike.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r When the windows is locked, trying to move the window through toolbar will stretch it instead.\n\n|cFFFFFF00-|r Renamed overheal for shields, now its called 'shield wasted'.\n\n|cFFFFFF00-|r Fine tuning on healing done, should have high accuracy now.\n\n|cFFFFFF00-|r Encounter Details plugin now supports Highmaul and Blackrock Foundry.\n\n|cFFFFFF00-|r New class cooldowns and spells recognition.\n\n|cFFFFFF00-|r Fixed few bugs on comparison panel and avoidance panel.\n\n|cFFFFFF00-|r Fixed encounter recognition, now it should show the encounter name over segments menu.\n\n|cFFFFFF00-|r Fixed Graphic part of Encounter Details Plugin, now he draws more accurately.\n\n|cFFFFFF00v1.29.3 (|cFFFFCC00Oct 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an addon crash bug when clicking directly on the sword button.\n\n|cFFFFFF00-|r Removed Flat Skin, added new skin: Serenity.\n\n|cFFFFFF00-|r Fixed many issues with bar animations.\n\n|cFFFFFF00-|r Fixed combat encounter start if the player already is in combat when the boss is pulled.\n\n|cFFFFFF00-|r Fixed wheel scroll when sometimes it move very slow or doesn't move the bars at all.\n\n|cFFFFFF00-|r Added option 'Always Show Me' which when enabled and you aren't at the top ranked players shown in the window, it forces to show you in the last bar.\n\n|cFFFFFF00-|r Added option 'First Hit' which when enabled show who did the first struck in the combat (normally is who pulled the boss).\n\n|cFFFFFF00-|r Added a panel to change class colors.\n\n|cFFFFFF00v1.28.3 (|cFFFFCC00Oct 04, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for plugin descriptions on options panel.\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|cFFFFFF00v1.25.1 (|cFFFFCC00Set 09, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to edit the total and percentage code for custom displays.\n\n|cFFFFFF00-|r Fixed a problem while report custom displays.\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index 76791ae1..2306a803 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -89,7 +89,17 @@ _detalhes.instance_defaults = { --auto hide menu buttons auto_hide_menu = {left = false, right = false}, --attribute text - attribute_text = {enabled = false, anchor = {5, 1}, text_face = "Friz Quadrata TT", text_size = 12, text_color = {1, 1, 1, 1}, side = 1, shadow = false}, + attribute_text = { + enabled = false, + anchor = {5, 1}, + text_face = "Friz Quadrata TT", + text_size = 12, + text_color = {1, 1, 1, 1}, + side = 1, + shadow = false, + enable_custom_text = false, + custom_text = "{name}" + }, --auto hide window borders statusbar main menu menu_alpha = {enabled = false, iconstoo = true, onenter = 1, onleave = 1, ignorebars = false}, --instance button anchor store the anchor point of instance and delete button diff --git a/core/plugins_statusbar.lua b/core/plugins_statusbar.lua index 385ade8a..2bcac68b 100644 --- a/core/plugins_statusbar.lua +++ b/core/plugins_statusbar.lua @@ -31,17 +31,21 @@ --> hida all micro frames function _detalhes.StatusBar:Hide (instance, side) if (not side) then - instance.StatusBar.center.frame:Hide() - instance.StatusBar.left.frame:Hide() - instance.StatusBar.right.frame:Hide() + if (instance.StatusBar.center and instance.StatusBar.left and instance.StatusBar.right) then + instance.StatusBar.center.frame:Hide() + instance.StatusBar.left.frame:Hide() + instance.StatusBar.right.frame:Hide() + end end end function _detalhes.StatusBar:Show (instance, side) if (not side) then - instance.StatusBar.center.frame:Show() - instance.StatusBar.left.frame:Show() - instance.StatusBar.right.frame:Show() + if (instance.StatusBar.center and instance.StatusBar.left and instance.StatusBar.right) then + instance.StatusBar.center.frame:Show() + instance.StatusBar.left.frame:Show() + instance.StatusBar.right.frame:Show() + end end end @@ -189,6 +193,10 @@ if (instance.StatusBar.left) then _detalhes.StatusBar:SetLeftPlugin (instance, instance.StatusBar.left) end + + if (not instance.show_statusbar and instance.micro_displays_side == 2) then + _detalhes.StatusBar:Hide (instance) + end end @@ -265,10 +273,15 @@ end function _detalhes.StatusBar:SetPlugin (instance, absolute_name, anchor) - local index = _detalhes.StatusBar:GetIndexFromAbsoluteName (absolute_name) - if (index and anchor) then + if (absolute_name == -1) then --> none anchor = string.lower (anchor) - ChoosePlugin (nil, nil, index, instance.StatusBar [anchor], anchor) + ChoosePlugin (nil, nil, -1, instance.StatusBar [anchor], anchor) + else + local index = _detalhes.StatusBar:GetIndexFromAbsoluteName (absolute_name) + if (index and anchor) then + anchor = string.lower (anchor) + ChoosePlugin (nil, nil, index, instance.StatusBar [anchor], anchor) + end end end @@ -464,7 +477,7 @@ --> build-in function for create a frame for an plugin child function _detalhes.StatusBar:CreateChildFrame (instance, name, w, h) --local frame = _detalhes.gump:NewPanel (instance.baseframe.cabecalho.fechar, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) - local frame = _detalhes.gump:NewPanel (instance.baseframe.DOWNFrame, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) + local frame = _detalhes.gump:NewPanel (instance.baseframe, nil, name..instance:GetInstanceId(), nil, w or DEFAULT_CHILD_WIDTH, h or DEFAULT_CHILD_HEIGHT, false) --create widgets local text = _detalhes.gump:NewLabel (frame, nil, "$parentText", "text", "0") @@ -1453,6 +1466,8 @@ window.locked = false window.close_with_right = true window.child = nil window.instance = nil +window:SetFrameStrata ("FULLSCREEN") +window:DisableGradient() local extraWindow = _detalhes.gump:NewPanel (window, nil, "DetailsStatusBarOptions2", "extra", 300, 180) extraWindow:SetPoint ("left", window, "right") @@ -1461,6 +1476,7 @@ extraWindow.locked = false extraWindow:SetHook ("OnHide", function() window:Hide() end) +extraWindow:DisableGradient() --> text style _detalhes.gump:NewLabel (window, _, "$parentTextStyleLabel", "textstyle", Loc ["STRING_PLUGINOPTIONS_TEXTSTYLE"]) diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 962f1c6e..d1184799 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -5518,11 +5518,194 @@ function window:CreateFrame6() frame6.instanceMicroDisplaysSideSlider:SetPoint ("left", frame6.instanceMicroDisplaysSideLabel, "right", 2) frame6.instanceMicroDisplaysSideSlider.OnSwitch = function (self, instance, value) instance:MicroDisplaysSide (value, true) + window:update_microframes() end frame6.instanceMicroDisplaysSideSlider.thumb:SetSize (50, 12) window:CreateLineBackground2 (frame6, "instanceMicroDisplaysSideSlider", "instanceMicroDisplaysSideLabel", Loc ["STRING_OPTIONS_MICRODISPLAYSSIDE_DESC"]) + --> micro displays selection + g:NewLabel (frame6, _, "$parentMicroDisplaysAnchor", "MicroDisplaysAnchor", Loc ["STRING_OPTIONS_MICRODISPLAY_ANCHOR"], "GameFontNormal") + + g:NewLabel (frame6, _, "$parentMicroDisplayLeftLabel", "MicroDisplayLeftLabel", Loc ["STRING_ANCHOR_LEFT"], "GameFontHighlightLeft") + g:NewLabel (frame6, _, "$parentMicroDisplayCenterLabel", "MicroDisplayCenterLabel", Loc ["STRING_CENTER_UPPER"], "GameFontHighlightLeft") + g:NewLabel (frame6, _, "$parentMicroDisplayRightLabel", "MicroDisplayRightLabel", Loc ["STRING_ANCHOR_RIGHT"], "GameFontHighlightLeft") + + g:NewLabel (frame6, _, "$parentMicroDisplayWarningLabel", "MicroDisplayWarningLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_WARNING"], "GameFontHighlightSmall", 10, "orange") + + local OnMicroDisplaySelect = function (_, instance, micro_display) + local anchor, index = unpack (micro_display) + + if (index == -1) then + return _detalhes.StatusBar:SetPlugin (instance, -1, anchor) + end + + local absolute_name = _detalhes.StatusBar.Plugins [index].real_name + _detalhes.StatusBar:SetPlugin (instance, absolute_name, anchor) + + window:update_microframes() + end + + local BuildLeftMicroMenu = function() + local options = {} + --options [1] = {value = {"left", -1}, label = Loc ["STRING_PLUGIN_CLEAN"], onclick = OnMicroDisplaySelect, icon = [[Interface\Buttons\UI-GroupLoot-Pass-Down]]} + for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + options [#options+1] = {value = {"left", index}, label = _name_and_icon [1], onclick = OnMicroDisplaySelect, icon = _name_and_icon [2]} + end + return options + end + local BuildCenterMicroMenu = function() + local options = {} + --options [1] = {value = {"center", -1}, label = Loc ["STRING_PLUGIN_CLEAN"], onclick = OnMicroDisplaySelect, icon = [[Interface\Buttons\UI-GroupLoot-Pass-Down]]} + for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + options [#options+1] = {value = {"center", index}, label = _name_and_icon [1], onclick = OnMicroDisplaySelect, icon = _name_and_icon [2]} + end + return options + end + local BuildRightMicroMenu = function() + local options = {} + --options [1] = {value = {"right", -1}, label = Loc ["STRING_PLUGIN_CLEAN"], onclick = OnMicroDisplaySelect, icon = [[Interface\Buttons\UI-GroupLoot-Pass-Down]]} + for index, _name_and_icon in ipairs (_detalhes.StatusBar.Menu) do + options [#options+1] = {value = {"right", index}, label = _name_and_icon [1], onclick = OnMicroDisplaySelect, icon = _name_and_icon [2]} + end + return options + end + + local d = g:NewDropDown (frame6, _, "$parentMicroDisplayLeftDropdown", "MicroDisplayLeftDropdown", DROPDOWN_WIDTH, 20, BuildLeftMicroMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + local d = g:NewDropDown (frame6, _, "$parentMicroDisplayCenterDropdown", "MicroDisplayCenterDropdown", DROPDOWN_WIDTH, 20, BuildCenterMicroMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + local d = g:NewDropDown (frame6, _, "$parentMicroDisplayRightDropdown", "MicroDisplayRightDropdown", DROPDOWN_WIDTH, 20, BuildRightMicroMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + frame6.MicroDisplayLeftDropdown:SetPoint ("left", frame6.MicroDisplayLeftLabel, "right", 2) + frame6.MicroDisplayCenterDropdown:SetPoint ("left", frame6.MicroDisplayCenterLabel, "right", 2) + frame6.MicroDisplayRightDropdown:SetPoint ("left", frame6.MicroDisplayRightLabel, "right", 2) + + window:CreateLineBackground2 (frame6, "MicroDisplayLeftDropdown", "MicroDisplayLeftLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"]) + window:CreateLineBackground2 (frame6, "MicroDisplayCenterDropdown", "MicroDisplayCenterLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"]) + window:CreateLineBackground2 (frame6, "MicroDisplayRightDropdown", "MicroDisplayRightLabel", Loc ["STRING_OPTIONS_MICRODISPLAYS_DROPDOWN_TOOLTIP"]) + + local HideLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentHideLeftMicroFrameButton", "HideLeftMicroFrameButton", 22, 22, function (_, _, self) + if (_G.DetailsOptionsWindow.instance.StatusBar ["left"].options.isHidden) then + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["left"].real_name, "left") + else + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, -1, "left") + end + if (_G.DetailsOptionsWindow.instance.StatusBar ["left"].options.isHidden) then + self:GetNormalTexture():SetDesaturated (false) + else + self:GetNormalTexture():SetDesaturated (true) + end + end) + HideLeftMicroFrameButton:SetPoint ("left", frame6.MicroDisplayLeftDropdown, "right", 2, 0) + HideLeftMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + --HideLeftMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + HideLeftMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + HideLeftMicroFrameButton:GetNormalTexture():SetDesaturated (true) + HideLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] + HideLeftMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + self:GetNormalTexture():SetBlendMode("ADD") + end) + HideLeftMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + self:GetNormalTexture():SetBlendMode("BLEND") + end) + + local HideCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentHideCenterMicroFrameButton", "HideCenterMicroFrameButton", 22, 22, function (_, _, self) + if (_G.DetailsOptionsWindow.instance.StatusBar ["center"].options.isHidden) then + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["center"].real_name, "center") + else + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, -1, "center") + end + + if (_G.DetailsOptionsWindow.instance.StatusBar ["center"].options.isHidden) then + self:GetNormalTexture():SetDesaturated (false) + else + self:GetNormalTexture():SetDesaturated (true) + end + end) + HideCenterMicroFrameButton:SetPoint ("left", frame6.MicroDisplayCenterDropdown, "right", 2, 0) + HideCenterMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + --HideCenterMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + HideCenterMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + HideCenterMicroFrameButton:GetNormalTexture():SetDesaturated (true) + HideCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] + HideCenterMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + self:GetNormalTexture():SetBlendMode("ADD") + end) + HideCenterMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + self:GetNormalTexture():SetBlendMode("BLEND") + end) + + local HideRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentHideRightMicroFrameButton", "HideRightMicroFrameButton", 20, 20, function (_, _, self) + if (_G.DetailsOptionsWindow.instance.StatusBar ["right"].options.isHidden) then + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, _G.DetailsOptionsWindow.instance.StatusBar ["right"].real_name, "right") + else + _detalhes.StatusBar:SetPlugin (_G.DetailsOptionsWindow.instance, -1, "right") + end + if (_G.DetailsOptionsWindow.instance.StatusBar ["right"].options.isHidden) then + self:GetNormalTexture():SetDesaturated (false) + else + self:GetNormalTexture():SetDesaturated (true) + end + end) + HideRightMicroFrameButton:SetPoint ("left", frame6.MicroDisplayRightDropdown, "right", 2, 0) + HideRightMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Down]]) + --HideRightMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]]) + HideRightMicroFrameButton:SetPushedTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) + HideRightMicroFrameButton:GetNormalTexture():SetDesaturated (true) + HideRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_SHOWHIDE_TOOLTIP"] + HideRightMicroFrameButton:SetHook ("OnEnter", function (self, capsule) + self:GetNormalTexture():SetBlendMode("ADD") + end) + HideRightMicroFrameButton:SetHook ("OnLeave", function (self, capsule) + self:GetNormalTexture():SetBlendMode("BLEND") + end) + + ------------- + + local ConfigRightMicroFrameButton = g:NewButton (frame6.MicroDisplayRightDropdown, _, "$parentConfigRightMicroFrameButton", "ConfigRightMicroFrameButton", 18, 18, function (_, _, self) + _G.DetailsOptionsWindow.instance.StatusBar ["right"]:Setup() + _G.DetailsOptionsWindow.instance.StatusBar ["right"]:Setup() + end) + ConfigRightMicroFrameButton:SetPoint ("left", HideRightMicroFrameButton, "right", 1, -1) + ConfigRightMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigRightMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigRightMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] + + local ConfigCenterMicroFrameButton = g:NewButton (frame6.MicroDisplayCenterDropdown, _, "$parentConfigCenterMicroFrameButton", "ConfigCenterMicroFrameButton", 18, 18, function (_, _, self) + _G.DetailsOptionsWindow.instance.StatusBar ["center"]:Setup() + _G.DetailsOptionsWindow.instance.StatusBar ["center"]:Setup() + end) + ConfigCenterMicroFrameButton:SetPoint ("left", HideCenterMicroFrameButton, "right", 1, -1) + ConfigCenterMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigCenterMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigCenterMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] + + local ConfigLeftMicroFrameButton = g:NewButton (frame6.MicroDisplayLeftDropdown, _, "$parentConfigLeftMicroFrameButton", "ConfigLeftMicroFrameButton", 18, 18, function (_, _, self) + _G.DetailsOptionsWindow.instance.StatusBar ["left"]:Setup() + _G.DetailsOptionsWindow.instance.StatusBar ["left"]:Setup() + end) + ConfigLeftMicroFrameButton:SetPoint ("left", HideLeftMicroFrameButton, "right", 1, -1) + ConfigLeftMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigLeftMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]]) + ConfigLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"] + + +-- local instance = _G.DetailsOptionsWindow.instance +-- /dump _detalhes:GetInstance(1).StatusBar ["left"].real_name + --> show side bars g:NewLabel (frame6, _, "$parentSideBarsLabel", "sideBarsLabel", Loc ["STRING_OPTIONS_SHOW_SIDEBARS"], "GameFontHighlightLeft") @@ -5550,6 +5733,7 @@ function window:CreateFrame6() instance:HideStatusBar() end instance:BaseFrameSnap() + window:update_microframes() end window:CreateLineBackground2 (frame6, "statusbarSlider", "statusbarLabel", Loc ["STRING_OPTIONS_SHOW_STATUSBAR_DESC"]) @@ -5668,6 +5852,11 @@ function window:CreateFrame6() {"statusbarAnchorLabel", 1, true}, {"statusbarLabel", 2}, {"statusbarColorLabel", 3}, + {"MicroDisplaysAnchor", 4, true}, + {"MicroDisplayLeftLabel", 5}, + {"MicroDisplayCenterLabel", 6}, + {"MicroDisplayRightLabel", 7}, + {"MicroDisplayWarningLabel", 8, true}, } window:arrange_menu (frame6, right_side, window.right_start_at, window.top_start_at) @@ -7903,6 +8092,46 @@ end --> if not window _G.DetailsOptionsWindow1LockButton.MyObject:SetText (Loc ["STRING_OPTIONS_WC_LOCK"]) end end + + function window:update_microframes() + + local instance = _G.DetailsOptionsWindow.instance + + local hide_left_button = _G.DetailsOptionsWindow6MicroDisplayLeftDropdown.MyObject.HideLeftMicroFrameButton + if (instance.StatusBar ["left"].options.isHidden) then + hide_left_button:GetNormalTexture():SetDesaturated (false) + else + hide_left_button:GetNormalTexture():SetDesaturated (true) + end + + local hide_center_button = _G.DetailsOptionsWindow6MicroDisplayCenterDropdown.MyObject.HideCenterMicroFrameButton + if (instance.StatusBar ["center"].options.isHidden) then + hide_center_button:GetNormalTexture():SetDesaturated (false) + else + hide_center_button:GetNormalTexture():SetDesaturated (true) + end + + local hide_right_button = _G.DetailsOptionsWindow6MicroDisplayRightDropdown.MyObject.HideRightMicroFrameButton + if (instance.StatusBar ["right"].options.isHidden) then + hide_right_button:GetNormalTexture():SetDesaturated (false) + else + hide_right_button:GetNormalTexture():SetDesaturated (true) + end + + local left = instance.StatusBar ["left"].__name + local center = instance.StatusBar ["center"].__name + local right = instance.StatusBar ["right"].__name + + _G.DetailsOptionsWindow6MicroDisplayLeftDropdown.MyObject:Select (left) + _G.DetailsOptionsWindow6MicroDisplayCenterDropdown.MyObject:Select (center) + _G.DetailsOptionsWindow6MicroDisplayRightDropdown.MyObject:Select (right) + + if (not instance.show_statusbar and instance.micro_displays_side == 2) then + _G.DetailsOptionsWindow6.MicroDisplayWarningLabel:Show() + else + _G.DetailsOptionsWindow6.MicroDisplayWarningLabel:Hide() + end + end function window:update_all (editing_instance, section) @@ -8097,6 +8326,17 @@ end --> if not window _G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetValue (editing_instance.window_scale) + ---- + + _G.DetailsOptionsWindow6MicroDisplayLeftDropdown.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6MicroDisplayCenterDropdown.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6MicroDisplayRightDropdown.MyObject:SetFixedParameter (editing_instance) + + --_detalhes.StatusBar.Plugins[1].real_name + --_detalhes.StatusBar.Plugins[1].__name + + window:update_microframes() + --> window 7 _G.DetailsOptionsWindow7MenuIconShadowSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow7MenuIconShadowSlider.MyObject:SetValue (editing_instance.menu_icons.shadow)