From 8b0379bad2ecfd940f52b818d78c57d2f0fe74ba Mon Sep 17 00:00:00 2001 From: Tercio Date: Wed, 15 Jul 2015 17:15:14 -0300 Subject: [PATCH] - Major improvements on the aura tool creation for WeakAuras. --- boot.lua | 7 +- framework/dropdown.lua | 13 ++- functions/link.lua | 202 +++++++++++++++++++++++++++++++++++++---- gumps/janela_info.lua | 13 ++- 4 files changed, 210 insertions(+), 25 deletions(-) diff --git a/boot.lua b/boot.lua index 906cd13e..00dbe720 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 1209 --it's 1209 for release - _detalhes.userversion = "v3.17.4" + _detalhes.userversion = "v3.17.5" _detalhes.realversion = 73 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,7 +21,8 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.17.4 (|cFFFFCC00Jul 14, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v3.17.5 (|cFFFFCC00Jul 15, 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 @@ -35,7 +36,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.17.4 (|cFFFFCC00Jul 14, 2015|r|cFFFFFF00)|r:\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.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.17.5 (|cFFFFCC00Jul 15, 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.\n\n|cFFFFFF00-|r Numbers format on Player Detail Window now respect the format chosen on options panel.\n\n|cFFFFFF00-|r Removed pet icons on Player Detail Window.\n\n|cFFFFFF00-|r Fixed some wrong textures on spec icons.\n\n|cFFFFFF00-|r Improvements on all skins for the Player Detail Window.\n\n|cFFFFFF00v3.15.8b (|cFFFFCC00Jul 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Soul Capacitor trinket fix.\n\n|cFFFFFF00-|r Fixed several small bugs from 6.2 patch.\n\n|cFFFFFF00-|r Disabled the special behavior for Tyrant Velhari encounter.\n\n|cFFFFFF00v3.15.7 (|cFFFFCC00Jun 23, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for Hellfire Citadel raid.\n\n|cFFFFFF00-|r Added support for custom CLEU parser functions.\n\n|cFFFFFF00-|r Tyrant Velhari encounter now has a custom CLEU parser function for healing where the heal absorbed by Aura of Contempt will count towards overheal and not healing done.\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00-|r |cFFAAFFAAPS: We've made an addon for Shadow-Lord Iskar encounter called 'Iskar Assist' check it out|r.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/framework/dropdown.lua b/framework/dropdown.lua index d5c8d9b4..503dfb2b 100644 --- a/framework/dropdown.lua +++ b/framework/dropdown.lua @@ -479,6 +479,7 @@ function DetailsDropDownOptionClick (button) --> set the value of selected option in main object button.object.myvalue = button.table.value + button.object.myvaluelabel = button.table.label end function DropDownMetaFunctions:Open() @@ -560,6 +561,7 @@ function DetailsDropDownOnMouseDown (button) local i = 1 local showing = 0 local currentText = button.text:GetText() or "" + local currentIndex if (object.OnMouseDownHook) then local interrupt = object.OnMouseDownHook (button, buttontype, menu, scrollFrame, scrollChild, selectedTexture) @@ -568,7 +570,7 @@ function DetailsDropDownOnMouseDown (button) end end - for _, _table in ipairs (menu) do + for tindex, _table in ipairs (menu) do local show = isOptionVisible (_table) @@ -637,6 +639,8 @@ function DetailsDropDownOnMouseDown (button) selectedTexture:Show() selectedTexture:SetVertexColor (1, 1, 1, .3); + + currentIndex = tindex currentText = nil end @@ -716,7 +720,12 @@ function DetailsDropDownOnMouseDown (button) end end - object.scroll:SetValue (0) + if (object.myvaluelabel and currentIndex) then + object.scroll:SetValue (max ((currentIndex*20) - 80, 0)) + else + object.scroll:SetValue (0) + end + object:Open() else diff --git a/functions/link.lua b/functions/link.lua index 3907d371..cea1431e 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -3,6 +3,17 @@ --> default weaktable _detalhes.weaktable = {__mode = "v"} + --> globals + --[[global]] DETAILS_WA_TRIGGER_DEBUFF_PLAYER = 1 + --[[global]] DETAILS_WA_TRIGGER_DEBUFF_TARGET = 2 + --[[global]] DETAILS_WA_TRIGGER_DEBUFF_FOCUS = 3 + + --[[global]] DETAILS_WA_TRIGGER_BUFF_PLAYER = 4 + --[[global]] DETAILS_WA_TRIGGER_BUFF_TARGET = 5 + --[[global]] DETAILS_WA_TRIGGER_BUFF_FOCUS = 6 + + --[[global]] DETAILS_WA_TRIGGER_CAST_START = 7 + --[[global]] DETAILS_WA_TRIGGER_CAST_OKEY = 8 --weak auras local group_prototype = { @@ -79,8 +90,8 @@ } local icon_prototype = { - ["yOffset"] = -10.08984375, - ["xOffset"] = -3.2294921875, + ["yOffset"] = 202.07, + ["xOffset"] = -296.82, ["fontSize"] = 14, ["displayStacks"] = "%s", ["parent"] = "Details! Aura Group", @@ -239,6 +250,17 @@ }, } + local sound_prototype_custom = { + ["actions"] = { + ["start"] = { + ["do_sound"] = true, + ["sound"] = " custom", + ["sound_path"] = "Interface\\Quiet.ogg", + ["sound_channel"] = "Master", + }, + }, + } + local chat_prototype = { ["actions"] = { ["start"] = { @@ -266,7 +288,7 @@ }, } - function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id) + function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size) --> check if wa is installed if (not WeakAuras or not WeakAurasSaved) then @@ -281,6 +303,7 @@ --> create the icon table local icon = _detalhes.table.copy ({}, icon_prototype) + icon_size = icon_size or 40 if (encounter_id) then icon.load.use_encounterid = true @@ -384,7 +407,13 @@ end --> using sound - if (sound and sound ~= "" and not sound:find ("Quiet.ogg")) then + if (sound and type (sound) == "table") then + 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 (icon, 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 (icon, add) @@ -420,8 +449,17 @@ _detalhes.table.deploy (icon, add) end - --> add the aura on our group - tinsert (WeakAurasSaved.displays ["Details! Aura Group"].controlledChildren, icon.id) + --> add the aura on a group + if (group) then + icon.parent = group + tinsert (WeakAurasSaved.displays [group].controlledChildren, icon.id) + else + icon.parent = nil + end + + --> icon size + icon.width = icon_size + icon.height = icon_size --> add the aura WeakAuras.Add (icon) @@ -437,14 +475,20 @@ end - function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid) + function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, triggertype) spellname = select (1, GetSpellInfo (spellid)) if (not DetailsAuraPanel) then + --> check if there is a group for our auras + if (WeakAuras and WeakAurasSaved and not WeakAurasSaved.displays ["Details! Aura Group"]) then + local group = _detalhes.table.copy ({}, group_prototype) + WeakAuras.Add (group) + end + local f = CreateFrame ("frame", "DetailsAuraPanel", UIParent, "ButtonFrameTemplate") - f:SetSize (300, 420) + f:SetSize (300, 488) f:SetPoint ("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) @@ -526,7 +570,7 @@ {label = "Buff on Focus", value = 13, icon = aura_on_icon}, {label = "Spell Cast Started", value = 21, icon = aura_on_icon}, - {label = "Spell Cast successful", value = 22, icon = aura_on_icon}, + {label = "Spell Cast Successful", value = 22, icon = aura_on_icon}, } local aura_on_options = function() return aura_on_table @@ -543,7 +587,11 @@ --sound effect local play_sound = function (self, fixedParam, file) - PlaySoundFile (file, "Master") + if (type (file) == "table") then + PlaySoundFile (file.sound_path, "Master") + else + PlaySoundFile (file, "Master") + end end local sort = function (t1, t2) @@ -554,16 +602,75 @@ end local iconsize = {14, 14} + local game_sounds = { + ["Horde Banner Down"] = [[Sound\event\EVENT_VashjirIntro_HordeBannerDown_01.ogg]], + ["Mast Crack"] = [[Sound\event\EVENT_VashjirIntro_MastCrack_01.ogg]], + ["Orc Attack "] = [[Sound\event\EVENT_VashjirIntro_OrcAttackVox_03.ogg]], + ["Ship Hull Impact"] = [[Sound\event\EVENT_VashjirIntro_ShipHullImpact_03.ogg]], + ["Run! 01"] = [[Sound\character\Scourge\ScourgeVocalFemale\UndeadFemaleFlee01.ogg]], + ["Run! 02"] = [[Sound\creature\HoodWolf\HoodWolfTransformPlayer01.ogg]], + ["Danger!"] = [[Sound\character\Scourge\ScourgeVocalMale\UndeadMaleIncoming01.ogg]], + ["Wing Flap 01"] = [[Sound\creature\Illidan\IllidanWingFlap2.ogg]], + ["Wing Flap 02"] = [[Sound\Universal\BirdFlap1.ogg]], + ["Not Prepared"] = [[Sound\creature\Illidan\BLACK_Illidan_04.ogg]], + ["Cannon Shot"] = [[Sound\DOODAD\AGS_BrassCannon_Custom0.ogg]], + ["Click 01"] = [[Sound\DOODAD\HangingBones_BoneClank06.ogg]], + ["Click 02"] = [[Sound\DOODAD\HangingBones_BoneClank02.ogg]], + ["Click 03"] = [[Sound\DOODAD\HangingBones_BoneClank03.ogg]], + ["Click 04"] = [[Sound\DOODAD\HangingBones_BoneClank09.ogg]], + ["Click 05"] = [[Sound\DOODAD\FX_Emote_Chopping_Wood08.ogg]], + ["Click 06"] = [[Sound\DOODAD\FX_Emote_Chopping_Wood04.ogg]], + ["Click 07"] = [[Sound\DOODAD\FX_BoardTilesDice_02.OGG]], + ["Click 08"] = [[Sound\Spells\IceCrown_Bug_Attack_08.ogg]], + ["Click 09"] = [[Sound\Spells\Tradeskills\BlackSmithCraftingE.ogg]], + ["Chest 01"] = [[Sound\DOODAD\G_BarrelOpen-Chest1.ogg]], + ["Beat 01"] = [[Sound\DOODAD\GO_PA_Kungfugear_bag_Left08.OGG]], + ["Beat 02"] = [[Sound\DOODAD\GO_PA_Kungfugear_bag_Left04.OGG]], + ["Water Drop"] = [[Sound\DOODAD\Hellfire_DW_Pipe_Type4_01.ogg]], + ["Frog"] = [[Sound\EMITTERS\Emitter_Dalaran_Petstore_Frog_01.ogg]], + } + local sound_options = function() local t = {{label = "No Sound", value = "", icon = [[Interface\Buttons\UI-GuildButton-MOTD-Disabled]], iconsize = iconsize}} + local sounds = {} + local already_added = {} + + for name, soundFile in pairs (game_sounds) do + name = name:gsub ("(%a)([%w_']*)", titlecase) + if (not already_added [name]) then + sounds [#sounds+1] = {name = name, file = soundFile, gamesound = true} + already_added [name] = true + end + end + for name, soundFile in pairs (LibStub:GetLibrary("LibSharedMedia-3.0"):HashTable ("sound")) do name = name:gsub ("(%a)([%w_']*)", titlecase) - sounds [#sounds+1] = {name = name, file = soundFile} + if (not already_added [name]) then + sounds [#sounds+1] = {name = name, file = soundFile} + already_added [name] = true + end end + + if (WeakAuras and WeakAuras.sound_types) then + for soundFile, name in pairs (WeakAuras.sound_types) do + name = name:gsub ("(%a)([%w_']*)", titlecase) + if (not already_added [name]) then + sounds [#sounds+1] = {name = name, file = soundFile} + end + end + end + table.sort (sounds, sort) + for _, sound in ipairs (sounds) do - tinsert (t, {label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) + if (sound.name:find ("D_")) then --> details sound + tinsert (t, {color = "orange", label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) + elseif (sound.gamesound) then --> game sound + tinsert (t, {color = "yellow", label = sound.name, value = {sound_path = sound.file}, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) + else + tinsert (t, {label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize}) + end end return t end @@ -604,6 +711,18 @@ useglow.glow_test:SetPoint ("bottomright", useglow.widget, "bottomright", 20, -2) useglow.glow_test:Hide() + --encounter id + local encounterid_label = fw:CreateLabel (f, "Encounter ID: ", nil, nil, "GameFontNormal") + local encounterid = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "EncounterIdText", "$parentEncounterIdText") + encounterid:SetPoint ("left", encounterid_label, "right", 2, 0) + encounterid.tooltip = "Only load this aura for this raid encounter." + + --icon size + local icon_size_slider = fw:NewSlider (f, f, "$parentIconSizeSlider", "IconSizeSlider", 150, 20, 16, 256, 1, 64) + local icon_size_label = fw:CreateLabel (f, "Icon Size: ", nil, nil, "GameFontNormal") + icon_size_slider:SetPoint ("left", icon_size_label, "right", 2, 0) + icon_size_slider.tooltip = "Icon size, width and height." + --aura addon local addon_options = function() local t = {} @@ -616,6 +735,28 @@ local aura_addon_label = fw:CreateLabel (f, "Addon: ", nil, nil, "GameFontNormal") aura_addon:SetPoint ("left", aura_addon_label, "right", 2, 0) + --weakauras - group + + local folder_icon = [[Interface\AddOns\Details\images\icons]] + local folder_texcoord = {435/512, 469/512, 189/512, 241/512} + local folder_iconsize = {14, 14} + + local weakauras_folder_options = function() + local t = {{label = "No Group", value = false, icon = folder_icon, texcoord = folder_texcoord, iconcolor = {0.8, 0.2, 0.2}, iconsize = folder_iconsize}} + if (WeakAuras and WeakAurasSaved) then + for display_name, aura_table in pairs (WeakAurasSaved.displays) do + if (aura_table.regionType == "dynamicgroup" or aura_table.regionType == "group") then + tinsert (t, {label = display_name, value = display_name, icon = folder_icon, texcoord = folder_texcoord, iconsize = folder_iconsize}) + end + end + end + return t + end + + local weakauras_folder_label = fw:CreateLabel (f, "Weak Auras Group: ", nil, nil, "GameFontNormal") + local weakauras_folder = fw:CreateDropDown (f, weakauras_folder_options, 1, 150, 20, "WeakaurasFolderDropdown", "$parentWeakaurasFolder") + weakauras_folder:SetPoint ("left", weakauras_folder_label, "right", 2, 0) + --create local create_func = function() @@ -629,14 +770,19 @@ local sound = f.SoundEffectDropdown.value local chat = f.SaySomething.text local addon = f.AuraAddonDropdown.value + local folder = f.WeakaurasFolderDropdown.value + local iconsize = f.IconSizeSlider.value local icon_text = f.AuraText.text local icon_glow = f.UseGlow.value - local eid = DetailsAuraPanel.encounterid + local eid = DetailsAuraPanel.EncounterIdText.text + if (eid == "") then + eid = nil + end if (addon == "WA") then - _detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow, eid) + _detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow, eid, folder, iconsize) else _detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.") end @@ -669,16 +815,29 @@ say_something_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*9) + (70)) * -1) aura_text_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*10) + (70)) * -1) useglow_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*11) + (70)) * -1) + encounterid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*12) + (70)) * -1) + icon_size_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*13) + (70)) * -1) - aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*13) + (60)) * -1) + aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*15) + (60)) * -1) + weakauras_folder_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*16) + (60)) * -1) - create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*15) + (60)) * -1) - cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*15) + (60)) * -1) + create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*18) + (60)) * -1) + cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*18) + (60)) * -1) end DetailsAuraPanel.spellid = spellid DetailsAuraPanel.encounterid = encounterid + DetailsAuraPanel.EncounterIdText.text = encounterid or "" + + DetailsAuraPanel.WeakaurasFolderDropdown:Refresh() + if (encounterid) then + DetailsAuraPanel.WeakaurasFolderDropdown:Select ("Details! Aura Group") + DetailsAuraPanel.IconSizeSlider:SetValue (128) + else + DetailsAuraPanel.WeakaurasFolderDropdown:Select (1, true) + DetailsAuraPanel.IconSizeSlider:SetValue (64) + end DetailsAuraPanel.name.text = spellname .. " (d!)" DetailsAuraPanel.spellname.text = spellname @@ -688,13 +847,18 @@ DetailsAuraPanel.UseGlow.glow_test.animIn:Stop() DetailsAuraPanel.UseGlow.glow_test.animOut:Play() DetailsAuraPanel.UseGlow:SetValue (false) - - DetailsAuraPanel.AuraOnDropdown:Select (1, true) + DetailsAuraPanel.StackSlider:SetValue (0) DetailsAuraPanel.SoundEffectDropdown:Select (1, true) DetailsAuraPanel.AuraText:SetText ("") DetailsAuraPanel.SaySomething:SetText ("") + if (triggertype and type (triggertype) == "number") then + DetailsAuraPanel.AuraOnDropdown:Select (triggertype, true) + else + DetailsAuraPanel.AuraOnDropdown:Select (1, true) + end + DetailsAuraPanel:Show() end diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index ba61267d..fed42fad 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -69,7 +69,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change, refresh, ShiftKeyDo end end - --> vamos passar os parāmetros para dentro da tabela da janela... + --> passar os parāmetros para dentro da tabela da janela. info.ativo = true --> sinaliza o addon que a janela esta aberta info.atributo = self.atributo --> instancia.atributo -> grava o atributo (damage, heal, etc) @@ -3636,6 +3636,7 @@ function gump:CriaJanelaInfo() compare_create --[5] oncreate ) + -- ~tab function este_gump:ShowTabs() local amt_positive = 0 @@ -3659,6 +3660,16 @@ function gump:CriaJanelaInfo() alert:SetPoint ("bottom", tab, "top", 5, 28) alert:Show() end + + local blink = _detalhes:GetTutorialCVar ("DETAILS_INFO_TUTORIAL2") or 0 + if (blink < 10) then + _detalhes:SetTutorialCVar ("DETAILS_INFO_TUTORIAL2", blink+1) + if (not tab.glow.Flash) then + gump:CreateFlashAnimation (tab.glow) + end + tab.glow:Flash (4.5, 0.8, 6, false, 0, 0, "NONE") + end + end tab:Show()