diff --git a/API.txt b/API.txt index 5b760337..2f8e565e 100644 --- a/API.txt +++ b/API.txt @@ -156,7 +156,10 @@ reset when data is wiped and each character have its own combat number counter. Details:IsInCombat() returns if Details! is in combat or not. - + +Details:IsInEncounter() +returns if Details! is in a raid encounter combat. + damage, healing, energy, misc = Details:GetAllActors (combat, actorname) returns all the four actor objects for the requested combat and actor. combat must be a combat object. diff --git a/boot.lua b/boot.lua index 169be56f..215a76fa 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 = 1382 --it's 1382 for release - _detalhes.userversion = "v3.18.0" + _detalhes.userversion = "v3.18.2" _detalhes.realversion = 74 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -22,6 +22,14 @@ do --[[ |cFFFFFF00v3.18.0 (|cFFFFCC00Aug 11, 2015|r|cFFFFFF00)|r:\n\n + +|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\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 item level of timewarped items.\n\n +|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n +|cFFFFFF00-|r Fixed background alpha after stretching which wasn't correctly coming back to original color.\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 users not make damage padding after a wipe call.\n\n |cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n @@ -29,7 +37,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.18.0 (|cFFFFCC00Aug 11, 2015|r|cFFFFFF00)|r:\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 Fixed an issue with dropdown boxes where wasn't showing all options.\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|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\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.\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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.18.2 (|cFFFFCC00Aug 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\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 '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.\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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 4d63aa95..5feb4e6a 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -199,12 +199,14 @@ local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"] local okey - for index, actor in _ipairs (instance_container._ActorTable) do + for index, actor in _ipairs (instance_container._ActorTable) do + local percent, ptotal + if (percent_script) then okey, percent = _pcall (percent_script, _math_floor (actor.value), top, total, combat, instance, actor) if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display function|r:", percent) + _detalhes:Msg ("|cFFFF9900percent script error|r:", percent) return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end else @@ -212,16 +214,16 @@ end if (total_script) then - local value = _pcall (total_script, _math_floor (actor.value), top, total, combat, instance, actor) - if (type (value) == "number") then - okey, ptotal = SelectedToKFunction (_, value) - if (not okey) then - _detalhes:Msg ("|cFFFF9900error on custom display function|r:", ptotal) - return _detalhes:EndRefresh (instance, 0, combat, combat [1]) - end - else - ptotal = value + local okey, value = _pcall (total_script, _math_floor (actor.value), top, total, combat, instance, actor) + if (not okey) then + _detalhes:Msg ("|cFFFF9900total script error|r:", value) + return _detalhes:EndRefresh (instance, 0, combat, combat [1]) end + + if (type (value) == "number") then + value = SelectedToKFunction (_, value) + end + ptotal = value else ptotal = SelectedToKFunction (_, _math_floor (actor.value)) end @@ -855,6 +857,7 @@ new_actor.spec = actor.spec new_actor.enemy = actor.enemy + new_actor.role = actor.role new_actor.arena_enemy = actor.arena_enemy new_actor.arena_ally = actor.arena_ally @@ -1600,7 +1603,7 @@ desc = "Show the crowd control amount for each player.", source = false, target = false, - script_version = 8, + script_version = 9, script = [[ local combat, instance_container, instance = ... local total, top, amount = 0, 0, 0 @@ -1646,7 +1649,7 @@ _detalhes:AddTooltipSpellHeaderText ("Targets", "yellow", #targets) local class, _, _, _, _, r, g, b = _detalhes:GetClass (actor.nome) - GameCooltip:AddStatusBar (100, 1, r, g, b, 1) + _detalhes:AddTooltipHeaderStatusbar (1, 1, 1, 0.6) for index, target in ipairs (targets) do GameCooltip:AddLine (target[1], target [2]) diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 1fc0a03b..899589af 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2366,9 +2366,16 @@ end -- ~menu local menu_wallpaper_tex = {63/512, 331/512, 109/512, 143/512} local menu_wallpaper_color = {.8, .8, .8, 0.2} +local menu_wallpaper_custom_color = {1, 0, 0, 1} local wallpaper_bg_color = {.8, .8, .8, 0.2} - +local menu_icones = { + "Interface\\AddOns\\Details\\images\\atributos_icones_damage", + "Interface\\AddOns\\Details\\images\\atributos_icones_heal", + "Interface\\AddOns\\Details\\images\\atributos_icones_energyze", + "Interface\\AddOns\\Details\\images\\atributos_icones_misc" +} + function _detalhes:MontaAtributosOption (instancia, func) func = func or instancia.TrocaTabela @@ -2385,13 +2392,6 @@ function _detalhes:MontaAtributosOption (instancia, func) else options = sub_atributos [atributo_ativo].lista end - - local icones = { - "Interface\\AddOns\\Details\\images\\atributos_icones_damage", - "Interface\\AddOns\\Details\\images\\atributos_icones_heal", - "Interface\\AddOns\\Details\\images\\atributos_icones_energyze", - "Interface\\AddOns\\Details\\images\\atributos_icones_misc" - } local CoolTip = _G.GameCooltip local p = 0.125 --> 32/256 @@ -2402,15 +2402,19 @@ function _detalhes:MontaAtributosOption (instancia, func) CoolTip:AddMenu (1, func, nil, i, nil, atributos.lista[i], nil, true) CoolTip:AddIcon ("Interface\\AddOns\\Details\\images\\atributos_icones", 1, 1, 20, 20, p*(i-1), p*(i), 0, 1) - if (i == 1) then - CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockDestruction-TopLeft]], {1, 0.22, 0, 0.55}, wallpaper_bg_color) - elseif (i == 2) then - --CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\PriestHoly-TopLeft]], {0, .8, 0, 1}, {1, 1, 1, .1}) - CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\bg-priest-holy]], {1, .6, 0, .2}, wallpaper_bg_color) - elseif (i == 3) then - CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\ShamanEnhancement-TopLeft]], {0, 1, .2, .6}, wallpaper_bg_color) - elseif (i == 4) then - CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockCurses-TopLeft]], {.2, 1, 0, 1}, wallpaper_bg_color) + if (_detalhes.tooltip.submenu_wallpaper) then + if (i == 1) then + CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockDestruction-TopLeft]], {1, 0.22, 0, 0.55}, wallpaper_bg_color) + elseif (i == 2) then + CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\bg-priest-holy]], {1, .6, 0, .2}, wallpaper_bg_color) + elseif (i == 3) then + CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\ShamanEnhancement-TopLeft]], {0, 1, .2, .6}, wallpaper_bg_color) + elseif (i == 4) then + CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarlockCurses-TopLeft]], {.2, 1, 0, 1}, wallpaper_bg_color) + end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end local options = sub_atributos [i].lista @@ -2418,11 +2422,11 @@ function _detalhes:MontaAtributosOption (instancia, func) for o = 1, atributos [i] do if (_detalhes:CaptureIsEnabled ( _detalhes.atributos_capture [gindex] )) then CoolTip:AddMenu (2, func, true, i, o, options[o], nil, true) - CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1) + CoolTip:AddIcon (menu_icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1) else CoolTip:AddLine (options[o], nil, 2, .5, .5, .5, 1) CoolTip:AddMenu (2, func, true, i, o) - CoolTip:AddIcon (icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1, {.3, .3, .3, 1}) + CoolTip:AddIcon (menu_icones[i], 2, 1, 20, 20, p*(o-1), p*(o), 0, 1, {.3, .3, .3, 1}) end gindex = gindex + 1 @@ -2456,7 +2460,11 @@ function _detalhes:MontaAtributosOption (instancia, func) end --> set the wallpaper on custom - GameCooltip:SetWallpaper (2, [[Interface\TALENTFRAME\WarriorArm-TopLeft]], {1, 0, 0, 1}, wallpaper_bg_color) + if (_detalhes.tooltip.submenu_wallpaper) then + CoolTip:SetWallpaper (2, [[Interface\TALENTFRAME\WarriorArm-TopLeft]], menu_wallpaper_custom_color, wallpaper_bg_color) + else + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) + end if (#_detalhes.custom == 0) then CoolTip:SetLastSelected (2, 6, 2) diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 07cf4754..133e5cb3 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -258,6 +258,11 @@ novo_objeto.displayName = nome end + --local pet_npc_template = _detalhes:GetNpcIdFromGuid (serial) + --if (pet_npc_template == 86933) then --viviane + -- novo_objeto.grupo = true + --end + else novo_objeto.displayName = nome end diff --git a/core/control.lua b/core/control.lua index 6e67e81f..ce338576 100644 --- a/core/control.lua +++ b/core/control.lua @@ -500,13 +500,17 @@ } end end - + if (not _detalhes.tabela_vigente.is_boss) then if (_detalhes.tabela_vigente.is_pvp or _detalhes.tabela_vigente.is_arena) then _detalhes:FlagActorsOnPvPCombat() end + if (_detalhes.tabela_vigente.is_arena) then + _detalhes.tabela_vigente.enemy = "[" .. ARENA .. "] " .. _detalhes.tabela_vigente.is_arena.name + end + local in_instance = IsInInstance() --> garrison returns party as instance type. if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then if (InstanceType == "party") then diff --git a/core/gears.lua b/core/gears.lua index 3d5e254d..c2023f59 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -1063,7 +1063,7 @@ function _detalhes:IlvlFromNetwork (player, realm, core, ilvl) _detalhes.item_level_pool [guid] = {name = player, ilvl = ilvl, time = time()} end ---test on your self: +--> test --/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true) --/run wipe (_detalhes.item_level_pool) function ilvl_core:CalcItemLevel (unitid, guid, shout) @@ -1076,7 +1076,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) if (CheckInteractDistance (unitid, 1)) then - --16 = all itens including main and off hand + --> 16 = all itens including main and off hand local item_amount = 16 local item_level = 0 local failed = 0 @@ -1086,10 +1086,22 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) local item = GetInventoryItemLink (unitid, equip_id) if (item) then local _, _, _, iLevel, _, _, _, _, equipSlot = GetItemInfo (item) - if (iLevel and iLevel > 100) then - item_level = item_level + iLevel - -- 16 = main hand 17 = off hand - -- if using a two-hand, ignore the off hand slot + if (iLevel and iLevel >= 100) then + + local _, _, _, _, _, _, _, _, _, _, _, upgradeTypeID, _, numBonusIDs, bonusID1, bonusID2 = strsplit (":", item) + + --> timewarped + if (upgradeTypeID == "512" and bonusID1 == "615") then + item_level = item_level + 660 + if (bonusID2 == "656") then + item_level = item_level + 15 + end + else + item_level = item_level + iLevel + end + + --> 16 = main hand 17 = off hand + --> if using a two-hand, ignore the off hand slot if (equip_id == 16 and two_hand [equipSlot]) then item_amount = 15 break @@ -1106,7 +1118,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout) local average = item_level / item_amount - -- register + --> register if (average > 0) then if (shout) then _detalhes:Msg (name .. " item level: " .. average) diff --git a/core/parser.lua b/core/parser.lua index c4d00f93..d19cf52c 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -3866,6 +3866,10 @@ function _detalhes:IsInCombat() return _in_combat end + + function _detalhes:IsInEncounter() + return _detalhes.encounter_table.id and true or false + end --> get combat function _detalhes:GetCombat (_combat) diff --git a/core/util.lua b/core/util.lua index 64a5e553..4ca8a761 100644 --- a/core/util.lua +++ b/core/util.lua @@ -13,6 +13,7 @@ local _math_floor = math.floor --lua local local _math_max = math.max --lua local local _math_abs = math.abs --lua local + local _math_min = math.min --lua local local _math_random = math.random --lua local local _type = type --lua local local _string_match = string.match --lua local @@ -24,6 +25,7 @@ local _tonumber = tonumber local _strsplit = strsplit local _pcall = pcall + local _GetTime = GetTime local _UnitClass = UnitClass --wow api local local _IsInRaid = IsInRaid --wow api local @@ -502,6 +504,17 @@ end return nil end + --[[ test grayscale ]] + function _detalhes:teste_grayscale() + local instancia = _detalhes.tabela_instancias[1] + for i = 1, instancia.rows_created, 1 do + local barra = instancia.barras[i] + local red, green, blue, alpha = barra.textura:GetVertexColor() + local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method + gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1) + end + end + local function frame_task (self, elapsed) self.FrameTime = self.FrameTime + elapsed @@ -509,34 +522,32 @@ end if (self.HaveGradientEffect) then local done = false - for index, ThisGradient in _ipairs (self.gradientes) do - if (self.FrameTime >= ThisGradient.NextStepAt and not ThisGradient.done) then - - --> effects + if (not ThisGradient.done) then + + local percent = _math_min ((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100) + local red_now = ThisGradient.StartRed + (percent * ThisGradient.OnePercentRed) + local green_now = ThisGradient.StartGreen + (percent * ThisGradient.OnePercentGreen) + local blue_now = ThisGradient.StartBlue + (percent * ThisGradient.OnePercentBlue) + local alpha_now = ThisGradient.StartAlpha + (percent * ThisGradient.OnePercentAlpha) + if (ThisGradient.ObjectType == "frame") then - local r, g, b, a = ThisGradient.Object:GetBackdropColor() - ThisGradient.Object:SetBackdropColor (r + ThisGradient.Colors.Red, g + ThisGradient.Colors.Green, b + ThisGradient.Colors.Blue, a + ThisGradient.Colors.Alpha) + ThisGradient.Object:SetBackdropColor (red_now, green_now, blue_now, alpha_now) elseif (ThisGradient.ObjectType == "texture") then - local r, g, b, a = ThisGradient.Object:GetVertexColor() - ThisGradient.Object:SetVertexColor (r + ThisGradient.Colors.Red, g + ThisGradient.Colors.Green, b + ThisGradient.Colors.Blue, a + ThisGradient.Colors.Alpha) + ThisGradient.Object:SetVertexColor (red_now, green_now, blue_now, alpha_now) end - ThisGradient.OnStep = ThisGradient.OnStep + 1 - if (ThisGradient.FinishStep == ThisGradient.OnStep) then + if (percent == 100) then if (ThisGradient.Func) then - if (type (ThisGradient.Func) == "string") then - local f = loadstring (ThisGradient.Func) - f() - else - ThisGradient.Func() + local okey, errortext = _pcall (ThisGradient.Func, ThisGradient.FuncParam) + if (not okey) then + _detalhes:Msg ("GradientEffect() end function error:", errortext) end end + ThisGradient.done = true done = true - else - ThisGradient.NextStepAt = self.FrameTime + ThisGradient.SleepTime end end end @@ -565,19 +576,8 @@ end end end - - --[[ test grayscale ]] - function _detalhes:teste_grayscale() - local instancia = _detalhes.tabela_instancias[1] - for i = 1, instancia.rows_created, 1 do - local barra = instancia.barras[i] - local red, green, blue, alpha = barra.textura:GetVertexColor() - local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method - gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1) - end - end - - function gump:GradientEffect ( Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam) + + function gump:GradientEffect (Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam) if (type (StartRed) == "table" and type (StartGreen) == "table") then Duration, EndFunction = StartBlue, StartAlpha @@ -619,33 +619,28 @@ end end end - local MinFramesPerSecond = 10 --> at least 10 frames will be necessary - local ExecTime = Duration * 1000 --> value in miliseconds - local SleepTime = 100 --> 100 miliseconds - - local FrameAmount = _math_floor (ExecTime/100) --> amount of frames - - if (FrameAmount < MinFramesPerSecond) then - FrameAmount = MinFramesPerSecond - SleepTime = ExecTime/FrameAmount + if (EndFunction and _type (EndFunction) == "string") then + EndFunction = loadstring (EndFunction) or false end - local ColorStep = {} - ColorStep.Red = (EndRed - StartRed) / FrameAmount - ColorStep.Green = (EndGreen - StartGreen) / FrameAmount - ColorStep.Blue = (EndBlue - StartBlue) / FrameAmount - ColorStep.Alpha = (EndAlpha - StartAlpha) / FrameAmount - GradientFrameControl.gradientes [#GradientFrameControl.gradientes+1] = { - OnStep = 1, - FinishStep = FrameAmount, - SleepTime = SleepTime/1000, - NextStepAt = GradientFrameControl.FrameTime + (SleepTime/1000), Object = Object, ObjectType = string.lower (ObjectType), - Colors = ColorStep, Func = EndFunction, - FuncParam = FuncParam} + FuncParam = FuncParam, + TimeStart = GetTime(), + Duration = Duration, + + StartRed = StartRed, + StartGreen = StartGreen, + StartBlue = StartBlue, + StartAlpha = StartAlpha, + + OnePercentRed = StartRed > EndRed and (StartRed - EndRed) / 100 * -1 or (EndRed - StartRed) / 100, + OnePercentGreen = StartGreen > EndGreen and (StartGreen - EndGreen) / 100 * -1 or (EndGreen - StartGreen) / 100, + OnePercentBlue = StartBlue > EndBlue and (StartBlue - EndBlue) / 100 * -1 or (EndBlue - StartBlue) / 100, + OnePercentAlpha = StartAlpha > EndAlpha and (StartAlpha - EndAlpha) / 100 * -1 or (EndAlpha - StartAlpha) /100, + } Object.HaveGradientEffect = true GradientFrameControl.HaveGradientEffect = true diff --git a/functions/link.lua b/functions/link.lua index d17f3442..f24197de 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -4,6 +4,10 @@ _detalhes.weaktable = {__mode = "v"} --> globals + --[[global]] DETAILS_WA_AURATYPE_ICON = 1 + --[[global]] DETAILS_WA_AURATYPE_TEXT = 2 + --[[global]] DETAILS_WA_AURATYPE_BAR = 3 + --[[global]] DETAILS_WA_TRIGGER_DEBUFF_PLAYER = 1 --[[global]] DETAILS_WA_TRIGGER_DEBUFF_TARGET = 2 --[[global]] DETAILS_WA_TRIGGER_DEBUFF_FOCUS = 3 @@ -15,7 +19,96 @@ --[[global]] DETAILS_WA_TRIGGER_CAST_START = 7 --[[global]] DETAILS_WA_TRIGGER_CAST_OKEY = 8 + --[[global]] DETAILS_WA_TRIGGER_DBM_TIMER = 9 + --[[global]] DETAILS_WA_TRIGGER_BW_TIMER = 10 + --weak auras + local group_prototype_boss_mods = { + ["grow"] = "DOWN", + ["controlledChildren"] = {}, + ["animate"] = true, + ["xOffset"] = 0, + ["border"] = "None", + ["yOffset"] = 370, + ["anchorPoint"] = "CENTER", + ["untrigger"] = {}, + ["sort"] = "none", + ["actions"] = { + ["start"] = {}, + ["finish"] = {}, + ["init"] = {}, + }, + ["space"] = 2, + ["background"] = "None", + ["expanded"] = true, + ["constantFactor"] = "RADIUS", + ["selfPoint"] = "TOP", + ["borderOffset"] = 16, + ["trigger"] = { + ["type"] = "aura", + ["spellIds"] = { + }, + ["names"] = { + }, + ["debuffType"] = "HELPFUL", + ["unit"] = "player", + }, + ["animation"] = { + ["start"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["main"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["finish"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + }, + ["id"] = "Details! Boss Mods Group", + ["backgroundInset"] = 0, + ["frameStrata"] = 1, + ["width"] = 359.096801757813, + ["rotation"] = 0, + ["radius"] = 200, + ["numTriggers"] = 1, + ["stagger"] = 0, + ["height"] = 121.503601074219, + ["align"] = "CENTER", + ["load"] = { + ["difficulty"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["use_class"] = false, + ["talent"] = { + ["multi"] = { + }, + }, + ["race"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["class"] = { + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["regionType"] = "dynamicgroup", + } + local group_prototype = { ["xOffset"] = -678.999450683594, ["yOffset"] = 212.765991210938, @@ -89,6 +182,574 @@ ["untrigger"] = {}, } + local bar_dbm_timerbar_prototype = { + ["sparkWidth"] = 10, + ["stacksSize"] = 12, + ["xOffset"] = 0, + ["stacksFlags"] = "None", + ["yOffset"] = 239.568542480469, + ["anchorPoint"] = "CENTER", + ["borderColor"] = {1, 1, 1, 0.5}, + ["rotateText"] = "NONE", + ["backgroundColor"] = {0, 0, 0, 0.5}, + ["fontFlags"] = "OUTLINE", + ["icon_color"] = {1, 1, 1, 1}, + ["selfPoint"] = "CENTER", + ["barColor"] = {1, 0, 0, 1}, + ["desaturate"] = false, + ["progressPrecision"] = 1, + ["sparkOffsetY"] = 0, + ["load"] = { + ["difficulty"] = { + ["multi"] = { + }, + }, + ["race"] = { + ["multi"] = { + }, + }, + ["talent"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["class"] = { + ["multi"] = { + }, + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["timerColor"] = {1, 1, 1, 1}, + ["regionType"] = "aurabar", + ["stacks"] = true, + ["texture"] = "Blizzard", + ["textFont"] = "Friz Quadrata TT", + ["zoom"] = 0, + ["spark"] = false, + ["timerFont"] = "Friz Quadrata TT", + ["alpha"] = 1, + ["borderInset"] = 11, + ["textColor"] = {1, 1, 1, 1}, + ["borderBackdrop"] = "Blizzard Tooltip", + ["customText"] = "function (expire, duration)\n return format (\"%.1f\", duration)\nend \n\n", + ["barInFront"] = true, + ["sparkRotationMode"] = "AUTO", + ["displayTextLeft"] = "%n", + ["animation"] = { + ["start"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["main"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["finish"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + }, + ["trigger"] = { + ["type"] = "custom", + ["custom_hide"] = "timed", + ["subeventSuffix"] = "_CAST_START", + ["custom_type"] = "status", + ["custom"] = "function()\n if (InCombatLockdown() and aura_env.trigger_at and aura_env.trigger_at <= GetTime() and aura_env.untrigger_at and aura_env.untrigger_at >= GetTime()) then\n return true\n else\n return false\n end\nend\n", + ["event"] = "Health", + ["unit"] = "player", + ["customDuration"] = "function()\n if (aura_env.trigger_at and aura_env.trigger_at <= GetTime() and aura_env.untrigger_at and aura_env.untrigger_at >= GetTime()) then\n return aura_env.untrigger_at - GetTime(), aura_env.countdown_at, true\n else\n return 0\n end\nend\n", + ["customName"] = "function()\n return aura_env.ability_text\nend", + ["spellIds"] = { + }, + ["customIcon"] = "function()\n return aura_env.ability_icon \nend\n", + ["check"] = "update", + ["subeventPrefix"] = "SPELL", + ["names"] = { + }, + ["debuffType"] = "HELPFUL", + }, + ["text"] = true, + ["stickyDuration"] = false, + ["height"] = 40.115104675293, + ["timerFlags"] = "None", + ["sparkBlendMode"] = "ADD", + ["backdropColor"] = {1, 1, 1, 0.5}, + ["untrigger"] = { + ["custom"] = "function()\n return true\nend", + }, + ["actions"] = { + ["start"] = { + }, + ["finish"] = { + }, + ["init"] = { + ["do_custom"] = true, + ["custom"] = "\n\n", + }, + }, + ["textFlags"] = "None", + ["border"] = false, + ["borderEdge"] = "None", + ["sparkOffsetX"] = 0, + ["borderSize"] = 16, + ["stacksFont"] = "Friz Quadrata TT", + ["icon_side"] = "LEFT", + ["inverse"] = false, + ["timer"] = true, + ["sparkHeight"] = 30, + ["sparkRotation"] = 0, + ["displayTextRight"] = "%c", + ["stacksColor"] = {1, 1, 1, 1}, + ["timerSize"] = 16, + ["icon"] = true, + ["textSize"] = 16, + ["frameStrata"] = 1, + ["width"] = 370, + ["customTextUpdate"] = "event", + ["sparkColor"] = {1, 1, 1, 1}, + ["numTriggers"] = 1, + ["sparkDesature"] = false, + ["orientation"] = "HORIZONTAL", + ["borderOffset"] = 5, + ["auto"] = true, + ["sparkTexture"] = "Interface\\CastingBar\\UI-CastingBar-Spark", + } + + local icon_dbm_timerbar_prototype = { + ["xOffset"] = -391.000030517578, + ["customText"] = "function (expire, duration)\n return \"\" .. aura_env.ability_text\nend \n\n", + ["yOffset"] = 300, + ["anchorPoint"] = "CENTER", + ["customTextUpdate"] = "event", + ["actions"] = { + ["start"] = { + }, + ["init"] = { + ["do_custom"] = true, + ["custom"] = "", + }, + ["finish"] = { + }, + }, + ["fontFlags"] = "OUTLINE", + ["selfPoint"] = "CENTER", + ["trigger"] = { + ["unevent"] = "auto", + ["type"] = "custom", + ["subeventPrefix"] = "SPELL", + ["custom_type"] = "status", + ["use_unit"] = true, + ["spellIds"] = { + }, + ["event"] = "Health", + ["unit"] = "player", + ["customDuration"] = "function()\n if (aura_env.trigger_at and aura_env.trigger_at <= GetTime() and aura_env.untrigger_at and aura_env.untrigger_at >= GetTime()) then\n return aura_env.untrigger_at - GetTime(), aura_env.countdown_at\n else\n return 0\n end\nend\n", + ["customName"] = "function()\n return aura_env.ability_name \nend\n", + ["custom"] = "function()\n if (InCombatLockdown() and aura_env.trigger_at and aura_env.trigger_at <= GetTime() and aura_env.untrigger_at and aura_env.untrigger_at >= GetTime()) then\n return true\n else\n return false\n end\nend\n", + ["customIcon"] = "function()\n return aura_env.ability_icon \nend\n", + ["check"] = "update", + ["names"] = { + }, + ["subeventSuffix"] = "_CAST_START", + ["debuffType"] = "HELPFUL", + }, + ["desaturate"] = false, + ["font"] = "Friz Quadrata TT", + ["height"] = 194.575485229492, + ["load"] = { + ["difficulty"] = { + ["multi"] = { + }, + }, + ["race"] = { + ["multi"] = { + }, + }, + ["talent"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["class"] = { + ["multi"] = { + }, + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["fontSize"] = 20, + ["displayStacks"] = "%c ", + ["regionType"] = "icon", + ["stacksContainment"] = "OUTSIDE", + ["zoom"] = 0, + ["auto"] = true, + ["stacksPoint"] = "BOTTOM", + ["color"] = {1, 1, 1, 1}, + ["frameStrata"] = 1, + ["width"] = 186.000091552734, + ["stickyDuration"] = false, + ["untrigger"] = { + ["custom"] = "function()\n return true\nend", + }, + ["inverse"] = false, + ["numTriggers"] = 1, + ["animation"] = { + ["start"] = { + ["type"] = "none", + ["duration_type"] = "seconds", + }, + ["main"] = { + ["type"] = "none", + ["duration_type"] = "seconds", + }, + ["finish"] = { + ["type"] = "none", + ["duration_type"] = "seconds", + }, + }, + ["icon"] = true, + ["cooldown"] = true, + ["textColor"] = {1, 1, 1, 1}, + } + + local text_dbm_timerbar_prototype = { + ["outline"] = true, + ["fontSize"] = 72, + ["color"] = {1, 1, 1, 1}, + ["displayText"] = "%c", + ["customText"] = "function()\n local at = aura_env.untrigger_at\n if (at) then\n return \"\" .. aura_env.ability_text .. \"\\n\" .. format (\"%.1f\", at - GetTime())\n else\n return \"\"\n end \n \nend", + ["untrigger"] = { + ["custom"] = "function()\n return true\nend", + }, + ["regionType"] = "text", + ["customTextUpdate"] = "update", + ["init_completed"] = 1, + ["actions"] = { + ["start"] = { + }, + ["finish"] = { + }, + ["init"] = { + ["do_custom"] = true, + ["custom"] = "aura_env.countdown_at = 4\naura_env.ability_name = \"Test Bar\"\naura_env.ability_icon = \"Interface\\\\ICONS\\\\Ability_Mage_FireStarter\"\naura_env.ability_text = \"** Next TEST BAR In **\"\naura_env.aura_global_name = \"Test Bar\"\n\nlocal details_aura_env = _G.DetailsAuraEnv\nlocal details_aura_func_cache = _G.DetailsAuraFuncCache\nif (not details_aura_env) then\n details_aura_env = {}\n _G.DetailsAuraEnv = details_aura_env\nend\nif (not details_aura_func_cache) then\n details_aura_func_cache = {}\n _G.DetailsAuraFuncCache = details_aura_func_cache\nend\n\ndetails_aura_env [aura_env.aura_global_name] = aura_env\n\naura_env.Calllback_func = function (event, timer_id, message, duration)\n if (timer_id:find (\"Test Bar\")) then\n duration = duration:gsub (DBM_CORE_SEC, \"\")\n duration = tonumber (duration)\n local aura_env = details_aura_env [\"Test Bar\"]\n aura_env.trigger_at = GetTime() + duration - aura_env.countdown_at\n aura_env.untrigger_at = GetTime() + duration\n end\nend\n\nlocal previous_func = details_aura_func_cache [aura_env.aura_global_name]\nif (previous_func and DBM:IsCallbackRegistered (\"DBM_TimerStart\", previous_func)) then\n DBM:UnregisterCallback (\"DBM_TimerStart\", previous_func)\nend\n\ndetails_aura_func_cache [aura_env.aura_global_name] = aura_env.Calllback_func\nDBM:RegisterCallback (\"DBM_TimerStart\", aura_env.Calllback_func)", + }, + }, + ["justify"] = "CENTER", + ["selfPoint"] = "CENTER", + ["trigger"] = { + ["type"] = "custom", + ["subeventSuffix"] = "_CAST_START", + ["custom_type"] = "status", + ["spellIds"] = { + }, + ["event"] = "Health", + ["unit"] = "player", + ["customDuration"] = "", + ["customName"] = "", + ["custom"] = "function()\n if (InCombatLockdown() and aura_env.trigger_at and aura_env.trigger_at <= GetTime() and aura_env.untrigger_at and aura_env.untrigger_at >= GetTime()) then\n return true\n else\n return false\n end\nend\n", + ["customIcon"] = "", + ["check"] = "update", + ["subeventPrefix"] = "SPELL", + ["names"] = { + }, + ["debuffType"] = "HELPFUL", + }, + ["yOffset"] = 251.43896484375, + ["frameStrata"] = 1, + ["width"] = 43.6800079345703, + ["animation"] = { + ["start"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["main"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["finish"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + }, + ["font"] = "Friz Quadrata TT", + ["numTriggers"] = 1, + ["xOffset"] = 0.999847412109, + ["height"] = 71.9999771118164, + ["load"] = { + ["use_never"] = false, + ["talent"] = { + ["multi"] = { + }, + }, + ["class"] = { + ["multi"] = { + }, + }, + ["difficulty"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["race"] = { + ["multi"] = { + }, + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["anchorPoint"] = "CENTER", + } + + local text_prototype = { + ["outline"] = true, + ["fontSize"] = 12, + ["color"] = {1, 1, 1, 1}, + ["displayText"] = "", + ["yOffset"] = 0, + ["anchorPoint"] = "CENTER", + ["customTextUpdate"] = "update", + ["actions"] = { + ["start"] = { + }, + ["finish"] = { + }, + ["init"] = { + }, + }, + ["justify"] = "LEFT", + ["selfPoint"] = "BOTTOM", + ["trigger"] = { + ["type"] = "aura", + ["spellId"] = "0", + ["subeventSuffix"] = "_CAST_START", + ["custom_hide"] = "timed", + ["event"] = "Health", + ["subeventPrefix"] = "SPELL", + ["debuffClass"] = "magic", + ["use_spellId"] = true, + ["spellIds"] = {}, + ["name_operator"] = "==", + ["fullscan"] = true, + ["unit"] = "player", + ["names"] = { + "", + }, + ["debuffType"] = "HARMFUL", + }, + ["untrigger"] = { + }, + ["frameStrata"] = 1, + ["width"] = 31.0000057220459, + ["animation"] = { + ["start"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["main"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["finish"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + }, + ["font"] = "Friz Quadrata TT", + ["numTriggers"] = 1, + ["xOffset"] = 0, + ["height"] = 11.8704862594604, + ["load"] = { + ["use_combat"] = true, + ["race"] = { + ["multi"] = { + }, + }, + ["talent"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["class"] = { + ["multi"] = { + }, + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["regionType"] = "text", + } + + local aurabar_prototype = { + ["sparkWidth"] = 10, + ["stacksSize"] = 12, + ["xOffset"] = 0, + ["stacksFlags"] = "None", + ["yOffset"] = 0, + ["anchorPoint"] = "CENTER", + ["borderColor"] = {1, 1, 1, 0.5}, + ["rotateText"] = "NONE", + ["backgroundColor"] = { 0, 0, 0, 0.5,}, + ["fontFlags"] = "OUTLINE", + ["icon_color"] = {1, 1, 1, 1}, + ["selfPoint"] = "CENTER", + ["barColor"] = {1, 0, 0, 1}, + ["desaturate"] = false, + ["sparkOffsetY"] = 0, + ["load"] = { + ["use_combat"] = true, + ["race"] = { + ["multi"] = { + }, + }, + ["talent"] = { + ["multi"] = { + }, + }, + ["role"] = { + ["multi"] = { + }, + }, + ["spec"] = { + ["multi"] = { + }, + }, + ["class"] = { + ["multi"] = { + }, + }, + ["size"] = { + ["multi"] = { + }, + }, + }, + ["timerColor"] = {1, 1, 1, 1}, + ["regionType"] = "aurabar", + ["stacks"] = true, + ["texture"] = "Blizzard", + ["textFont"] = "Friz Quadrata TT", + ["zoom"] = 0, + ["spark"] = false, + ["timerFont"] = "Friz Quadrata TT", + ["alpha"] = 1, + ["borderInset"] = 11, + ["textColor"] = {1, 1, 1, 1}, + ["borderBackdrop"] = "Blizzard Tooltip", + ["barInFront"] = true, + ["sparkRotationMode"] = "AUTO", + ["displayTextLeft"] = "%n", + ["animation"] = { + ["start"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["main"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + ["finish"] = { + ["duration_type"] = "seconds", + ["type"] = "none", + }, + }, + ["trigger"] = { + ["type"] = "aura", + ["spellId"] = "0", + ["subeventSuffix"] = "_CAST_START", + ["custom_hide"] = "timed", + ["event"] = "Health", + ["subeventPrefix"] = "SPELL", + ["debuffClass"] = "magic", + ["use_spellId"] = true, + ["spellIds"] = {}, + ["name_operator"] = "==", + ["fullscan"] = true, + ["unit"] = "player", + ["names"] = { + "", + }, + ["debuffType"] = "HARMFUL", + }, + ["text"] = true, + ["stickyDuration"] = false, + ["height"] = 15, + ["timerFlags"] = "None", + ["sparkBlendMode"] = "ADD", + ["backdropColor"] = {1, 1, 1, 0.5}, + ["untrigger"] = { + }, + ["actions"] = { + ["start"] = { + }, + ["finish"] = { + }, + ["init"] = { + }, + }, + ["textFlags"] = "None", + ["border"] = false, + ["borderEdge"] = "None", + ["sparkOffsetX"] = 0, + ["borderSize"] = 16, + ["stacksFont"] = "Friz Quadrata TT", + ["icon_side"] = "RIGHT", + ["textSize"] = 12, + ["timer"] = true, + ["sparkHeight"] = 30, + ["sparkRotation"] = 0, + ["customTextUpdate"] = "update", + ["stacksColor"] = {1, 1, 1, 1}, + ["displayTextRight"] = "%p", + ["icon"] = true, + ["inverse"] = false, + ["frameStrata"] = 1, + ["width"] = 200, + ["sparkColor"] = {1, 1, 1, 1}, + ["timerSize"] = 12, + ["numTriggers"] = 1, + ["sparkDesature"] = false, + ["orientation"] = "HORIZONTAL", + ["borderOffset"] = 5, + ["auto"] = true, + ["sparkTexture"] = "Interface\\CastingBar\\UI-CastingBar-Spark", + } + local icon_prototype = { ["yOffset"] = 202.07, ["xOffset"] = -296.82, @@ -139,7 +800,7 @@ ["fullscan"] = true, ["unit"] = "player", ["names"] = { - "", -- [1] + "", }, ["debuffType"] = "HARMFUL", }, @@ -179,12 +840,7 @@ }, }, }, - ["textColor"] = { - 1, -- [1] - 1, -- [2] - 1, -- [3] - 1, -- [4] - }, + ["textColor"] = {1, 1, 1, 1}, } local actions_prototype = { @@ -271,7 +927,7 @@ }, } - local text_prototype = { + local widget_text_prototype = { ["fontSize"] = 20, ["displayStacks"] = "", ["stacksPoint"] = "BOTTOM", @@ -288,7 +944,7 @@ }, } - function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id, group, icon_size) + 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) --> check if wa is installed if (not WeakAuras or not WeakAurasSaved) then @@ -301,142 +957,285 @@ WeakAuras.Add (group) end + if (not WeakAurasSaved.displays ["Details! Boss Mods Group"]) then + local group = _detalhes.table.copy ({}, group_prototype_boss_mods) + WeakAuras.Add (group) + end + --> create the icon table - local icon = _detalhes.table.copy ({}, icon_prototype) + local new_aura icon_size = icon_size or 40 - if (encounter_id) then - icon.load.use_encounterid = true - icon.load.encounterid = tostring (encounter_id) - end - - icon.id = name - icon.displayIcon = icon_texture - - if (target) then - if (target == 1) then --Debuff on Player - local add = _detalhes.table.copy ({}, debuff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names [1] = spellname - add.trigger.unit = "player" - _detalhes.table.deploy (icon, add) - - elseif (target == 2) then --Debuff on Target - local add = _detalhes.table.copy ({}, debuff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names[1] = spellname - add.trigger.unit = "target" - _detalhes.table.deploy (icon, add) - - elseif (target == 3) then --Debuff on Focus - local add = _detalhes.table.copy ({}, debuff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names[1] = spellname - add.trigger.unit = "focus" - _detalhes.table.deploy (icon, add) - - elseif (target == 11) then --Buff on Player - local add = _detalhes.table.copy ({}, buff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names[1] = spellname - add.trigger.unit = "player" - _detalhes.table.deploy (icon, add) - - elseif (target == 12) then --Buff on Target - local add = _detalhes.table.copy ({}, buff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names[1] = spellname - add.trigger.unit = "target" - _detalhes.table.deploy (icon, add) - - elseif (target == 13) then --Buff on Focus - local add = _detalhes.table.copy ({}, buff_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellIds[1] = spellid - add.trigger.names[1] = spellname - add.trigger.unit = "focus" - _detalhes.table.deploy (icon, add) - - elseif (target == 21) then --Spell Cast Started - local add = _detalhes.table.copy ({}, cast_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellName = spellname - add.trigger.subeventSuffix = "_CAST_START" - if (not use_spellid) then - add.trigger.use_spellName = true - add.trigger.use_spellId = false - end - _detalhes.table.deploy (icon, add) - - elseif (target == 22) then --Spell Cast Successful - local add = _detalhes.table.copy ({}, cast_prototype) - add.trigger.spellId = tostring (spellid) - add.trigger.spellName = spellname - if (not use_spellid) then - add.trigger.use_spellName = true - add.trigger.use_spellId = false - end - _detalhes.table.deploy (icon, add) + if (other_values.dbm_timer_id or other_values.bw_timer_id) then + if (aura_type == "icon") then + new_aura = _detalhes.table.copy ({}, icon_dbm_timerbar_prototype) + elseif (aura_type == "aurabar") then + new_aura = _detalhes.table.copy ({}, bar_dbm_timerbar_prototype) + elseif (aura_type == "text") then + new_aura = _detalhes.table.copy ({}, text_dbm_timerbar_prototype) end - else - icon.trigger.spellId = tostring (spellid) - icon.trigger.name = spellname + + new_aura.actions.init.custom = [[ + aura_env.dbm_timer_id = "@dbm_timer_id" + aura_env.bw_timer_id = "@bw_timer_id" + + aura_env.countdown_at = @countdown + aura_env.ability_name = "@name" + aura_env.ability_icon = [=[@icon]=] + aura_env.ability_text = "@text" + aura_env.aura_global_name = "@gname" + + local details_aura_env = _G.DetailsAuraEnv + local details_aura_func_cache = _G.DetailsAuraFuncCache + + if (not details_aura_env) then + details_aura_env = {} + _G.DetailsAuraEnv = details_aura_env + end + if (not details_aura_func_cache) then + details_aura_func_cache = {} + _G.DetailsAuraFuncCache = details_aura_func_cache + end + + if (BigWigs) then + local old_aura_env = details_aura_env [aura_env.aura_global_name] + if (old_aura_env) then + old_aura_env:UnregisterMessage ("BigWigs_StartBar") + end + elseif (_G.DBM) then + local previous_func = details_aura_func_cache [aura_env.aura_global_name] + if (previous_func and DBM:IsCallbackRegistered ("DBM_TimerStart", previous_func)) then + DBM:UnregisterCallback ("DBM_TimerStart", previous_func) + end + end + + details_aura_env [aura_env.aura_global_name] = aura_env + + if (_G.DBM) then + aura_env.Calllback_func = function (event, timer_id, message, duration) + local aura_env = DetailsAuraEnv ["@gname"] + if (timer_id:find (aura_env.dbm_timer_id)) then + duration = duration:gsub (DBM_CORE_SEC, "") + duration = tonumber (duration) + aura_env.trigger_at = GetTime() + duration - aura_env.countdown_at + aura_env.untrigger_at = GetTime() + duration + end + end + details_aura_func_cache [aura_env.aura_global_name] = aura_env.Calllback_func + DBM:RegisterCallback ("DBM_TimerStart", aura_env.Calllback_func) + end + if (BigWigs) then + function aura_env:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...) + local aura_env = DetailsAuraEnv ["@gname"] + if (tostring (spellid) == aura_env.bw_timer_id) then + duration = time + aura_env.trigger_at = GetTime() + duration - aura_env.countdown_at + aura_env.untrigger_at = GetTime() + duration + end + end + BigWigs.RegisterMessage (aura_env, "BigWigs_StartBar") + end + ]] - tinsert (icon.trigger.spellIds, spellid) + local c = new_aura.actions.init.custom + + if (other_values.dbm_timer_id) then + local dbm_tid = tostring (other_values.dbm_timer_id):match ("%d+", 1) + c = c:gsub ("@dbm_timer_id", dbm_tid) + c = c:gsub ("@bw_timer_id", "Timer ID Not Set") + c = c:gsub ("@gname", "DetailsAura_" .. dbm_tid) + + elseif (other_values.bw_timer_id) then + local bw_tid = other_values.bw_timer_id + c = c:gsub ("@bw_timer_id", bw_tid) + c = c:gsub ("@dbm_timer_id", "Timer ID Not Set") + c = c:gsub ("@gname", "DetailsAura_" .. bw_tid) + end + + if (aura_type == "aurabar") then + icon_text = icon_text:gsub ("= ", "") + icon_text = icon_text:gsub (" =", "") + icon_text = icon_text:gsub ("=", "") + end + + c = c:gsub ("@text", icon_text) + c = c:gsub ("@icon", icon_texture) + c = c:gsub ("@name", spellname) + c = c:gsub ("@countdown", floor (stacksize)) + + new_aura.actions.init.custom = c + + --> size + if (aura_type == "icon") then + new_aura.width = icon_size + new_aura.height = icon_size + elseif (aura_type == "aurabar") then + new_aura.width = min (icon_size, 370) + new_aura.height = 40 + elseif (aura_type == "text") then + new_aura.fontSize = min (icon_size, 72) + end + + else + + if (aura_type == "icon") then + new_aura = _detalhes.table.copy ({}, icon_prototype) + elseif (aura_type == "aurabar") then + new_aura = _detalhes.table.copy ({}, aurabar_prototype) + elseif (aura_type == "text") then + new_aura = _detalhes.table.copy ({}, text_prototype) + new_aura.displayText = spellname + end + + if (target) then + if (target == 1) then --Debuff on Player + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names [1] = spellname + add.trigger.unit = "player" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 2) then --Debuff on Target + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names[1] = spellname + add.trigger.unit = "target" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 3) then --Debuff on Focus + local add = _detalhes.table.copy ({}, debuff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names[1] = spellname + add.trigger.unit = "focus" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 11) then --Buff on Player + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names[1] = spellname + add.trigger.unit = "player" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 12) then --Buff on Target + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names[1] = spellname + add.trigger.unit = "target" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 13) then --Buff on Focus + local add = _detalhes.table.copy ({}, buff_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellIds[1] = spellid + add.trigger.names[1] = spellname + add.trigger.unit = "focus" + _detalhes.table.deploy (new_aura, add) + + elseif (target == 21) then --Spell Cast Started + local add = _detalhes.table.copy ({}, cast_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellName = spellname + add.trigger.subeventSuffix = "_CAST_START" + if (not use_spellid) then + add.trigger.use_spellName = true + add.trigger.use_spellId = false + end + _detalhes.table.deploy (new_aura, add) + + elseif (target == 22) then --Spell Cast Successful + local add = _detalhes.table.copy ({}, cast_prototype) + add.trigger.spellId = tostring (spellid) + add.trigger.spellName = spellname + if (not use_spellid) then + add.trigger.use_spellName = true + add.trigger.use_spellId = false + end + _detalhes.table.deploy (new_aura, add) + end + else + new_aura.trigger.spellId = tostring (spellid) + new_aura.trigger.name = spellname + tinsert (new_aura.trigger.spellIds, spellid) + end + + --> if is a regular auras withour using spells ids + if (not use_spellid) then + new_aura.trigger.use_spellId = false + new_aura.trigger.fullscan = false + new_aura.trigger.spellId = nil + new_aura.trigger.spellIds = {} + end + + --> check stack size + if (stacksize and stacksize >= 1) then + stacksize = floor (stacksize) + local add = _detalhes.table.copy ({}, stack_prototype) + add.trigger.count = tostring (stacksize) + _detalhes.table.deploy (new_aura, add) + end + + --> icon text + if (icon_text and icon_text ~= "") then + if (aura_type == "text") then + new_aura.displayText = icon_text + else + local add = _detalhes.table.copy ({}, widget_text_prototype) + add.displayStacks = icon_text + _detalhes.table.deploy (new_aura, add) + end + end + + --> size + if (aura_type == "icon") then + new_aura.width = icon_size + new_aura.height = icon_size + elseif (aura_type == "aurabar") then + new_aura.width = min (icon_size, 250) + new_aura.height = 24 + elseif (aura_type == "text") then + new_aura.fontSize = min (icon_size, 24) + end end - --> if is a regular auras withour using spells ids - if (not use_spellid) then - icon.trigger.use_spellId = false - icon.trigger.fullscan = false - icon.trigger.spellId = nil - icon.trigger.spellIds = {} + new_aura.id = name + new_aura.displayIcon = icon_texture + + --> load by encounter id + if (encounter_id) then + new_aura.load.use_encounterid = true + new_aura.load.encounterid = tostring (encounter_id) end - - --> check stack size - if (stacksize and stacksize >= 1) then - stacksize = floor (stacksize) - local add = _detalhes.table.copy ({}, stack_prototype) - add.trigger.count = tostring (stacksize) - _detalhes.table.deploy (icon, add) - end - + --> using sound 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) + _detalhes.table.deploy (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 (icon, add) + _detalhes.table.deploy (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 (icon, add) - end - - if (icon_text and icon_text ~= "") then - local add = _detalhes.table.copy ({}, text_prototype) - add.displayStacks = icon_text - _detalhes.table.deploy (icon, add) + _detalhes.table.deploy (new_aura, add) end --> check if already exists a aura with this name - if (WeakAurasSaved.displays [icon.id]) then + if (WeakAurasSaved.displays [new_aura.id]) then for i = 2, 100 do - if (not WeakAurasSaved.displays [icon.id .. " (" .. i .. ")"]) then - icon.id = icon.id .. " (" .. i .. ")" + if (not WeakAurasSaved.displays [new_aura.id .. " (" .. i .. ")"]) then + new_aura.id = new_aura.id .. " (" .. i .. ")" break end end @@ -445,24 +1244,20 @@ --> check is is using glow effect if (icon_glow) then local add = _detalhes.table.copy ({}, glow_prototype) - add.actions.start.glow_frame = "WeakAuras:" .. icon.id - _detalhes.table.deploy (icon, add) + add.actions.start.glow_frame = "WeakAuras:" .. new_aura.id + _detalhes.table.deploy (new_aura, add) end --> add the aura on a group if (group) then - icon.parent = group - tinsert (WeakAurasSaved.displays [group].controlledChildren, icon.id) + new_aura.parent = group + tinsert (WeakAurasSaved.displays [group].controlledChildren, new_aura.id) else - icon.parent = nil + new_aura.parent = nil end - --> icon size - icon.width = icon_size - icon.height = icon_size - --> add the aura - WeakAuras.Add (icon) + WeakAuras.Add (new_aura) --> check if the options panel has loaded local options_frame = WeakAuras.OptionsFrame and WeakAuras.OptionsFrame() @@ -470,25 +1265,37 @@ if (options_frame and not options_frame:IsShown()) then WeakAuras.ToggleOptions() end - WeakAuras.NewDisplayButton (icon) + WeakAuras.NewDisplayButton (new_aura) end end - function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, triggertype) + local empty_other_values = {} + function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, triggertype, auratype, other_values) - spellname = select (1, GetSpellInfo (spellid)) + if (not spellname) then + spellname = select (1, GetSpellInfo (spellid)) + end + + wipe (empty_other_values) + other_values = other_values or empty_other_values 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) + if (WeakAuras and WeakAurasSaved) then + if (not WeakAurasSaved.displays ["Details! Aura Group"]) then + local group = _detalhes.table.copy ({}, group_prototype) + WeakAuras.Add (group) + end + if (not WeakAurasSaved.displays ["Details! Boss Mods Group"]) then + local group = _detalhes.table.copy ({}, group_prototype_boss_mods) + WeakAuras.Add (group) + end end - + local f = CreateFrame ("frame", "DetailsAuraPanel", UIParent, "ButtonFrameTemplate") - f:SetSize (300, 488) + f:SetSize (600, 488) f:SetPoint ("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) @@ -525,6 +1332,24 @@ name_textentry:SetPoint ("left", name_label, "right", 2, 0) f.name = name_textentry + --aura type + local on_select_aura_type = function (_, _, aura_type) + if (f.UpdateLabels) then + f:UpdateLabels() + end + end + local aura_type_table = { + {label = "Icon", value = "icon", onclick = on_select_aura_type}, --, icon = aura_on_icon + {label = "Text", value = "text", onclick = on_select_aura_type}, + {label = "Progress Bar", value = "aurabar", onclick = on_select_aura_type}, + } + local aura_type_options = function() + return aura_type_table + end + local aura_type = fw:CreateDropDown (f, aura_type_options, 1, 150, 20, "AuraTypeDropdown", "$parentAuraTypeDropdown") + local aura_type_label = fw:CreateLabel (f, "Aura Type: ", nil, nil, "GameFontNormal") + aura_type:SetPoint ("left", aura_type_label, "right", 2, 0) + --spellname local spellname_label = fw:CreateLabel (f, "Spell Name: ", nil, nil, "GameFontNormal") local spellname_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName") @@ -559,18 +1384,27 @@ f.icon = icon_button_icon --target + local on_select_aura_trigger = function (_, _, aura_trigger) + if (f.UpdateLabels) then + f:UpdateLabels() + end + end + local aura_on_icon = [[Interface\Buttons\UI-GroupLoot-DE-Down]] local aura_on_table = { - {label = "Debuff on You", value = 1, icon = aura_on_icon}, - {label = "Debuff on Target", value = 2, icon = aura_on_icon}, - {label = "Debuff on Focus", value = 3, icon = aura_on_icon}, + {label = "Debuff on You", value = 1, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "Debuff on Target", value = 2, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "Debuff on Focus", value = 3, icon = aura_on_icon, onclick = on_select_aura_trigger}, - {label = "Buff on You", value = 11, icon = aura_on_icon}, - {label = "Buff on Target", value = 12, icon = aura_on_icon}, - {label = "Buff on Focus", value = 13, icon = aura_on_icon}, + {label = "Buff on You", value = 11, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "Buff on Target", value = 12, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "Buff on Focus", value = 13, icon = aura_on_icon, onclick = on_select_aura_trigger}, - {label = "Spell Cast Started", value = 21, icon = aura_on_icon}, - {label = "Spell Cast Successful", value = 22, icon = aura_on_icon}, + {label = "Spell Cast Started", value = 21, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "Spell Cast Successful", value = 22, icon = aura_on_icon, onclick = on_select_aura_trigger}, + + {label = "DBM Time Bar", value = 31, icon = aura_on_icon, onclick = on_select_aura_trigger}, + {label = "BigWigs Time Bar", value = 32, icon = aura_on_icon, onclick = on_select_aura_trigger}, } local aura_on_options = function() return aura_on_table @@ -686,7 +1520,7 @@ say_something.tooltip = "Your character /say this phrase when the aura triggers." --aura text - local aura_text_label = fw:CreateLabel (f, "Icon Text: ", nil, nil, "GameFontNormal") + local aura_text_label = fw:CreateLabel (f, "Aura Text: ", nil, nil, "GameFontNormal") local aura_text = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText") aura_text:SetPoint ("left", aura_text_label, "right", 2, 0) aura_text.tooltip = "Text shown at aura's icon right side." @@ -717,9 +1551,9 @@ encounterid:SetPoint ("left", encounterid_label, "right", 2, 0) encounterid.tooltip = "Only load this aura for this raid encounter." - --icon size + --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") + local icon_size_label = fw:CreateLabel (f, "Size: ", nil, nil, "GameFontNormal") icon_size_slider:SetPoint ("left", icon_size_label, "right", 2, 0) icon_size_slider.tooltip = "Icon size, width and height." @@ -741,8 +1575,10 @@ local folder_texcoord = {435/512, 469/512, 189/512, 241/512} local folder_iconsize = {14, 14} + local sort_func = function (t1, t2) return t1.label < t2.label end + 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}} + local t = {} 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 @@ -750,6 +1586,8 @@ end end end + table.sort (t, sort_func) + tinsert (t, 1, {label = "No Group", value = false, icon = folder_icon, texcoord = folder_texcoord, iconcolor = {0.8, 0.2, 0.2}, iconsize = folder_iconsize}) return t end @@ -761,6 +1599,7 @@ local create_func = function() local name = f.AuraName.text + local aura_type_value = f.AuraTypeDropdown.value local spellname = f.SpellName.text local use_spellId = f.UseSpellId.value local spellid = f.AuraSpellId.text @@ -780,9 +1619,9 @@ 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, folder, iconsize) + _detalhes:CreateWeakAura (aura_type_value, spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow, eid, folder, iconsize, f.other_values) else _detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.") end @@ -800,23 +1639,30 @@ cancel_button:SetIcon ([[Interface\Buttons\UI-GroupLoot-Pass-Down]], nil, nil, nil, {0.125, 0.875, 0.125, 0.875}, nil, 4, 2) local x_start = 20 + local x2_start = 320 local y_start = 21 + --aura name and the type name_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*1) + (50)) * -1) - aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1) + aura_type_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1) - spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (60)) * -1) - auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (60)) * -1) - usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (60)) * -1) + --triggers + aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (45)) * -1) + stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (45)) * -1) + encounterid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (45)) * -1) - icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (70)) * -1) - stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*7) + (70)) * -1) - sound_effect_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*8) + (70)) * -1) - 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) + --about the spell + spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*8) + (45)) * -1) + auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*9) + (45)) * -1) + usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*10) + (45)) * -1) + + --configuration + icon_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*1) + (50)) * -1) + sound_effect_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*2) + (50)) * -1) + say_something_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*3) + (50)) * -1) + aura_text_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*4) + (50)) * -1) + useglow_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*5) + (50)) * -1) + icon_size_label:SetPoint ("topleft", f, "topleft", x2_start, ((y_start*6) + (50)) * -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) @@ -824,12 +1670,54 @@ 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) + function f:UpdateLabels() + + local aura_type = f.AuraTypeDropdown.value + local trigger = f.AuraOnDropdown.value + + f.StackSlider:Enable() + f.StackSlider.tooltip = "Minimum amount of stacks to trigger the aura." + f.StackSlider:SetValue (0) + f.SpellName:Enable() + f.UseSpellId:Enable() + + if (aura_type == "icon") then + aura_text_label:SetText ("Icon Text: ") + icon_size_label:SetText ("Width/Height: ") + + elseif (aura_type == "text") then + aura_text_label:SetText ("Text: ") + icon_size_label:SetText ("Font Size: ") + + elseif (aura_type == "aurabar") then + aura_text_label:SetText ("Left Text: ") + icon_size_label:SetText ("Bar Width: ") + + end + + if (trigger >= 1 and trigger <= 19) then --buff and debuff + stack_label:SetText ("Stack Size: ") + + elseif (trigger >= 20 and trigger <= 29) then --cast start and end + stack_label:SetText ("Stack Size: ") + f.StackSlider:Disable() + + elseif (trigger >= 30 and trigger <= 39) then --boss mods + stack_label:SetText ("Remaining Time:") + f.StackSlider:SetValue (4) + f.StackSlider.tooltip = "Will trigger when the bar remaining time reach this value." + f.SpellName:Disable() + f.UseSpellId:Disable() + end + end end DetailsAuraPanel.spellid = spellid DetailsAuraPanel.encounterid = encounterid DetailsAuraPanel.EncounterIdText.text = encounterid or "" + DetailsAuraPanel.other_values = other_values + DetailsAuraPanel.WeakaurasFolderDropdown:Refresh() if (encounterid) then DetailsAuraPanel.WeakaurasFolderDropdown:Select ("Details! Aura Group") @@ -839,18 +1727,26 @@ DetailsAuraPanel.IconSizeSlider:SetValue (64) end + if (other_values.dbm_timer_id or other_values.bw_timer_id) then + DetailsAuraPanel.WeakaurasFolderDropdown:Select ("Details! Boss Mods Group") + end + + if (DetailsAuraPanel.other_values.text_size) then + DetailsAuraPanel.IconSizeSlider:SetValue (DetailsAuraPanel.other_values.text_size) + end + DetailsAuraPanel.name.text = spellname .. " (d!)" DetailsAuraPanel.spellname.text = spellname DetailsAuraPanel.AuraSpellId.text = tostring (spellid) DetailsAuraPanel.icon.texture = spellicon - + DetailsAuraPanel.UseGlow.glow_test.animIn:Stop() DetailsAuraPanel.UseGlow.glow_test.animOut:Play() DetailsAuraPanel.UseGlow:SetValue (false) - + DetailsAuraPanel.StackSlider:SetValue (0) DetailsAuraPanel.SoundEffectDropdown:Select (1, true) - DetailsAuraPanel.AuraText:SetText ("") + DetailsAuraPanel.AuraText:SetText (DetailsAuraPanel.other_values.text or "") DetailsAuraPanel.SaySomething:SetText ("") if (triggertype and type (triggertype) == "number") then @@ -859,6 +1755,14 @@ DetailsAuraPanel.AuraOnDropdown:Select (1, true) end + if (auratype and type (auratype) == "number") then + DetailsAuraPanel.AuraTypeDropdown:Select (auratype, true) + else + DetailsAuraPanel.AuraTypeDropdown:Select (1, true) + end + + DetailsAuraPanel:UpdateLabels() + DetailsAuraPanel:Show() end diff --git a/functions/profiles.lua b/functions/profiles.lua index b35583c1..7a84b056 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -969,7 +969,8 @@ local default_profile = { show_amount = false, commands = {}, header_text_color = {1, 0.9176, 0, 1}, --{1, 0.7, 0, 1} - + submenu_wallpaper = true, + anchored_to = 1, anchor_screen_pos = {507.700, -350.500}, anchor_point = "bottom", diff --git a/functions/slash.lua b/functions/slash.lua index 229e0e9d..a7e2a302 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -999,26 +999,6 @@ function SlashCmdList.DETAILS (msg, editbox) end end - elseif (msg == "ilvl") then - local item_amount = 0 - local item_level = 0 - - for equip_id = 1, 17 do - if (equip_id ~= 4) then --shirt slot - local item = GetInventoryItemLink ("player", equip_id) - if (item) then - local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo (item) - if (iLevel) then - item_amount = item_amount + 1 - item_level = item_level + iLevel - end - end - end - end - - local average = item_level / item_amount - print ("your item lvl:", average) - elseif (msg == "forge") then _detalhes:OpenForge() @@ -1044,7 +1024,23 @@ function SlashCmdList.DETAILS (msg, editbox) -1, --overkill = 1 --school = ) - + + elseif (msg == "ilvl") then + local ilvl_frame = CreateFrame ("GameTooltip", "details_ilvl_tooltip", UIParent, "GameTooltipTemplate"); + local get_ilvl = function (itemLink) + ilvl_frame:SetOwner (UIParent, "ANCHOR_NONE") + ilvl_frame:ClearLines() + ilvl_frame:SetHyperlink (itemLink) + + for i = 1, 13 do + print (_G ["details_ilvl_tooltipTextLeft" .. i]:GetText()) + end + end + + local item = GetInventoryItemLink ("player", 1) + print ("item:", item) + get_ilvl (item) + else --if (_detalhes.opened_windows < 1) then diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 141b61d8..e1ebb37e 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1643,6 +1643,18 @@ function window:CreateFrame20() edit_menu_bg:SetIcon ([[Interface\CHATFRAME\UI-ChatIcon-Maximize-Down]], 12, 12, nil, {6/32, 23/32, 10/32, 25/32}, nil, 4, 2) window:CreateLineBackground2 (frame20, "EditMenuBgButton", "EditMenuBgButton", Loc ["STRING_OPTIONS_TOOLTIPS_MENU_WALLP_DESC"], nil, {1, 0.8, 0}, button_color_rgb) + --> disable cooltip wallpaper on submenus + g:NewLabel (frame20, _, "$parentCopyMainWallpaperLabel", "CopyMainWallpaperLabel", Loc ["STRING_OPTIONS_TOOLTIPS_IGNORESUBWALLPAPER"], "GameFontHighlightLeft") + g:NewSwitch (frame20, _, "$parentCopyMainWallpaperSlider", "CopyMainWallpaperSlider", 60, 20, _, _, _detalhes.tooltip.submenu_wallpaper) + frame20.CopyMainWallpaperSlider:SetPoint ("left", frame20.CopyMainWallpaperLabel, "right", 2) + + frame20.CopyMainWallpaperSlider.OnSwitch = function (self, _, value) + _detalhes.tooltip.submenu_wallpaper = value + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame20, "CopyMainWallpaperSlider", "CopyMainWallpaperLabel", Loc ["STRING_OPTIONS_TOOLTIPS_IGNORESUBWALLPAPER_DESC"]) + --> anchors: --general anchor @@ -1668,13 +1680,10 @@ function window:CreateFrame20() {"TooltipShowAmountLabel", 8}, {"TooltipdpsAbbreviateLabel", 10}, {"TooltipMaximizeLabel", 9}, - - {"TooltipsBorderAnchorLabel", 11, true}, - {"BackdropBorderTextureLabel", 14}, - {"BackdropSizeLabel", 13}, - {"BackdropColorLabel", 12}, + {"CopyMainWallpaperLabel", 10}, + {edit_menu_bg, 11, true}, } - + window:arrange_menu (frame20, left_side, x, -90) x = window.right_start_at @@ -1687,7 +1696,11 @@ function window:CreateFrame20() {"TooltipRelativeSideLabel", 5}, {"TooltipOffsetXLabel", 6, true}, {"TooltipOffsetYLabel", 7}, - {edit_menu_bg, 8, true}, + + {"TooltipsBorderAnchorLabel", 8, true}, + {"BackdropBorderTextureLabel", 9}, + {"BackdropSizeLabel", 10}, + {"BackdropColorLabel", 11}, } window:arrange_menu (frame20, right_side, x, -90) @@ -10670,6 +10683,8 @@ end --> if not window _G.DetailsOptionsWindow20BackdropSizeHeight.MyObject:SetValue (_detalhes.tooltip.border_size) _G.DetailsOptionsWindow20BackdropColorPick.MyObject:SetColor (unpack (_detalhes.tooltip.border_color)) + _G.DetailsOptionsWindow20CopyMainWallpaperSlider.MyObject:SetValue (_detalhes.tooltip.submenu_wallpaper) + ---------- _G.DetailsOptionsWindow6SideBarsSlider.MyObject:SetFixedParameter (editing_instance) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 4b0a1b30..a0dbe6b2 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -317,6 +317,7 @@ local function OnLeaveMainWindow (instancia, self) instancia.is_interacting = false instancia:SetMenuAlpha (nil, nil, nil, nil, true) instancia:SetAutoHideMenu (nil, nil, true) + instancia:RefreshAttributeTextSize() if (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and not instancia.baseframe.isLocked) then @@ -350,6 +351,8 @@ 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 (instancia.baseframe:GetFrameLevel() > instancia.rowframe:GetFrameLevel()) then @@ -5616,23 +5619,28 @@ local build_segment_list = function (self, elapsed) end CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 16, 0.96875, 1, 0, 0.03125) - local background = _detalhes:GetRaidIcon (thisCombat.is_boss.mapid) - if (background) then - CoolTip:SetWallpaper (2, background, nil, segments_wallpaper_color) - else - local ej_id = thisCombat.is_boss.ej_instance_id - if (ej_id and ej_id ~= 0) then - local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = EJ_GetInstanceInfo (ej_id) - if (name) then - if (thisCombat.instance_type == "party") then - CoolTip:SetWallpaper (2, bgImage, party_wallpaper_tex, party_wallpaper_color) - else - CoolTip:SetWallpaper (2, loreImage, raid_wallpaper_tex, party_wallpaper_color) - end - end + if (_detalhes.tooltip.submenu_wallpaper) then + local background = _detalhes:GetRaidIcon (thisCombat.is_boss.mapid) + if (background) then + CoolTip:SetWallpaper (2, background, nil, segments_wallpaper_color) else - CoolTip:SetWallpaper (2, [[Interface\BlackMarket\HotItemBanner]], unknown_boss_tex, unknown_boss_color, true) + local ej_id = thisCombat.is_boss.ej_instance_id + if (ej_id and ej_id ~= 0) then + local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = EJ_GetInstanceInfo (ej_id) + if (name) then + if (thisCombat.instance_type == "party") then + CoolTip:SetWallpaper (2, bgImage, party_wallpaper_tex, party_wallpaper_color) + else + CoolTip:SetWallpaper (2, loreImage, raid_wallpaper_tex, party_wallpaper_color) + end + end + else + CoolTip:SetWallpaper (2, [[Interface\BlackMarket\HotItemBanner]], unknown_boss_tex, unknown_boss_color, true) + end end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end elseif (thisCombat.is_pvp) then @@ -5640,9 +5648,14 @@ local build_segment_list = function (self, elapsed) enemy = thisCombat.is_pvp.name CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) - local file, coords = _detalhes:GetBattlegroundInfo (thisCombat.is_pvp.mapid) - if (file) then - CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + if (_detalhes.tooltip.submenu_wallpaper) then + local file, coords = _detalhes:GetBattlegroundInfo (thisCombat.is_pvp.mapid) + if (file) then + CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end elseif (thisCombat.is_arena) then @@ -5650,9 +5663,14 @@ local build_segment_list = function (self, elapsed) enemy = thisCombat.is_arena.name CoolTip:AddIcon ([[Interface\AddOns\Details\images\icons]], "main", "left", 16, 12, 0.251953125, 0.306640625, 0.205078125, 0.248046875) - local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid) - if (file) then - CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + if (_detalhes.tooltip.submenu_wallpaper) then + local file, coords = _detalhes:GetArenaInfo (thisCombat.is_arena.mapid) + if (file) then + CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end else enemy = thisCombat.enemy @@ -5668,7 +5686,12 @@ local build_segment_list = function (self, elapsed) CoolTip:AddIcon ([[Interface\QUESTFRAME\UI-Quest-BulletPoint]], "main", "left", 16, 16) end - CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) + if (_detalhes.tooltip.submenu_wallpaper) then + CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) + end end @@ -5721,21 +5744,26 @@ local build_segment_list = function (self, elapsed) CoolTip:AddIcon (portrait, 2, "top", 128, 64) end - local background = _detalhes:GetRaidIcon (_detalhes.tabela_vigente.is_boss.mapid) - if (background) then - CoolTip:SetWallpaper (2, background, nil, segments_wallpaper_color) - else - local ej_id = _detalhes.tabela_vigente.is_boss.ej_instance_id - if (ej_id and ej_id ~= 0) then - local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = EJ_GetInstanceInfo (ej_id) - if (name) then - if (_detalhes.tabela_vigente.instance_type == "party") then - CoolTip:SetWallpaper (2, bgImage, party_wallpaper_tex, party_wallpaper_color) - else - CoolTip:SetWallpaper (2, loreImage, raid_wallpaper_tex, party_wallpaper_color) + if (_detalhes.tooltip.submenu_wallpaper) then + local background = _detalhes:GetRaidIcon (_detalhes.tabela_vigente.is_boss.mapid) + if (background) then + CoolTip:SetWallpaper (2, background, nil, segments_wallpaper_color) + else + local ej_id = _detalhes.tabela_vigente.is_boss.ej_instance_id + if (ej_id and ej_id ~= 0) then + local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = EJ_GetInstanceInfo (ej_id) + if (name) then + if (_detalhes.tabela_vigente.instance_type == "party") then + CoolTip:SetWallpaper (2, bgImage, party_wallpaper_tex, party_wallpaper_color) + else + CoolTip:SetWallpaper (2, loreImage, raid_wallpaper_tex, party_wallpaper_color) + end end end end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end elseif (_detalhes.tabela_vigente.is_pvp) then enemy = _detalhes.tabela_vigente.is_pvp.name @@ -5744,12 +5772,23 @@ local build_segment_list = function (self, elapsed) enemy = _detalhes.tabela_vigente.is_arena.name file, coords = _detalhes:GetArenaInfo (_detalhes.tabela_vigente.is_arena.mapid) else - CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) + if (_detalhes.tooltip.submenu_wallpaper) then + CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) + end end CoolTip:AddLine (Loc ["STRING_SEGMENT_ENEMY"] .. ":", enemy, 2, "white", "white") - if (file) then - CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + + if (_detalhes.tooltip.submenu_wallpaper) then + if (file) then + CoolTip:SetWallpaper (2, "Interface\\Glues\\LOADINGSCREENS\\" .. file, coords, empty_segment_color) + end + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) end if (not _detalhes.tabela_vigente:GetEndTime()) then @@ -5799,7 +5838,12 @@ local build_segment_list = function (self, elapsed) --CoolTip:SetWallpaper (2, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]], segments_common_tex, segments_common_color) --CoolTip:SetWallpaper (2, [[Interface\PetBattles\MountJournal-NoMounts]], {0, 403/512, 0, 294/512}, {.5, .5, .5, 0.9}) - CoolTip:SetWallpaper (2, [[Interface\PetPaperDollFrame\PetStatsBG-Hunter]], {321/512, 0, 0, 190/512}, {1, 1, 1, 0.9}) + if (_detalhes.tooltip.submenu_wallpaper) then + CoolTip:SetWallpaper (2, [[Interface\PetPaperDollFrame\PetStatsBG-Hunter]], {321/512, 0, 0, 190/512}, {1, 1, 1, 0.9}) + else + --> wallpaper = main window + CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true) + end CoolTip:AddLine (Loc ["STRING_SEGMENT_START"] .. ":", _detalhes.tabela_overall.data_inicio, 2, "white", "white") CoolTip:AddLine (Loc ["STRING_SEGMENT_END"] .. ":", _detalhes.tabela_overall.data_fim, 2, "white", "white") @@ -6293,7 +6337,15 @@ end -- ~attributemenu (text with attribute name) function _detalhes:RefreshAttributeTextSize() if (self.attribute_text.enabled and self.total_buttons_shown and self.baseframe and self.menu_attribute_string) then + local window_width = self:GetSize() + + if (self.auto_hide_menu.left and not self.is_interacting) then + self.menu_attribute_string:SetWidth (window_width) + self.menu_attribute_string:SetHeight (self.attribute_text.text_size + 2) + return + end + local buttons_shown = self.total_buttons_shown local buttons_width, buttons_spacement = self.menu_icons_size * 16, self.menu_icons.space @@ -6577,6 +6629,7 @@ function _detalhes:SetAutoHideMenu (left, right, interacting) end end + self:RefreshAttributeTextSize() --auto_hide_menu = {left = false, right = false}, end