From 334bcba985b12f06056c60255d058cfa664bf44e Mon Sep 17 00:00:00 2001 From: tercio Date: Sun, 10 Aug 2014 14:03:33 -0300 Subject: [PATCH] - Added hotcorner support. --- boot.lua | 22 ++---- core/windows.lua | 50 ++++++++----- functions/profiles.lua | 4 +- gumps/janela_options.lua | 71 ++---------------- gumps/janela_principal.lua | 143 +++++++++++++++++++------------------ startup.lua | 8 ++- 6 files changed, 124 insertions(+), 174 deletions(-) diff --git a/boot.lua b/boot.lua index 6ec9d975..2606f81c 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 = 32 --it's 32 for release - _detalhes.userversion = "v1.21.4" + _detalhes.build_counter = 32 --it's 33 for release + _detalhes.userversion = "v1.22.0" _detalhes.realversion = 25 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -19,23 +19,11 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00a1.21.0 (|cFFFFCC00Ago 7, 2014|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n -|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n -|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n -|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n -|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n -|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n -|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n -|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n -|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n -|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n -|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n -|cFFFFFF00-|r Fixed bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n -|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n +|cFFFFFF00a1.22.0 (|cFFFFCC00Ago 10, 2014|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added support for hotcorners.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable.\n\n|cFFFFFF00-|r 'Hide' slash command now hides all opened windows; 'Show', open all closed windows and 'New' create a new window.\n\n|cFFFFFF00-|r Added Devotion Aura, Rallying Cry as cooldowns.\n\n|cFFFFFF00-|r Added options for lock, unlock, break snap, close, reopen and create new window.\n\n|cFFFFFF00-|r Added a options panel for HotCorners, access it through options button or slash hotcorner command.\n\n|cFFFFFF00-|r Added 'Logos' and 'Raid & Dungeons' sections for Wallpapers. \n\n|cFFFFFF00-|r Added a option to load a image from the computer to use as wallpaper.\n\n|cFFFFFF00-|r Fixed the percent issue with Healing Done and HPS while in combat.\n\n|cFFFFFF00-|r Fixed non-combat switch by role where changing role wasnt changing the shown attribute.\n\n|cFFFFFF00-|r Fixed 'While in Combat' hiding schema |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed several bugs on Interact Auto Transparency.\n\n|cFFFFFF00-|r Fixed the report window alert when opening the report window and it already is opened |cFF999999(thanks @Rasstapp-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the gap between last row created and the end of the window.\n\n|cFFFFFF00-|r Fixed all tooltips bugs on Wallpaper Section on Options Panel.\n\n|cFFFFFF00a1.17.0 (|cFFFFCC00Jun 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Support for Custom Displays has been rewrited, to access the new panel go to Sword Menu -> Custom -> Create New Display.\n\n|cFFFFFF00-|r Added a custom display for show potion usage.\n\n|cFFFFFF00-|r Fixed a bug where the player pet wasnt being tracked after logon in the game. This bug was affecting directly classes with pets playing out of a raid group.\n\n|cFFFFFF00-|r Fixed the report bug on healing, energy and misc attributes |cFF999999(thanks @skmzarn-mmochampion forum)|r." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.22.0 (|cFFFFCC00Ago 10, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development).\n\n|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Details! is now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\n|cFFFFFF00http://wow.curseforge.com/addons/details/localization/|r\n\n|cFFFFFF00-|r Slash commands now are multi language, accepting both english and the localized language.\n\n|cFFFFFF00-|r Added Data Broker for: Combat Time, Player Dps and Player Hps.\n\n|cFFFFFF00-|r Rework on plugins: Timeline, You Are Not Prepared, Tiny Threat, Encounter Details. All those plugins got a options panel and few improvaments.\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Raid Dps and Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable.\n\n|cFFFFFF00-|r 'Hide' slash command now hides all opened windows; 'Show', open all closed windows and 'New' create a new window.\n\n|cFFFFFF00-|r Added Devotion Aura, Rallying Cry as cooldowns.\n\n|cFFFFFF00-|r Added options for lock, unlock, break snap, close, reopen and create new window.\n\n|cFFFFFF00-|r Added a options panel for HotCorners, access it through options button or slash hotcorner command.\n\n|cFFFFFF00-|r Added 'Logos' and 'Raid & Dungeons' sections for Wallpapers. \n\n|cFFFFFF00-|r Added a option to load a image from the computer to use as wallpaper.\n\n|cFFFFFF00-|r Fixed the percent issue with Healing Done and HPS while in combat.\n\n|cFFFFFF00-|r Fixed non-combat switch by role where changing role wasnt changing the shown attribute.\n\n|cFFFFFF00-|r Fixed 'While in Combat' hiding schema |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed several bugs on Interact Auto Transparency.\n\n|cFFFFFF00-|r Fixed the report window alert when opening the report window and it already is opened |cFF999999(thanks @Rasstapp-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the gap between last row created and the end of the window.\n\n|cFFFFFF00-|r Fixed all tooltips bugs on Wallpaper Section on Options Panel.\n\n|cFFFFFF00a1.17.0 (|cFFFFCC00Jun 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Support for Custom Displays has been rewrited, to access the new panel go to Sword Menu -> Custom -> Create New Display.\n\n|cFFFFFF00-|r Added a custom display for show potion usage.\n\n|cFFFFFF00-|r Fixed a bug where the player pet wasnt being tracked after logon in the game. This bug was affecting directly classes with pets playing out of a raid group." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " --> startup diff --git a/core/windows.lua b/core/windows.lua index b6a7784d..3c4f038c 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -170,24 +170,25 @@ end local mostrando = self.mostrando - -- + --> get sizes local baseframe_width = self.baseframe:GetWidth() local baseframe_height = self.baseframe:GetHeight() if (not baseframe_width) then return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end - -- + + --> calc position local xOfs, yOfs = self.baseframe:GetCenter() if (not xOfs) then return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end - -- local _scale = self.baseframe:GetEffectiveScale() local _UIscale = _UIParent:GetScale() -- xOfs = xOfs*_scale - _GetScreenWidth()*_UIscale/2 yOfs = yOfs*_scale - _GetScreenHeight()*_UIscale/2 + --> save the position local _w = baseframe_width local _h = baseframe_height local _x = xOfs/_UIscale @@ -198,6 +199,7 @@ self.posicao[mostrando].w = _w self.posicao[mostrando].h = _h + --> update the 4 points for window groups local metade_largura = _w/2 local metade_altura = _h/2 @@ -1459,7 +1461,7 @@ end --> minimap icon and hotcorner - function _detalhes:RegisterMinimapAndHotCorner() + function _detalhes:RegisterMinimap() local LDB = LibStub ("LibDataBroker-1.1", true) local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) @@ -1572,7 +1574,9 @@ _detalhes.databroker = databroker end - + end + + function _detalhes:DoRegisterHotCorner() --register lib-hotcorners local on_click_on_hotcorner_button = function (frame, button) if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then @@ -1589,20 +1593,19 @@ _detalhes.tabela_historico:resetar() end end + + local quickclick_func1 = function (frame, button) + _detalhes.tabela_historico:resetar() + end - local on_click_on_quickclick_button = function (frame, button) - if (_detalhes.hotcorner_topleft.quickclick_what_todo == 1) then - local lower_instance = _detalhes:GetLowerInstanceNumber() - if (not lower_instance) then - local instance = _detalhes:GetInstance (1) - _detalhes.CriarInstancia (_, _, 1) - _detalhes:OpenOptionsWindow (instance) - else - _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) - end - - elseif (_detalhes.hotcorner_topleft.quickclick_what_todo == 2) then - _detalhes.tabela_historico:resetar() + local quickclick_func2 = function (frame, button) + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (not lower_instance) then + local instance = _detalhes:GetInstance (1) + _detalhes.CriarInstancia (_, _, 1) + _detalhes:OpenOptionsWindow (instance) + else + _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) end end @@ -1636,7 +1639,16 @@ --> menus nil, --> quick click - on_click_on_quickclick_button + { + {func = quickclick_func1, name = "Details! - Reset Data"}, + {func = quickclick_func2, name = "Details! - Open Options"} + }, + --> onenter + nil, + --> onleave + nil, + --> is install + true ) end end diff --git a/functions/profiles.lua b/functions/profiles.lua index 114eb61a..070ea8d2 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -664,9 +664,9 @@ local default_profile = { }, --> minimap - minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1, HotCornerIgnore = true}, + minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1}, --> horcorner - hotcorner_topleft = {hide = false, onclick_what_todo = 1, topleft_quickclick = true, quickclick_what_todo = 2}, + hotcorner_topleft = {hide = false}, --> PvP only_pvp_frags = false, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 183cc760..edb17285 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1416,63 +1416,10 @@ function window:CreateFrame19() frame19.hotcornerSlider:SetPoint ("left", frame19.hotcornerLabel, "right", 2, 0) frame19.hotcornerSlider.OnSwitch = function (self, _, value) - _detalhes:HideHotCornerButton ("Details!", "TOPLEFT", not value) + _G.HotCorners:HideHotCornerButton ("Details!", "TOPLEFT", not value) end window:CreateLineBackground2 (frame19, "hotcornerSlider", "hotcornerLabel", Loc ["STRING_OPTIONS_HOTCORNER_DESC"]) - --on click action - do - g:NewLabel (frame19, _, "$parentHotcornerActionLabel", "hotcornerActionLabel", Loc ["STRING_OPTIONS_HOTCORNER_ACTION"], "GameFontHighlightLeft") - local on_select = function (_, _, option) - _detalhes.hotcorner_topleft.onclick_what_todo = option - end - local build_menu = function() - return { - {value = 1, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION1"], onclick = on_select, icon = [[Interface\FriendsFrame\FriendsFrameScrollIcon]]}, - {value = 2, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION2"], onclick = on_select, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Up]], iconcolor = {1, .8, 0, 1}}, - } - end - local dropdown = g:NewDropDown (frame19, _, "$parentHotcornerActionDropdown", "hotcornerActionDropdown", 160, 20, build_menu, _detalhes.hotcorner_topleft.onclick_what_todo) - dropdown.onenter_backdrop = dropdown_backdrop_onenter - dropdown.onleave_backdrop = dropdown_backdrop_onleave - dropdown:SetBackdrop (dropdown_backdrop) - dropdown:SetBackdropColor (unpack (dropdown_backdrop_onleave)) - - frame19.hotcornerActionDropdown:SetPoint ("left", frame19.hotcornerActionLabel, "right", 2, 0) - window:CreateLineBackground2 (frame19, "hotcornerActionDropdown", "hotcornerActionLabel", Loc ["STRING_OPTIONS_HOTCORNER_ACTION_DESC"]) - end - - --quick click enabled - g:NewLabel (frame19, _, "$parentHotcornerQuickClickLabel", "hotcornerQuickClickLabel", Loc ["STRING_OPTIONS_HOTCORNER_QUICK_CLICK"], "GameFontHighlightLeft") - g:NewSwitch (frame19, _, "$parentHotcornerQuickClickSlider", "hotcornerQuickClickSlider", 60, 20, _, _, _detalhes.hotcorner_topleft.topleft_quick_click) - - frame19.hotcornerQuickClickSlider:SetPoint ("left", frame19.hotcornerQuickClickLabel, "right", 2, 0) - frame19.hotcornerQuickClickSlider.OnSwitch = function (self, _, value) - _detalhes:QuickHotCornerEnable ("Details!", "TOPLEFT", value) - end - window:CreateLineBackground2 (frame19, "hotcornerQuickClickSlider", "hotcornerQuickClickLabel", Loc ["STRING_OPTIONS_HOTCORNER_QUICK_CLICK_DESC"]) - - --quick click function - do - g:NewLabel (frame19, _, "$parentQuickClickLabel", "quickClickLabel", Loc ["STRING_OPTIONS_HOTCORNER_QUICK_CLICK_FUNC"], "GameFontHighlightLeft") - local on_select = function (_, _, option) - _detalhes.hotcorner_topleft.quickclick_what_todo = option - end - local build_menu = function() - return { - {value = 1, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION1"], onclick = on_select, icon = [[Interface\FriendsFrame\FriendsFrameScrollIcon]]}, - {value = 2, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION2"], onclick = on_select, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Up]], iconcolor = {1, .8, 0, 1}}, - } - end - local dropdown = g:NewDropDown (frame19, _, "$parentQuickClickDropdown", "quickClickDropdown", 160, 20, build_menu, _detalhes.hotcorner_topleft.quickclick_what_todo) - dropdown.onenter_backdrop = dropdown_backdrop_onenter - dropdown.onleave_backdrop = dropdown_backdrop_onleave - dropdown:SetBackdrop (dropdown_backdrop) - dropdown:SetBackdropColor (unpack (dropdown_backdrop_onleave)) - - frame19.quickClickDropdown:SetPoint ("left", frame19.quickClickLabel, "right", 2, 0) - window:CreateLineBackground2 (frame19, "quickClickDropdown", "quickClickLabel", Loc ["STRING_OPTIONS_HOTCORNER_QUICK_CLICK_FUNC_DESC"]) - end --> broker --anchor g:NewLabel (frame19, _, "$parentHotcornerAnchor", "brokerAnchorLabel", Loc ["STRING_OPTIONS_DATABROKER"], "GameFontNormal") @@ -1520,11 +1467,8 @@ function window:CreateFrame19() {"minimapActionLabel", 3}, {"hotcornerAnchorLabel", 4, true}, {"hotcornerLabel", 5}, - {"hotcornerActionLabel", 6}, - {"hotcornerQuickClickLabel", 7}, - {"quickClickLabel", 8}, - {"brokerAnchorLabel", 9, true}, - {"brokerTextLabel", 10}, + {"brokerAnchorLabel", 6, true}, + {"brokerTextLabel", 7}, } window:arrange_menu (frame19, left_side, x, -90) @@ -7679,20 +7623,15 @@ function window:update_all (editing_instance) --> window 19 _G.DetailsOptionsWindow19MinimapSlider.MyObject:SetValue (not _detalhes.minimap.hide) _G.DetailsOptionsWindow19MinimapActionDropdown.MyObject:Select (_detalhes.minimap.onclick_what_todo) - _G.DetailsOptionsWindow19HotcornerSlider.MyObject:SetValue (not _detalhes.hotcorner_topleft.hide) - _G.DetailsOptionsWindow19HotcornerActionDropdown.MyObject:Select (_detalhes.hotcorner_topleft.onclick_what_todo) - _G.DetailsOptionsWindow19HotcornerQuickClickSlider.MyObject:SetValue (_detalhes.hotcorner_topleft.topleft_quickclick) - _G.DetailsOptionsWindow19QuickClickDropdown.MyObject:Select (_detalhes.hotcorner_topleft.quickclick_what_todo) _G.DetailsOptionsWindow19BrokerTextDropdown.MyObject:Select (_detalhes.minimap.text_type) if (not _G.HotCorners) then _G.DetailsOptionsWindow19HotcornerSlider.MyObject:Disable() - _G.DetailsOptionsWindow19HotcornerActionDropdown.MyObject:Disable() - _G.DetailsOptionsWindow19HotcornerQuickClickSlider.MyObject:Disable() - _G.DetailsOptionsWindow19QuickClickDropdown.MyObject:Disable() if (not _G.DetailsOptionsWindow19HotcornerAnchor.MyObject:GetText():find ("not installed")) then _G.DetailsOptionsWindow19HotcornerAnchor.MyObject:SetText (_G.DetailsOptionsWindow19HotcornerAnchor.MyObject:GetText() .. " |cFFFF5555(not installed)|r") end + else + _G.DetailsOptionsWindow19HotcornerSlider.MyObject:SetValue (not _detalhes.hotcorner_topleft.hide) end --> window 20 diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index e6e4493a..c8490fcb 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -2310,24 +2310,29 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- main frames ----------------------------------------------------------------------------------------------------------------------------------------------- - local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent) --> main frame + --> create the base frame, everything connect in this frame except the rows. + local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent) baseframe.instance = instancia baseframe:SetFrameStrata (baseframe_strata) baseframe:SetFrameLevel (2) - local backgroundframe = CreateFrame ("scrollframe", "Details_WindowFrame"..ID, baseframe) --> main window - local backgrounddisplay = CreateFrame ("frame", "Details_GumpFrame"..ID, backgroundframe) --> background window + --> background holds the wallpaper, alert strings ans textures, have setallpoints on baseframe + --> backgrounddisplay is a scrollschild of backgroundframe + local backgroundframe = CreateFrame ("scrollframe", "Details_WindowFrame"..ID, baseframe) + local backgrounddisplay = CreateFrame ("frame", "Details_GumpFrame"..ID, backgroundframe) backgroundframe:SetFrameLevel (3) backgrounddisplay:SetFrameLevel (3) backgroundframe.instance = instancia backgrounddisplay.instance = instancia - local rowframe = CreateFrame ("frame", "DetailsRowFrame"..ID, _UIParent) --> main frame + --> row frame is the parent of rows, it have setallpoints on baseframe + local rowframe = CreateFrame ("frame", "DetailsRowFrame"..ID, _UIParent) rowframe:SetAllPoints (baseframe) rowframe:SetFrameStrata (baseframe_strata) rowframe:SetFrameLevel (2) instancia.rowframe = rowframe + --> right click bookmark local switchbutton = gump:NewDetailsButton (backgrounddisplay, baseframe, nil, function() end, nil, nil, 1, 1, "", "", "", "", {rightFunc = {func = function() _detalhes.switch:ShowMe (instancia) end, param1 = nil, param2 = nil}}, "Details_SwitchButtonFrame" .. ID) @@ -2335,15 +2340,16 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) switchbutton:SetPoint ("bottomright", backgrounddisplay, "bottomright") switchbutton:SetFrameLevel (backgrounddisplay:GetFrameLevel()+1) + --> avoid mouse hover over a high window when the menu is open for a lower instance. local anti_menu_overlap = CreateFrame ("frame", "Details_WindowFrameAntiMenuOverlap" .. ID, baseframe) anti_menu_overlap:SetSize (100, 13) anti_menu_overlap:SetFrameStrata ("DIALOG") anti_menu_overlap:EnableMouse (true) anti_menu_overlap:Hide() - --anti_menu_overlap:SetBackdrop (gump_fundo_backdrop) baseframe.anti_menu_overlap = anti_menu_overlap -- scroll bar ----------------------------------------------------------------------------------------------------------------------------------------------- +--> create the scrollbar, almost not used. local scrollbar = CreateFrame ("slider", "Details_ScrollBar"..ID, backgrounddisplay) --> scroll @@ -2400,7 +2406,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) --> config set scrollbar:SetOrientation ("VERTICAL") - scrollbar.scrollMax = 0 --default - tamanho da janela de fundo + scrollbar.scrollMax = 0 scrollbar:SetMinMaxValues (0, 0) scrollbar:SetValue (0) scrollbar.ultimo = 0 @@ -2441,8 +2447,6 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando) -- main window config ------------------------------------------------------------------------------------------------------------------------------------------------- baseframe:SetClampedToScreen (true) - --baseframe:SetClampRectInsets (unpack (_detalhes.window_clamp)) - baseframe:SetSize (_detalhes.new_window_size.width, _detalhes.new_window_size.height) baseframe:SetPoint ("center", _UIParent) @@ -2779,95 +2783,98 @@ _detalhes.barras_criadas = 0 --> search key: ~row ~barra function gump:CriaNovaBarra (instancia, index) + --> instancia = window object, index = row number local baseframe = instancia.baseframe local rowframe = instancia.rowframe - local esta_barra = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, rowframe) + --> create the bar with rowframe as parent + local new_row = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, rowframe) - esta_barra.row_id = index - esta_barra.instance_id = instancia.meu_id - esta_barra.animacao_fim = 0 - esta_barra.animacao_fim2 = 0 + new_row.row_id = index + new_row.instance_id = instancia.meu_id + new_row.animacao_fim = 0 + new_row.animacao_fim2 = 0 - local y = instancia.row_height*(index-1) - + --> set point, almost irrelevant here, it recalc this on SetBarGrowDirection() + local y = instancia.row_height * (index-1) if (instancia.bars_grow_direction == 1) then y = y*-1 - esta_barra:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y) + new_row:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y) elseif (instancia.bars_grow_direction == 2) then - esta_barra:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2) + new_row:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2) end - esta_barra:SetHeight (instancia.row_info.height) --> altura determinada pela instância - esta_barra:SetWidth (baseframe:GetWidth()+instancia.row_info.space.right) + --> row height + new_row:SetHeight (instancia.row_info.height) + new_row:SetWidth (baseframe:GetWidth()+instancia.row_info.space.right) + new_row:SetFrameLevel (baseframe:GetFrameLevel() + 4) + new_row.last_value = 0 + new_row.w_mod = 0 + new_row:EnableMouse (true) + new_row:RegisterForClicks ("LeftButtonDown", "RightButtonDown") - esta_barra:SetFrameLevel (baseframe:GetFrameLevel() + 4) + --> statusbar + new_row.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, new_row) + --> frame for hold the backdrop border + new_row.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, new_row.statusbar) + new_row.border:SetFrameLevel (new_row.statusbar:GetFrameLevel()+1) + new_row.border:SetAllPoints (new_row) - esta_barra.last_value = 0 - esta_barra.w_mod = 0 - - esta_barra:EnableMouse (true) - esta_barra:RegisterForClicks ("LeftButtonDown", "RightButtonDown") - - esta_barra.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, esta_barra) + --> create textures and icons + new_row.textura = new_row.statusbar:CreateTexture (nil, "artwork") + new_row.textura:SetHorizTile (false) + new_row.textura:SetVertTile (false) - esta_barra.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, esta_barra.statusbar) - esta_barra.border:SetFrameLevel (esta_barra.statusbar:GetFrameLevel()+1) - esta_barra.border:SetAllPoints (esta_barra) + --> row background texture + new_row.background = new_row:CreateTexture (nil, "background") + new_row.background:SetTexture() + new_row.background:SetAllPoints (new_row) - esta_barra.textura = esta_barra.statusbar:CreateTexture (nil, "artwork") - esta_barra.textura:SetHorizTile (false) - esta_barra.textura:SetVertTile (false) - - esta_barra.background = esta_barra:CreateTexture (nil, "background") - esta_barra.background:SetTexture() - esta_barra.background:SetAllPoints (esta_barra) + new_row.statusbar:SetStatusBarColor (0, 0, 0, 0) + new_row.statusbar:SetStatusBarTexture (new_row.textura) + new_row.statusbar:SetMinMaxValues (0, 100) + new_row.statusbar:SetValue (0) - esta_barra.statusbar:SetStatusBarColor (0, 0, 0, 0) - esta_barra.statusbar:SetStatusBarTexture (esta_barra.textura) - - esta_barra.statusbar:SetMinMaxValues (0, 100) - esta_barra.statusbar:SetValue (0) - - local icone_classe = esta_barra.statusbar:CreateTexture (nil, "overlay") + --> class icon + local icone_classe = new_row.statusbar:CreateTexture (nil, "overlay") icone_classe:SetHeight (instancia.row_info.height) icone_classe:SetWidth (instancia.row_info.height) icone_classe:SetTexture (instancia.row_info.icon_file) icone_classe:SetTexCoord (.75, 1, .75, 1) - esta_barra.icone_classe = icone_classe + new_row.icone_classe = icone_classe - icone_classe:SetPoint ("left", esta_barra, "left") + icone_classe:SetPoint ("left", new_row, "left") + new_row.statusbar:SetPoint ("topleft", icone_classe, "topright") + new_row.statusbar:SetPoint ("bottomright", new_row, "bottomright") - esta_barra.statusbar:SetPoint ("topleft", icone_classe, "topright") - esta_barra.statusbar:SetPoint ("bottomright", esta_barra, "bottomright") + --> left text + new_row.texto_esquerdo = new_row.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") + new_row.texto_esquerdo:SetPoint ("left", new_row.icone_classe, "right", 3, 0) + new_row.texto_esquerdo:SetJustifyH ("left") + new_row.texto_esquerdo:SetNonSpaceWrap (true) + + --> right text + new_row.texto_direita = new_row.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") + new_row.texto_direita:SetPoint ("right", new_row.statusbar, "right") + new_row.texto_direita:SetJustifyH ("right") - esta_barra.texto_esquerdo = esta_barra.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") + --> set the onclick, on enter scripts + barra_scripts (new_row, instancia, index) - esta_barra.texto_esquerdo:SetPoint ("left", esta_barra.icone_classe, "right", 3, 0) - esta_barra.texto_esquerdo:SetJustifyH ("left") - esta_barra.texto_esquerdo:SetNonSpaceWrap (true) + --> hide + gump:Fade (new_row, 1) - esta_barra.texto_direita = esta_barra.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight") - - esta_barra.texto_direita:SetPoint ("right", esta_barra.statusbar, "right") - esta_barra.texto_direita:SetJustifyH ("right") + --> adds the window container + instancia.barras [index] = new_row - --> inicia os scripts da barra - barra_scripts (esta_barra, instancia, index) - - --> hida a barra - gump:Fade (esta_barra, 1) - - --> adiciona ela ao container de barras - instancia.barras [index] = esta_barra - - --> seta o texto da esqueda - esta_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) + --> set the left text + new_row.texto_esquerdo:SetText (Loc ["STRING_NEWROW"]) + --> refresh rows instancia:InstanceRefreshRows() - return esta_barra + return new_row end function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext) diff --git a/startup.lua b/startup.lua index 88e1b1e8..a5558bed 100644 --- a/startup.lua +++ b/startup.lua @@ -405,9 +405,13 @@ function _G._detalhes:Start() end --> minimap - _detalhes:RegisterMinimapAndHotCorner() + _detalhes:RegisterMinimap() + + function _detalhes:RegisterHotCorner() + _detalhes:DoRegisterHotCorner() + end + _detalhes:ScheduleTimer ("RegisterHotCorner", 5) - function _detalhes:OpenOptionsWindowAtStart() --_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1]) --print (_G ["DetailsClearSegmentsButton1"]:GetSize())