diff --git a/API Custom Displays.txt b/API Custom Displays.txt index 815fdb9e..d2429fa3 100644 --- a/API Custom Displays.txt +++ b/API Custom Displays.txt @@ -170,4 +170,37 @@ top is the amount of value of the actor with more value. container:WipeCustomActorContainer() removes all data from a custom container. -this is automatically performed when the search script runs. \ No newline at end of file +this is automatically performed when the search script runs. + + +Creating Customs from Plugins or 3rd Party Addons +======================================= +Custom Displays can be created through the Custom Display Manager accessed by Sword -> Customs -> Custom Display Manager. +But if you are in a plugin or another addon you'll need to create a hard-coded custom table, and after that, install with InstallCustomObject(). + +Details:InstallCustomObject (custom_object) +Adds a custom display on Details!. +custom_object is a table with several key telling what Details! should do when the user selects this custom on a window: + +name = the name of the custom display, is shown when the user is selecting on the list (string). +icon = icon path, is shown together with the name (string). +source = set false to use a custom search script (bool). +attribute = always use false here to be able to use the scripted search (bool). +spellid = the same as attribute, use false to be able to use the script (bool). +target = set false here when using script (bool). +author = who created this custom object (string). +desc = description of what this display do (string). +script_version = number to identify the version, when installing, Details! checks for custom displays with the same name and always use with the biggest script_version (number). +script = the code used when searching for results (string-code). +total_script = use total script when the result shown in the bar isn't the actor's total, e.g., an actor have 90 as total but you want to show "1min 30sec" instead. +percent_script = similar to total_script, use when you need the percentage to be something different than the default one. +tooltip = code ran when the user passes the mouse over a bar. + +Details:RemoveCustomObject (name) +Removes a custom display. + +Details:GetCustomObject (name) +Returns the object of a custom display already installed. + + + diff --git a/API UI.txt b/API UI.txt index 4c91aa19..dcef64ce 100644 --- a/API UI.txt +++ b/API UI.txt @@ -214,6 +214,8 @@ set the update speed of all windows, if nosave is true, it won't save this chang Details:SetUseAnimations (enabled, nosave) set on off bar animations on all windows, if nosave is true, it won't save this change (apply only). +Details:SetTrashSuppression (seconds) +how much time after a boss encounter kill, the window should not switch to trash segments. -------------------- Details.chat_embed:SetTabSettings (tab_name, is_enabled, is_single) diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index 8809fc5d..496ff4bc 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -1255,7 +1255,7 @@ function DF:CreateCoolTip() row.leftText:SetHeight (10) end - --> ~inicio ~start + --> ~inicio ~start ~tooltip function CoolTip:monta_tooltip() --> hide sub frame @@ -1417,7 +1417,7 @@ function DF:CreateCoolTip() button.divbar:SetDesaturated (true) end - --> ~inicio ~start + --> ~inicio ~start ~menu function CoolTip:monta_cooltip (host, instancia, options, sub_menus, icones, tamanho1, tamanho2, font, fontsize) if (CoolTip.Indexes == 0) then diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index e6d40211..3c4d6b7e 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,5 @@ -local dversion = 10 +local dversion = 11 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index 5e4bf8b7..a91b0cb0 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1474,7 +1474,8 @@ local SimplePanel_frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], e local SimplePanel_frame_backdrop_color = {0, 0, 0, 0.9} local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1} -function DF:CreateSimplePanel (parent, w, h, title, name) +local no_options = {} +function DF:CreateSimplePanel (parent, w, h, title, name, panel_options) if (not name) then name = "DetailsFrameworkSimplePanel" .. simple_panel_counter @@ -1483,6 +1484,8 @@ function DF:CreateSimplePanel (parent, w, h, title, name) if (not parent) then parent = UIParent end + + panel_options = panel_options or no_options local f = CreateFrame ("frame", name, UIParent) f:SetSize (w or 400, h or 250) @@ -1493,7 +1496,12 @@ function DF:CreateSimplePanel (parent, w, h, title, name) f:SetBackdrop (SimplePanel_frame_backdrop) f:SetBackdropColor (unpack (SimplePanel_frame_backdrop_color)) f:SetBackdropBorderColor (unpack (SimplePanel_frame_backdrop_border_color)) - tinsert (UISpecialFrames, name) + + f.DontRightClickClose = panel_options.DontRightClickClose + + if (not panel_options.NoTUISpecialFrame) then + tinsert (UISpecialFrames, name) + end local title_bar = CreateFrame ("frame", name .. "TitleBar", f) title_bar:SetPoint ("topleft", f, "topleft", 2, -3) @@ -1502,6 +1510,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name) title_bar:SetBackdrop (SimplePanel_frame_backdrop) title_bar:SetBackdropColor (.2, .2, .2, 1) title_bar:SetBackdropBorderColor (0, 0, 0, 1) + f.TitleBar = title_bar local close = CreateFrame ("button", name and name .. "CloseButton", title_bar) close:SetSize (16, 16) diff --git a/boot.lua b/boot.lua index 45db0cac..94e91079 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 = 2009 --it's 2009 for release - _detalhes.userversion = "v4.0.4" - _detalhes.realversion = 75 --core version + _detalhes.build_counter = 2059 --it's 2059 for release + _detalhes.userversion = "v4.0.5" + _detalhes.realversion = 76 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,14 +21,16 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Added slash command '/details api'.\n\n -|cFFFFFF00-|r Major update on our .txt about the API, these files are on the root folder of details! at WoW/Interface/AddOns/Details.\n\n +|cFFFFFF00v4.0.5 (|cFFFFCC00Oct 13, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n +|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n +|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n +|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window.\n\n|cFFFFFF00v3.16.0c (|cFFFFCC00Jul 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Encounter Details graphic for Archimonde encounter." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0.5 (|cFFFFCC00Oct 15, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index ff38b34e..960e4391 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -1050,6 +1050,15 @@ _detalhes.switch:OnRemoveCustom (index) end + --> export for plugins + function _detalhes:RemoveCustomObject (object_name) + for index, object in ipairs (_detalhes.custom) do + if (object.name == object_name) then + return atributo_custom:RemoveCustom (index) + end + end + end + function _detalhes:ResetCustomFunctionsCache() table.wipe (_detalhes.custom_function_cache) end @@ -1097,6 +1106,37 @@ atributo_custom:UpdateDamageDoneBracket() atributo_custom:UpdateHealingDoneBracket() end + + function _detalhes:InstallCustomObject (object) + local have = false + if (object.script_version) then + for _, custom in ipairs (_detalhes.custom) do + if (custom.name == object.name and (custom.script_version and custom.script_version >= object.script_version) ) then + have = true + break + end + end + else + for _, custom in ipairs (_detalhes.custom) do + if (custom.name == object.name) then + have = true + break + end + end + end + + if (not have) then + for i, custom in ipairs (_detalhes.custom) do + if (custom.name == object.name) then + table.remove (_detalhes.custom, i) + break + end + end + setmetatable (object, _detalhes.atributo_custom) + object.__index = _detalhes.atributo_custom + _detalhes.custom [#_detalhes.custom+1] = object + end + end function _detalhes:AddDefaultCustomDisplays() diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index 6986cb73..b497b08c 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -2543,8 +2543,10 @@ end end else if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then + --> setando o valor mesmo com animações pq o barra esta hidada com o value do último actor que ela mostrou if (use_animations) then esta_barra.animacao_fim = esta_porcentagem + esta_barra:SetValue (esta_porcentagem) else esta_barra:SetValue (esta_porcentagem) esta_barra.animacao_ignorar = true diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index 2f2167e0..23e7830a 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -799,13 +799,13 @@ function atributo_heal:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo if (esta_barra.hidden or esta_barra.fading_in or esta_barra.faded) then + esta_barra:SetValue (esta_porcentagem) if (use_animations) then esta_barra.animacao_fim = esta_porcentagem else - esta_barra:SetValue (esta_porcentagem) esta_barra.animacao_ignorar = true end - + gump:Fade (esta_barra, "out") if (instancia.row_info.texture_class_colors) then diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index caec0158..208a44e8 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -202,8 +202,16 @@ function _detalhes:GetShowingCombat() return self.showing end -function _detalhes:GetCustomObject() - return _detalhes.custom [self.sub_atributo] +function _detalhes:GetCustomObject (object_name) + if (object_name) then + for _, object in ipairs (_detalhes.custom) do + if (object.name == object_name) then + return object + end + end + else + return _detalhes.custom [self.sub_atributo] + end end function _detalhes:ResetAttribute() @@ -373,7 +381,6 @@ end _detalhes.solo = nil end - --print ("Abertas: " .. _detalhes.opened_windows) if (not _detalhes.initializing) then _detalhes:SendEvent ("DETAILS_INSTANCE_CLOSE", nil, self) end @@ -435,16 +442,12 @@ end local _R, _T, _L, _B = _detalhes.VPL (instance2, instance1), _detalhes.VPB (instance2, instance1), _detalhes.VPR (instance2, instance1), _detalhes.VPT (instance2, instance1) if (_R) then - --print ("R") instance2:MakeInstanceGroup ({false, false, 1, false}) elseif (_T) then - --print ("T") instance2:MakeInstanceGroup ({false, false, false, 1}) elseif (_L) then - --print ("L") instance2:MakeInstanceGroup ({1, false, false, false}) elseif (_B) then - --print ("B") instance2:MakeInstanceGroup ({false, 1, false, false}) end end @@ -583,6 +586,8 @@ end self:SetCombatAlpha (nil, nil, true) self:DesaturateMenu() + self:CheckFor_EnabledTrashSuppression() + if (not temp and not _detalhes.initializing) then _detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self) end @@ -808,7 +813,6 @@ function _detalhes:BaseFrameSnap() local my_baseframe = self.baseframe for lado, snap_to in _pairs (self.snap) do - --print ("DEBUG instancia " .. snap_to .. " lado "..lado) local instancia_alvo = _detalhes.tabela_instancias [snap_to] if (instancia_alvo.ativa and instancia_alvo.baseframe) then @@ -979,8 +983,6 @@ function _detalhes:agrupar_janelas (lados) elseif (lado == 1) then --> esquerda --> mover frame - --print (esta_instancia.baseframe:GetPoint (0)[2], esta_instancia.baseframe:GetPoint (0)[2] == instancia.baseframe) - instancia.baseframe:SetPoint ("TOPLEFT", esta_instancia.baseframe, "TOPRIGHT") instancia.baseframe:SetPoint ("LEFT", esta_instancia.baseframe, "RIGHT") instancia.baseframe:SetPoint ("BOTTOMLEFT", esta_instancia.baseframe, "BOTTOMRIGHT") @@ -1061,7 +1063,6 @@ function _detalhes:Desagrupar (instancia, lado, lado2) _detalhes:DelayOptionsRefresh (nil, true) if (not lado) then - --print ("DEBUG: Desagrupar esta sem lado") return end @@ -1107,7 +1108,6 @@ function _detalhes:Desagrupar (instancia, lado, lado2) local esta_instancia = _detalhes.tabela_instancias [instancia.snap[lado]] if (not esta_instancia) then - --print ("DEBUG: Erro, a instancia nao existe") return end @@ -1135,11 +1135,6 @@ function _detalhes:Desagrupar (instancia, lado, lado2) esta_instancia:SaveMainWindowPosition() esta_instancia:RestoreMainWindowPosition() end - - --print ("DEBUG: Details: Instancias desagrupadas") - - --_detalhes:RefreshAgrupamentos() - end function _detalhes:SnapTextures (remove) @@ -1549,6 +1544,8 @@ end --backtable indexes: [1]: mode [2]: attribute [3]: sub attribute [4]: segment [5]: raidmode index [6]: solomode index function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) + local old_attribute, old_sub_atribute = self:GetDisplay() + self:SwitchBack() local role = _UnitGroupRolesAssigned ("player") @@ -1574,8 +1571,11 @@ function _detalhes:CheckSwitchOnCombatEnd (nowipe, warning) end if (warning and got_switch) then - local attribute_name = self:GetInstanceAttributeText() - self:InstanceAlert (string.format (Loc ["STRING_SWITCH_WARNING"], attribute_name), {[[Interface\CHARACTERFRAME\UI-StateIcon]], 18, 18, false, 0.5, 1, 0, 0.5}, 4) + local current_attribute, current_sub_atribute = self:GetDisplay() + if (current_attribute ~= old_attribute or current_sub_atribute ~= old_sub_atribute) then + local attribute_name = self:GetInstanceAttributeText() + self:InstanceAlert (string.format (Loc ["STRING_SWITCH_WARNING"], attribute_name), {[[Interface\CHARACTERFRAME\UI-StateIcon]], 18, 18, false, 0.5, 1, 0, 0.5}, 4) + end end if (self.switch_all_roles_after_wipe and not nowipe) then @@ -1691,8 +1691,6 @@ function _detalhes:ApplySavedSkin (style) local skin = style.skin self.skin = "" self:ChangeSkin (skin) - - -- /script print (_detalhes.tabela_instancias[1].baseframe:GetAlpha()) --> overwrite all instance parameters with saved ones for key, value in pairs (style) do @@ -1780,9 +1778,6 @@ end function _detalhes:SetBackgroundAlpha (alpha) if (not alpha) then alpha = self.bg_alpha --- else --- print (alpha) --- alpha = _detalhes:Scale (0, 1, 0.2, 1, alpha) - 0.8 end self.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, alpha) @@ -1851,7 +1846,7 @@ function _detalhes:PostponeSwitchToCurrent (instance) return end end - if (instance.is_interacting) then + if (instance.is_interacting and instance.last_interaction < _detalhes._tempo) then instance.last_interaction = _detalhes._tempo end instance._postponing_switch = _detalhes:ScheduleTimer ("PostponeSwitchToCurrent", 1, instance) @@ -1860,7 +1855,7 @@ end function _detalhes:CheckSwitchToCurrent() for _, instance in _ipairs (_detalhes.tabela_instancias) do if (instance.ativa and instance.auto_current and instance.baseframe and instance.segmento > 0) then - if (instance.is_interacting) then + if (instance.is_interacting and instance.last_interaction < _detalhes._tempo) then instance.last_interaction = _detalhes._tempo end @@ -1924,6 +1919,7 @@ function _detalhes:AtualizaSegmentos (instancia) elseif (instancia.segmento == 0) then --instancia.baseframe.rodape.segmento:SetText (segmentos.current) --> localiza-me instancia.showing = _detalhes.tabela_vigente + --print ("==> Changing the Segment now! - classe_instancia.lua 1922") else instancia.showing = _detalhes.tabela_historico.tabelas [instancia.segmento] --instancia.baseframe.rodape.segmento:SetText (segmentos.past..instancia.segmento) --> localiza-me @@ -1943,7 +1939,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) if (segmento == _detalhes.segments_amount) then --> significa que o index [5] passou a ser [6] com a entrada da nova tabela instancia.showing = historico.tabelas [_detalhes.segments_amount] --> então ele volta a pegar o index [5] que antes era o index [4] - + --print ("==> Changing the Segment now! - classe_instancia.lua 1942") gump:Fade (instancia, _fadeType, _fadeSpeed, "barras") instancia.showing[instancia.atributo].need_refresh = true instancia.v_barras = true @@ -1953,6 +1949,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico) elseif (segmento < _detalhes.segments_amount and segmento > 0) then instancia.showing = historico.tabelas [segmento] + --print ("==> Changing the Segment now! - classe_instancia.lua 1952") gump:Fade (instancia, _fadeType, _fadeSpeed, "barras") --"in", nil instancia.showing[instancia.atributo].need_refresh = true @@ -2115,6 +2112,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.showing = _detalhes.tabela_overall elseif (segmento == 0) then --> combate atual instancia.showing = _detalhes.tabela_vigente + --print ("==> Changing the Segment now! - classe_instancia.lua 2115") else --> alguma tabela do histórico instancia.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2147,7 +2145,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini if (segmento == -1) then --> overall instance.showing = _detalhes.tabela_overall elseif (segmento == 0) then --> combate atual - instance.showing = _detalhes.tabela_vigente + instance.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2148") else --> alguma tabela do histórico instance.showing = _detalhes.tabela_historico.tabelas [segmento] end @@ -2176,8 +2174,6 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini end --> Muda o atributo caso necessário - --print ("DEBUG atributos", instancia, segmento, atributo, sub_atributo, iniciando_instancia) - if (atributo == 5) then if (#_detalhes.custom < 1) then atributo = 1 @@ -2276,7 +2272,6 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini instancia.sub_atributo = sub_atributo if (sub_attribute_click) then - --print ("aqui", instancia.sub_atributo) instancia.sub_atributo_last [instancia.atributo] = instancia.sub_atributo end @@ -2317,7 +2312,6 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini if (not _detalhes.initializing and not iniciando_instancia) then instancia:ResetaGump() - --print ("atualizando: ", instancia.atributo, instancia.sub_atributo) instancia:AtualizaGumpPrincipal (true) end @@ -2542,8 +2536,6 @@ end function _detalhes:ChangeIcon (icon) local skin = _detalhes.skins [self.skin] - - --print (debugstack()) if (not self.hide_icon) then if (skin.icon_on_top) then @@ -2639,11 +2631,9 @@ function _detalhes:AlteraModo (instancia, qual, from_mode_menu) if (not instancia.atributo) then instancia.atributo = 1 instancia.sub_atributo = 1 - --print ("Details found a internal probleam and fixed: 'instancia.atributo' were null, now is 1.") end if (not instancia.showing[instancia.atributo]) then - instancia.showing = _detalhes.tabela_vigente - --print ("Details found a internal problem and fixed: container for instancia.showing were null, now is current combat.") + instancia.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2636") end instancia.atributo = instancia.atributo or 1 instancia.showing[instancia.atributo].need_refresh = true @@ -3020,7 +3010,6 @@ function _detalhes:monta_relatorio (este_relatorio, custom) atributo = 1 container = self.showing [atributo]._ActorTable end - --print (total, keyName, first, atributo, container_amount) end amt = math.min (amt, container_amount or 0) diff --git a/core/control.lua b/core/control.lua index c40977ec..149ad82e 100644 --- a/core/control.lua +++ b/core/control.lua @@ -190,7 +190,11 @@ end end - _detalhes:SendEvent ("COMBAT_BOSS_FOUND", nil, index, name) + --> we the boss was found during the combat table creation, we must postpone the event trigger + if (not _detalhes.tabela_vigente.IsBeingCreated) then + _detalhes:SendEvent ("COMBAT_BOSS_FOUND", nil, index, name) + _detalhes:CheckFor_SuppressedWindowsOnEncounterFound() + end return boss_table end @@ -292,7 +296,7 @@ -- ~start ~inicio ~novo ñovo function _detalhes:EntrarEmCombate (...) - + if (_detalhes.debug) then _detalhes:Msg ("(debug) started a new combat.") end @@ -306,18 +310,19 @@ end --> re-lock nos tempos da tabela passada -- lock again last table times - _detalhes.tabela_vigente:TravarTempos() --> lá em cima é feito wipe, não deveria ta dando merda nisso aqui? ou ela puxa da __index e da zero jogadores no mapa e container + _detalhes.tabela_vigente:TravarTempos() local n_combate = _detalhes:NumeroCombate (1) --aumenta o contador de combates -- combat number up --> cria a nova tabela de combates -- create new table local ultimo_combate = _detalhes.tabela_vigente _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (true, _detalhes.tabela_overall, n_combate, ...) --cria uma nova tabela de combate + + --> flag this combat as being created + _detalhes.tabela_vigente.IsBeingCreated = true + _detalhes.tabela_vigente.previous_combat = ultimo_combate - --> verifica se há alguma instância mostrando o segmento atual -- change segment - _detalhes:InstanciaCallFunction (_detalhes.TrocaSegmentoAtual) - _detalhes.tabela_vigente:seta_data (_detalhes._detalhes_props.DATA_TYPE_START) --seta na tabela do combate a data do inicio do combate -- setup time data _detalhes.in_combat = true --sinaliza ao addon que há um combate em andamento -- in combat flag up _detalhes.tabela_vigente.combat_id = n_combate --> grava o número deste combate na tabela atual -- setup combat id on new table @@ -340,8 +345,31 @@ _table_wipe (_detalhes.cache_healing_group) _detalhes:UpdateParserGears() + --> get all buff already applied before the combat start + _detalhes:CatchRaidBuffUptime ("BUFF_UPTIME_IN") + _detalhes:CatchRaidDebuffUptime ("DEBUFF_UPTIME_IN") + _detalhes:UptadeRaidMembersCache() + + --> we already have boss information? build .is_boss table + if (_detalhes.encounter_table.id and _detalhes.encounter_table ["start"] >= GetTime() - 3 and not _detalhes.encounter_table ["end"]) then + local encounter_table = _detalhes.encounter_table + --> boss_found will trigger "COMBAT_BOSS_FOUND" event, but at this point of the combat creation is safe to send it + boss_found (encounter_table.index, encounter_table.name, encounter_table.zone, encounter_table.mapid, encounter_table.diff, encounter_table.id) + else + --> if we don't have this infor right now, lets check in few seconds dop + if (_detalhes.EncounterInformation [_detalhes.zone_id]) then + _detalhes:ScheduleTimer ("ReadBossFrames", 1) + _detalhes:ScheduleTimer ("ReadBossFrames", 30) + end + end + + --> if the window is showing current segment, switch it for the new combat + --> also if the window has auto current, jump to current segment + _detalhes:InstanciaCallFunction (_detalhes.TrocaSegmentoAtual, _detalhes.tabela_vigente.is_boss and true) + + --> clear hosts and make the cloud capture stuff _detalhes.host_of = nil - _detalhes.host_by = nil + _detalhes.host_by = nil if (_detalhes.in_group and _detalhes.cloud_capture) then if (_detalhes:IsInInstance() or _detalhes.debug) then @@ -361,11 +389,7 @@ _detalhes:Msg ("(debug) isn't in group or cloud is turned off", _detalhes.in_group, _detalhes.cloud_capture) end end - - _detalhes:CatchRaidBuffUptime ("BUFF_UPTIME_IN") - _detalhes:CatchRaidDebuffUptime ("DEBUFF_UPTIME_IN") - _detalhes:UptadeRaidMembersCache() - + --> hide / alpha / switch in combat for index, instancia in ipairs (_detalhes.tabela_instancias) do if (instancia.ativa) then @@ -376,9 +400,16 @@ _detalhes:InstanceCall (_detalhes.CheckPsUpdate) - _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente, _detalhes.encounter_table and _detalhes.encounter_table.id) - _detalhes:CheckSwitchToCurrent() + --> combat creation is completed, remove the flag + _detalhes.tabela_vigente.IsBeingCreated = nil + _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente, _detalhes.encounter_table and _detalhes.encounter_table.id) + if (_detalhes.tabela_vigente.is_boss) then + --> the encounter was found through encounter_start event + _detalhes:SendEvent ("COMBAT_BOSS_FOUND", nil, _detalhes.tabela_vigente.is_boss.index, _detalhes.tabela_vigente.is_boss.name) + end + + _detalhes:CheckSwitchToCurrent() _detalhes:CheckForTextTimeCounter (true) end @@ -540,10 +571,8 @@ --> verifica memoria _detalhes:FlagActorsOnCommonFight() --fight_component _detalhes:CheckMemoryAfterCombat() - --print ("isn't boss") else - --print ("is boss") if (not InCombatLockdown() and not UnitAffectingCombat ("player")) then _detalhes:FlagActorsOnBossFight() else @@ -569,6 +598,8 @@ end _detalhes:SendEvent ("COMBAT_BOSS_DEFEATED", nil, _detalhes.tabela_vigente) + + _detalhes:CheckFor_TrashSuppressionOnEncounterEnd() else _detalhes:SendEvent ("COMBAT_BOSS_WIPE", nil, _detalhes.tabela_vigente) end @@ -1145,7 +1176,7 @@ not instance.last_interaction or ( (instance.ativa) and - (instance.last_interaction+3 < _detalhes._tempo) and + (instance.last_interaction+3 < _tempo) and (not DetailsReportWindow or not DetailsReportWindow:IsShown()) and (not _detalhes.janela_info:IsShown()) ) @@ -1157,30 +1188,68 @@ return end end - if (instance.is_interacting) then - instance.last_interaction = _detalhes._tempo + if (instance.is_interacting and instance.last_interaction < _tempo) then + instance.last_interaction = _tempo end instance._postponing_current = _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 1, instance) end - function _detalhes:TrocaSegmentoAtual (instancia) + function _detalhes:TrocaSegmentoAtual (instancia, is_encounter) if (instancia.segmento == 0 and instancia.baseframe and instancia.ativa) then - if (instancia.is_interacting) then - instancia.last_interaction = _detalhes._tempo + + if (not is_encounter) then + if (instancia.is_interacting) then + if (not instancia.last_interaction or instancia.last_interaction < _tempo) then + instancia.last_interaction = _tempo or time() + end + end + + if ((instancia.last_interaction and (instancia.last_interaction+3 > _detalhes._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (_detalhes.janela_info:IsShown())) then + --> postpone + instancia._postponing_current = _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 1, instancia) + return + end end - if ((instancia.last_interaction and (instancia.last_interaction+3 > _detalhes._tempo)) or (DetailsReportWindow and DetailsReportWindow:IsShown()) or (_detalhes.janela_info:IsShown())) then - --> postpone - instancia._postponing_current = _detalhes:ScheduleTimer ("PostponeInstanceToCurrent", 1, instancia) - return - end + --print ("==> Changing the Segment now! - control.lua 1220") + instancia.last_interaction = _tempo - 4 --pode setar, completou o ciclo instancia._postponing_current = nil - instancia.showing =_detalhes.tabela_vigente + instancia.showing = _detalhes.tabela_vigente instancia:ResetaGump() _detalhes.gump:Fade (instancia, "in", nil, "barras") end end + + function _detalhes:SetTrashSuppression (n) + assert (type (n) == "number", "SetTrashSuppression expects a number on index 1.") + if (n < 0) then + n = 0 + end + _detalhes.instances_suppress_trash = n + end + function _detalhes:CheckFor_SuppressedWindowsOnEncounterFound() + for _, instance in _detalhes:ListInstances() do + if (instance.ativa and instance.baseframe and instance.last_interaction > _tempo and instance.segmento == 0) then + _detalhes:TrocaSegmentoAtual (instance, true) + end + end + end + function _detalhes:CheckFor_EnabledTrashSuppression() + if (_detalhes.HasTrashSuppression and _detalhes.HasTrashSuppression > _tempo) then + self.last_interaction = _detalhes.HasTrashSuppression + end + end + function _detalhes:SetTrashSuppressionAfterEncounter() + _detalhes:InstanceCall ("CheckFor_EnabledTrashSuppression") + end + function _detalhes:CheckFor_TrashSuppressionOnEncounterEnd() + if (_detalhes.instances_suppress_trash > 0) then + _detalhes.HasTrashSuppression = _tempo + _detalhes.instances_suppress_trash + --> delaying in 3 seconds for other stuff like auto open windows after combat. + _detalhes:ScheduleTimer ("SetTrashSuppressionAfterEncounter", 3) + end + end --> internal GetCombatId() version function _detalhes:NumeroCombate (flag) diff --git a/core/parser.lua b/core/parser.lua index 906608b3..fbb511a9 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -3296,11 +3296,7 @@ end function _detalhes.parser_functions:PLAYER_REGEN_DISABLED (...) - if (_detalhes.EncounterInformation [_detalhes.zone_id]) then - _detalhes:ScheduleTimer ("ReadBossFrames", 1) - _detalhes:ScheduleTimer ("ReadBossFrames", 30) - end - + if (not _detalhes:CaptureGet ("damage")) then _detalhes:EntrarEmCombate() end diff --git a/core/util.lua b/core/util.lua index 9e8fb755..091ca6cf 100644 --- a/core/util.lua +++ b/core/util.lua @@ -281,6 +281,17 @@ end end + function _detalhes.table.overwrite (t1, t2) + for key, value in pairs (t2) do + if (type (value) == "table") then + t1 [key] = t1 [key] or {} + _detalhes.table.overwrite (t1 [key], t2 [key]) + else + t1 [key] = value + end + end + end + function _detalhes.table.dump (t, s, deep) s = s or "" diff --git a/functions/link.lua b/functions/link.lua index 0eb31c47..9fff50ce 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -1177,6 +1177,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size, other_values) + --print (aura_type, spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size, other_values) + --> check if wa is installed if (not WeakAuras or not WeakAurasSaved) then return @@ -1358,7 +1360,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names [1] = spellname add.trigger.unit = "player" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 2) then --Debuff on Target local add = _detalhes.table.copy ({}, debuff_prototype) @@ -1366,7 +1368,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names[1] = spellname add.trigger.unit = "target" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 3) then --Debuff on Focus local add = _detalhes.table.copy ({}, debuff_prototype) @@ -1374,7 +1376,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names[1] = spellname add.trigger.unit = "focus" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 11) then --Buff on Player local add = _detalhes.table.copy ({}, buff_prototype) @@ -1382,7 +1384,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names[1] = spellname add.trigger.unit = "player" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 12) then --Buff on Target local add = _detalhes.table.copy ({}, buff_prototype) @@ -1390,7 +1392,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names[1] = spellname add.trigger.unit = "target" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 13) then --Buff on Focus local add = _detalhes.table.copy ({}, buff_prototype) @@ -1398,7 +1400,7 @@ add.trigger.spellIds[1] = spellid add.trigger.names[1] = spellname add.trigger.unit = "focus" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 21) then --Spell Cast Started local add = _detalhes.table.copy ({}, cast_prototype) @@ -1409,7 +1411,7 @@ add.trigger.use_spellName = true add.trigger.use_spellId = false end - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (target == 22) then --Spell Cast Successful local add = _detalhes.table.copy ({}, cast_prototype) @@ -1419,7 +1421,7 @@ add.trigger.use_spellName = true add.trigger.use_spellId = false end - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end else new_aura.trigger.spellId = tostring (spellid) @@ -1440,7 +1442,7 @@ stacksize = floor (stacksize) local add = _detalhes.table.copy ({}, stack_prototype) add.trigger.count = tostring (stacksize) - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end --> icon text @@ -1450,7 +1452,7 @@ else local add = _detalhes.table.copy ({}, widget_text_prototype) add.displayStacks = icon_text - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end end @@ -1480,19 +1482,19 @@ local add = _detalhes.table.copy ({}, sound_prototype_custom) add.actions.start.sound_path = sound.sound_path add.actions.start.sound_channel = sound.sound_channel or "Master" - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) elseif (sound and sound ~= "" and not sound:find ("Quiet.ogg")) then local add = _detalhes.table.copy ({}, sound_prototype) add.actions.start.sound = sound - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end --> chat message if (chat and chat ~= "") then local add = _detalhes.table.copy ({}, chat_prototype) add.actions.start.message = chat - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end --> check if already exists a aura with this name @@ -1509,7 +1511,7 @@ if (icon_glow) then local add = _detalhes.table.copy ({}, glow_prototype) add.actions.start.glow_frame = "WeakAuras:" .. new_aura.id - _detalhes.table.deploy (new_aura, add) + _detalhes.table.overwrite (new_aura, add) end --> add the aura on a group diff --git a/functions/profiles.lua b/functions/profiles.lua index 1479b622..9b283462 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -881,6 +881,7 @@ local default_profile = { disable_lock_ungroup_buttons = false, disable_stretch_from_toolbar = false, disable_stretch_button = false, + disable_alldisplays_window = false, damage_taken_everything = false, --> info window @@ -902,6 +903,7 @@ local default_profile = { instances_disable_bar_highlight = false, instances_menu_click_to_open = false, instances_no_libwindow = false, + instances_suppress_trash = 0, --> if clear ungroup characters when logout clear_ungrouped = true, @@ -1019,7 +1021,8 @@ local default_profile = { tooltip_max_targets = 2, tooltip_max_pets = 2, - menus_bg_coords = {331/512, 63/512, 109/512, 143/512}, + --menus_bg_coords = {331/512, 63/512, 109/512, 143/512}, --with gradient on right side + menus_bg_coords = {0.309777336120606, 0.924000015258789, 0.213000011444092, 0.279000015258789}, menus_bg_color = {.8, .8, .8, 0.2}, menus_bg_texture = [[Interface\SPELLBOOK\Spellbook-Page-1]], diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 32db90c7..733b0c10 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -752,9 +752,43 @@ local menus2 = { selected_texture:SetVertexColor (1, 1, 1, 0.8) selected_texture:SetBlendMode ("ADD") - local button_onenter = function (self) + local is_appearance = { + [3] = true, + [4] = true, + [5] = true, + [8] = true, + [14] = true, + [7] = true, + [6] = true, + [17] = true, + [9] = true, + [18] = true, + } + local button_onenter = function (self, capsule) self.MyObject.my_bg_texture:SetVertexColor (1, 1, 1, 1) self.MyObject.textcolor = "yellow" + + --[[ + if (is_appearance [capsule.menu_index]) then + GameCooltip:Reset() + GameCooltip:SetType ("tooltip") + + _detalhes:CooltipPreset (2) + GameCooltip:AddLine (Loc ["STRING_OPTIONS_SKIN_A_DESC"]) + GameCooltip:AddLine (" ") + GameCooltip:AddLine ("Editing Window: 1") + GameCooltip:AddLine ("You may change the editing window at the bottom right corner.") + + GameCooltip:SetOption ("FixedWidth", 200) + --GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) + --GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) + GameCooltip:SetOption ("NoLastSelectedBar", true) + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) + GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) + GameCooltip:SetOwner (self, "topright", "topleft", -5, 0) + GameCooltip:ShowCooltip() + end + --]] end local button_onleave = function (self) self.MyObject.my_bg_texture:SetVertexColor (1, 1, 1, .5) @@ -763,6 +797,7 @@ local menus2 = { else self.MyObject.textcolor = selected_textcolor end + GameCooltip:Hide() end local button_mouse_up = function (button) button = button.MyObject @@ -798,6 +833,7 @@ local menus2 = { button.textcolor = textcolor button.textsize = 11 button.my_bg_texture = texture + button.menu_index = menus_settings [true_index] tinsert (all_buttons, button) y = y - 16 @@ -2460,8 +2496,34 @@ function window:CreateFrame18() frame18.ReportFormatDropdown:SetPoint ("left", frame18.ReportFormatLabel, "right", 2, 0) window:CreateLineBackground2 (frame18, "ReportFormatDropdown", "ReportFormatLabel", Loc ["STRING_OPTIONS_REPORT_SCHEMA_DESC"]) - + + --> trash suppression + g:NewLabel (frame18, _, "$parentTrashSuppressionLabel", "TrashSuppressionLabel", "Trash Suppression", "GameFontHighlightLeft") + g:NewSlider (frame18, _, "$parentTrashSuppressionSlider", "TrashSuppressionSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 0, 180, 1, _detalhes.instances_suppress_trash, nil, nil, nil, options_slider_template) + + frame18.TrashSuppressionSlider:SetPoint ("left", frame18.TrashSuppressionLabel, "right", 2) + + frame18.TrashSuppressionSlider:SetHook ("OnValueChange", function (_, _, amount) + _detalhes:SetTrashSuppression (amount) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end) + + window:CreateLineBackground2 (frame18, "TrashSuppressionSlider", "TrashSuppressionLabel", "For |cFFFFFF00X|r seconds, suppress auto switching to show trash segments (|cFFFFFF00only after defeat a boss encounter|r).") + + --> disable all displays window + g:NewLabel (frame18, _, "$parentDisableAllDisplaysWindowLabel", "DisableAllDisplaysWindowLabel", Loc ["STRING_OPTIONS_DISABLE_ALLDISPLAYSWINDOW"], "GameFontHighlightLeft") + g:NewSwitch (frame18, _, "$parentDisableAllDisplaysWindowSlider", "DisableAllDisplaysWindowSlider", 60, 20, _, _, _detalhes.disable_alldisplays_window, nil, nil, nil, nil, options_switch_template) + + frame18.DisableAllDisplaysWindowSlider:SetPoint ("left", frame18.DisableAllDisplaysWindowLabel, "right", 2) + frame18.DisableAllDisplaysWindowSlider:SetAsCheckBox() + frame18.DisableAllDisplaysWindowSlider.OnSwitch = function (_, _, value) + _detalhes.disable_alldisplays_window = value + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame18, "DisableAllDisplaysWindowSlider", "DisableAllDisplaysWindowLabel", Loc ["STRING_OPTIONS_DISABLE_ALLDISPLAYSWINDOW_DESC"]) + --> Anchors g:NewLabel (frame18, _, "$parentInstancesMiscAnchor", "instancesMiscLabel", Loc ["STRING_OPTIONS_INSTANCES"], "GameFontNormal") @@ -2489,11 +2551,12 @@ function window:CreateFrame18() {"autoSwitchLabel", 8, true}, {"AutoSwitchWipeLabel", 9}, - {"autoCurrentLabel", 10}, - {"reportAnchorLabel", 11, true}, - {"ReportHelpfulLinkLabel", 12}, - {"ReportFormatLabel", 13}, + {"TrashSuppressionLabel", 11}, + + {"reportAnchorLabel", 12, true}, + {"ReportHelpfulLinkLabel", 13}, + {"ReportFormatLabel", 14}, } window:arrange_menu (frame18, left_side, x, -90) @@ -2508,9 +2571,10 @@ function window:CreateFrame18() {"DisableLockResizeUngroupLabel", 7}, {"DisableStretchButtonLabel", 8}, {"DisableBarHighlightLabel", 9}, - {"DamageTakenEverythingLabel", 10}, - {"ClickToOpenMenusLabel", 11}, - {"scrollLabel", 12, true}, + {"DisableAllDisplaysWindowLabel", 10}, + {"DamageTakenEverythingLabel", 11}, + {"ClickToOpenMenusLabel", 12}, + {"scrollLabel", 13, true}, } @@ -10067,7 +10131,11 @@ function window:CreateFrame12() if (not value) then for index, instancia in ipairs (_detalhes.tabela_instancias) do if (instancia.modo == 4) then -- 4 = raid - _detalhes:TrocaTabela (instancia, 0, 1, 1, nil, 2) + if (instancia:IsEnabled()) then + _detalhes:TrocaTabela (instancia, 0, 1, 1, nil, 2) + else + instancia.modo = 2 -- group mode + end end end end @@ -10791,13 +10859,14 @@ end --> if not window end _G.DetailsOptionsWindow18AutoCurrentSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow18AutoCurrentSlider.MyObject:SetValue (editing_instance.auto_current) + _G.DetailsOptionsWindow18AutoCurrentSlider.MyObject:SetValue (editing_instance.auto_current) + _G.DetailsOptionsWindow18TrashSuppressionSlider.MyObject:SetValue (editing_instance.instances_suppress_trash) _G.DetailsOptionsWindow18MenuTextSizeSlider.MyObject:SetValue (_detalhes.font_sizes.menus) _G.DetailsOptionsWindow18FontDropdown.MyObject:Select (_detalhes.font_faces.menus) - - + + _G.DetailsOptionsWindow18DisableAllDisplaysWindowSlider.MyObject:SetValue (_detalhes.disable_alldisplays_window) _G.DetailsOptionsWindow18DisableStretchButtonSlider.MyObject:SetValue (_detalhes.disable_stretch_button) _G.DetailsOptionsWindow18DisableBarHighlightSlider.MyObject:SetValue (_detalhes.instances_disable_bar_highlight) _G.DetailsOptionsWindow18ClickToOpenMenusSlider.MyObject:SetValue (_detalhes.instances_menu_click_to_open) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index e4a6d8f2..28396e79 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -115,7 +115,7 @@ end -- icones: 365 = 0.35693359375 // 397 = 0.38720703125 -function _detalhes:AtualizarScrollBar (x) +function _detalhes:AtualizarScrollBar (x) --> x = quantas barras esta sendo mostrado local cabe = self.rows_fit_in_window --> quantas barras cabem na janela @@ -348,13 +348,14 @@ end _detalhes.OnLeaveMainWindow = OnLeaveMainWindow local function OnEnterMainWindow (instancia, self) - instancia.is_interacting = true instancia:SetMenuAlpha (nil, nil, nil, nil, true) instancia:SetAutoHideMenu (nil, nil, true) instancia:RefreshAttributeTextSize() - instancia.last_interaction = _detalhes._tempo or time() + if (not instancia.last_interaction or instancia.last_interaction < _detalhes._tempo) then + instancia.last_interaction = _detalhes._tempo or time() + end if (instancia.baseframe:GetFrameLevel() > instancia.rowframe:GetFrameLevel()) then instancia.rowframe:SetFrameLevel (instancia.baseframe:GetFrameLevel()) @@ -1033,7 +1034,7 @@ local BGFrame_scripts_onmousedown = function (self, button) end end elseif (button == "RightButton") then - if (self.is_toolbar) then + if (self.is_toolbar and not _detalhes.disable_alldisplays_window) then self._instance:ShowAllSwitch() else if (_detalhes.switch.current_instancia and _detalhes.switch.current_instancia == self._instance) then @@ -1613,6 +1614,10 @@ local resize_scripts_onenter = function (self) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) GameCooltip:SetOption ("NoLastSelectedBar", true) + + GameCooltip:SetOption ("YSpacingMod", -3) + GameCooltip:SetOption ("FixedHeight", 106) + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:SetOwner (self) @@ -1669,6 +1674,10 @@ local lockFunctionOnEnter = function (self) GameCooltip:SetOption ("NoLastSelectedBar", true) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) + + GameCooltip:SetOption ("YSpacingMod", -3) + GameCooltip:SetOption ("FixedHeight", 32) + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:SetOwner (self) @@ -1781,6 +1790,10 @@ local unSnapButtonOnEnter = function (self) GameCooltip:AddFromTable (unSnapButtonTooltip) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) + + GameCooltip:SetOption ("YSpacingMod", -3) + GameCooltip:SetOption ("FixedHeight", 32) + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:ShowCooltip (self, "tooltip") @@ -2421,7 +2434,7 @@ function _detalhes:ReportSingleLine (instancia, barra) --> dump cooltip local GameCooltip = GameCooltip - if (GameCoolTipFrame1:IsShown()) then + if (GameCooltipFrame1:IsShown()) then local actor_name = barra.texto_esquerdo:GetText() or "" actor_name = actor_name:gsub ((".*%."), "") @@ -2784,16 +2797,18 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef function (self, delta) if (delta > 0) then --> rolou pra cima local A = instancia.barraS[1] - if (A > 1) then - scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height * _detalhes.scroll_speed) - else - scrollbar:SetValue (0) - scrollbar.ultimo = 0 - baseframe.button_up:Disable() + if (A) then + if (A > 1) then + scrollbar:SetValue (scrollbar:GetValue() - instancia.row_height * _detalhes.scroll_speed) + else + scrollbar:SetValue (0) + scrollbar.ultimo = 0 + baseframe.button_up:Disable() + end end elseif (delta < 0) then --> rolou pra baixo local B = instancia.barraS[2] - --if (B) then + if (B) then if (B < (instancia.rows_showing or 0)) then scrollbar:SetValue (scrollbar:GetValue() + instancia.row_height * _detalhes.scroll_speed) else @@ -2802,7 +2817,7 @@ local function iterate_scroll_scripts (backgrounddisplay, backgroundframe, basef scrollbar.ultimo = maxValue baseframe.button_down:Disable() end - --end + end end end) @@ -5425,8 +5440,7 @@ local OnClickNovoMenu = function (_, _, id, instance) end function _detalhes:SetTooltipMinWidth() - GameCooltip:SetOption ("MinWidth", 140) --- /dump GameCooltipFrame1:GetWidth() + GameCooltip:SetOption ("MinWidth", 155) end local build_mode_list = function (self, elapsed) @@ -6125,13 +6139,8 @@ local build_segment_list = function (self, elapsed) CoolTip:SetOption ("HeighMod", 12) _detalhes:SetTooltipMinWidth() - - - --CoolTip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) - --CoolTip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, {66/512, 1, 78/512, 435/512}, _detalhes.tooltip.menus_bg_color, true) CoolTip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) - --CoolTip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, {331/512, 63/512, 109/512, 143/512}, _detalhes.tooltip.menus_bg_color, true) CoolTip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) CoolTip:SetBackdrop (2, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) @@ -7608,7 +7617,7 @@ end GameCooltip:Reset() GameCooltip:SetType ("menu") GameCooltip:SetOption ("ButtonsYMod", -2) - GameCooltip:SetOption ("YSpacingMod", 0) + GameCooltip:SetOption ("YSpacingMod", -3) GameCooltip:SetOption ("TextHeightMod", 0) GameCooltip:SetOption ("IgnoreButtonAutoHeight", false) @@ -7617,16 +7626,16 @@ end _detalhes:SetTooltipMinWidth() - GameCooltip:AddLine (Loc ["STRING_ERASE_DATA"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) - GameCooltip:AddIcon ([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red") - GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar) - - GameCooltip:AddLine ("$div", nil, 1, nil, -5, -11) - GameCooltip:AddLine (Loc ["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "orange") GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar_overall) + GameCooltip:AddLine ("$div", nil, 1, nil, -5, -11) + + GameCooltip:AddLine (Loc ["STRING_ERASE_DATA"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) + GameCooltip:AddIcon ([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red") + GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar) + GameCooltip:SetWallpaper (1, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) @@ -7813,7 +7822,7 @@ local report_on_enter = function (self, motion, forced, from_click) GameCooltip:AddMenu (1, _detalhes.ReportFromLatest, index) end - GameCooltip:AddLine ("$div") + GameCooltip:AddLine ("$div", nil, nil, -4) end GameCooltip:AddLine (Loc ["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) diff --git a/startup.lua b/startup.lua index 81eda558..937dbbce 100644 --- a/startup.lua +++ b/startup.lua @@ -610,6 +610,60 @@ function _G._detalhes:Start() _detalhes.chat_embed:CheckChatEmbed (true) + --_detalhes:SetTutorialCVar ("MEMORY_USAGE_ALERT1", false) + if (not _detalhes:GetTutorialCVar ("MEMORY_USAGE_ALERT1")) then + function _detalhes:AlertAboutMemoryUsage() + if (DetailsWelcomeWindow and DetailsWelcomeWindow:IsShown()) then + return _detalhes:ScheduleTimer ("AlertAboutMemoryUsage", 30) + end + + local f = _detalhes.gump:CreateSimplePanel (UIParent, 500, 290, Loc ["STRING_MEMORY_ALERT_TITLE"], "AlertAboutMemoryUsagePanel", {NoTUISpecialFrame = true, DontRightClickClose = true}) + f:SetPoint ("center", UIParent, "center", -200, 100) + f.Close:Hide() + _detalhes:SetFontColor (f.Title, "yellow") + + local gnoma = _detalhes.gump:CreateImage (f.TitleBar, [[Interface\AddOns\Details\images\icons2]], 104, 107, "overlay", {104/512, 0, 405/512, 1}) + gnoma:SetPoint ("topright", 0, 14) + + local logo = _detalhes.gump:CreateImage (f, [[Interface\AddOns\Details\images\logotipo]]) + logo:SetPoint ("topleft", -5, 15) + logo:SetSize (512*0.4, 256*0.4) + + local text1 = Loc ["STRING_MEMORY_ALERT_TEXT1"] + local text2 = Loc ["STRING_MEMORY_ALERT_TEXT2"] + local text3 = Loc ["STRING_MEMORY_ALERT_TEXT3"] + + local str1 = _detalhes.gump:CreateLabel (f, text1) + str1.width = 480 + str1.fontsize = 12 + str1:SetPoint ("topleft", 10, -100) + + local str2 = _detalhes.gump:CreateLabel (f, text2) + str2.width = 480 + str2.fontsize = 12 + str2:SetPoint ("topleft", 10, -150) + + local str3 = _detalhes.gump:CreateLabel (f, text3) + str3.width = 480 + str3.fontsize = 12 + str3:SetPoint ("topleft", 10, -200) + + local textbox = _detalhes.gump:CreateTextEntry (f, function()end, 350, 20, nil, nil, nil, _detalhes.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + textbox:SetPoint ("topleft", 10, -250) + textbox:SetText ([[www.curse.com/addons/wow/addons-cpu-usage]]) + textbox:SetHook ("OnEditFocusGained", function() textbox:HighlightText() end) + + local close_func = function() + _detalhes:SetTutorialCVar ("MEMORY_USAGE_ALERT1", true) + f:Hide() + end + local close = _detalhes.gump:CreateButton (f, close_func, 127, 20, Loc ["STRING_MEMORY_ALERT_BUTTON"], nil, nil, nil, nil, nil, nil, _detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) + close:SetPoint ("left", textbox, "right", 2, 0) + + end + _detalhes:ScheduleTimer ("AlertAboutMemoryUsage", 30) --30 + end + _detalhes.AddOnStartTime = GetTime() end