From 202bbdc606b03cce7fcc312d73925225a9c7ad4c Mon Sep 17 00:00:00 2001 From: tercio Date: Sun, 19 Oct 2014 23:16:31 -0200 Subject: [PATCH] - More smoothness progress on menus. - Fixed a avoidance bug inside the parser. --- boot.lua | 6 +- classes/classe_instancia.lua | 15 ++--- core/parser.lua | 12 ++++ framework/cooltip.lua | 99 +++++++++++++++++++++-------- framework/cooltip.xml | 29 +++++++-- gumps/janela_principal.lua | 97 +++++++++++++++------------- images/atributos_icones_damage.tga | Bin 21247 -> 22662 bytes images/cooltip_selected.tga | Bin 32812 -> 9452 bytes 8 files changed, 171 insertions(+), 87 deletions(-) diff --git a/boot.lua b/boot.lua index 09452813..76732010 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 = 125 --it's 135 for release - _detalhes.userversion = "a2.1.2" + _detalhes.build_counter = 125 --it's 138 for release + _detalhes.userversion = "a2.1.3" _detalhes.realversion = 34 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -29,7 +29,7 @@ do --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v2.1.2 (|cFFFFCC00Oct 18, 2014|r|cFFFFFF00)|r:\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' and 'ElvUI Frame Style BW'.\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.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v2.1.3 (|cFFFFCC00Oct 20, 2014|r|cFFFFFF00)|r:\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' and 'ElvUI Frame Style BW'.\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.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 76cdaa75..d39ea94f 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2258,8 +2258,10 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddMenu (1, func, nil, 5, nil, atributos.lista[5], nil, true) CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(5-1), p*(5), 0, 1) - CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], "Interface\\PaperDollInfoFrame\\Character-Plus", true) - CoolTip:AddLine ("$div", nil, 2, nil, -6, -9) + CoolTip:AddMenu (2, _detalhes.OpenCustomDisplayWindow, nil, nil, nil, Loc ["STRING_CUSTOM_NEW"], nil, true) + CoolTip:AddIcon ([[Interface\CHATFRAME\UI-ChatIcon-Maximize-Up]], 2, 1, 20, 20, 3/32, 29/32, 3/32, 29/32) + + CoolTip:AddLine ("$div", nil, 2, nil, -8, -13) for index, custom in _ipairs (_detalhes.custom) do if (custom.temp) then @@ -2291,6 +2293,9 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:SetOption ("HeighMod", 8) CoolTip:SetOption ("HeighModSub", 8) + CoolTip:SetOption ("SelectedTopAnchorMod", -2) + CoolTip:SetOption ("SelectedBottomAnchorMod", 2) + CoolTip:SetLastSelected (1, atributo_ativo) CoolTip:SetWallpaper (1, [[Interface\SPELLBOOK\DeathKnightBlood-TopLeft]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) @@ -2389,12 +2394,6 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) qual = 1 end end - - --[[ if (_detalhes.solo and _detalhes.solo == instancia.meu_id) then --> não trocar de modo se tiver em combate e a janela no solo mode - if (UnitAffectingCombat ("player")) then - return - end - end --]] if (instancia.showing) then if (not instancia.atributo) then diff --git a/core/parser.lua b/core/parser.lua index 049287cb..224bf58e 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -306,6 +306,11 @@ if (tanks_members_cache [alvo_serial]) then --> autoshot or melee hit --> avoidance local avoidance = jogador_alvo.avoidance + if (not avoidance) then + jogador_alvo.avoidance = _detalhes:CreateActorAvoidanceTable() + avoidance = jogador_alvo.avoidance + end + local overall = avoidance.overall local mob = avoidance [who_name] @@ -521,10 +526,17 @@ end if (tanks_members_cache [alvo_serial]) then --> only track tanks + local TargetActor = damage_cache [alvo_name] if (TargetActor) then local avoidance = TargetActor.avoidance + + if (not avoidance) then + TargetActor.avoidance = _detalhes:CreateActorAvoidanceTable() + avoidance = TargetActor.avoidance + end + local missTable = avoidance.overall [missType] if (missTable) then diff --git a/framework/cooltip.lua b/framework/cooltip.lua index d9b79986..8bda976b 100644 --- a/framework/cooltip.lua +++ b/framework/cooltip.lua @@ -108,6 +108,10 @@ function DetailsCreateCoolTip() ["IconBlendModeHover"] = true, ["SubFollowButton"] = true, ["IgnoreArrows"] = true, + ["SelectedTopAnchorMod"] = true, + ["SelectedBottomAnchorMod"] = true, + ["SelectedLeftAnchorMod"] = true, + ["SelectedRightAnchorMod"] = true, } CoolTip.OptionsTable = {} @@ -132,6 +136,12 @@ function DetailsCreateCoolTip() CoolTip.default_text_size = 10.5 CoolTip.default_text_font = "GameFontHighlight" + CoolTip.selected_anchor = {} + CoolTip.selected_anchor.left = 2 + CoolTip.selected_anchor.right = 0 + CoolTip.selected_anchor.top = 0 + CoolTip.selected_anchor.bottom = 0 + --> Create Frames --> main frame @@ -508,6 +518,43 @@ function DetailsCreateCoolTip() --> Button Click Functions ---------------------------------------------------------------------- + CoolTip.selected_anchor.left = 4 + CoolTip.selected_anchor.right = -4 + CoolTip.selected_anchor.top = 0 + CoolTip.selected_anchor.bottom = 0 + + function CoolTip:HideSelectedTexture (frame) + frame.selectedTop:Hide() + frame.selectedBottom:Hide() + frame.selectedMiddle:Hide() + end + + function CoolTip:ShowSelectedTexture (frame) + frame.selectedTop:Show() + frame.selectedBottom:Show() + frame.selectedMiddle:Show() + end + + function CoolTip:SetSelectedAnchor (frame, button) + + local left = CoolTip.selected_anchor.left + (CoolTip.OptionsTable.SelectedLeftAnchorMod or 0) + local right = CoolTip.selected_anchor.right + (CoolTip.OptionsTable.SelectedRightAnchorMod or 0) + + local top = CoolTip.selected_anchor.top + (CoolTip.OptionsTable.SelectedTopAnchorMod or 0) + local bottom = CoolTip.selected_anchor.bottom + (CoolTip.OptionsTable.SelectedBottomAnchorMod or 0) + + frame.selectedTop:ClearAllPoints() + frame.selectedBottom:ClearAllPoints() + + frame.selectedTop:SetPoint ("topleft", button, "topleft", left, top) -- + frame.selectedTop:SetPoint ("topright", button, "topright", right, top) -- + + frame.selectedBottom:SetPoint ("bottomleft", button, "bottomleft", left, bottom) -- + frame.selectedBottom:SetPoint ("bottomright", button, "bottomright", right, bottom) -- + + CoolTip:ShowSelectedTexture (frame) + end + local OnClickFunctionButtonPrincipal = function (self) if (CoolTip.IndexesSub [self.index] and CoolTip.IndexesSub [self.index] > 0) then CoolTip:ShowSub (self.index) @@ -515,10 +562,11 @@ function DetailsCreateCoolTip() end CoolTip.buttonClicked = true - frame1.selected:SetPoint ("top", self, "top", 0, -1) - frame1.selected:SetPoint ("bottom", self, "bottom") + CoolTip:SetSelectedAnchor (frame1, self) + if (not CoolTip.OptionsTable.NoLastSelectedBar) then - frame1.selected:Show() + CoolTip:ShowSelectedTexture (frame1) + end CoolTip.SelectedIndexMain = self.index @@ -530,10 +578,8 @@ function DetailsCreateCoolTip() local OnClickFunctionButtonSecundario = function (self) CoolTip.buttonClicked = true - frame2.selected:SetPoint ("top", self, "top", 0, -1) - frame2.selected:SetPoint ("bottom", self, "bottom") - --UIFrameFlash (frame2.selected, 0.05, 0.05, 0.2, true, 0, 0) + CoolTip:SetSelectedAnchor (frame2, self) if (CoolTip.FunctionsTableSub [self.mainIndex] and CoolTip.FunctionsTableSub [self.mainIndex] [self.index]) then local parameterTable = CoolTip.ParametersTableSub [self.mainIndex] [self.index] @@ -541,10 +587,10 @@ function DetailsCreateCoolTip() end local botao_p = frame1.Lines [self.mainIndex] - frame1.selected:SetPoint ("top", botao_p, "top", 0, -1) - frame1.selected:SetPoint ("bottom", botao_p, "bottom") + CoolTip:SetSelectedAnchor (frame1, botao_p) + if (not CoolTip.OptionsTable.NoLastSelectedBar) then - frame1.selected:Show() + CoolTip:ShowSelectedTexture (frame1) end CoolTip.SelectedIndexMain = self.mainIndex @@ -1017,13 +1063,14 @@ function DetailsCreateCoolTip() local selected = CoolTip.SelectedIndexSec [index] if (selected) then - frame2.selected:SetPoint ("top", frame2.Lines [selected], "top", 0, -1) - frame2.selected:SetPoint ("bottom", frame2.Lines [selected], "bottom") + + CoolTip:SetSelectedAnchor (frame2, frame2.Lines [selected]) + if (not CoolTip.OptionsTable.NoLastSelectedBar) then - frame2.selected:Show() + CoolTip:ShowSelectedTexture (frame2) end else - frame2.selected:Hide() + CoolTip:HideSelectedTexture (frame2) end for i = CoolTip.IndexesSub [index] + 1, #frame2.Lines do @@ -1174,7 +1221,7 @@ function DetailsCreateCoolTip() --> hide sub frame gump:Fade (frame2, 1) --> hide select bar - gump:Fade (frame1.selected, 1) + CoolTip:HideSelectedTexture (frame1) frame1:EnableMouse (false) @@ -1325,7 +1372,7 @@ function DetailsCreateCoolTip() button.divbar:SetTexCoord (238/512, 445/512, 0/64, 4/64) button.divbar:SetHeight (3) - button.divbar:SetAlpha (0.2) + button.divbar:SetAlpha (0.1) button.divbar:SetDesaturated (true) end @@ -1387,15 +1434,15 @@ function DetailsCreateCoolTip() --> selected texture if (CoolTip.SelectedIndexMain) then - frame1.selected:SetPoint ("top", frame1.Lines [CoolTip.SelectedIndexMain], "top", 0, -1) - frame1.selected:SetPoint ("bottom", frame1.Lines [CoolTip.SelectedIndexMain], "bottom") + CoolTip:SetSelectedAnchor (frame1, frame1.Lines [CoolTip.SelectedIndexMain]) + if (CoolTip.OptionsTable.NoLastSelectedBar) then - gump:Fade (frame1.selected, 1) + CoolTip:HideSelectedTexture (frame1) else - gump:Fade (frame1.selected, 0) + CoolTip:ShowSelectedTexture (frame1) end else - gump:Fade (frame1.selected, 1) + CoolTip:HideSelectedTexture (frame1) end if (CoolTip.Indexes < #frame1.Lines) then @@ -1836,17 +1883,16 @@ function DetailsCreateCoolTip() if (menuType == 1) then --main menu local botao = frame1.Lines [option] CoolTip.buttonClicked = true - frame1.selected:SetPoint ("top", botao, "top", 0, -1) - frame1.selected:SetPoint ("bottom", botao, "bottom") + CoolTip:SetSelectedAnchor (frame1, botao) + --UIFrameFlash (frame1.selected, 0.05, 0.05, 0.2, true, 0, 0) elseif (menuType == 2) then --sub menu CoolTip:ShowSub (mainIndex) local botao = frame2.Lines [option] CoolTip.buttonClicked = true - frame2.selected:SetPoint ("top", botao, "top", 0, -1) - frame2.selected:SetPoint ("bottom", botao, "bottom") - --UIFrameFlash (frame2.selected, 0.05, 0.05, 0.2, true, 0, 0) + + CoolTip:SetSelectedAnchor (frame2, botao) end end @@ -1866,6 +1912,9 @@ function DetailsCreateCoolTip() frame2:ClearAllPoints() frame2:SetPoint ("bottomleft", frame1, "bottomright") + CoolTip:HideSelectedTexture (frame1) + CoolTip:HideSelectedTexture (frame2) + CoolTip.FixedValue = nil CoolTip.HaveSubMenu = false diff --git a/framework/cooltip.xml b/framework/cooltip.xml index fcd3052d..03b99989 100644 --- a/framework/cooltip.xml +++ b/framework/cooltip.xml @@ -78,13 +78,30 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + +