diff --git a/boot.lua b/boot.lua index 0a2a2ac2..82ad8831 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 389 --it's 389 for release - _detalhes.userversion = "v3.7.1" - _detalhes.realversion = 57 --core version + _detalhes.userversion = "v3.8c" + _detalhes.realversion = 58 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -18,34 +18,23 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n -|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n -|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n -|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n -|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n -|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n -|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n -|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n -|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n -|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n -|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n -|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch. -|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n -|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n -|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n -|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n -|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment.\n\n -|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n -|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n -|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n -|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n -|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n -|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n -|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n -|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n +|cFFFFFF00v3.8 (|cFFFFCC00Jan 16, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n +|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n +|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n +|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n +|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now track more spells and also melee hits.\n\n +|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n +|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n +|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n +|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n +|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n +|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n +|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n +|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch.|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel.\n\n|cFFFFFF00v3.6.8 (|cFFFFCC00Dec 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Fast (i mean, really fast) Dps/Hps update rate, its option is under Rows: Advanced -> Fast Updates.\n\n|cFFFFFF00-|r Created a custom spell for Mirror Image's Fireball and Frostbolt, with that Player Detail window distinguishes spells from the player and images.\n\n|cFFFFFF00-|r Added new skin: 'ElvUI Style II'.\n\n|cFFFFFF00-|r Added Observer mode for Raid Tools: report cooldown/interrupt/death of entire raid only to you in your chat window.\n\n|cFFFFFF00-|r Added new plugin 'Raid Check': tracks raid members checking food, flask and pre-potions usage.\n\n|cFFFFFF00-|r Changed DPS display, now it shows onyl the player's Dps and the Dps difference between him and the top ranked.\n\n|cFFFFFF00-|r Changed Overheal display, now its percentage shows the player's overheal percent.\n\n|cFFFFFF00-|r Player Detail Window now shows the amount of multistrike on normal and critical hits.\n\n|cFFFFFF00-|r Removed skin: 'ElvUI Frame Style BW'.\n\n|cFFFFFF00-|r The tooltip for Scale option under options panel, now shows the real value for the scale.\n\n|cFFFFFF00-|r Fixed Imperator Mar'gok's adds damage taken.\n\n|cFFFFFF00-|r Fixed a problem where multistrike was counting towards critical strike amount.\n\n|cFFFFFF00-|r Fixed death display's report where it was't showing any death.\n\n|cFFFFFF00-|r Fixed a small issue with Encounter Details plugin where sometimes gets a error right after a boss encounter.\n\n|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute.\n\n|cFFFFFF00-|r Clicking on report button when the report window is already open, make it close.\n\n|cFFFFFF00v3.4.7 (|cFFFFCC00Dec 11, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs plugin got updates on Endurance Player Value and few bug fixes.\n\n|cFFFFFF00-|r Max Window Amount options can new be set to 1, before the minimum was 3.\n\n|cFFFFFF00-|r Fixed a problem with friendly fire tooltip where sometimes it wasn't showing up.\n\n|cFFFFFF00-|r Fixed cooldowns tooltip which wasn't showing rounded numbers (49.99 instead of 50).\n\n|cFFFFFF00-|r Fixed Warrior's Shield Block which wasn't being count as a cooldown.\n\n|cFFFFFF00-|r Fixed a problem where sometimes when a hunter pull and reset the boss right after, was causing segments to merge.\n\n|cFFFFFF00v3.4.4 (|cFFFFCC00Dec 05, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a issue with Ko'Ragh boss on Highmaul raid.\n\n|cFFFFFF00-|r Few changes on Bookmark panel.\n\n|cFFFFFF00v3.4.3 (|cFFFFCC00Dec 02, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Removed 'Simple Gray' skin.\n\n|cFFFFFF00-|r Addde new skin: 'Forced Square'.\n\n|cFFFFFF00-|r 'Default Skin' got renamed to 'WoW Interface'." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.8.0 (|cFFFFCC00Jan 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now track more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch.|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel.\n\n|cFFFFFF00v3.6.8 (|cFFFFCC00Dec 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Fast (i mean, really fast) Dps/Hps update rate, its option is under Rows: Advanced -> Fast Updates.\n\n|cFFFFFF00-|r Created a custom spell for Mirror Image's Fireball and Frostbolt, with that Player Detail window distinguishes spells from the player and images.\n\n|cFFFFFF00-|r Added new skin: 'ElvUI Style II'.\n\n|cFFFFFF00-|r Added Observer mode for Raid Tools: report cooldown/interrupt/death of entire raid only to you in your chat window.\n\n|cFFFFFF00-|r Added new plugin 'Raid Check': tracks raid members checking food, flask and pre-potions usage.\n\n|cFFFFFF00-|r Changed DPS display, now it shows onyl the player's Dps and the Dps difference between him and the top ranked.\n\n|cFFFFFF00-|r Changed Overheal display, now its percentage shows the player's overheal percent.\n\n|cFFFFFF00-|r Player Detail Window now shows the amount of multistrike on normal and critical hits.\n\n|cFFFFFF00-|r Removed skin: 'ElvUI Frame Style BW'.\n\n|cFFFFFF00-|r The tooltip for Scale option under options panel, now shows the real value for the scale.\n\n|cFFFFFF00-|r Fixed Imperator Mar'gok's adds damage taken.\n\n|cFFFFFF00-|r Fixed a problem where multistrike was counting towards critical strike amount.\n\n|cFFFFFF00-|r Fixed death display's report where it was't showing any death.\n\n|cFFFFFF00-|r Fixed a small issue with Encounter Details plugin where sometimes gets a error right after a boss encounter.\n\n|cFFFFFF00-|r Fixed bugs on sending messages to chat for Raid Tools.\n\n\n\n|cFFFFFF00v3.5.1 (|cFFFFCC00Dec 16, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few accuracy on miss spells.\n\n|cFFFFFF00v3.5.0 (|cFFFFCC00Dec 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed tooltip for Auras and Voidzones, now shows sorted by damage and time.\n\n|cFFFFFF00-|r More fixes for Korgath encounter on Highmaul.\n\n|cFFFFFF00-|r Added slash commands: 'reset' 'config'.\n\n|cFFFFFF00-|r Spell bars on Player Details Window now is painted with the spell spellschool color.\n\n|cFFFFFF00-|r Multistrike doesn't count any more for spell's Minimal Damage.\n\n|cFFFFFF00-|r Resource display got an tooltip which shows what resource is and resource gained per minute." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -88,6 +77,8 @@ do --> cache de grupo _detalhes.cache_damage_group = {} _detalhes.cache_healing_group = {} + --> cache de specs + _detalhes.cached_specs = {} --> ignored pets _detalhes.pets_ignored = {} _detalhes.pets_no_owner = {} @@ -360,9 +351,9 @@ do --> welcome function _detalhes:WelcomeMsgLogon() - _detalhes:Msg ("|cffb0b0b0you can always reset the addon running the command '/details reinstall' if it does fail to load after being updated.|r") + _detalhes:Msg ("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.") end - _detalhes:ScheduleTimer ("WelcomeMsgLogon", 8) + _detalhes.failed_to_load = _detalhes:ScheduleTimer ("WelcomeMsgLogon", 20) --> key binds --> header diff --git a/classes/classe_custom.lua b/classes/classe_custom.lua index 60b08784..6eed61bc 100644 --- a/classes/classe_custom.lua +++ b/classes/classe_custom.lua @@ -625,7 +625,7 @@ else if (self.id) then - esta_barra.icone_classe:SetTexCoord (0, 1, 0, 1) + esta_barra.icone_classe:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875) esta_barra.icone_classe:SetTexture (self.icon) else esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) @@ -1250,7 +1250,7 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - +-- /run _detalhes:AddDefaultCustomDisplays() local Healthstone = { name = Loc ["STRING_CUSTOM_HEALTHSTONE_DEFAULT"], icon = [[Interface\ICONS\warlock_ healthstone]], @@ -1272,7 +1272,7 @@ local AllSpells = character:GetSpellList() local found = false for spellid, spell in pairs (AllSpells) do - if (spellid == 6262 or spellid == 156445) then + if (spellid == 6262 or spellid == 156445 or spellid == 156438) then --healthstone, reju potion, health potion instance_container:AddValue (character, spell.total) total = total + spell.total if (top < spell.total) then @@ -1297,6 +1297,7 @@ --get the cooltip object (we dont use the convencional GameTooltip here) local GameCooltip = GameCooltip local R, G, B, A = 0, 0, 0, 0.75 + local hs = actor:GetSpell (6262) if (hs) then GameCooltip:AddLine (select (1, GetSpellInfo(6262)), _detalhes:ToK(hs.total)) @@ -1310,11 +1311,19 @@ GameCooltip:AddIcon (select (3, GetSpellInfo (156445)), 1, 1, 16, 16) GameCooltip:AddStatusBar (100, 1, R, G, B, A) end + + local pot = actor:GetSpell (156438) + if (pot) then + GameCooltip:AddLine (select (1, GetSpellInfo(156438)), _detalhes:ToK(pot.total)) + GameCooltip:AddIcon (select (3, GetSpellInfo (156438)), 1, 1, 16, 16) + GameCooltip:AddStatusBar (100, 1, R, G, B, A) + end + --Cooltip code ]], percent_script = false, total_script = false, - script_version = 3, + script_version = 9, } -- /run_detalhes:AddDefaultCustomDisplays() local have = false @@ -1476,14 +1485,12 @@ desc = Loc ["STRING_CUSTOM_DTBS_DESC"], source = false, target = false, - script_version = 8, + script_version = 13, script = [[ --> get the parameters passed local combat, instance_container, instance = ... - --> declade the values to return local total, top, amount = 0, 0, 0 - --> get a list of all damage actors local AllDamageCharacters = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE) @@ -1492,49 +1499,77 @@ --> do a loop amoung the actors for index, character in ipairs (AllDamageCharacters) do + + --> is the actor a enemy? + if (character:IsPlayer()) then - --> is the actor a enemy? - if (character:IsEnemy()) then - - local AllSpells = character:GetSpellList() + local taken_from = character.damage_from + + for source_name, _ in pairs (taken_from) do + + local source = combat (1, source_name) + + if (source) then + local AllSpells = source:GetSpellList() for spellid, spell in pairs (AllSpells) do - - if (spell.total >= 1 and spellid > 10) then - instance_container:AddValue (spell, spell.total) - - total = total + spell.total - - if (top < spell.total) then - top = spell.total - end - - if (not NoRepeat [spellid]) then - amount = amount + 1 - NoRepeat [spellid] = true - end + local on_player = spell.targets [character.nome] + + if (on_player and on_player >= 1) then + instance_container:AddValue (spell, on_player) + total = total + on_player + local value = instance_container:GetValue (spell) + if (value > top) then + top = value end + if (not NoRepeat [spellid]) then + amount = amount + 1 + NoRepeat [spellid] = true + end + end end - end - + ------------- + + local friendlyfire = source.friendlyfire [character.nome] + if (friendlyfire and friendlyfire.total >= 1) then + for _spellid, _on_player in pairs (friendlyfire.spells) do + local _spellname = GetSpellInfo (_spellid) + local _object + local _index = instance_container._NameIndexTable [_spellname] + if (_index) then + _object = instance_container._ActorTable [_index] + else + _object = {id = _spellid, spellschool = 1} + end + + instance_container:AddValue (_object, _on_player) + total = total + _on_player + local _value = instance_container:GetValue (_object) + if (_value > top) then + top = _value + end + if (not NoRepeat [_spellid]) then + amount = amount + 1 + NoRepeat [_spellid] = true + end + end + end + + ------------ + end + end + end end - --> return return total, top, amount ]], tooltip = [[ --get the parameters passed local actor, combat, instance = ... - local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) - - --get the cooltip object (we do not use the convencional GameTooltip here) local GameCooltip = GameCooltip - - --Cooltip code - local from_spell = actor.id --> get a list of all damage actors @@ -1542,60 +1577,72 @@ --> hold the targets local Targets = {} + local total = 0 + local top = 0 for index, character in ipairs (AllDamageCharacters) do - if (character:IsEnemy()) then - local AllSpells = character:GetSpellList() - - for spellid, spell in pairs (AllSpells) do - if (spellid == from_spell) then - for targetname, amount in pairs (spell.targets) do - local got = false - - local damage_actor = combat (1, targetname) - local heal_actor = combat (2, targetname) - - if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then - for index, t in ipairs (Targets) do - if (t[1] == targetname) then - t[2] = t[2] + amount - got = true - break - end - end - if (not got) then - Targets [#Targets+1] = {targetname, amount} - end - else - for index, t in ipairs (Targets) do - if (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then - t[2] = t[2] + amount - got = true - break - end - end - if (not got) then - Targets [#Targets+1] = {Loc ["STRING_TARGETS_OTHER1"], amount} - end - end - end + + local spell = character.spells._ActorTable [from_spell] + + if (spell) then + for targetname, amount in pairs (spell.targets) do + + local got = false + + local damage_actor = combat (1, targetname) + local heal_actor = combat (2, targetname) + + if ( (damage_actor or heal_actor) and ( (damage_actor and damage_actor:IsPlayer()) or (heal_actor and heal_actor:IsPlayer()) ) ) then + for index, t in ipairs (Targets) do + if (t[1] == targetname) then + t[2] = t[2] + amount + if (t[2] > top) then + top = t[2] end + got = true + break + end end + if (not got) then + Targets [#Targets+1] = {targetname, amount} + if (amount > top) then + top = amount + end + end + else + for index, t in ipairs (Targets) do + if (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then + t[2] = t[2] + amount + got = true + break + end + end + if (not got) then + Targets [#Targets+1] = {Loc ["STRING_TARGETS_OTHER1"], amount} + end + end end + end end table.sort (Targets, _detalhes.Sort2) + GameCooltip:SetOption ("StatusBarTexture", "Interface\\AddOns\\Details\\images\\bar_serenity") + + local bar_background = {value = 100, color = {0, 0, 0, 0.7}, texture = "Interface\\AddOns\\Details\\images\\bar4"} + for index, t in ipairs (Targets) do - GameCooltip:AddLine (t[1], _detalhes:ToK2 (t[2])) - _detalhes:AddTooltipBackgroundStatusbar() - local class = _detalhes:GetClass (t[1]) - if (class) then - local texture, l, r, t, b = _detalhes:GetClassIcon (class) - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, l, r, t, b) - elseif (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then - GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) - end + GameCooltip:AddLine (_detalhes:GetOnlyName(t[1]), _detalhes:ToK (t[2])) + local class, _, _, _, _, r, g, b = _detalhes:GetClass (t[1]) + + GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.6, true, bar_background) + + if (class) then + local texture, l, r, t, b = _detalhes:GetClassIcon (class) + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, l, r, t, b) + elseif (t[1] == Loc ["STRING_TARGETS_OTHER1"]) then + GameCooltip:AddIcon ("Interface\\AddOns\\Details\\images\\classes_small_alpha", 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1) + end end ]], } @@ -1845,7 +1892,6 @@ self.custom [#self.custom+1] = MySpells end + _detalhes:ResetCustomFunctionsCache() + end - - - diff --git a/classes/classe_damage.lua b/classes/classe_damage.lua index bd4bec30..125f9269 100644 --- a/classes/classe_damage.lua +++ b/classes/classe_damage.lua @@ -1622,9 +1622,16 @@ end esta_barra.icone_classe:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + + if (instancia.row_info.use_spec_icons and self.spec) then + esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec])) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + else + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + end end --texture and text diff --git a/classes/classe_energy.lua b/classes/classe_energy.lua index 42510dc2..44d627e7 100644 --- a/classes/classe_energy.lua +++ b/classes/classe_energy.lua @@ -764,9 +764,15 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + if (instancia.row_info.use_spec_icons and self.spec) then + esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec])) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + else + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + end end --texture and text diff --git a/classes/classe_heal.lua b/classes/classe_heal.lua index bc9b8c6c..99a8bc5f 100644 --- a/classes/classe_heal.lua +++ b/classes/classe_heal.lua @@ -823,9 +823,15 @@ function atributo_heal:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + if (instancia.row_info.use_spec_icons and self.spec) then + esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec])) --very slow method + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + else + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + end end --texture and text diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 970b1b2e..110b5fd4 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -1742,31 +1742,13 @@ end ------------------------------------------------------------------------------------------------------------------------ -function _detalhes:HaveOneCurrentInstance() - - local have = false +function _detalhes:CheckSwitchToCurrent() for _, instance in _ipairs (_detalhes.tabela_instancias) do - if (instance.ativa and instance.baseframe and instance.segmento == 0) then - return - end - end - - local lower = _detalhes:GetLowerInstanceNumber() - if (lower) then - local instance = _detalhes:GetInstance (lower) - if (instance and instance.auto_current) then + if (instance.ativa and instance.baseframe and instance.segmento ~= 0 and instance.auto_current) then instance:TrocaTabela (0) --> muda o segmento pra current - return instance:InstanceAlert (Loc ["STRING_CHANGED_TO_CURRENT"], {[[Interface\GossipFrame\TrainerGossipIcon]], 18, 18, false}, 6) - else - for _, instance in _ipairs (_detalhes.tabela_instancias) do - if (instance.ativa and instance.baseframe and instance.segmento ~= 0 and instance.auto_current) then - instance:TrocaTabela (0) --> muda o segmento pra current - return instance:InstanceAlert (Loc ["STRING_CHANGED_TO_CURRENT"], {[[Interface\GossipFrame\TrainerGossipIcon]], 18, 18, false}, 6) - end - end + instance:InstanceAlert (Loc ["STRING_CHANGED_TO_CURRENT"], {[[Interface\AddOns\Details\images\toolbar_icons]], 18, 18, false, 32/256, 64/256, 0, 1}, 6) end end - end function _detalhes:Freeze (instancia) diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index c9bc7e1f..11c81cb2 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -178,6 +178,9 @@ _detalhes.instance_defaults = { }, --fast hps/dps updates fast_ps_update = false, + --show spec icons + use_spec_icons = false, + spec_file = [[Interface\AddOns\Details\images\spec_icons_normal]], }, --instance window color color = {1, 1, 1, 1}, diff --git a/classes/classe_others.lua b/classes/classe_others.lua index 81a98056..7e4ea891 100644 --- a/classes/classe_others.lua +++ b/classes/classe_others.lua @@ -903,9 +903,15 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize) esta_barra.icone_classe:SetVertexColor (actor_class_color_r, actor_class_color_g, actor_class_color_b) else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method - esta_barra.icone_classe:SetVertexColor (1, 1, 1) + if (instancia.row_info.use_spec_icons and self.spec) then + esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) + esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [self.spec])) + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + else + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [self.classe])) --very slow method + esta_barra.icone_classe:SetVertexColor (1, 1, 1) + end end --texture and text diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 239171a0..5df01a03 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -42,6 +42,7 @@ local container_enemydebufftarget_target = _detalhes.container_type.CONTAINER_ENEMYDEBUFFTARGET_CLASS local container_pets = {} + local cached_specs = _detalhes.cached_specs --> flags local REACTION_HOSTILE = 0x00000040 @@ -118,7 +119,19 @@ end --> try to get the actor class from name - local function get_actor_class (novo_objeto, nome, flag) + local function get_actor_class (novo_objeto, nome, flag, serial) + + --> get spec + if (_detalhes.track_specs) then + local have_cached = cached_specs [serial] + if (have_cached) then + novo_objeto.spec = have_cached + _detalhes:ScheduleTimer ("GuessSpec", 15, {novo_objeto, self, 10}) + else + _detalhes:ScheduleTimer ("GuessSpec", 3, {novo_objeto, self, 1}) + end + end + local _, engClass = _UnitClass (nome) if (engClass) then @@ -296,6 +309,12 @@ --[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1 + --if (flag and nome:find ("Kastfall") and bit.band (flag, 0x2000) ~= 0) then + --print ("PET:", nome, _detalhes.tabela_pets.pets [serial], container_pets [serial]) + --else + --print (nome, flag) + --end + --> verifica se é um pet, se for confere se tem o nome do dono, se não tiver, precisa por local dono_do_pet serial = serial or "ns" @@ -342,7 +361,7 @@ if (self.tipo == container_damage) then --> CONTAINER DAMAGE - get_actor_class (novo_objeto, nome, flag) + get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "damage") if (dono_do_pet) then @@ -372,7 +391,7 @@ elseif (self.tipo == container_heal) then --> CONTAINER HEALING - get_actor_class (novo_objeto, nome, flag) + get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "heal") if (dono_do_pet) then @@ -399,7 +418,7 @@ elseif (self.tipo == container_energy) then --> CONTAINER ENERGY - get_actor_class (novo_objeto, nome, flag) + get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "energy") if (dono_do_pet) then @@ -419,7 +438,7 @@ elseif (self.tipo == container_misc) then --> CONTAINER MISC - get_actor_class (novo_objeto, nome, flag) + get_actor_class (novo_objeto, nome, flag, serial) read_actor_flag (novo_objeto, dono_do_pet, serial, flag, nome, "misc") --local teste_classe = @@ -459,7 +478,7 @@ elseif (self.tipo == container_friendlyfire) then --> CONTAINER FRIENDLY FIRE - get_actor_class (novo_objeto, nome) + get_actor_class (novo_objeto, nome, serial) end diff --git a/classes/container_historico.lua b/classes/container_historico.lua index 8b6978ab..09d3208c 100644 --- a/classes/container_historico.lua +++ b/classes/container_historico.lua @@ -279,6 +279,7 @@ function historico:resetar() _table_wipe (_detalhes.spellcache) _detalhes:LimparPets() + _detalhes:ResetSpecCache (true) --> forçar -- novo container de historico _detalhes.tabela_historico = historico:NovoHistorico() --joga fora a tabela antiga e cria uma nova diff --git a/core/control.lua b/core/control.lua index 8ec8f224..8347bccc 100644 --- a/core/control.lua +++ b/core/control.lua @@ -337,7 +337,7 @@ _detalhes:InstanceCall (_detalhes.CheckPsUpdate) _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente) - _detalhes:HaveOneCurrentInstance() + _detalhes:CheckSwitchToCurrent() end diff --git a/core/gears.lua b/core/gears.lua index 41983b0c..8cb9cff5 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -15,6 +15,122 @@ function _detalhes:UpdateGears() end +function _detalhes:TrackSpecsNow (track_everything) + + local spelllist = _detalhes.SpecSpellList + + if (not track_everything) then + for _, actor in _detalhes.tabela_vigente[1]:ListActors() do + if (actor:IsPlayer()) then + for spellid, spell in pairs (actor:GetSpellList()) do + if (spelllist [spell.id]) then + actor.spec = spelllist [spell.id] + _detalhes.cached_specs [actor.serial] = actor.spec + break + end + end + end + end + + for _, actor in _detalhes.tabela_vigente[2]:ListActors() do + if (actor:IsPlayer()) then + for spellid, spell in pairs (actor:GetSpellList()) do + if (spelllist [spell.id]) then + actor.spec = spelllist [spell.id] + _detalhes.cached_specs [actor.serial] = actor.spec + break + end + end + end + end + else + local combatlist = {} + for _, combat in ipairs (_detalhes.tabela_historico.tabelas) do + tinsert (combatlist, combat) + end + tinsert (combatlist, _detalhes.tabela_vigente) + tinsert (combatlist, _detalhes.tabela_overall) + + for _, combat in ipairs (combatlist) do + for _, actor in combat[1]:ListActors() do + if (actor:IsPlayer()) then + for spellid, spell in pairs (actor:GetSpellList()) do + if (spelllist [spell.id]) then + actor.spec = spelllist [spell.id] + _detalhes.cached_specs [actor.serial] = actor.spec + break + end + end + end + end + + for _, actor in combat[2]:ListActors() do + if (actor:IsPlayer()) then + for spellid, spell in pairs (actor:GetSpellList()) do + if (spelllist [spell.id]) then + actor.spec = spelllist [spell.id] + _detalhes.cached_specs [actor.serial] = actor.spec + break + end + end + end + end + end + end + +end + +function _detalhes:ResetSpecCache (forced) + + local isininstance = IsInInstance() + + if (forced or (not isininstance and not _detalhes.in_group)) then + table.wipe (_detalhes.cached_specs) + + if (_detalhes.track_specs) then + local my_spec = GetSpecialization() + if (type (my_spec) == "number") then + local spec_number = GetSpecializationInfo (my_spec) + if (type (spec_number) == "number") then + local pguid = UnitGUID (_detalhes.playername) + if (pguid) then + _detalhes.cached_specs [pguid] = spec_number + end + end + end + end + + elseif (_detalhes.in_group and not isininstance) then + table.wipe (_detalhes.cached_specs) + + if (_detalhes.track_specs) then + if (IsInRaid()) then + local c_combat_dmg = _detalhes.tabela_vigente [1] + local c_combat_heal = _detalhes.tabela_vigente [2] + for i = 1, GetNumGroupMembers(), 1 do + local name = GetUnitName ("raid" .. i, true) + local index = c_combat_dmg._NameIndexTable [name] + if (index) then + local actor = c_combat_dmg._ActorTable [index] + if (actor and actor.grupo and actor.spec) then + _detalhes.cached_specs [actor.serial] = actor.spec + end + else + index = c_combat_heal._NameIndexTable [name] + if (index) then + local actor = c_combat_heal._ActorTable [index] + if (actor and actor.grupo and actor.spec) then + _detalhes.cached_specs [actor.serial] = actor.spec + end + end + end + end + end + end + end + +end + function _detalhes:SetWindowUpdateSpeed (interval, nosave) if (not interval) then interval = _detalhes.update_speed diff --git a/core/meta.lua b/core/meta.lua index e311443e..1936f763 100644 --- a/core/meta.lua +++ b/core/meta.lua @@ -646,6 +646,9 @@ _detalhes:ClearCCPetsBlackList() end + --> reseta cache de specs + _detalhes:ResetSpecCache() + --> wipa container de escudos _table_wipe (_detalhes.escudos) diff --git a/core/parser.lua b/core/parser.lua index 2c661d62..17f29b6b 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -159,6 +159,7 @@ elseif (not who_name) then --> no actor name, use spell name instead who_name = "[*] "..spellname + who_serial = "" end if (absorbed) then @@ -224,7 +225,7 @@ --> get actors --> damager - local este_jogador, meu_dono = damage_cache [who_name] or damage_cache_pets [who_serial], damage_cache_petsOwners [who_serial] + local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial], damage_cache_petsOwners [who_serial] if (not este_jogador) then --> pode ser um desconhecido ou um pet @@ -234,17 +235,21 @@ damage_cache_pets [who_serial] = este_jogador damage_cache_petsOwners [who_serial] = meu_dono --conferir se o dono já esta no cache - if (not damage_cache [meu_dono.nome]) then - damage_cache [meu_dono.nome] = meu_dono + if (not damage_cache [meu_dono.serial]) then + damage_cache [meu_dono.serial] = meu_dono end else if (who_flags) then --> ter certeza que não é um pet - damage_cache [who_name] = este_jogador - --> se for spell actor - if (who_name:find ("[*]")) then - local _, _, icon = _GetSpellInfo (spellid or 1) - este_jogador.spellicon = icon - --print ("spell actor:", who_name, "icon:", icon) + if (who_serial ~= "") then + damage_cache [who_serial] = este_jogador + else + if (who_name:find ("%[")) then + local _, _, icon = _GetSpellInfo (spellid or 1) + este_jogador.spellicon = icon + --print ("Spell Actor:", who_name) + else + --print ("No Serial Actor:", who_name) + end end end end @@ -255,7 +260,7 @@ end --> his target - local jogador_alvo, alvo_dono = damage_cache [alvo_name] or damage_cache_pets [alvo_serial], damage_cache_petsOwners [alvo_serial] + local jogador_alvo, alvo_dono = damage_cache [alvo_serial] or damage_cache_pets [alvo_serial], damage_cache_petsOwners [alvo_serial] if (not jogador_alvo) then @@ -265,12 +270,12 @@ damage_cache_pets [alvo_serial] = jogador_alvo damage_cache_petsOwners [alvo_serial] = alvo_dono --conferir se o dono já esta no cache - if (not damage_cache [alvo_dono.nome]) then - damage_cache [alvo_dono.nome] = alvo_dono + if (not damage_cache [alvo_dono.serial]) then + damage_cache [alvo_dono.serial] = alvo_dono end else if (alvo_flags) then --> ter certeza que não é um pet - damage_cache [alvo_name] = jogador_alvo + damage_cache [alvo_serial] = jogador_alvo end end @@ -522,7 +527,10 @@ ------------------------------------------------------------------------------------------------ --> early checks and fixes - if (not who_name or not alvo_name) then + if (not who_name) then + --> no actor name, use spell name instead + who_name = "[*] " .. spellname + elseif (not who_name or not alvo_name) then return --> just return end @@ -531,7 +539,7 @@ --print ("MISS", "|", missType, "|", isOffHand, "|", multistrike, "|", amountMissed, "|", arg1) --> 'misser' - local este_jogador = damage_cache [who_name] + local este_jogador = damage_cache [who_serial] if (not este_jogador) then --este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (nil, who_name) este_jogador, meu_dono, who_name = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) @@ -542,7 +550,7 @@ if (tanks_members_cache [alvo_serial]) then --> only track tanks - local TargetActor = damage_cache [alvo_name] + local TargetActor = damage_cache [alvo_serial] if (TargetActor) then local avoidance = TargetActor.avoidance @@ -620,6 +628,10 @@ --[[statistics]]-- _detalhes.statistics.pets_summons = _detalhes.statistics.pets_summons + 1 + --if (who_name:find ("Kastfall")) then + -- print ("SUMMON", who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags) + --end + if (not who_name) then who_name = "[*] " .. spellName end @@ -1672,11 +1684,11 @@ if (who_name == alvo_name) then - local damage_actor = damage_cache [who_name] + local damage_actor = damage_cache [who_serial] if (not damage_actor) then --> pode ser um desconhecido ou um pet damage_actor = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) if (who_flags) then --> se não for um pet, adicionar no cache - damage_cache [who_name] = damage_actor + damage_cache [who_serial] = damage_actor end end @@ -1867,7 +1879,7 @@ --> enemy successful casts (not interrupted) if (_bit_band (who_flags, 0x00000040) ~= 0 and who_name) then --> byte 2 = 4 (enemy) --> damager - local este_jogador = damage_cache [who_name] + local este_jogador = damage_cache [who_serial] if (not este_jogador) then este_jogador = _current_damage_container:PegarCombatente (who_serial, who_name, who_flags, true) end diff --git a/core/windows.lua b/core/windows.lua index 9afdfc11..a365c1c3 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -2232,7 +2232,44 @@ for i = 1, 10 do local robot = current_combat[1]:PegarCombatente (0x0000000000000, actors_name [math.random (1, #actors_name)], 0x114, true) robot.grupo = true + robot.classe = actors_classes [math.random (1, #actors_classes)] + + if (robot.classe == "DEATHKNIGHT") then + local specs = {250, 251, 252} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "DRUID") then + local specs = {102, 103, 104, 105} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "HUNTER") then + local specs = {253, 254, 255} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "MAGE") then + local specs = {62, 63, 64} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "MONK") then + local specs = {268, 269, 270} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "PALADIN") then + local specs = {65, 66, 70} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "PRIEST") then + local specs = {256, 257, 258} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "ROGUE") then + local specs = {259, 260, 261} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "SHAMAN") then + local specs = {262, 263, 264} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "WARLOCK") then + local specs = {265, 266, 267} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "WARRIOR") then + local specs = {71, 72, 73} + robot.spec = specs [math.random (1, #specs)] + end + robot.total = math.random (10000000, 60000000) robot.damage_taken = math.random (10000000, 60000000) robot.friendlyfire_total = math.random (10000000, 60000000) @@ -2256,6 +2293,42 @@ local robot = current_combat[2]:PegarCombatente (0x0000000000000, actors_name [math.random (1, #actors_name)], 0x114, true) robot.grupo = true robot.classe = actors_classes [math.random (1, #actors_classes)] + + if (robot.classe == "DEATHKNIGHT") then + local specs = {250, 251, 252} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "DRUID") then + local specs = {102, 103, 104, 105} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "HUNTER") then + local specs = {253, 254, 255} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "MAGE") then + local specs = {62, 63, 64} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "MONK") then + local specs = {268, 269, 270} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "PALADIN") then + local specs = {65, 66, 70} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "PRIEST") then + local specs = {256, 257, 258} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "ROGUE") then + local specs = {259, 260, 261} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "SHAMAN") then + local specs = {262, 263, 264} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "WARLOCK") then + local specs = {265, 266, 267} + robot.spec = specs [math.random (1, #specs)] + elseif (robot.classe == "WARRIOR") then + local specs = {71, 72, 73} + robot.spec = specs [math.random (1, #specs)] + end + robot.total = math.random (10000000, 60000000) robot.totalover = math.random (10000000, 60000000) robot.totalabsorb = math.random (10000000, 60000000) diff --git a/framework/panel.lua b/framework/panel.lua index be3ab1b4..a70ef8b3 100644 --- a/framework/panel.lua +++ b/framework/panel.lua @@ -910,7 +910,13 @@ function gump:IconPick (callback, close_when_select) gump.IconPickFrame.emptyFunction = function() end gump.IconPickFrame.callback = gump.IconPickFrame.emptyFunction - gump.IconPickFrame.preview = gump:NewImage (gump.IconPickFrame, nil, 76, 76) + gump.IconPickFrame.preview = CreateFrame ("frame", nil, UIParent) + gump.IconPickFrame.preview:SetFrameStrata ("tooltip") + gump.IconPickFrame.preview:SetSize (76, 76) + local preview_image = gump:NewImage (gump.IconPickFrame.preview, nil, 76, 76) + preview_image:SetAllPoints (gump.IconPickFrame.preview) + gump.IconPickFrame.preview.icon = preview_image + gump.IconPickFrame.preview:Hide() gump.IconPickFrame.searchLabel = gump:NewLabel (gump.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:", font, size, color) gump.IconPickFrame.searchLabel:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12, -20) @@ -924,6 +930,8 @@ function gump:IconPick (callback, close_when_select) gump.IconPickFrame.updateFunc() else gump.IconPickFrameScroll:Hide() + FauxScrollFrame_SetOffset (gump.IconPickFrame, 1) + gump.IconPickFrame.last_filter_index = 1 gump.IconPickFrame.updateFunc() end end) @@ -971,6 +979,8 @@ function gump:IconPick (callback, close_when_select) end end + GetLooseMacroItemIcons (MACRO_ICON_FILENAMES) + GetLooseMacroIcons (MACRO_ICON_FILENAMES) GetMacroIcons (MACRO_ICON_FILENAMES) GetMacroItemIcons (MACRO_ICON_FILENAMES ) @@ -983,10 +993,8 @@ function gump:IconPick (callback, close_when_select) gump.IconPickFrame.buttons = {} - local OnClickFunction = function (index) - local button = gump.IconPickFrame.buttons [index] - local texture = button:GetNormalTexture() - gump.IconPickFrame.callback (button.icon_texture) + local OnClickFunction = function (self) + gump.IconPickFrame.callback (self.icon:GetTexture()) if (gump.IconPickFrame.click_close) then close_button:Click() end @@ -994,119 +1002,197 @@ function gump:IconPick (callback, close_when_select) local onenter = function (self) gump.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2) - gump.IconPickFrame.preview:SetTexture (self.icon_texture) - gump.IconPickFrame.preview:SetParent (self) + gump.IconPickFrame.preview.icon:SetTexture (self.icon:GetTexture()) gump.IconPickFrame.preview:Show() + self.icon:SetBlendMode ("ADD") end local onleave = function (self) gump.IconPickFrame.preview:Hide() + self.icon:SetBlendMode ("BLEND") end + local backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, + insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10} + for i = 0, 9 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i+1, i+1, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..(i+1)) + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..(i+1), gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..(i+1).."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i+1 + newcheck:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12 + (i*30), -40) newcheck:SetID (i+1) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end - for i = 11, 20 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i) + for i = 11, 20 do + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i + newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1) newcheck:SetID (i) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end for i = 21, 30 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i) + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i + newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1) newcheck:SetID (i) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end for i = 31, 40 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i) + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i + newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1) newcheck:SetID (i) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end for i = 41, 50 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i) + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i + newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1) newcheck:SetID (i) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end for i = 51, 60 do - local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i) + local newcheck = CreateFrame ("Button", "DetailsIconPickFrameButton"..i, gump.IconPickFrame) + local image = newcheck:CreateTexture ("DetailsIconPickFrameButton"..i.."Icon", "overlay") + newcheck.icon = image + image:SetPoint ("topleft", newcheck, "topleft", 2, -2); image:SetPoint ("bottomright", newcheck, "bottomright", -2, 2) + newcheck:SetSize (30, 28) + newcheck:SetBackdrop (backdrop) + + newcheck:SetScript ("OnClick", OnClickFunction) + newcheck.param1 = i + newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1) newcheck:SetID (i) gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck - newcheck.MouseOnEnterHook = onenter - newcheck.MouseOnLeaveHook = onleave + newcheck:SetScript ("OnEnter", onenter) + newcheck:SetScript ("OnLeave", onleave) end local scroll = CreateFrame ("ScrollFrame", "DetailsIconPickFrameScroll", gump.IconPickFrame, "ListScrollFrameTemplate") local ChecksFrame_Update = function (self) - --self = self or MacroPopupFrame; - local numMacroIcons = #MACRO_ICON_FILENAMES; - local macroPopupIcon, macroPopupButton; - local macroPopupOffset = FauxScrollFrame_GetOffset (scroll); - local index; - - -- Icon list - local texture; - + + local numMacroIcons = #MACRO_ICON_FILENAMES + local macroPopupIcon, macroPopupButton + local macroPopupOffset = FauxScrollFrame_GetOffset (scroll) + local index + + local texture local filter if (gump.IconPickFrame.searching) then filter = string_lower (gump.IconPickFrame.searching) end if (filter and filter ~= "") then - local i = 1 - for o = 1, numMacroIcons do - local text = string_lower (MACRO_ICON_FILENAMES [o]) - if (text:find (filter)) then - macroPopupIcon = _G ["DetailsIconPickFrameButton"..i] - macroPopupButton = _G ["DetailsIconPickFrameButton"..i] - local texture = MACRO_ICON_FILENAMES [o] - macroPopupButton:ChangeIcon ("INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture) - macroPopupButton.IconID = index - macroPopupButton.icon_texture = "INTERFACE\\ICONS\\"..texture - macroPopupButton:Show(); - - i = i + 1 - if (i > 60) then - break + + local ignored = 0 + local tryed = 0 + local found = 0 + local type = type + local buttons = gump.IconPickFrame.buttons + index = 1 + + for i = 1, 60 do + + macroPopupIcon = buttons[i].icon + macroPopupButton = buttons[i] + + for o = index, numMacroIcons do + + tryed = tryed + 1 + + texture = MACRO_ICON_FILENAMES [o] + if (type (texture) == "number") then + macroPopupIcon:SetToFileData (texture) + texture = macroPopupIcon:GetTexture() + macroPopupIcon:SetTexture (nil) + else + texture = "INTERFACE\\ICONS\\" .. texture end + + if (texture and texture:find (filter)) then + macroPopupIcon:SetTexture (texture) + macroPopupButton:Show() + found = found + 1 + gump.IconPickFrame.last_filter_index = o + index = o+1 + break + else + ignored = ignored + 1 + end + end end - if (i == 1) then --no resutls - macroPopupButton = _G ["DetailsIconPickFrameButton"..i] - macroPopupButton:Hide() - end - - for o = i+1, 60 do + for o = found+1, 60 do macroPopupButton = _G ["DetailsIconPickFrameButton"..o] macroPopupButton:Hide() end else for i = 1, 60 do - macroPopupIcon = _G ["DetailsIconPickFrameButton"..i] + macroPopupIcon = _G ["DetailsIconPickFrameButton"..i.."Icon"] macroPopupButton = _G ["DetailsIconPickFrameButton"..i] - index = (macroPopupOffset * 10) + i; + index = (macroPopupOffset * 10) + i texture = MACRO_ICON_FILENAMES [index] if ( index <= numMacroIcons and texture ) then - macroPopupButton:ChangeIcon ("INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture) + + if (type (texture) == "number") then + macroPopupIcon:SetToFileData (texture) + else + macroPopupIcon:SetTexture ("INTERFACE\\ICONS\\" .. texture) + end + + macroPopupIcon:SetTexCoord (4/64, 60/64, 4/64, 60/64) macroPopupButton.IconID = index - macroPopupButton.icon_texture = "INTERFACE\\ICONS\\"..texture macroPopupButton:Show() else macroPopupButton:Hide() @@ -1115,7 +1201,7 @@ function gump:IconPick (callback, close_when_select) end -- Scrollbar stuff - FauxScrollFrame_Update (scroll, ceil (numMacroIcons / 10) , 5, 20 ); + FauxScrollFrame_Update (scroll, ceil (numMacroIcons / 10) , 5, 20 ) end gump.IconPickFrame.updateFunc = ChecksFrame_Update diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 71b0f55c..93f53311 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -203,6 +203,18 @@ function _detalhes:LoadCombatTables() _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() _detalhes:UpdateContainerCombatentes() + else + --> check integrity + local combat = _detalhes.tabela_historico.tabelas [1] + if (combat) then + if (not combat[1] or not combat[2] or not combat[3] or not combat[4]) then + --> something went wrong in last logon, let's just reset and we are good to go + _detalhes.tabela_historico = _detalhes.historico:NovoHistorico() + _detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall) + _detalhes.tabela_pets = _detalhes.container_pets:NovoContainer() + _detalhes:UpdateContainerCombatentes() + end + end end --> re-build all indexes and metatables diff --git a/functions/playerclass.lua b/functions/playerclass.lua index d98de722..48c1f6eb 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -10,6 +10,8 @@ do local _select = select local _unpack = unpack + local unknown_class_coords = {0.75, 1, 0.75, 1} + -- try get the class from actor name function _detalhes:GetClass (name) local _, class = _UnitClass (name) @@ -20,12 +22,18 @@ do if (index) then local actor = container._ActorTable [index] if (actor.classe ~= "UNGROUPPLAYER") then - return actor.classe, _detalhes:unpacks (_detalhes.class_coords [actor.classe] or {0.75, 1, 0.75, 1}, _detalhes.class_colors [actor.classe]) + local left, right, top, bottom = unpack (_detalhes.class_coords [actor.classe] or unknown_class_coords) + local r, g, b = unpack (_detalhes.class_colors [actor.classe]) + return actor.classe, left, right, top, bottom, r or 1, g or 1, b or 1 end end end + + return "UNKNOW", 0.75, 1, 0.75, 1, 1, 1, 1, 1 else - return class, _detalhes:unpacks (_detalhes.class_coords [class] or {0.75, 1, 0.75, 1}, _detalhes.class_colors [class]) + local left, right, top, bottom = unpack (_detalhes.class_coords [class]) + local r, g, b = unpack (_detalhes.class_colors [class]) + return class, left, right, top, bottom, r or 1, g or 1, b or 1 end end @@ -122,5 +130,138 @@ do return false end + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + -- try get the spec from actor name + function _detalhes:GetSpec (name) + + local guid = UnitGUID (name) + if (guid) then + local spec = _detalhes.cached_specs [guid] + if (spec) then + return spec + end + end + + for _, container in _ipairs (_detalhes.tabela_overall) do + local index = container._NameIndexTable [name] + if (index) then + local actor = container._ActorTable [index] + return actor and actor.spec + end + end + + end + + function _detalhes:GuessSpec (t) + + local Actor, container, tries = t[1], t[2], t[3] + + if (not Actor) then + return false + end + + local guid = UnitGUID (Actor.nome) + if (guid) then + local spec = _detalhes.cached_specs [guid] + if (spec) then + Actor.spec = spec + Actor.guessing_spec = nil + + if (container) then + container.need_refresh = true + end + + if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + Actor.minha_barra.minha_tabela = nil + end + + return spec + end + end + + local SpecSpellList = _detalhes.SpecSpellList + + if (Actor.spells) then --> correcao pros containers misc, precisa pegar os diferentes tipos de containers de lá + for spellid, _ in _pairs (Actor.spells._ActorTable) do + local spec = SpecSpellList [spellid] + if (spec) then + + _detalhes.cached_specs [Actor.serial] = spec + + Actor.spec = spec + Actor.guessing_spec = nil + + if (container) then + container.need_refresh = true + end + + if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + Actor.minha_barra.minha_tabela = nil + end + + return spec + end + end + end + + if (Actor.classe == "HUNTER") then + local container_misc = _detalhes.tabela_vigente[4] + local index = container_misc._NameIndexTable [Actor.nome] + if (index) then + local misc_actor = container_misc._ActorTable [index] + local buffs = misc_actor.buff_uptime_spells and misc_actor.buff_uptime_spells._ActorTable + if (buffs) then + for spellid, spell in _pairs (buffs) do + local spec = SpecSpellList [spellid] + if (spec) then + + _detalhes.cached_specs [Actor.serial] = spec + + Actor.spec = spec + Actor.guessing_spec = nil + + if (container) then + container.need_refresh = true + end + + if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + Actor.minha_barra.minha_tabela = nil + end + + return spec + end + end + end + end + end + + local spec = _detalhes:GetSpec (Actor.nome) + if (spec) then + + _detalhes.cached_specs [Actor.serial] = spec + + Actor.spec = spec + Actor.need_refresh = true + Actor.guessing_spec = nil + + if (container) then + container.need_refresh = true + end + + if (Actor.minha_barra and type (Actor.minha_barra) == "table") then + Actor.minha_barra.minha_tabela = nil + end + + return spec + end + + if (tries and tries < 10) then + _detalhes:ScheduleTimer ("GuessSpec", 3, {Actor, container, tries+1}) + end + + return false + end end diff --git a/functions/profiles.lua b/functions/profiles.lua index bf312831..1479ddf7 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -567,6 +567,54 @@ end local default_profile = { + --> spec coords + class_specs_coords = { + [252] = {0, 64/512, 0, 64/512}, --> unholy dk + [251] = {64/512, 128/512, 0, 64/512}, --> frost dk + [250] = {128/512, 192/512, 0, 64/512}, --> blood dk + + [102] = {192/512, 256/512, 0, 64/512}, --> druid balance + [103] = {256/512, 320/512, 0, 64/512}, --> druid feral + [104] = {320/512, 384/512, 0, 64/512}, --> druid guardian + [105] = {384/512, 448/512, 0, 64/512}, --> druid resto + + [253] = {448/512, 512/512, 0, 64/512}, --> hunter bm + [254] = {0, 64/512, 64/512, 128/512}, --> hunter marks + [255] = {64/512, 128/512, 64/512, 128/512}, --> hunter survivor + + [62] = {128/512, 192/512, 64/512, 128/512}, --> mage arcane + [63] = {192/512, 256/512, 64/512, 128/512}, --> mage fire + [64] = {256/512, 320/512, 64/512, 128/512}, --> mage frost + + [268] = {320/512, 384/512, 64/512, 128/512}, --> monk bm + [269] = {384/512, 448/512, 64/512, 128/512}, --> monk mw + [270] = {448/512, 512/512, 64/512, 128/512}, --> monk ww + + [65] = {0, 64/512, 128/512, 192/512}, --> paladin holy + [66] = {64/512, 128/512, 128/512, 192/512}, --> paladin protect + [70] = {128/512, 192/512, 128/512, 192/512}, --> paladin ret + + [256] = {192/512, 256/512, 128/512, 192/512}, --> priest disc + [257] = {256/512, 320/512, 128/512, 192/512}, --> priest holy + [258] = {320/512, 384/512, 128/512, 192/512}, --> priest shadow + + [259] = {384/512, 448/512, 128/512, 192/512}, --> rogue assassination + [260] = {448/512, 512/512, 128/512, 192/512}, --> rogue combat + [261] = {0, 64/512, 192/512, 256/512}, --> rogue sub + + [262] = {64/512, 128/512, 192/512, 256/512}, --> shaman elemental + [263] = {128/512, 192/512, 192/512, 256/512}, --> shamel enhancement + [264] = {192/512, 256/512, 192/512, 256/512}, --> shaman resto + + [265] = {256/512, 320/512, 192/512, 256/512}, --> warlock aff + [266] = {320/512, 384/512, 192/512, 256/512}, --> warlock demo + [267] = {384/512, 448/512, 192/512, 256/512}, --> warlock destro + + [71] = {448/512, 512/512, 192/512, 256/512}, --> warrior arms + [72] = {0, 64/512, 256/512, 320/512}, --> warrior fury + [73] = {64/512, 128/512, 256/512, 320/512}, --> warrior protect + }, + --> class icons and colors class_icons_small = [[Interface\AddOns\Details\images\classes_small]], class_coords = { @@ -807,6 +855,7 @@ local default_profile = { --> text sizes font_sizes = {menus = 10}, + font_faces = {menus = "Friz Quadrata TT"}, ps_abbreviation = 3, total_abbreviation = 2, diff --git a/functions/skins.lua b/functions/skins.lua index 0b30bb06..161ae7bb 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -505,6 +505,8 @@ local _ ["window_scale"] = 1, ["bars_grow_direction"] = 1, ["row_info"] = { + ["use_spec_icons"] = true, + ["spec_file"] = [[Interface\AddOns\Details\images\spec_icons_normal]], ["textR_outline"] = false, ["textL_outline"] = false, ["percent_type"] = 1, diff --git a/functions/spells.lua b/functions/spells.lua index 44075c3d..580f6ab5 100644 --- a/functions/spells.lua +++ b/functions/spells.lua @@ -17,7 +17,399 @@ do } _detalhes.SpecSpellList = { + + -- Unholy Death Knight: + [165395] = 252, -- Necrosis + [49206] = 252, -- Summon Gargoyle + [63560] = 252, -- Dark Transformation + [85948] = 252, -- Festering Strike + [49572] = 252, -- Shadow Infusion + [55090] = 252, -- Scourge Strike + [46584] = 252, -- Raise Dead + [51160] = 252, -- Ebon Plaguebringer + -- Frost Death Knight: + [130735] = 251, -- Soul Reaper + [51271] = 251, -- Pillar of Frost + [49020] = 251, -- Obliterate + [49143] = 251, -- Frost Strike + [49184] = 251, -- Howling Blast + + -- Blood Death Knight: + [165394] = 250, -- Runic Strikes + [114866] = 250, -- Soul Reaper + [49222] = 250, -- Bone Shield + [55233] = 250, -- Vampiric Blood + [49028] = 250, -- Dancing Rune Weapon + [48982] = 250, -- Rune Tap + [56222] = 250, -- Dark Command + + -- Balance Druid: + [152221] = 102, -- Stellar Flare + [88747] = 102, -- Wild Mushroom + [33605] = 102, -- Astral Showers + [48505] = 102, -- Starfall + [112071] = 102, -- Celestial Alignment + [78675] = 102, -- Solar Beam + [93399] = 102, -- Shooting Stars + [78674] = 102, -- Starsurge + [2912] = 102, -- Starfire + + -- Feral Druid: + [171746] = 103, -- Claws of Shirvallah + [22570] = 103, -- Maim + [16974] = 103, -- Predatory Swiftness + [106785] = 103, -- Swipe + [1079] = 103, -- Rip + [52610] = 103, -- Savage Roar + [5217] = 103, -- Tiger's Fury + [1822] = 103, -- Rake + + -- Guardian Druid: + [155835] = 104, -- Bristling Fur + [155578] = 104, -- Guardian of Elune + [80313] = 104, -- Pulverize + [159232] = 104, -- Ursa Major + [33745] = 104, -- Lacerate + [135288] = 104, -- Tooth and Claw + [6807] = 104, -- Maul + [62606] = 104, -- Savage Defense + + -- Restoration Druid: + + [145518] = 105, -- Genesis + [145205] = 105, -- Wild Mushroom + [48438] = 105, -- Wild Growth + [740] = 105, -- Tranquility + [102342] = 105, -- Ironbark + [33763] = 105, -- Lifebloom + [88423] = 105, -- Nature's Cure + [8936] = 105, -- Regrowth + [18562] = 105, -- Swiftmend + + -- Beast Mastery Hunter: + [19574] = 253, -- Bestial Wrath + [82692] = 253, -- Focus Fire + [53257] = 253, -- Cobra Strikes + [19574] = 253, -- Bestial Wrath + --[34026] = 253, -- Kill Command + --[83381] = 253, -- Kill Command + + -- Marksmanship Hunter: + [53209] = 254, -- Chimaera Shot + [3045] = 254, -- Rapid Fire + [19434] = 254, -- Aimed Shot + + -- Survival Hunter: + [3674] = 255, -- Black Arrow + [53301] = 255, -- Explosive Shot + [87935] = 255, -- Serpent Sting + + -- Arcane Mage: + [153626] = 62, -- Arcane Orb + [114923] = 62, -- Nether Tempest + [157980] = 62, -- Supernova + [12042] = 62, -- Arcane Power + [12051] = 62, -- Evocation + [31589] = 62, -- Slow + [5143] = 62, -- Arcane Missiles + [1449] = 62, -- Arcane Explosion + [44425] = 62, -- Arcane Barrage + [30451] = 62, -- Arcane Blast + + -- Fire Mage: + [153561] = 63, -- Meteor + [11129] = 63, -- Combustion + [157981] = 63, -- Blast Wave + [44457] = 63, -- Living Bomb + [31661] = 63, -- Dragon's Breath + [2120] = 63, -- Flamestrike + [108853] = 63, -- Inferno Blast + [2948] = 63, -- Scorch + [133] = 63, -- Fireball + [11366] = 63, -- Pyroblast + + -- Frost Mage: + [153595] = 64, -- Comet Storm + [112948] = 64, -- Frost Bomb + [157997] = 64, -- Ice Nova + [84714] = 64, -- Frozen Orb + [10] = 64, -- Blizzard + [30455] = 64, -- Ice Lance + [116] = 64, -- Frostbolt + + -- Brewmaster Monk: + [157676] = 268, -- Chi Explosion + [119582] = 268, -- Purifying Brew + [115308] = 268, -- Elusive Brew + [115295] = 268, -- Guard + [115181] = 268, -- Breath of Fire + [121253] = 268, -- Keg Smash + [115180] = 268, -- Dizzying Haze + + -- Mistweaver Monk: + [115310] = 269, -- Revival + [116680] = 269, -- Thunder Focus Tea + [115460] = 269, -- Detonate Chi + [116670] = 269, -- Uplift + [115294] = 269, -- Mana Tea + [116849] = 269, -- Life Cocoon + [115151] = 269, -- Renewing Mist + [124682] = 269, -- Enveloping Mist + [115175] = 269, -- Soothing Mist + + -- Windwalker Monk: + [152175] = 270, -- Hurricane Strike + [116095] = 270, -- Disable + [122470] = 270, -- Touch of Karma + [124280] = 270, -- Touch of Karma + [128595] = 270, -- Combat Conditioning + [101545] = 270, -- Flying Serpent Kick + [113656] = 270, -- Fists of Fury + [117418] = 270, -- Fists of Fury + + -- Holy Paladin: + [156910] = 65, -- Beacon of Faith + [157007] = 65, -- Beacon of Insight + [85222] = 65, -- Light of Dawn + [31821] = 65, -- Devotion Aura + [82326] = 65, -- Holy Light + [148039] = 65, -- Sacred Shield + [53563] = 65, -- Beacon of Light + [82327] = 65, -- Holy Radiance + [2812] = 65, -- Denounce + [20473] = 65, -- Holy Shock + + -- Protection Paladin: + [53600] = 66, -- Shield of the Righteous + [26573] = 66, -- Consecration + [119072] = 66, -- Holy Wrath + [31935] = 66, -- Avenger's Shield + + -- Retribution Paladin: + [157048] = 70, -- Final Verdict + [20164] = 70, -- Seal of Justice + [879] = 70, -- Exorcism + [53385] = 70, -- Divine Storm + [85256] = 70, -- Templar's Verdict + + -- Discipline Priest: + [152118] = 256, -- Clarity of Will + [109964] = 256, -- Spirit Shell + [62618] = 256, -- Power Word: Barrier + [33206] = 256, -- Pain Suppression + [81751] = 256, -- Atonement + [94472] = 256, -- Atonement (crit) + [47753] = 256, -- Divine Aegis + [132157] = 256, -- Holy Nova + [47750] = 256, -- Penance + + -- Holy Priest: + [155245] = 257, -- Clarity of Purpose + [64843] = 257, -- Divine Hymn + [34861] = 257, -- Circle of Healing + [32546] = 257, -- Binding Heal + [596] = 257, -- Prayer of Healing + [126135] = 257, -- Lightwell + [139] = 257, -- Renew + [88625] = 257, -- Holy Word: Chastise + + -- Shadow Priest: + [127632] = 258, -- Cascade + [122121] = 258, -- Divine Star + [120644] = 258, -- Halo + [15286] = 258, -- Vampiric Embrace + [32379] = 258, -- Shadow Word: Death + [73510] = 258, -- Mind Spike + [78203] = 258, -- Shadowy Apparitions + [34914] = 258, -- Vampiric Touch + [2944] = 258, -- Devouring Plague + [8092] = 258, -- Mind Blast + [15407] = 258, -- Mind Flay + + -- Assassination Rogue: + [79140] = 259, -- Vendetta + [111240] = 259, -- Dispatch + [32645] = 259, -- Envenom + [1329] = 259, -- Mutilate + [79134] = 259, -- Venomous Wounds + + -- Combat Rogue: + [51690] = 260, -- Killing Spree + [84617] = 260, -- Revealing Strike + + -- Subtlety Rogue: + [53] = 261, -- Backstab + [16511] = 261, -- Hemorrhage + + -- Elemental Shaman: + [165399] = 262, -- Elemental Overload + [165477] = 262, -- Unleashed Fury + [165339] = 262, -- Ascendance + [165462] = 262, -- Unleash Flame + [170374] = 262, -- Mastery: Molten Earth + [61882] = 262, -- Earthquake + [77756] = 262, -- Lava Surge + [86108] = 262, -- Mail Specialization + [88766] = 262, -- Fulmination + [60188] = 262, -- Elemental Fury + [29000] = 262, -- Elemental Reach + [62099] = 262, -- Shamanism + [123099] = 262, -- Spiritual Insight + [51490] = 262, -- Thunderstorm + [8042] = 262, -- Earth Shock + + -- Enhancement Shaman: + [165368] = 263, -- Lightning Strikes + [117012] = 263, -- Unleashed Fury + [165341] = 263, -- Ascendance + [73680] = 263, -- Unleash Elements + [77223] = 263, -- Mastery: Enhanced Elements + [51533] = 263, -- Feral Spirit + [58875] = 263, -- Spirit Walk + [51530] = 263, -- Maelstrom Weapon + [86099] = 263, -- Mail Specialization + [1535] = 263, -- Fire Nova + [8190] = 263, -- Magma Totem + [166221] = 263, -- Enhanced Weapons + [33757] = 263, -- Windfury + [17364] = 263, -- Stormstrike + [16282] = 263, -- Flurry + [86629] = 263, -- Dual Wield + [10400] = 263, -- Flametongue + [60103] = 263, -- Lava Lash + [30814] = 263, -- Mental Quickness + [51522] = 263, -- Primal Wisdom + + -- Restoration Shaman: + [157153] = 264, -- Cloudburst Totem + [157154] = 264, -- High Tide + [165391] = 264, -- Purification + [165479] = 264, -- Unleashed Fury + [165344] = 264, -- Ascendance + [77226] = 264, -- Mastery: Deep Healing + [98008] = 264, -- Spirit Link Totem + [108280] = 264, -- Healing Tide Totem + [77472] = 264, -- Healing Wave + [86100] = 264, -- Mail Specialization + [51564] = 264, -- Tidal Waves + [1064] = 264, -- Chain Heal + [16196] = 264, -- Resurgence + [974] = 264, -- Earth Shield + [52127] = 264, -- Water Shield + [77130] = 264, -- Purify Spirit + [55453] = 264, -- Telluric Currents + [95862] = 264, -- Meditation + [16213] = 264, -- Restorative Waves + [61295] = 264, -- Riptide + [112858] = 264, -- Spiritual Insight + + -- Affliction Warlock: + [152109] = 265, -- Soulburn: Haunt + [165367] = 265, -- Eradication + [113860] = 265, -- Dark Soul: Misery + [77215] = 265, -- Mastery: Potent Afflictions + [86121] = 265, -- Soul Swap + [48181] = 265, -- Haunt + [980] = 265, -- Agony + [103103] = 265, -- Drain Soul + [27243] = 265, -- Seed of Corruption + [117198] = 265, -- Soul Shards + [74434] = 265, -- Soulburn + [108558] = 265, -- Nightfall + [30108] = 265, -- Unstable Affliction + + -- Demonology Warlock: + [157695] = 266, -- Demonbolt + [165392] = 266, -- Demonic Tactics + [113861] = 266, -- Dark Soul: Knowledge + [77219] = 266, -- Mastery: Master Demonologist + [171975] = 266, -- Grimoire of Synergy + [30146] = 266, -- Summon Felguard + [114592] = 266, -- Wild Imps + [1949] = 266, -- Hellfire + [105174] = 266, -- Hand of Gul'dan + [6353] = 266, -- Soul Fire + [109151] = 266, -- Demonic Leap + [108869] = 266, -- Decimation + [104315] = 266, -- Demonic Fury + [124913] = 266, -- Doom + [103958] = 266, -- Metamorphosis + [122351] = 266, -- Molten Core + + -- Destruction Warlock: + [157696] = 267, -- Charred Remains + [165363] = 267, -- Devastation + [113858] = 267, -- Dark Soul: Instability + [77220] = 267, -- Mastery: Emberstorm + [120451] = 267, -- Flames of Xoroth + [117896] = 267, -- Backdraft + [109784] = 267, -- Aftermath + [108683] = 267, -- Fire and Brimstone + [17877] = 267, -- Shadowburn + [80240] = 267, -- Havoc + [5740] = 267, -- Rain of Fire + [114635] = 267, -- Ember Tap + [174848] = 267, -- Searing Flames + [348] = 267, -- Immolate + [108647] = 267, -- Burning Embers + [116858] = 267, -- Chaos Bolt + [111546] = 267, -- Chaotic Energy + [17962] = 267, -- Conflagrate + [29722] = 267, -- Incinerate + + -- Arms Warrior: + [165365] = 71, -- Weapon Mastery + [167105] = 71, -- Colossus Smash + [12328] = 71, -- Sweeping Strikes + [86101] = 71, -- Plate Specialization + [1464] = 71, -- Slam + [56636] = 71, -- Taste for Blood + [12294] = 71, -- Mortal Strike + [12712] = 71, -- Seasoned Soldier + [772] = 71, -- Rend + [174737] = 71, -- Enhanced Rend + + -- Fury Warrior: + [165383] = 72, -- Cruelty + [12950] = 72, -- Meat Cleaver + [46915] = 72, -- Bloodsurge + [86110] = 72, -- Plate Specialization + [169679] = 72, -- Furious Strikes + [169683] = 72, -- Unquenchable Thirst + [81099] = 72, -- Single-Minded Fury + [85288] = 72, -- Raging Blow + [12323] = 72, -- Piercing Howl + [100130] = 72, -- Wild Strike + [23881] = 72, -- Bloodthirst + [23588] = 72, -- Crazed Berserker + [46917] = 72, -- Titan's Grip + [5308] = 72, -- Execute + + -- Protection Warrior: + [152276] = 73, -- Gladiator's Resolve + [159362] = 73, -- Blood Craze + [165393] = 73, -- Shield Mastery + [114192] = 73, -- Mocking Banner + [76857] = 73, -- Mastery: Critical Block + [161798] = 73, -- Riposte + [84608] = 73, -- Bastion of Defense + [1160] = 73, -- Demoralizing Shout + [86535] = 73, -- Plate Specialization + [871] = 73, -- Shield Wall + [169680] = 73, -- Heavy Repercussions + [169685] = 73, -- Unyielding Strikes + [12975] = 73, -- Last Stand + [6572] = 73, -- Revenge + [20243] = 73, -- Devastate + [2565] = 73, -- Shield Block + [161608] = 73, -- Bladed Armor + [23922] = 73, -- Shield Slam + [46953] = 73, -- Sword and Board + [122509] = 73, -- Ultimatum + [29144] = 73, -- Unwavering Sentinel + [157497] = 73, -- Improved Block + } _detalhes.ClassSpellList = { diff --git a/gumps/fw_mods.lua b/gumps/fw_mods.lua index 6cefb3a8..23e096c3 100644 --- a/gumps/fw_mods.lua +++ b/gumps/fw_mods.lua @@ -36,7 +36,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color) return newFontString end -function gump:NewDetailsButton (parent, container, instancia, func, param1, param2, w, h, pic_up, pic_down, pic_disabled, pic_highlight, options, FrameName) +function gump:NewDetailsButton (parent, container, instancia, func, param1, param2, w, h, pic_up, pic_down, pic_disabled, pic_highlight, options, FrameName, inherits, ischeck) if (not parent) then return nil @@ -46,7 +46,13 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para h = h or 16 options = options or {} - local new_button = CreateFrame ("Button", FrameName, parent) + local new_button + if (ischeck) then + new_button = CreateFrame ("CheckButton", FrameName, parent, inherits) + else + new_button = CreateFrame ("Button", FrameName, parent) + end + new_button:SetWidth (w) new_button:SetHeight (h) diff --git a/gumps/janela_custom.lua b/gumps/janela_custom.lua index c99d457e..a45b08b7 100644 --- a/gumps/janela_custom.lua +++ b/gumps/janela_custom.lua @@ -998,6 +998,7 @@ local pickicon_callback = function (texture) box0.icontexture:SetTexture (texture) + end local pickicon = function() gump:IconPick (pickicon_callback, true) diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index e390addf..2ef53e08 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -3033,6 +3033,11 @@ function _detalhes.janela_info:monta_relatorio (botao) local amt = _detalhes.report_lines + if (not player) then + _detalhes:Msg ("Player not found.") + return + end + local report_lines if (botao == 1) then --> botão da esquerda @@ -3040,7 +3045,10 @@ function _detalhes.janela_info:monta_relatorio (botao) for index, barra in _ipairs (info.barras1) do if (barra:IsShown()) then local spellid = barra.show - if (spellid > 10) then + if (atributo == 1 and sub_atributo == 4) then --> friendly fire + report_lines [#report_lines+1] = barra.texto_esquerdo:GetText() .. ": " .. barra.texto_direita:GetText() + + elseif (spellid > 10) then local link = GetSpellLink (spellid) report_lines [#report_lines+1] = index .. ". " .. link .. ": " .. barra.texto_direita:GetText() else diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index cf5d8f1b..069e3e26 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1952,9 +1952,6 @@ function window:CreateFrame18() --> auto current segment g:NewSwitch (frame18, _, "$parentAutoCurrentSlider", "autoCurrentSlider", 60, 20, _, _, instance.auto_current) - - -- Auto Current Segment - g:NewLabel (frame18, _, "$parentAutoCurrentLabel", "autoCurrentLabel", Loc ["STRING_OPTIONS_INSTANCE_CURRENT"], "GameFontHighlightLeft") frame18.autoCurrentSlider:SetPoint ("left", frame18.autoCurrentLabel, "right", 2) @@ -1965,72 +1962,7 @@ function window:CreateFrame18() end window:CreateLineBackground2 (frame18, "autoCurrentSlider", "autoCurrentLabel", Loc ["STRING_OPTIONS_INSTANCE_CURRENT_DESC"]) - - --> show total bar - - g:NewLabel (frame18, _, "$parentTotalBarLabel", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR"], "GameFontHighlightLeft") - g:NewSwitch (frame18, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled) - frame18.totalBarSlider:SetPoint ("left", frame18.totalBarLabel, "right", 2) - frame18.totalBarSlider.OnSwitch = function (self, instance, value) - instance.total_bar.enabled = value - instance:InstanceReset() - - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - - window:CreateLineBackground2 (frame18, "totalBarSlider", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_DESC"]) - - --> total bar color - local totalbarcolor_callback = function (button, r, g, b, a) - _G.DetailsOptionsWindow.instance.total_bar.color[1] = r - _G.DetailsOptionsWindow.instance.total_bar.color[2] = g - _G.DetailsOptionsWindow.instance.total_bar.color[3] = b - _G.DetailsOptionsWindow.instance:InstanceReset() - - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - g:NewColorPickButton (frame18, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback) - g:NewLabel (frame18, _, "$parentTotalBarColorPickLabel", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_COLOR"], "GameFontHighlightLeft") - frame18.totalBarColorPick:SetPoint ("left", frame18.totalBarPickColorLabel, "right", 2, 0) - - window:CreateLineBackground2 (frame18, "totalBarColorPick", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"]) - - --> total bar only in group - g:NewLabel (frame18, _, "$parentTotalBarOnlyInGroupLabel", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP"], "GameFontHighlightLeft") - g:NewSwitch (frame18, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group) - - frame18.totalBarOnlyInGroupSlider:SetPoint ("left", frame18.totalBarOnlyInGroupLabel, "right", 2) - frame18.totalBarOnlyInGroupSlider.OnSwitch = function (self, instance, value) - instance.total_bar.only_in_group = value - instance:InstanceReset() - - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - - window:CreateLineBackground2 (frame18, "totalBarOnlyInGroupSlider", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP_DESC"]) - - --> total bar icon - local totalbar_pickicon_callback = function (texture) - instance.total_bar.icon = texture - frame18.totalBarIconTexture:SetTexture (texture) - instance:InstanceReset() - - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - local totalbar_pickicon = function() - g:IconPick (totalbar_pickicon_callback, true) - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) - end - g:NewLabel (frame18, _, "$parentTotalBarIconLabel", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON"], "GameFontHighlightLeft") - g:NewImage (frame18, nil, 20, 20, nil, nil, "totalBarIconTexture", "$parentTotalBarIconTexture") - g:NewButton (frame18, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon) - frame18.totalBarIconButton:InstallCustomTexture (nil, nil, nil, true) - frame18.totalBarIconButton:SetPoint ("left", frame18.totalBarIconLabel, "right", 2, 0) - frame18.totalBarIconTexture:SetPoint ("left", frame18.totalBarIconLabel, "right", 2, 0) - - window:CreateLineBackground2 (frame18, "totalBarIconButton", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON_DESC"]) - --> instances g:NewLabel (frame18, _, "$parentDeleteInstanceLabel", "deleteInstanceLabel", Loc ["STRING_OPTIONS_INSTANCE_DELETE"], "GameFontHighlightLeft") @@ -2127,6 +2059,32 @@ function window:CreateFrame18() window:CreateLineBackground2 (frame18, "MenuTextSizeSlider", "MenuTextSizeLabel", Loc ["STRING_OPTIONS_MENU_FONT_SIZE_DESC"]) + --> menu text face + local onSelectFont = function (_, _, fontName) + _detalhes.font_faces.menus = fontName + end + + local buildFontMenu = function() + local fontObjects = SharedMedia:HashTable ("font") + local fontTable = {} + for name, fontPath in pairs (fontObjects) do + fontTable[#fontTable+1] = {value = name, label = name, icon = font_select_icon, texcoord = font_select_texcoord, onclick = onSelectFont, font = fontPath, descfont = name, desc = Loc ["STRING_MUSIC_DETAILS_ROBERTOCARLOS"]} + end + table.sort (fontTable, function (t1, t2) return t1.label < t2.label end) + return fontTable + end + + local d = g:NewDropDown (frame18, _, "$parentFontDropdown", "fontDropdown", DROPDOWN_WIDTH, 20, buildFontMenu, nil) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)) + + g:NewLabel (frame18, _, "$parentFontLabel", "fontLabel", Loc ["STRING_OPTIONS_MENU_FONT_FACE"], "GameFontHighlightLeft") + frame18.fontDropdown:SetPoint ("left", frame18.fontLabel, "right", 2) + + window:CreateLineBackground2 (frame18, "fontDropdown", "fontLabel", Loc ["STRING_OPTIONS_MENU_FONT_FACE_DESC"]) + --> disable groups g:NewLabel (frame18, _, "$parentDisableGroupsLabel", "DisableGroupsLabel", Loc ["STRING_OPTIONS_DISABLE_GROUPS"], "GameFontHighlightLeft") g:NewSwitch (frame18, _, "$parentDisableGroupsSlider", "DisableGroupsSlider", 60, 20, _, _, _detalhes.disable_window_groups) @@ -2223,7 +2181,6 @@ function window:CreateFrame18() g:NewLabel (frame18, _, "$parentInstancesMiscAnchor", "instancesMiscLabel", Loc ["STRING_OPTIONS_INSTANCES"], "GameFontNormal") g:NewLabel (frame18, _, "$parentSwitchesAnchor", "switchesAnchorLabel", Loc ["STRING_OPTIONS_SWITCH_ANCHOR"], "GameFontNormal") - g:NewLabel (frame18, _, "$parentTotalBarAnchor", "totalBarAnchorLabel", Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"], "GameFontNormal") g:NewLabel (frame18, _, "$parentReportAnchor", "reportAnchorLabel", Loc ["STRING_OPTIONS_REPORT_ANCHOR"], "GameFontNormal") @@ -2260,14 +2217,11 @@ function window:CreateFrame18() {"instancesMiscLabel", 1, true}, {"deleteInstanceLabel", 2}, {"MenuTextSizeLabel", 3}, - {"DisableGroupsLabel", 4}, - {"DisableResetLabel", 5}, - {"scrollLabel", 6}, - {"totalBarAnchorLabel", 7, true}, - {"totalBarIconLabel", 8}, - {"totalBarPickColorLabel", 9}, - {"totalBarLabel", 10}, - {"totalBarOnlyInGroupLabel", 11}, + {"fontLabel", 4}, + {"DisableGroupsLabel", 5}, + {"DisableResetLabel", 6}, + {"scrollLabel", 7}, + } window:arrange_menu (frame18, right_side, window.right_start_at, -90) @@ -5017,6 +4971,17 @@ function window:CreateFrame4() local OnSelectIconFile = function (_, _, iconpath) _G.DetailsOptionsWindow.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, iconpath) frame4.iconFileEntry:SetText (iconpath) + + if (_G.DetailsOptionsWindow.instance.row_info.use_spec_icons) then + _G.DetailsOptionsWindow.instance:SetBarSpecIconSettings (false) + end + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + local OnSelectIconFileSpec = function (_, _, iconpath) + _G.DetailsOptionsWindow.instance:SetBarSpecIconSettings (true, iconpath, true) + frame4.iconFileEntry:SetText (iconpath) _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end @@ -5026,6 +4991,8 @@ function window:CreateFrame4() local list = { {value = [[]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE1"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize, iconcolor = {1, 1, 1, .3}}, {value = [[Interface\AddOns\Details\images\classes_small]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE2"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\spec_icons_normal]], label = "Specialization", onclick = OnSelectIconFileSpec, icon = [[Interface\AddOns\Details\images\icons]], texcoord = {2/512, 32/512, 480/512, 510/512}, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], label = "Specialization Alpha", onclick = OnSelectIconFileSpec, icon = [[Interface\AddOns\Details\images\icons]], texcoord = {2/512, 32/512, 480/512, 510/512}, iconsize = iconsize}, {value = [[Interface\AddOns\Details\images\classes_small_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE3"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, {value = [[Interface\AddOns\Details\images\classes_small_alpha]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE4"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, {value = [[Interface\AddOns\Details\images\classes_small_alpha_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE6"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, @@ -5035,7 +5002,14 @@ function window:CreateFrame4() return list end - local d = g:NewDropDown (frame4, _, "$parentIconSelectDropdown", "IconSelectDropdown", DROPDOWN_WIDTH, 20, BuiltIconList, instance.row_info.icon_file) + local default + if (instance.row_info.use_spec_icons) then + default = _G.DetailsOptionsWindow.instance.row_info.spec_file + else + default = instance.row_info.icon_file + end + + local d = g:NewDropDown (frame4, _, "$parentIconSelectDropdown", "IconSelectDropdown", DROPDOWN_WIDTH, 20, BuiltIconList, default) d.onenter_backdrop = dropdown_backdrop_onenter d.onleave_backdrop = dropdown_backdrop_onleave d:SetBackdrop (dropdown_backdrop) @@ -5050,16 +5024,33 @@ function window:CreateFrame4() frame4.iconFileEntry.tooltip = "- Press escape to restore default value.\n- Leave empty to hide icons." frame4.iconFileEntry:SetHook ("OnEnterPressed", function() - _G.DetailsOptionsWindow.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, frame4.iconFileEntry.text) + + local instance = _G.DetailsOptionsWindow.instance + + local text = frame4.iconFileEntry.text + if (text:find ("spec_")) then + instance:SetBarSpecIconSettings (true, text, true) + else + if (instance.row_info.use_spec_icons) then + instance:SetBarSpecIconSettings (false) + end + instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, text) + end + d:Select (false) d:Select (frame4.iconFileEntry.text) _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end) frame4.iconFileEntry:SetHook ("OnEscapePressed", function() - frame4.iconFileEntry:SetText ([[Interface\AddOns\Details\images\classes_small]]) + local instance = _G.DetailsOptionsWindow.instance + + if (instance.row_info.use_spec_icons) then + frame4.iconFileEntry:SetText (instance.row_info.spec_file) + else + frame4.iconFileEntry:SetText (instance.row_info.icon_file) + end + frame4.iconFileEntry:ClearFocus() - _G.DetailsOptionsWindow.instance:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, [[Interface\AddOns\Details\images\classes_small]]) - _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) return true end) @@ -6544,6 +6535,74 @@ function window:CreateFrame8() end window:CreateLineBackground2 (frame8, "ShowMeSlider", "ShowMeLabel", Loc ["STRING_OPTIONS_BAR_FOLLOWING_DESC"]) + --> show total bar + + g:NewLabel (frame8, _, "$parentTotalBarAnchor", "totalBarAnchorLabel", Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"], "GameFontNormal") + + g:NewLabel (frame8, _, "$parentTotalBarLabel", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR"], "GameFontHighlightLeft") + g:NewSwitch (frame8, _, "$parentTotalBarSlider", "totalBarSlider", 60, 20, _, _, instance.total_bar.enabled) + + frame8.totalBarSlider:SetPoint ("left", frame8.totalBarLabel, "right", 2) + frame8.totalBarSlider.OnSwitch = function (self, instance, value) + instance.total_bar.enabled = value + instance:InstanceReset() + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame8, "totalBarSlider", "totalBarLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_DESC"]) + + --> total bar color + local totalbarcolor_callback = function (button, r, g, b, a) + _G.DetailsOptionsWindow.instance.total_bar.color[1] = r + _G.DetailsOptionsWindow.instance.total_bar.color[2] = g + _G.DetailsOptionsWindow.instance.total_bar.color[3] = b + _G.DetailsOptionsWindow.instance:InstanceReset() + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + g:NewColorPickButton (frame8, "$parentTotalBarColorPick", "totalBarColorPick", totalbarcolor_callback) + g:NewLabel (frame8, _, "$parentTotalBarColorPickLabel", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_COLOR"], "GameFontHighlightLeft") + frame8.totalBarColorPick:SetPoint ("left", frame8.totalBarPickColorLabel, "right", 2, 0) + + window:CreateLineBackground2 (frame8, "totalBarColorPick", "totalBarPickColorLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"]) + + --> total bar only in group + g:NewLabel (frame8, _, "$parentTotalBarOnlyInGroupLabel", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP"], "GameFontHighlightLeft") + g:NewSwitch (frame8, _, "$parentTotalBarOnlyInGroupSlider", "totalBarOnlyInGroupSlider", 60, 20, _, _, instance.total_bar.only_in_group) + + frame8.totalBarOnlyInGroupSlider:SetPoint ("left", frame8.totalBarOnlyInGroupLabel, "right", 2) + frame8.totalBarOnlyInGroupSlider.OnSwitch = function (self, instance, value) + instance.total_bar.only_in_group = value + instance:InstanceReset() + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame8, "totalBarOnlyInGroupSlider", "totalBarOnlyInGroupLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_INGROUP_DESC"]) + + --> total bar icon + local totalbar_pickicon_callback = function (texture) + instance.total_bar.icon = texture + frame8.totalBarIconTexture:SetTexture (texture) + instance:InstanceReset() + + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + local totalbar_pickicon = function() + g:IconPick (totalbar_pickicon_callback, true) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + g:NewLabel (frame8, _, "$parentTotalBarIconLabel", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON"], "GameFontHighlightLeft") + g:NewImage (frame8, nil, 20, 20, nil, nil, "totalBarIconTexture", "$parentTotalBarIconTexture") + g:NewButton (frame8, _, "$parentTotalBarIconButton", "totalBarIconButton", 20, 20, totalbar_pickicon) + frame8.totalBarIconButton:InstallCustomTexture (nil, nil, nil, true) + frame8.totalBarIconButton:SetPoint ("left", frame8.totalBarIconLabel, "right", 2, 0) + frame8.totalBarIconTexture:SetPoint ("left", frame8.totalBarIconLabel, "right", 2, 0) + + window:CreateLineBackground2 (frame8, "totalBarIconButton", "totalBarIconLabel", Loc ["STRING_OPTIONS_SHOW_TOTALBAR_ICON_DESC"]) + + --> anchors local x = window.left_start_at @@ -6561,6 +6620,12 @@ function window:CreateFrame8() {"ModelLowerEnabledLabel", 6}, {"ModelLowerAlphaLabel", 7}, {"ModelLowerSelect", 8}, + + {"totalBarAnchorLabel", 9, true}, + {"totalBarIconLabel", 10}, + {"totalBarPickColorLabel", 11}, + {"totalBarLabel", 12}, + {"totalBarOnlyInGroupLabel", 13}, } window:arrange_menu (frame8, left_side, x, -90) @@ -6759,9 +6824,6 @@ function window:CreateFrame9() {value = [[Interface\Glues\COMMON\GLUES-WOW-BCLOGO]], label = "Burning Cruzade Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\GLUES-WOW-BCLOGO]], texcoord = nil}, {value = [[Interface\Glues\COMMON\GLUES-WOW-CCLOGO]], label = "Cataclysm Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\GLUES-WOW-CCLOGO]], texcoord = nil}, {value = [[Interface\Glues\COMMON\Glues-WOW-WoltkLogo]], label = "WotLK Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\Glues-WOW-WoltkLogo]], texcoord = nil}, - - - --{value = [[]], label = "", onclick = onSelectSecTexture, icon = [[]], texcoord = nil}, }, ["CREDITS"] = { @@ -7284,7 +7346,7 @@ function window:CreateFrame10() titulo_performance_general_desc.width = 320 --------------- Memory - local s = g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, 20, 1, 5, 1, _detalhes.segments_amount_to_save) + local s = g:NewSlider (frame10, _, "$parentSliderSegmentsSave", "segmentsSliderToSave", SLIDER_WIDTH, 20, 1, 25, 1, _detalhes.segments_amount_to_save) s:SetBackdrop (slider_backdrop) s:SetBackdropColor (unpack (slider_backdrop_color)) s:SetThumbSize (50) @@ -8711,9 +8773,15 @@ end --> if not window _G.DetailsOptionsWindow4BackdropSizeHeight.MyObject:SetValue (editing_instance.row_info.backdrop.size) _G.DetailsOptionsWindow4BackdropColorPick.MyObject:SetColor (unpack (editing_instance.row_info.backdrop.color)) - _G.DetailsOptionsWindow4IconFileEntry:SetText (editing_instance.row_info.icon_file) _G.DetailsOptionsWindow4IconSelectDropdown.MyObject:Select (false) - _G.DetailsOptionsWindow4IconSelectDropdown.MyObject:Select (editing_instance.row_info.icon_file) + local default + if (editing_instance.row_info.use_spec_icons) then + default = editing_instance.row_info.spec_file + else + default = editing_instance.row_info.icon_file + end + _G.DetailsOptionsWindow4IconSelectDropdown.MyObject:Select (default) + _G.DetailsOptionsWindow4IconFileEntry:SetText (default) --> window 5 @@ -8815,6 +8883,15 @@ end --> if not window _G.DetailsOptionsWindow8ShowMeSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow8ShowMeSlider.MyObject:SetValue (editing_instance.following.enabled) + _G.DetailsOptionsWindow8TotalBarSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow8TotalBarSlider.MyObject:SetValue (editing_instance.total_bar.enabled) + + _G.DetailsOptionsWindow8TotalBarColorPick.MyObject:SetColor (unpack (editing_instance.total_bar.color)) + + _G.DetailsOptionsWindow8TotalBarOnlyInGroupSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow8TotalBarOnlyInGroupSlider.MyObject:SetValue (editing_instance.total_bar.only_in_group) + _G.DetailsOptionsWindow8TotalBarIconTexture.MyObject:SetTexture (editing_instance.total_bar.icon) + --> window 10 _G.DetailsOptionsWindow10SliderMemory.MyObject:SetValue (_detalhes.memory_threshold) _G.DetailsOptionsWindow10PanicModeSlider.MyObject:SetValue (_detalhes.segments_panic_mode) @@ -9018,17 +9095,10 @@ end --> if not window _G.DetailsOptionsWindow18AutoCurrentSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow18AutoCurrentSlider.MyObject:SetValue (editing_instance.auto_current) - _G.DetailsOptionsWindow18TotalBarSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow18TotalBarSlider.MyObject:SetValue (editing_instance.total_bar.enabled) - - _G.DetailsOptionsWindow18TotalBarColorPick.MyObject:SetColor (unpack (editing_instance.total_bar.color)) - - _G.DetailsOptionsWindow18TotalBarOnlyInGroupSlider.MyObject:SetFixedParameter (editing_instance) - _G.DetailsOptionsWindow18TotalBarOnlyInGroupSlider.MyObject:SetValue (editing_instance.total_bar.only_in_group) - _G.DetailsOptionsWindow18TotalBarIconTexture.MyObject:SetTexture (editing_instance.total_bar.icon) - _G.DetailsOptionsWindow18MenuTextSizeSlider.MyObject:SetValue (_detalhes.font_sizes.menus) + _G.DetailsOptionsWindow18FontDropdown.MyObject:Select (_detalhes.font_faces.menus) + --> window 19 _G.DetailsOptionsWindow19MinimapSlider.MyObject:SetValue (not _detalhes.minimap.hide) _G.DetailsOptionsWindow19MinimapActionDropdown.MyObject:Select (_detalhes.minimap.onclick_what_todo) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index b2a5b384..7b97fe8f 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -1556,6 +1556,7 @@ local resize_scripts_onenter = function (self) GameCooltip:SetType ("tooltip") GameCooltip:AddFromTable (resizeTooltip) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) + GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) GameCooltip:SetOption ("NoLastSelectedBar", true) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) @@ -1607,6 +1608,7 @@ local lockFunctionOnEnter = function (self) GameCooltip:AddFromTable (lockButtonTooltip) GameCooltip:SetOption ("NoLastSelectedBar", true) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) + GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:SetOwner (self) @@ -1691,6 +1693,7 @@ local unSnapButtonOnEnter = function (self) GameCooltip:Reset() GameCooltip:AddFromTable (unSnapButtonTooltip) GameCooltip:SetOption ("TextSize", _detalhes.font_sizes.menus) + GameCooltip:SetOption ("TextFont", _detalhes.font_faces.menus) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true) GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color) GameCooltip:ShowCooltip (self, "tooltip") @@ -2435,13 +2438,13 @@ function _detalhes:InstanceAlert (msg, icon, time, clickfunc) if (icon) then if (type (icon) == "table") then - local texture, w, h, animate, l, r, t, b, r, g, b, a = unpack (icon) + local texture, w, h, animate, left, right, top, bottom, r, g, b, a = unpack (icon) self.alert.icon:SetTexture (texture) self.alert.icon:SetWidth (w or 14) self.alert.icon:SetHeight (h or 14) - if (l and r and t and b) then - self.alert.icon:SetTexCoord (l, r, t, b) + if (left and right and top and bottom) then + self.alert.icon:SetTexCoord (left, right, top, bottom) end if (animate) then self.alert.rotate:Play() @@ -3475,6 +3478,44 @@ function _detalhes:SetBarModel (upper_enabled, upper_model, upper_alpha, lower_e _detalhes:AtualizaGumpPrincipal (-1, true) end +-- ~spec ~icons +function _detalhes:SetBarSpecIconSettings (enabled, iconfile, fulltrack) + + if (type (enabled) ~= "boolean") then + enabled = self.row_info.use_spec_icons + end + if (not iconfile) then + iconfile = self.row_info.spec_file + end + + self.row_info.use_spec_icons = enabled + self.row_info.spec_file = iconfile + + if (enabled) then + if (not _detalhes.track_specs) then + _detalhes.track_specs = true + _detalhes:TrackSpecsNow (fulltrack) + end + else + local have_enabled + for _, instance in _ipairs (_detalhes.tabela_instancias) do + if (instance:IsEnabled() and instance.row_info.use_spec_icons) then + have_enabled = true + break + end + end + if (not have_enabled) then + _detalhes.track_specs = false + _detalhes:ResetSpecCache (true) --> forçar + end + end + + self:InstanceReset() + self:InstanceRefreshRows() + self:ReajustaGump() + +end + function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement) --> bar start @@ -3691,6 +3732,10 @@ function _detalhes:InstanceRefreshRows (instancia) local icon_texture = self.row_info.icon_file local start_after_icon = self.row_info.start_after_icon + if (self.row_info.use_spec_icons) then + icon_texture = self.row_info.spec_file + end + --custom right text local custom_right_text_enabled = self.row_info.textR_enable_custom_text local custom_right_text = self.row_info.textR_custom_text @@ -4648,6 +4693,7 @@ local build_mode_list = function (self, elapsed) CoolTip:SetColor ("main", "transparent") CoolTip:SetOption ("TextSize", _detalhes.font_sizes.menus) + CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) CoolTip:SetOption ("ButtonHeightModSub", -2) CoolTip:SetOption ("ButtonHeightMod", -5) @@ -4804,14 +4850,15 @@ local build_mode_list = function (self, elapsed) end CoolTip:SetOption ("TextSize", _detalhes.font_sizes.menus) + CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) end end if (ClosedInstances > 0 or _detalhes:GetNumInstancesAmount() < _detalhes:GetMaxInstancesAmount()) then GameCooltip:AddLine ("$div", nil, 2, nil, -5, -11) end - - GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE"], nil, 2, "white", nil, _detalhes.font_sizes.menus, font) + + GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE"], nil, 2, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], 2, 1, 14, 14, 0.2, 0.8, 0.2, 0.8) GameCooltip:AddMenu (2, _detalhes.close_instancia_func, instancia.baseframe.cabecalho.fechar) @@ -5145,6 +5192,8 @@ local build_segment_list = function (self, elapsed) _detalhes:SetMenuOwner (self, instancia) CoolTip:SetOption ("TextSize", _detalhes.font_sizes.menus) + CoolTip:SetOption ("TextFont", _detalhes.font_faces.menus) + CoolTip:SetOption ("SubMenuIsTooltip", true) CoolTip:SetOption ("ButtonHeightMod", -4) @@ -5327,6 +5376,7 @@ function _detalhes:ChangeSkin (skin_name) ----------> call widgets handlers self:SetBarSettings (self.row_info.height) self:SetBarBackdropSettings() + self:SetBarSpecIconSettings() --> update toolbar self:ToolbarSide() @@ -6440,13 +6490,11 @@ end GameCooltip:SetOption ("ButtonsYMod", -7) GameCooltip:SetOption ("HeighMod", 8) - local font = SharedMedia:Fetch ("font", "Friz Quadrata TT") - - GameCooltip:AddLine (Loc ["STRING_ERASE_DATA"], nil, 1, "white", nil, _detalhes.font_sizes.menus, font) + GameCooltip:AddLine (Loc ["STRING_ERASE_DATA"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red") GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar) - GameCooltip:AddLine (Loc ["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, _detalhes.font_sizes.menus, font) + GameCooltip:AddLine (Loc ["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "orange") GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar_overall) @@ -6524,16 +6572,16 @@ end --GameCooltip:SetOption ("FixedHeight", 30) GameCooltip:SetOption ("HeighMod", 9) - + local font = SharedMedia:Fetch ("font", "Friz Quadrata TT") - GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, _detalhes.font_sizes.menus, font) + GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], 1, 1, 14, 14, 0.2, 0.8, 0.2, 0.8) GameCooltip:AddMenu (1, close_button_onclick, self) - GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE_DESC"], nil, 2, "white", nil, _detalhes.font_sizes.menus, font) + GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE_DESC"], nil, 2, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\CHATFRAME\UI-ChatIcon-Minimize-Up]], 2, 1, 18, 18) - GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE_DESC2"], nil, 2, "white", nil, _detalhes.font_sizes.menus, font) + GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE_DESC2"], nil, 2, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]], 2, 1, 18, 18) GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true) @@ -7014,7 +7062,7 @@ function gump:CriaCabecalho (baseframe, instancia) GameCooltip:SetOption ("ButtonsYMod", -7) GameCooltip:SetOption ("HeighMod", 8) - GameCooltip:AddLine ("Report Results", nil, 1, "white", nil, _detalhes.font_sizes.menus, SharedMedia:Fetch ("font", "Friz Quadrata TT")) + GameCooltip:AddLine ("Report Results", nil, 1, "white", nil, _detalhes.font_sizes.menus, _detalhes.font_faces.menus) GameCooltip:AddIcon ([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19) GameCooltip:AddMenu (1, _detalhes.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id) diff --git a/gumps/janela_report.lua b/gumps/janela_report.lua index 4da78bb1..9210f99b 100644 --- a/gumps/janela_report.lua +++ b/gumps/janela_report.lua @@ -3,6 +3,7 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) local _detalhes = _G._detalhes local gump = _detalhes.gump local _ + --lua locals local _cstr = tostring --> lua local local _math_ceil = math.ceil --> lua local @@ -17,18 +18,8 @@ local _IsInGuild = IsInGuild --> wow api locals local _GetChannelList = GetChannelList --> wow api locals local _UIParent = UIParent --> wow api locals ---> got weird errors with globals, not sure why -local _UIDropDownMenu_SetSelectedID = UIDropDownMenu_SetSelectedID --> wow api locals -local _UIDropDownMenu_CreateInfo = UIDropDownMenu_CreateInfo --> wow api locals -local _UIDropDownMenu_AddButton = UIDropDownMenu_AddButton --> wow api locals -local _UIDropDownMenu_Initialize = UIDropDownMenu_Initialize --> wow api locals -local _UIDropDownMenu_SetWidth = UIDropDownMenu_SetWidth --> wow api locals -local _UIDropDownMenu_SetButtonWidth = UIDropDownMenu_SetButtonWidth --> wow api locals -local _UIDropDownMenu_SetSelectedValue = UIDropDownMenu_SetSelectedValue --> wow api locals -local _UIDropDownMenu_JustifyText = UIDropDownMenu_JustifyText --> wow api locals local _UISpecialFrames = UISpecialFrames --> wow api locals - --> details API functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function _detalhes:SendReportLines (lines) @@ -150,7 +141,7 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals if (type (param2) == "string") then id = param2 end - + if (_detalhes.last_report_id and id and _detalhes.last_report_id == id) then _detalhes.last_report_id = nil _detalhes.janela_report.fechar:Click() @@ -257,18 +248,18 @@ BG Leader: 255 216 183 General/Trade: 255 189 192 --]] -local iconsize = {16, 16} + local iconsize = {16, 16} -local lista = { -{Loc ["STRING_REPORTFRAME_PARTY"], "PARTY", function() return GetNumSubgroupMembers() > 0 end, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {0.66, 0.65, 1}}}, -{Loc ["STRING_REPORTFRAME_RAID"], "RAID", _IsInRaid, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {1, 0.49, 0}}}, -{Loc ["STRING_REPORTFRAME_GUILD"], "GUILD", _IsInGuild, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.98, 0.25}}}, -{Loc ["STRING_REPORTFRAME_OFFICERS"], "OFFICER", _IsInGuild, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}}}, -{Loc ["STRING_REPORTFRAME_WHISPER"], "WHISPER", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}}}, -{Loc ["STRING_REPORTFRAME_WHISPERTARGET"], "WHISPER2", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}}}, -{Loc ["STRING_REPORTFRAME_SAY"], "SAY", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0390625, 0.203125, 0.09375, 0.375}, color = {1, 1, 1}}}, -{Loc ["STRING_REPORTFRAME_COPY"], "COPY", nil, {iconsize = iconsize, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Disabled]], coords = {0, 1, 0, 1}, color = {1, 1, 1}}}, -} + local lista = { + {Loc ["STRING_REPORTFRAME_PARTY"], "PARTY", function() return GetNumSubgroupMembers() > 0 end, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {0.66, 0.65, 1}}}, + {Loc ["STRING_REPORTFRAME_RAID"], "RAID", _IsInRaid, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.53125, 0.7265625, 0.078125, 0.40625}, color = {1, 0.49, 0}}}, + {Loc ["STRING_REPORTFRAME_GUILD"], "GUILD", _IsInGuild, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.98, 0.25}}}, + {Loc ["STRING_REPORTFRAME_OFFICERS"], "OFFICER", _IsInGuild, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.8046875, 0.96875, 0.125, 0.390625}, color = {0.25, 0.74, 0.25}}}, + {Loc ["STRING_REPORTFRAME_WHISPER"], "WHISPER", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}}}, + {Loc ["STRING_REPORTFRAME_WHISPERTARGET"], "WHISPER2", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0546875, 0.1953125, 0.625, 0.890625}, color = {1, 0.49, 1}}}, + {Loc ["STRING_REPORTFRAME_SAY"], "SAY", nil, {iconsize = iconsize, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], coords = {0.0390625, 0.203125, 0.09375, 0.375}, color = {1, 1, 1}}}, + {Loc ["STRING_REPORTFRAME_COPY"], "COPY", nil, {iconsize = iconsize, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Disabled]], coords = {0, 1, 0, 1}, color = {1, 1, 1}}}, + } local on_click = function (self, fixedParam, selectedOutput) _detalhes.report_where = selectedOutput @@ -286,10 +277,7 @@ local lista = { local channels = {_GetChannelList()} --> coloca o resultado em uma tabela .. {id1, canal1, id2, canal2} for i = 1, #channels, 2 do --> total de canais - output_array [#output_array + 1] = {iconsize = iconsize, value = "CHANNEL|"..channels [i+1], label = channels [i]..". "..channels [i+1], onclick = on_click, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], texcoord = {0.3046875, 0.4453125, 0.109375, 0.390625}, iconcolor = {149/255, 112/255, 112/255}} - - --lista [#lista+1] = {channels [i]..". "..channels [i+1], "CHANNEL|"..channels [i+1]} end local bnet_friends = {} @@ -304,51 +292,12 @@ local lista = { return output_array end + este_gump.dropdown_func = build_list local select_output = gump:NewDropDown (este_gump, _, "$parentOutputDropdown", "select", 185, 20, build_list, 1) select_output:SetPoint ("topleft", este_gump, "topleft", 107, -55) este_gump.select = select_output.widget - - local function initialize (self, level) - local info = _UIDropDownMenu_CreateInfo() - - for i = 9, #lista do - lista [i] = nil - end - - local channels = {_GetChannelList()} --> coloca o resultado em uma tabela .. {id1, canal1, id2, canal2} - for i = 1, #channels, 2 do --> total de canais - lista [#lista+1] = {channels [i]..". "..channels [i+1], "CHANNEL|"..channels [i+1]} - end - - local BnetFriends = BNGetNumFriends() - for i = 1, BnetFriends do - local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR = BNGetFriendInfo (i) - if (isOnline) then - lista [#lista+1] = {presenceName, "REALID|" .. presenceID, nil, [[Interface\FriendsFrame\Battlenet-Battleneticon]]} - end - end - - --BNSendWhisper - - for index, v in _pairs (lista) do - - if (not v[3] or (type (v[3]) == "function" and v[3]())) then - info = _UIDropDownMenu_CreateInfo() - info.text = v[1] - info.value = v[2] - - if (v[4]) then - info.icon = v[4] - end - - info.func = OnClick - _UIDropDownMenu_AddButton (info, level) - end - end - end - function select_output:CheckValid() local last_selected = _detalhes.report_where @@ -581,11 +530,48 @@ local lista = { local este_gump = _CreateFrame ("Frame", "DetailsReportWindow", _UIParent) este_gump:SetPoint ("CENTER", UIParent, "CENTER") este_gump:SetFrameStrata ("HIGH") + + este_gump:SetScript ("OnShow", function (self) + local dropdown = este_gump.select.MyObject + local where = _detalhes.report_where + + local list = este_gump.dropdown_func() + local found + + for index, option in ipairs (list) do + if (option.value == where) then + dropdown:Select (where) + found = true + break + end + end + + if (not found) then + if (_IsInRaid()) then + dropdown:Select ("RAID") + _detalhes.report_where = "RAID" + + elseif (GetNumSubgroupMembers() > 0) then + dropdown:Select ("PARTY") + _detalhes.report_where = "PARTY" + + elseif (_IsInGuild()) then + dropdown:Select ("GUILD") + _detalhes.report_where = "GUILD" + + else + dropdown:Select ("SAY") + _detalhes.report_where = "SAY" + end + end + + end) _tinsert (_UISpecialFrames, este_gump:GetName()) este_gump:SetScript ("OnHide", function (self) _detalhes.janela_report.ativa = false + _detalhes.last_report_id = nil end) este_gump:SetWidth (320) diff --git a/gumps/janela_welcome.lua b/gumps/janela_welcome.lua index da39f07b..bac4fb94 100644 --- a/gumps/janela_welcome.lua +++ b/gumps/janela_welcome.lua @@ -19,7 +19,7 @@ function _detalhes:OpenWelcomeWindow () window = CreateFrame ("frame", "DetailsWelcomeWindow", UIParent) window:SetPoint ("center", UIParent, "center", -200, 0) window:SetWidth (512) - window:SetHeight (256) + window:SetHeight (265) window:SetMovable (true) window:SetScript ("OnMouseDown", function() window:StartMoving() end) window:SetScript ("OnMouseUp", function() window:StopMovingOrSizing() end) @@ -56,8 +56,9 @@ function _detalhes:OpenWelcomeWindow () cancel:SetNormalTexture ([[Interface\Buttons\UI-GroupLoot-Pass-Up]]) cancel:SetScript ("OnClick", function() window:Hide() end) local cancelText = cancel:CreateFontString (nil, "overlay", "GameFontNormal") + cancelText:SetTextColor (1, 1, 1) cancelText:SetPoint ("left", cancel, "right", 2, 0) - cancelText:SetText ("Skip") + cancelText:SetText (Loc ["STRING_WELCOME_69"]) local forward = CreateFrame ("button", nil, window) forward:SetWidth (26) @@ -274,7 +275,7 @@ local window_openned_at = time() nickname:SetPoint ("center", avatar_bg, "center", 0, -15) end - local nicknamelabel = g:NewLabel (window, nil, "$parentNickNameLabel", "nicknameLabel", Loc ["STRING_OPTIONS_NICKNAME"] .. ":", "GameFontHighlightLeft") + local nicknamelabel = g:NewLabel (window, nil, "$parentNickNameLabel", "nicknameLabel", Loc ["STRING_OPTIONS_NICKNAME"] .. ":", "GameFontNormal") local nicknamebox = g:NewTextEntry (window, nil, "$parentNicknameEntry", "nicknameEntry", 140, 20, onPressEnter) nicknamebox:HighlightText() @@ -430,7 +431,7 @@ local window_openned_at = time() skins_image:SetTexCoord (0, 0.41796875, 0, 0.259765625) --0, 0, 214 133 --import settings - local import_label = g:NewLabel (window, _, "$parentImportSettingsLabel", "ImportLabel", Loc ["STRING_WELCOME_46"]) + local import_label = g:NewLabel (window, _, "$parentImportSettingsLabel", "ImportLabel", Loc ["STRING_WELCOME_46"] .. ":", "GameFontNormal") import_label:SetPoint ("topleft", window, "topleft", 30, -160) local convert_table = { @@ -520,8 +521,8 @@ local window_openned_at = time() import_dropdown.tooltip = Loc ["STRING_WELCOME_57"] --wallpapaer and skin - local wallpaper_label_switch = g:NewLabel (window, _, "$parentBackgroundLabel", "enablewallpaperLabel", Loc ["STRING_WELCOME_44"]) - wallpaper_label_switch:SetPoint ("topleft", window, "topleft", 30, -180) + local wallpaper_label_switch = g:NewLabel (window, _, "$parentBackgroundLabel", "enablewallpaperLabel", Loc ["STRING_WELCOME_44"] .. ":", "GameFontNormal") + wallpaper_label_switch:SetPoint ("topleft", window, "topleft", 30, -200) --skin local onSelectSkin = function (_, _, skin_name) @@ -541,20 +542,64 @@ local window_openned_at = time() local skin_dropdown = g:NewDropDown (window, _, "$parentSkinDropdown", "skinDropdown", 140, 20, buildSkinMenu, instance1.skin) skin_dropdown.tooltip = Loc ["STRING_WELCOME_58"] - local skin_label = g:NewLabel (window, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"]) + local skin_label = g:NewLabel (window, _, "$parentSkinLabel", "skinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"] .. ":", "GameFontNormal") skin_dropdown:SetPoint ("left", skin_label, "right", 2) skin_label:SetPoint ("topleft", window, "topleft", 30, -140) --skin_dropdown:Select ("WoW Interface") + + --> icon type + local OnSelectIconFile = function (_, _, iconpath) + instance1:SetBarSettings (nil, nil, nil, nil, nil, nil, nil, nil, iconpath) + if (instance1.row_info.use_spec_icons) then + instance1:SetBarSpecIconSettings (false) + end + end + local OnSelectIconFileSpec = function (_, _, iconpath) + instance1:SetBarSpecIconSettings (true, iconpath, true) + end + + local iconsize = {16, 16} + local icontexture = [[Interface\WorldStateFrame\ICONS-CLASSES]] + local iconcoords = {0.25, 0.50, 0, 0.25} + local list = { + {value = [[]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE1"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize, iconcolor = {1, 1, 1, .3}}, + {value = [[Interface\AddOns\Details\images\classes_small]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE2"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\spec_icons_normal]], label = "Specialization", onclick = OnSelectIconFileSpec, icon = [[Interface\AddOns\Details\images\icons]], texcoord = {2/512, 32/512, 480/512, 510/512}, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], label = "Specialization Alpha", onclick = OnSelectIconFileSpec, icon = [[Interface\AddOns\Details\images\icons]], texcoord = {2/512, 32/512, 480/512, 510/512}, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\classes_small_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE3"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\classes_small_alpha]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE4"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\classes_small_alpha_bw]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE6"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + {value = [[Interface\AddOns\Details\images\classes]], label = Loc ["STRING_OPTIONS_BAR_ICONFILE5"], onclick = OnSelectIconFile, icon = icontexture, texcoord = iconcoords, iconsize = iconsize}, + } + local BuiltIconList = function() + return list + end + local default + if (instance1.row_info.use_spec_icons) then + default = instance1.row_info.spec_file + else + default = instance1.row_info.icon_file + end + + local d = g:NewDropDown (window, _, "$parentIconSelectDropdown", "IconSelectDropdown", 140, 20, BuiltIconList, default) + + g:NewLabel (window, _, "$parentIconsAnchor", "rowIconsLabel", Loc ["STRING_OPTIONS_TEXT_ROWICONS_ANCHOR"], "GameFontNormal") + + d:SetPoint ("left", window.rowIconsLabel, "right", 2) + window.rowIconsLabel:SetPoint ("topleft", window, "topleft", 30, -180) + --wallpapper --> agora cria os 2 dropdown da categoria e wallpaper local onSelectSecTexture = function (_, _, texturePath) if (texturePath:find ("TALENTFRAME")) then - instance:InstanceWallpaper (texturePath, nil, nil, {0, 1, 0, 0.703125}) + instance1:InstanceWallpaper (texturePath, nil, nil, {0, 1, 0, 0.703125}, nil, nil, {1, 1, 1, 1}) + elseif (texturePath:find ("EncounterJournal")) then + instance1:InstanceWallpaper (texturePath, nil, nil, {0.06, 0.68, 0.1, 0.57}, nil, nil, {1, 1, 1, 1}) else - instance:InstanceWallpaper (texturePath, nil, nil, {0, 1, 0, 1}) + instance1:InstanceWallpaper (texturePath, nil, nil, {0, 1, 0, 1}, nil, nil, {1, 1, 1, 1}) end end @@ -584,6 +629,39 @@ local window_openned_at = time() {value = [[Interface\ARCHEOLOGY\ArchRare-TyrandesFavoriteDoll]], label = "Tyrandes Favorite Doll", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ArchRare-TyrandesFavoriteDoll]], texcoord = nil}, {value = [[Interface\ARCHEOLOGY\ArchRare-ZinRokhDestroyer]], label = "ZinRokh Destroyer", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ArchRare-ZinRokhDestroyer]], texcoord = nil}, }, + + ["RAIDS"] = { + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-BlackrockCaverns]], label = "Blackrock Caverns", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-BlackrockCaverns]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-BlackrockSpire]], label = "Blackrock Spire", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-BlackrockSpire]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-DragonSoul]], label = "Dragon Soul", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-DragonSoul]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-EndTime]], label = "End Time", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-EndTime]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-Firelands1]], label = "Firelands", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-Firelands1]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-HallsofReflection]], label = "Halls of Reflection", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-HallsofReflection]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-HellfireCitadel]], label = "Hellfire Citadel", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-HellfireCitadel]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-Pandaria]], label = "Pandaria", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-Pandaria]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-RagefireChasm]], label = "Ragefire Chasm", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-RagefireChasm]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-SiegeofOrgrimmar]], label = "Siege of Orgrimmar", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-SiegeofOrgrimmar]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheNexus]], label = "The Nexus", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheNexus]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheOculus]], label = "The Oculus", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheOculus]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheStonecore]], label = "The Stonecore", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-TheStonecore]], texcoord = nil}, + {value = [[Interface\EncounterJournal\UI-EJ-LOREBG-ThunderKingRaid]], label = "Throne of Thunder", onclick = onSelectSecTexture, icon = [[Interface\EncounterJournal\UI-EJ-LOREBG-ThunderKingRaid]], texcoord = nil}, + }, + + ["LOGOS"] = { + {value = [[Interface\Timer\Alliance-Logo]], label = "For the Alliance", onclick = onSelectSecTexture, icon = [[Interface\Timer\Alliance-Logo]], texcoord = nil}, + {value = [[Interface\Timer\Horde-Logo]], label = "For the Horde", onclick = onSelectSecTexture, icon = [[Interface\Timer\Horde-Logo]], texcoord = nil}, + {value = [[Interface\Destiny\EndscreenImage]], label = "Pandaria Logo", onclick = onSelectSecTexture, icon = [[Interface\Destiny\EndscreenImage]], texcoord = nil}, + {value = [[Interface\ARCHEOLOGY\ARCH-RACE-ORC]], label = "Orc Crest", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ARCH-RACE-ORC]], texcoord = nil}, + {value = [[Interface\ARCHEOLOGY\ARCH-RACE-DWARF]], label = "Dwarf Crest", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ARCH-RACE-DWARF]], texcoord = nil}, + {value = [[Interface\ARCHEOLOGY\ARCH-RACE-NIGHTELF]], label = "Night Elf Crest", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ARCH-RACE-NIGHTELF]], texcoord = nil}, + {value = [[Interface\ARCHEOLOGY\Arch-Race-Pandaren]], label = "Padaren Crest", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\Arch-Race-Pandaren]], texcoord = nil}, + {value = [[Interface\ARCHEOLOGY\ARCH-RACE-TROLL]], label = "Troll Crest", onclick = onSelectSecTexture, icon = [[Interface\ARCHEOLOGY\ARCH-RACE-TROLL]], texcoord = nil}, + {value = [[Interface\FlavorImages\BloodElfLogo-small]], label = "Blood Elf Crest", onclick = onSelectSecTexture, icon = [[Interface\FlavorImages\BloodElfLogo-small]], texcoord = nil}, + {value = [[Interface\Glues\COMMON\Glues-Logo]], label = "Wow Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\Glues-Logo]], texcoord = nil}, + {value = [[Interface\Glues\COMMON\GLUES-WOW-BCLOGO]], label = "Burning Cruzade Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\GLUES-WOW-BCLOGO]], texcoord = nil}, + {value = [[Interface\Glues\COMMON\GLUES-WOW-CCLOGO]], label = "Cataclysm Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\GLUES-WOW-CCLOGO]], texcoord = nil}, + {value = [[Interface\Glues\COMMON\Glues-WOW-WoltkLogo]], label = "WotLK Logo", onclick = onSelectSecTexture, icon = [[Interface\Glues\COMMON\Glues-WOW-WoltkLogo]], texcoord = nil}, + }, ["CREDITS"] = { {value = [[Interface\Glues\CREDITS\Arakkoa2]], label = "Arakkoa", onclick = onSelectSecTexture, icon = [[Interface\Glues\CREDITS\Arakkoa2]], texcoord = nil}, @@ -717,8 +795,10 @@ local window_openned_at = time() local backgroundTable = { {value = "ARCHEOLOGY", label = "Archeology", onclick = onSelectMainTexture, icon = [[Interface\ARCHEOLOGY\Arch-Icon-Marker]]}, {value = "CREDITS", label = "Burning Crusade", onclick = onSelectMainTexture, icon = [[Interface\ICONS\TEMP]]}, + {value = "LOGOS", label = "Logos", onclick = onSelectMainTexture, icon = [[Interface\WorldStateFrame\ColumnIcon-FlagCapture0]]}, + {value = "DRESSUP", label = "Race Background", onclick = onSelectMainTexture, icon = [[Interface\ICONS\INV_Chest_Cloth_17]]}, + {value = "RAIDS", label = "Dungeons & Raids", onclick = onSelectMainTexture, icon = [[Interface\COMMON\friendship-FistHuman]]}, {value = "DEATHKNIGHT", label = "Death Knight", onclick = onSelectMainTexture, icon = _detalhes.class_icons_small, texcoord = _detalhes.class_coords ["DEATHKNIGHT"]}, - {value = "DRESSUP", label = "Class Background", onclick = onSelectMainTexture, icon = [[Interface\ICONS\INV_Chest_Cloth_17]]}, {value = "DRUID", label = "Druid", onclick = onSelectMainTexture, icon = _detalhes.class_icons_small, texcoord = _detalhes.class_coords ["DRUID"]}, {value = "HUNTER", label = "Hunter", onclick = onSelectMainTexture, icon = _detalhes.class_icons_small, texcoord = _detalhes.class_coords ["HUNTER"]}, {value = "MAGE", label = "Mage", onclick = onSelectMainTexture, icon = _detalhes.class_icons_small, texcoord = _detalhes.class_coords ["MAGE"]}, @@ -799,7 +879,7 @@ local window_openned_at = time() end end) - pages [#pages+1] = {import_label, import_dropdown, skins_frame_alert, bg55, texto55, texto555, skins_image, changemind, texto_appearance, skin_dropdown, skin_label, wallpaper_label_switch, wallpaper_switch, wallpaper_dropdown1, wallpaper_dropdown2, } + pages [#pages+1] = {import_label, import_dropdown, skins_frame_alert, bg55, texto55, texto555, skins_image, changemind, texto_appearance, skin_dropdown, skin_label, wallpaper_label_switch, wallpaper_switch, wallpaper_dropdown1, wallpaper_dropdown2, window.rowIconsLabel, window.IconSelectDropdown} for _, widget in ipairs (pages[#pages]) do widget:Hide() @@ -928,7 +1008,7 @@ local window_openned_at = time() dance_text:SetPoint ("topleft", window, "topleft", 30, -175) --------------- Update Speed - g:NewLabel (window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_WELCOME_14"] .. ":") + g:NewLabel (window, _, "$parentUpdateSpeedLabel", "updatespeedLabel", Loc ["STRING_WELCOME_14"] .. ":", "GameFontNormal") window.updatespeedLabel:SetPoint (31, -150) -- @@ -963,7 +1043,7 @@ local window_openned_at = time() window.updatespeedSlider.tooltip = Loc ["STRING_WELCOME_15"] --------------- Animate Rows - g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_WELCOME_16"] .. ":") + g:NewLabel (window, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_WELCOME_16"] .. ":", "GameFontNormal") window.animateLabel:SetPoint (31, -170) -- g:NewSwitch (window, _, "$parentAnimateSlider", "animateSlider", 60, 20, _, _, _detalhes.use_row_animations) -- ltext, rtext, defaultv @@ -975,7 +1055,7 @@ local window_openned_at = time() --------------- Fast Hps/Dps Updates --[ - g:NewLabel (window, _, "$parentDpsHpsLabel", "DpsHpsLabel", Loc ["STRING_WELCOME_63"] .. ":") + g:NewLabel (window, _, "$parentDpsHpsLabel", "DpsHpsLabel", Loc ["STRING_WELCOME_63"] .. ":", "GameFontNormal") window.DpsHpsLabel:SetPoint (31, -190) -- g:NewSwitch (window, _, "$parentDpsHpsSlider", "DpsHpsSlider", 60, 20, _, _, _detalhes:GetInstance(1).row_info.fast_ps_update) -- ltext, rtext, defaultv @@ -986,7 +1066,7 @@ local window_openned_at = time() window.DpsHpsSlider.tooltip = Loc ["STRING_WELCOME_64"] --]] --------------- Max Segments - g:NewLabel (window, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_WELCOME_21"] .. ":") + g:NewLabel (window, _, "$parentSliderLabel", "segmentsLabel", Loc ["STRING_WELCOME_21"] .. ":", "GameFontNormal") window.segmentsLabel:SetPoint (31, -210) -- g:NewSlider (window, _, "$parentSlider", "segmentsSlider", 120, 20, 1, 25, 1, _detalhes.segments_amount) -- min, max, step, defaultv @@ -1006,7 +1086,7 @@ local window_openned_at = time() local mech_icon2 = window:CreateTexture (nil, "overlay") mech_icon2:SetTexture ([[Interface\Vehicles\UI-Vehicles-Trim-Alliance]]) - mech_icon2:SetPoint ("topright", window, "topright", -10, -142) + mech_icon2:SetPoint ("topright", window, "topright", -10, -151) mech_icon2:SetWidth (128*1.0) mech_icon2:SetHeight (128*0.6) mech_icon2:SetAlpha (0.6) @@ -1369,6 +1449,8 @@ local window_openned_at = time() end end + _detalhes:GetInstance(1):SetDisplay (0, 1, 1) + local bar1 = _detalhes:GetInstance(1):GetRow(1) frame_alert.alert:SetPoint ("topleft", bar1, "topleft", -60, 8) diff --git a/images/icons.tga b/images/icons.tga index 4a288ac0..bc9f7c45 100644 Binary files a/images/icons.tga and b/images/icons.tga differ diff --git a/images/spec_icons_normal.tga b/images/spec_icons_normal.tga new file mode 100644 index 00000000..4aad4940 Binary files /dev/null and b/images/spec_icons_normal.tga differ diff --git a/images/spec_icons_normal_alpha.tga b/images/spec_icons_normal_alpha.tga new file mode 100644 index 00000000..1e8789d6 Binary files /dev/null and b/images/spec_icons_normal_alpha.tga differ diff --git a/plugins/Details_DmgRank/Details_DmgRank.lua b/plugins/Details_DmgRank/Details_DmgRank.lua index f48cb836..16f979bd 100644 --- a/plugins/Details_DmgRank/Details_DmgRank.lua +++ b/plugins/Details_DmgRank/Details_DmgRank.lua @@ -41,7 +41,7 @@ local function CreatePluginFrames (data) elseif (event == "REFRESH") then --> requested a refresh window DmgRank:Refresh() - elseif (event == "COMBAT_PLAYER_TIMESTARTED") then --> combat started + elseif (event == "COMBAT_PLAYER_ENTER") then --> combat started --print ("recebeu event start") local combat = select (1, ...) DmgRank:Start() @@ -402,53 +402,55 @@ local function CreatePluginFrames (data) --> Exec function local DoDmgRank = function (self, elapsed) - + DmgRank.Time.Elapsed = DmgRank.Time.Elapsed + elapsed update = update + elapsed if (_GetTime() > DmgRank.Time.EndTime) then --> reached the end time if (DmgRank.Time.Working and not DmgRank.Time.Done) then - DmgRank:Cancel() DmgRank:Finish() + else + DmgRank.Time.Working = false + DmgRank.Time.Done = true + DmgRank.Frame:SetScript ("OnUpdate", nil) end else - --> aqui vem as funções que verificam se o jogador esta em grupo ou se tem algum buff proibido + DmgRank.Time.Tick = DmgRank.Time.Tick + elapsed + if (DmgRank.Time.Tick > 1) then DmgRank.Time.Tick = 0 if (not _UFC ("player")) then --> isn't in combat - print (Loc ["STRING_CANCELLED_NOT_COMBAT"]) - DmgRank:Cancel() - elseif (_IsInRaid() or _IsInGroup()) then - print (Loc ["STRING_CANCELLED_IN_GROUP"]) - DmgRank:Cancel() - else - --> check for not allowed buffs: - for i = 1, 41 do - local auraName, _, _, _, _, _, _, _, _, _, spellId = _UnitAura ("player", i) - if (spellId and (spellId == 2825 or spellId == 80353 or spellId == 90355)) then --> bloodlust//timewarp//ancient hysteria - print (Loc ["STRING_CANCELLED_AURA"] .. auraName) - DmgRank:Cancel() - end - end + DmgRank:Finish() end else - if (update > 0.050) then + if (not player) then + player = _detalhes:GetActor() + end + if (player) then local minutos, segundos = _math_floor (DmgRank.Time.Elapsed/60), _math_floor (DmgRank.Time.Elapsed%60) if (segundos < 10) then segundos = "0"..segundos end + local mili = _cstr ("%.2f", DmgRank.Time.Elapsed - _math_floor (DmgRank.Time.Elapsed))*100 if (mili < 10) then mili = "0"..mili end + DmgRank.TimeMinutes:SetText ("0".. minutos .. ":") DmgRank.TimeSeconds:SetText (segundos ..":") DmgRank.TimeMiliSeconds:SetText (mili) + local DamageGoal = DmgRank.TimeGoal [DmgRank.rank.level].damage + if (player.total > DamageGoal) then --> yeah, you didit + DmgRank.MainDamageDisplay:SetTextColor (0.3, 1, 0.1) + else + DmgRank.MainDamageDisplay:SetTextColor (1, 1, 1) + end + DmgRank.MainDamageDisplay:SetText (_detalhes:comma_value (player.total)) - update = 0 end end end @@ -479,22 +481,31 @@ local function CreatePluginFrames (data) --> When the time is gone function DmgRank:Finish() - local DamageGoal = DmgRank.TimeGoal [DmgRank.rank.level].damage --> damage - if (player.total > DamageGoal) then --> yeah, you didit - DmgRank:LevelUpRank() - else - DmgRank:FailedLevelUpRank() + DmgRank.Frame:SetScript ("OnUpdate", nil) + + if (player) then + local DamageGoal = DmgRank.TimeGoal [DmgRank.rank.level].damage --> damage + if (player.total > DamageGoal) then --> yeah, you didit + DmgRank:LevelUpRank() + else + DmgRank:FailedLevelUpRank() + end end + + DmgRank.Time.Working = false + DmgRank.Time.Done = true end --> When a new combat is received by the PlugIn function DmgRank:Start() if (DmgRank.Time and DmgRank.Time.Working) then + DmgRank:Msg ("Plugin already in use.") return end if (not DmgRank.TimeGoal[DmgRank.rank.level].damage) then + DmgRank:Msg ("There is no goal for this level.") return end @@ -506,17 +517,22 @@ local function CreatePluginFrames (data) DmgRank.Time = {} DmgRank.Time.StartTime = _GetTime() - DmgRank.Time.EndTime = DmgRank.Time.StartTime + DmgRank.TimeGoal[DmgRank.rank.level].time - DmgRank.Time.Elapsed = 0 + DmgRank.Time.EndTime = DmgRank.Time.StartTime + DmgRank.TimeGoal [DmgRank.rank.level].time + DmgRank.Time.Elapsed = 3 DmgRank.Time.Done = nil DmgRank.Time.Working = true DmgRank.Time.Tick = 0 player = _detalhes:GetActor() --> param 1 = combat | param 2 = attribute | param 3 = player name update = 0 - DmgRank.Frame:SetScript ("OnUpdate", DoDmgRank) + DmgRank.starting = DmgRank:ScheduleTimer ("StartUpdate", 3) end + function DmgRank:StartUpdate() + player = _detalhes:GetActor() + DmgRank.Frame:SetScript ("OnUpdate", DoDmgRank) + end + end function DmgRank:OnEvent (_, event, ...) @@ -541,12 +557,10 @@ function DmgRank:OnEvent (_, event, ...) CreatePluginFrames() --> Register needed events - _G._detalhes:RegisterEvent (DmgRank, "COMBAT_PLAYER_TIMESTARTED") + _G._detalhes:RegisterEvent (DmgRank, "COMBAT_PLAYER_ENTER") end end - - elseif (event == "PLAYER_LOGOUT") then - _detalhes_databaseDmgRank = DmgRank.rank + end end \ No newline at end of file diff --git a/plugins/Details_TimeAttack/Details_TimeAttack.lua b/plugins/Details_TimeAttack/Details_TimeAttack.lua index 704e26f4..819747d5 100644 --- a/plugins/Details_TimeAttack/Details_TimeAttack.lua +++ b/plugins/Details_TimeAttack/Details_TimeAttack.lua @@ -146,8 +146,13 @@ local function CreatePluginFrames() TimeAmount2:SetPoint ("left", TimeDesc, "right", 4, 0) --> main time/damage/dps texts - local clock = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TIMER", "00:00:00", "GameFontHighlightLarge") - clock:SetPoint ("center", TimeAttackFrame, 0, -20) + local clock = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TIMER", "00:", "GameFontHighlightLarge") + clock:SetPoint ("center", TimeAttackFrame, -25, -20) + local clock2 = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TIMER", "00:", "GameFontHighlightLarge") + clock2:SetPoint ("center", TimeAttackFrame, 0, -20) + local clock3 = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TIMER", "00", "GameFontHighlightLarge") + clock3:SetPoint ("center", TimeAttackFrame, 23, -20) + local damage = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "DAMAGE", "00.000.000", "GameFontHighlightLarge") damage:SetPoint ("center", TimeAttackFrame, 0, -40) local persecond = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "DPS", "000.000", "GameFontHighlightLarge") @@ -776,7 +781,7 @@ local function CreatePluginFrames() --> Cancel function function TimeAttack:Cancel() - if (TimeAttack.Time and TimeAttack.Time.Working) then + if (TimeAttack.Time) then TimeAttack.Time.Working = false TimeAttack.Time.Done = true end @@ -792,6 +797,8 @@ local function CreatePluginFrames() if (TimeAttack.Time.Working and not TimeAttack.Time.Done) then TimeAttack:Cancel() TimeAttack:Finish() + else + TimeAttack:Cancel() end else --> aqui vem as funções que verificam se o jogador esta em grupo ou se tem algum buff proibido @@ -802,28 +809,24 @@ local function CreatePluginFrames() TimeAttack:Cancel() end else - if (update > 0.050) then - --> Update Timer Here - - local minutos, segundos = _math_floor (TimeAttack.Time.Elapsed/60), _math_floor (TimeAttack.Time.Elapsed%60) + local minutos, segundos = _math_floor (TimeAttack.Time.Elapsed/60), _math_floor (TimeAttack.Time.Elapsed%60) - if (segundos < 10) then - segundos = "0"..segundos - end - - local mili = _cstr ("%.2f", TimeAttack.Time.Elapsed-_math_floor (TimeAttack.Time.Elapsed))*100 - if (mili < 10) then - mili = "0"..mili - end - - clock:SetText ("0".. minutos .. ":"..segundos ..":"..mili) - damage:SetText (TimeAttack:comma_value (player.total)) - - if (TimeAttack.Time.Elapsed > 3) then - persecond:SetText (TimeAttack:comma_value (_math_floor (player.total/TimeAttack.Time.Elapsed))) - end - - update = 0 + if (segundos < 10) then + segundos = "0"..segundos + end + + local mili = _cstr ("%.2f", TimeAttack.Time.Elapsed-_math_floor (TimeAttack.Time.Elapsed))*100 + if (mili < 10) then + mili = "0"..mili + end + + clock:SetText ("0".. minutos .. ":") + clock2:SetText (segundos ..":") + clock3:SetText (mili) + damage:SetText (TimeAttack:comma_value (player.total)) + + if (TimeAttack.Time.Elapsed > 3) then + persecond:SetText (TimeAttack:comma_value (_math_floor (player.total/TimeAttack.Time.Elapsed))) end end end @@ -859,7 +862,7 @@ local function CreatePluginFrames() function TimeAttack:Start() if (TimeAttack.Time and TimeAttack.Time.Working) then - return + TimeAttack:Cancel() end TimeAttack.Time = {} diff --git a/plugins/Details_Vanguard/Details_Vanguard.lua b/plugins/Details_Vanguard/Details_Vanguard.lua index f533bae5..470faabf 100644 --- a/plugins/Details_Vanguard/Details_Vanguard.lua +++ b/plugins/Details_Vanguard/Details_Vanguard.lua @@ -1,12 +1,12 @@ local AceLocale = LibStub ("AceLocale-3.0") -local Loc = AceLocale:GetLocale ("Details_Vanguard") +local Loc = AceLocale:GetLocale ("Details") --------------------------------------------------------------------------------------------- + local _GetTime = GetTime --> wow api local local _UFC = UnitAffectingCombat --> wow api local local _IsInRaid = IsInRaid --> wow api local local _IsInGroup = IsInGroup --> wow api local -local _UnitAura = UnitAura --> wow api local local _UnitName = UnitName --> wow api local local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --> wow api local local _UnitHealth = UnitHealth --> wow api local @@ -14,8 +14,11 @@ local _UnitHealthMax = UnitHealthMax --> wow api local local _UnitIsPlayer = UnitIsPlayer --> wow api local local _UnitClass = UnitClass --> wow api local local _UnitDebuff = UnitDebuff --> wow api local -local _UnitGetIncomingHeals = UnitGetIncomingHeals +local UnitGetIncomingHeals = UnitGetIncomingHeals +local _unpack = unpack +local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs --------------------------------------------------------------------------------------------- + local _cstr = string.format --> lua library local local _table_insert = table.insert --> lua library local local _table_remove = table.remove --> lua library local @@ -25,6 +28,7 @@ local _math_floor = math.floor --> lua library local local _math_abs = math.abs --> lua library local local _math_min = math.min --> lua library local local _table_sort = table.sort + --------------------------------------------------------------------------------------------- --> Create plugin Object @@ -34,1267 +38,625 @@ local VanguardFrame = Vanguard.Frame Vanguard:SetPluginDescription ("Show debuffs on each tanks in the raid, also shows incoming heal and damage and the last hits you took.") ---> Create plugin objects, function and widgets + local function CreatePluginFrames (data) - --> catch Details! main object - local _detalhes = _G._detalhes - local DetailsFrameWork = _detalhes.gump - - --> any saved data cames here - Vanguard.data = data or {} + --> localize details functions + Vanguard.GetSpec = Vanguard.GetSpec + Vanguard.class_specs_coords = Vanguard.class_specs_coords - --> main locals - local _combat_object = nil --> demais current combat object - local _track_player_object = nil --> Damage Actor in current damage object - local _track_player_unit = "player" --> current tracking unit - local _track_player_name = _UnitName (_track_player_unit) --> current tracking unit name - local instancia --> instancia object (details window) - local MyName = _UnitName ("player") --> player name - - --> running yes or not - Vanguard.Running = false - - --> window size requirements - Vanguard.MinWidth = 300 - Vanguard.MinHeight = 100 + local framework = Vanguard:GetFramework() --> OnDetailsEvent Parser function Vanguard:OnDetailsEvent (event, ...) if (event == "HIDE") then --> plugin hidded, disabled - VanguardFrame:SetScript ("OnUpdate", nil) VanguardFrame:UnregisterEvent ("ROLE_CHANGED_INFORM") VanguardFrame:UnregisterEvent ("GROUP_ROSTER_UPDATE") VanguardFrame:UnregisterEvent ("PLAYER_TARGET_CHANGED") - Vanguard:Cancel() + Vanguard:CombatEnd() elseif (event == "SHOW") then --> plugin shown, enabled - instancia = Vanguard:GetInstance (Vanguard.instance_id) - - for index, tankframe in _ipairs (Vanguard.TankFrames) do - DetailsFrameWork:RegisterForDetailsMove (tankframe.Frame.frame, instancia) - end - DetailsFrameWork:RegisterForDetailsMove (VanguardFrame ["DamageRowBackground"].frame, instancia) - - Vanguard:OnResize() + Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id) VanguardFrame:RegisterEvent ("ROLE_CHANGED_INFORM") VanguardFrame:RegisterEvent ("GROUP_ROSTER_UPDATE") VanguardFrame:RegisterEvent ("PLAYER_TARGET_CHANGED") Vanguard:ResetBars() - Vanguard:ResetDamage() - Vanguard:ResetDebuffs() + --Vanguard:ResetDebuffs() -- ?? Vanguard:IdentifyTanks() + Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id) + Vanguard.CurrentCombat = _detalhes:GetCombat ("current") + + VanguardFrame:SetFrameStrata (Vanguard.CurrentInstance.baseframe:GetFrameStrata()) + VanguardFrame:SetFrameLevel (Vanguard.CurrentInstance.baseframe:GetFrameLevel()+5) if (Vanguard:IsInCombat()) then - instancia = Vanguard:GetInstance (Vanguard.instance_id) - _combat_object = _detalhes.tabela_vigente - _track_player_object = nil - _track_player_name = nil - Vanguard.Running = true - - VanguardFrame:RegisterEvent ("PLAYER_TARGET_CHANGED") - - Vanguard:Start() + Vanguard:CombatStart() end - - VanguardFrame:SetFrameStrata (instancia.strata) - VanguardFrame:SetFrameLevel (instancia.baseframe:GetFrameLevel()+5) - elseif (event == "REFRESH") then --> requested a refresh window - --> + VanguardFrame:SetPoint ("topleft", Vanguard.CurrentInstance.baseframe, "topleft") + VanguardFrame:SetPoint ("bottomright", Vanguard.CurrentInstance.baseframe, "bottomright") elseif (event == "COMBAT_PLAYER_ENTER") then --> a new combat has been started - --instancia = _detalhes.RaidTables.instancia - instancia = Vanguard:GetInstance (Vanguard.instance_id) - _combat_object = select (1, ...) - _track_player_object = nil - _track_player_name = nil + Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id) + Vanguard.CurrentCombat = select (1, ...) Vanguard.Running = true - VanguardFrame:RegisterEvent ("UNIT_HEALTH") + Vanguard:CombatStart() - Vanguard:Start() - - elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then - Vanguard:OnResize() - - elseif (event == "DETAILS_INSTANCE_STARTSTRETCH") then - VanguardFrame:SetFrameStrata ("TOOLTIP") - VanguardFrame:SetFrameLevel (instancia.baseframe:GetFrameLevel()+1) - - elseif (event == "DETAILS_INSTANCE_ENDSTRETCH") then - local instance = Vanguard:GetInstance (Vanguard.instance_id) - VanguardFrame:SetFrameStrata (instance.strata) - VanguardFrame:SetFrameLevel (instance.baseframe:GetFrameLevel()+5) - Vanguard:OnResize() - elseif (event == "COMBAT_PLAYER_LEAVE") then --> current combat has finished - _combat_object = select (1, ...) - - Vanguard.Running = false - VanguardFrame:SetScript ("OnUpdate", nil) + Vanguard.CurrentCombat = select (1, ...) + Vanguard:CombatEnd() Vanguard:ResetBars() - Vanguard:ResetDamage() - Vanguard:ResetDebuffs() + Vanguard:ResetBlocks() - VanguardFrame:UnregisterEvent ("UNIT_HEALTH") - - for i = 1, 3 do - Vanguard.TankFrames [i].Life (100) + elseif (event == "GROUP_ONLEAVE") then + + if (Vanguard.Running) then + Vanguard:CombatEnd() + Vanguard:ResetBars() + Vanguard:ResetBlocks() end + Vanguard:IdentifyTanks() + + elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then + --Vanguard:OnResize() + elseif (event == "PLUGIN_DISABLED") then elseif (event == "PLUGIN_ENABLED") then end end - - function Vanguard:OnResize() - - local w, h = instancia:GetSize() - VanguardFrame:SetHeight (h) - Vanguard:OnResizeDamageLabels() - Vanguard:OnResizeTankBoxes() - - Vanguard.DamageVsHeal.width = w - 6 - Vanguard.TookVsAvoid.width = w - 6 - - if (h >= 95) then - --> show two bars - Vanguard.DamageVsHeal:Show() - Vanguard.TookVsAvoid:Show() - --> show last hit box - Vanguard.LastHitsBackground:Show() - Vanguard.LastHitsBackground:SetPoint ("topleft", VanguardFrame, 2, -35) - --> show tank boxes - for i = 1, Vanguard.TankFrames.Spots do - Vanguard.TankFrames [i].Frame:SetPoint ("bottomleft", VanguardFrame, 2 + ((i-1)*95), 0) - end - return - end - - if (h < 95 and h >= 60) then - --> hide two bars - Vanguard.DamageVsHeal:Hide() - Vanguard.TookVsAvoid:Hide() - --> move up last hit box - Vanguard.LastHitsBackground:Show() - Vanguard.LastHitsBackground:SetPoint (3, -3) - --> move up the 3 tank boxes - for i = 1, Vanguard.TankFrames.Spots do - Vanguard.TankFrames [i].Frame:SetPoint ("bottomleft", VanguardFrame, 2 + ((i-1)*95), 0) - end - - return - end - - if (h < 60) then - --> hide two bars (hide again due stretch) - Vanguard.DamageVsHeal:Hide() - Vanguard.TookVsAvoid:Hide() - --> hide last hit box - Vanguard.LastHitsBackground:Hide() - --> move up the 3 tank boxes - for i = 1, Vanguard.TankFrames.Spots do - Vanguard.TankFrames [i].Frame:SetPoint ("bottomleft", VanguardFrame, 2 + ((i-1)*95), 0) - end - end - end + -- não vamos mais mostrar o jogador + -- somente barra de inc heal + absorbs + -- somente barra de vida + + -- option tank square size - function Vanguard:HealthChanged (unitId) - if (Vanguard.TankListHash [unitId]) then - Vanguard:UpdateHealth (Vanguard.TankListHash [unitId], unitId) - end - end --> list with tank names - Vanguard.TankList = {} --> indexes - Vanguard.TankListHash = {} --> name hash + Vanguard.TankList = {} --> tanks + Vanguard.TankHashNames = {} --> tanks + Vanguard.TankBlocks = {} --> tank frames --> search for tanks in the raid or party group function Vanguard:IdentifyTanks() table.wipe (Vanguard.TankList) - table.wipe (Vanguard.TankListHash) + table.wipe (Vanguard.TankHashNames) if (IsInRaid()) then - local playerName = _UnitName ("player") - for i = 1, GetNumGroupMembers(), 1 do - local role = _UnitGroupRolesAssigned ("raid"..i) + local role = _UnitGroupRolesAssigned ("raid" .. i) if (role == "TANK") then - local tankName = _UnitName ("raid"..i) - if (tankName == playerName) then - playerName = "SELFISTANK" - end - Vanguard.TankList [#Vanguard.TankList+1] = tankName - Vanguard.TankListHash ["raid"..i] = #Vanguard.TankList - if (#Vanguard.TankList == 5) then - break + local name, realm = UnitName ("raid"..i) + if (realm) then + name = name .. "-" .. realm end + Vanguard.TankList [#Vanguard.TankList+1] = name + Vanguard.TankHashNames [name] = #Vanguard.TankList end end - - if (#Vanguard.TankList < 5 and playerName ~= "SELFISTANK") then - Vanguard.TankList [#Vanguard.TankList+1] = _UnitName ("player") - Vanguard.TankListHash ["player"] = #Vanguard.TankList - end - + elseif (IsInGroup()) then - local playerName = _UnitName ("player") - for i = 1, GetNumGroupMembers()-1, 1 do local role = _UnitGroupRolesAssigned ("party"..i) if (role == "TANK") then - local tankName = _UnitName ("party"..i) - if (tankName == playerName) then - playerName = "SELFISTANK" - end - Vanguard.TankList [#Vanguard.TankList+1] = tankName - Vanguard.TankListHash ["party"..i] = #Vanguard.TankList - if (#Vanguard.TankList == 5) then - break + local name, realm = UnitName ("party"..i) + if (realm) then + name = name .. "-" .. realm end + Vanguard.TankList [#Vanguard.TankList+1] = name + Vanguard.TankHashNames [name] = #Vanguard.TankList end end - if (#Vanguard.TankList < 5 and playerName ~= "SELFISTANK") then - Vanguard.TankList [#Vanguard.TankList+1] = _UnitName ("player") - Vanguard.TankListHash ["player"] =#Vanguard.TankList + local role = _UnitGroupRolesAssigned ("player") + if (role == "TANK") then + local name, realm = UnitName ("player") + if (realm) then + name = name .. "-" .. realm + end + Vanguard.TankList [#Vanguard.TankList+1] = name + Vanguard.TankHashNames [name] = #Vanguard.TankList end else - Vanguard.TankList [#Vanguard.TankList+1] = _UnitName ("player") - Vanguard.TankListHash ["player"] =#Vanguard.TankList + local name, realm = UnitName ("player") + if (realm) then + name = name .. "-" .. realm + end + Vanguard.TankList [#Vanguard.TankList+1] = name + Vanguard.TankHashNames [name] = #Vanguard.TankList end - for index, tankname in _ipairs (Vanguard.TankList) do - Vanguard.TankFrames [index]:SetTank (tankname) - end - - for i = #Vanguard.TankList+1, 5 do - Vanguard.TankFrames [i]:SetTank (nil, i) - end + Vanguard:RefreshTanks() end - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---> Build Frames and Gadgets ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - --> Vanguard frame attributes - --[[ - VanguardFrame:SetBackdrop ({ - bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", - tile = true, tileSize = 16, - insets = {left = 1, right = 1, top = 0, bottom = 1},}) - VanguardFrame:SetBackdropColor (.3, .3, .3, .3) ---]] - - VanguardFrame:SetWidth (300) - VanguardFrame:SetHeight (100) - --------> Build two splits bars for damage vs heal and avoid vs hits -------------------------------------------------------------------------------------------------- - - --> Damage Vs Healing bar - local infoFrame = DetailsFrameWork:NewPanel (VanguardFrame, VanguardFrame, "VanguardInfoFrame", "infoFrame", 300, 100) - infoFrame:SetPoint ("topleft", VanguardFrame, "topleft") - infoFrame:Hide() - infoFrame:SetFrameLevel (VanguardFrame:GetFrameLevel() + 10) - - VanguardFrame.InfoShown = false - - infoFrame:SetBackdrop ("Interface\\DialogFrame\\UI-DialogBox-Background-Dark") - infoFrame:SetBackdropColor ("black") - infoFrame:SetGradient ("OnEnter", "black") - - local c = infoFrame:CreateRightClickLabel() - c:SetPoint ("bottomright", infoFrame, "bottomright", -3, 1) - - --> report button - local reportFunc = function (IsCurrent, IsReverse, AmtLines) - local lines = { Loc ["STRING_REPORT"]..": " .. Loc ["STRING_REPORT_AVOIDANCE"] .. ": " .. MyName, - Loc ["STRING_HITS"] .. ": " .. infoFrame ["hitsReceivedAmount"].text, - Loc ["STRING_DODGE"] .. ": " .. infoFrame ["dodgeAmount"].text, - Loc ["STRING_PARRY"] .. ": " .. infoFrame ["parryAmount"].text, - Loc ["STRING_DAMAGETAKEN"] .. ": " .. infoFrame ["damageTakenAmount"].text, - Loc ["STRING_DTPS"] .. ": " .. infoFrame ["damageTakenSecAmount"].text - } - Vanguard:SendReportLines (lines) + function Vanguard:ResetBars() + for i, tankblock in ipairs (Vanguard.TankBlocks) do + local bar = tankblock.heal_inc + bar:SetSplit (50) + bar:SetLeftText (tankblock.tankname_string) + bar:SetRightText ("") + bar:SetRightColor (.25, 0, 0, 1) + bar:SetLeftColor (0, .25, 0, 1) end - - --[1] fucntion wich will build report lines after click on 'Send Button' [2] enable current button [3] enable reverse button - local ReportButton = DetailsFrameWork:NewButton (infoFrame, nil, "DetailsVanguardAvoidanceReportButton", "ReportButton", 20, 20, function() Vanguard:SendReportWindow (reportFunc) end) - ReportButton.texture = "Interface\\COMMON\\VOICECHAT-ON" - ReportButton:SetPoint ("topright", infoFrame, "topright", -5, -1) - ReportButton.tooltip = Loc ["STRING_REPORT_AVOIDANCE_TOOLTIP"] - - infoFrame:SetHook ("OnMouseUp", function (_, button) - --if (string.lower (button):find ("right")) then - VanguardFrame.InfoShown = false - infoFrame:Hide() - if (infoFrame.refreshTick) then - Vanguard:CancelTimer (infoFrame.refreshTick) - infoFrame.refreshTick = nil - end - --end - end) - - local funcInfo = function (self, button) - if (button == "LeftButton") then - VanguardFrame.InfoShown = true - Vanguard:VanguardRefreshInfoFrame() - local w, h = instancia:GetSize() - infoFrame.width = w - infoFrame.height = h - infoFrame:Show() - infoFrame.refreshTick = Vanguard:ScheduleRepeatingTimer ("VanguardRefreshInfoFrame", 1) - - elseif (button == "RightButton") then - local instance = Vanguard:GetPluginInstance() - if (instance) then - _detalhes.switch:ShowMe (instance) - end - - end - end - - --> Info frame widgets: - local healReceived = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealReceived", nil, Loc ["STRING_HEALRECEIVED"]..":", "GameFontHighlightSmall", 9.5) - healReceived:SetPoint (10, -5) - local healReceivedNumber = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealReceivedAmount", nil, "0", "GameFontHighlightSmall", 9.5) - healReceivedNumber:SetPoint ("left", healReceived, "right", 2) - - local healPerSecond = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealHps", nil, Loc ["STRING_HPS"]..":", "GameFontHighlightSmall", 9.5) - healPerSecond:SetPoint (10, -20) - local healPerSecondNumber = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealHealHpsAmount", nil, "0", "GameFontHighlightSmall", 9.5) - healPerSecondNumber:SetPoint ("left", healPerSecond, "right", 2) - - local icon1 = DetailsFrameWork:NewImage (infoFrame, nil, 14, 14, nil, nil, nil, "VanguardInfoHealTop1Icon") - local topHealer1 = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop1", nil, "", "GameFontHighlightSmall", 9.5) - topHealer1:SetWidth (80) - topHealer1:SetHeight (10) - local topHealer1Amount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop1Amount", nil, "", "GameFontHighlightSmall", 9.5) - icon1:SetPoint (10, -35) - topHealer1:SetPoint ("left", icon1, "right", 2) - topHealer1Amount:SetPoint ("left", topHealer1, "right", 2) - - local icon2 = DetailsFrameWork:NewImage (infoFrame, nil, 14, 14, nil, nil, nil, "VanguardInfoHealTop2Icon") - local topHealer2 = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop2", nil, "", "GameFontHighlightSmall", 9.5) - topHealer2:SetWidth (80) - topHealer2:SetHeight (10) - local topHealer2Amount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop2Amount", nil, "", "GameFontHighlightSmall", 9.5) - icon2:SetPoint (10, -50) - topHealer2:SetPoint ("left", icon2, "right", 2) - topHealer2Amount:SetPoint ("left", topHealer2, "right", 2) - - local icon3 = DetailsFrameWork:NewImage (infoFrame, nil, 14, 14, nil, nil, nil, "VanguardInfoHealTop3Icon") - local topHealer3 = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop3", nil, "", "GameFontHighlightSmall", 9.5) - topHealer3:SetWidth (80) - topHealer3:SetHeight (10) - local topHealer3Amount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop3Amount", nil, "", "GameFontHighlightSmall", 9.5) - icon3:SetPoint (10, -64) - topHealer3:SetPoint ("left", icon3, "right", 2) - topHealer3Amount:SetPoint ("left", topHealer3, "right", 2) - - local icon4 = DetailsFrameWork:NewImage (infoFrame, nil, 14, 14, nil, nil, nil, "VanguardInfoHealTop4Icon") - local topHealer4 = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop4", nil, "", "GameFontHighlightSmall", 9.5) - topHealer4:SetWidth (80) - topHealer4:SetHeight (10) - local topHealer4Amount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHealTop4Amount", nil, "", "GameFontHighlightSmall", 9.5) - icon4:SetPoint (10, -80) - topHealer4:SetPoint ("left", icon4, "right", 2) - topHealer4Amount:SetPoint ("left", topHealer4, "right", 2) - - local iconTable = {icon1, icon2, icon3, icon4} - local healerTable = {topHealer1, topHealer2, topHealer3, topHealer4} - local healerAmountTable = {topHealer1Amount, topHealer2Amount, topHealer3Amount, topHealer4Amount} - - local hitsReceived = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHitsReceived", nil, Loc ["STRING_HITS"], "GameFontHighlightSmall", 9.5) - hitsReceived:SetPoint (150, -5) - local hitsReceivedAmount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoHitsReceivedAmount", "hitsReceivedAmount", "0", "GameFontHighlightSmall", 9.5) - hitsReceivedAmount:SetPoint ("left", hitsReceived, "right", 2) - - local dodge = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDodge", nil, Loc ["STRING_DODGE"], "GameFontHighlightSmall", 9.5) - dodge:SetPoint (150, -20) - local dodgeAmount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDodgeAmount", "dodgeAmount", "0", "GameFontHighlightSmall", 9.5) - dodgeAmount:SetPoint ("left", dodge, "right", 2) - - local parry = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoParry", nil, Loc ["STRING_PARRY"], "GameFontHighlightSmall", 9.5) - parry:SetPoint (150, -35) - local parryAmount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoParryAmount", "parryAmount", "0", "GameFontHighlightSmall", 9.5) - parryAmount:SetPoint ("left", parry, "right", 2) - - local damageTaken = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDamageTaken", nil, Loc ["STRING_DAMAGETAKEN"], "GameFontHighlightSmall", 9.5) - damageTaken:SetPoint (150, -50) - local damageTakenAmount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDamageTakenAmount", "damageTakenAmount", "0", "GameFontHighlightSmall", 9.5) - damageTakenAmount:SetPoint ("left", damageTaken, "right", 2) - - local damageTakenSec = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDamageSec", nil, Loc ["STRING_DTPS"], "GameFontHighlightSmall", 9.5) - damageTakenSec:SetPoint (150, -65) - local damageTakenSecAmount = DetailsFrameWork:NewLabel (infoFrame, nil, "VanguardInfoDamageTakenSecAmount", "damageTakenSecAmount", "0", "GameFontHighlightSmall", 9.5) - damageTakenSecAmount:SetPoint ("left", damageTakenSec, "right", 2) - ---------- - --> need to be a member of _detalhes bacause we want to use a schedule timer - --> once a member of _detalhes we can call through plugin object like Vanguard:VanguardRefreshInfoFrame() - _detalhes.VanguardRefreshInfoFrame = function() - - --> data mine - - --> Get heal actor - local actorHeal = Vanguard:GetActor ("current", DETAILS_ATTRIBUTE_HEAL, _track_player_name) --> [1] combat [2] attribute [3] name - local combat = Vanguard:GetCombat ("current") - - if (actorHeal) then - --> members can be found at details/classes/classe_heal line 75 - healReceivedNumber.text = Vanguard:ToK (actorHeal.healing_taken or 0) - healPerSecondNumber.text = Vanguard:ToK (actorHeal.healing_taken / combat:GetCombatTime()) - - local heal_from = actorHeal.healing_from --> table with [name] = true - local myReceivedHeal = {} - - for actorName, _ in pairs (heal_from) do - local thisActor = Vanguard:GetActor ("current", DETAILS_ATTRIBUTE_HEAL, actorName) - local targets = thisActor.targets --> targets is a container with target classes - local amount = targets [_track_player_name] or 0 - myReceivedHeal [#myReceivedHeal+1] = {actorName, amount} - end - - _table_sort (myReceivedHeal, Vanguard.Sort2) --> Sort2 sort by second index - - for i = 1, 4 do - if (myReceivedHeal[i]) then - healerTable [i].text = myReceivedHeal[i][1]..":" - healerAmountTable[i].text = Vanguard:ToK (myReceivedHeal[i][2] or 0) - iconTable [i].texture = Vanguard.class_icons_small - - local _, L, R, T, B = Vanguard:GetClass (myReceivedHeal[i][1]) - if (L) then - iconTable [i]:SetTexCoord (L, R, T, B) - end - else - iconTable [i].texture = nil - healerTable [i].text = "-- -- --" - healerAmountTable[i].text = "" - end - end - else - --> reset - healReceivedNumber.text = "0" - healPerSecondNumber.text = "0" - for i = 1, 4 do - iconTable [i].texture = nil - healerTable [i].text = "-- -- --" - healerAmountTable[i].text = "" - end - end - - --> Get damage actor - local actorDamage = Vanguard:GetActor ("current", DETAILS_ATTRIBUTE_DAMAGE, _track_player_name) --> [1] combat [2] attribute [3] name - if (actorDamage and actorDamage.avoidance) then - --> members can be found at details/classes/classe_damage line 75 - local avoidance = actorDamage.avoidance --> table with DODGE, PARRY, HITS members - - local totalAvoid = avoidance.overall.DODGE + avoidance.overall.PARRY - local totalOver = totalAvoid + avoidance.overall.HITS - - if (totalOver > 0) then - hitsReceivedAmount.text = avoidance.overall.HITS .. " (" .. _math_floor (avoidance.overall.HITS / totalOver * 100) .. "%)" - dodgeAmount.text = avoidance.overall.DODGE .. " (" .. _math_floor (avoidance.overall.DODGE / totalOver * 100) .. "%)" - parryAmount.text = avoidance.overall.PARRY .. " (" .. _math_floor (avoidance.overall.PARRY / totalOver * 100) .. "%)" - else - hitsReceivedAmount.text = "0 (0%)" - dodgeAmount.text = "0 (0%)" - parryAmount.text = "0 (0%)" - end - - damageTakenAmount.text = Vanguard:ToK (actorDamage.damage_taken) - damageTakenSecAmount.text = Vanguard:ToK (actorDamage.damage_taken / combat:GetCombatTime()) - else - hitsReceivedAmount.text = "0" - dodgeAmount.text = "0" - parryAmount.text = "0" - damageTakenAmount.text = "0" - damageTakenSecAmount.text = "0" - end - - end - - local DamageVsHeal = DetailsFrameWork:NewSplitBar (VanguardFrame, VanguardFrame, "VanguardDamageVsHealBar", "DamageVsHealBar", 294, 14) - - DamageVsHeal:SetPoint (3, -3) - - DamageVsHeal.fontsize = 10 - DamageVsHeal.lefticon = "Interface\\ICONS\\misc_arrowright" - DamageVsHeal.righticon = "Interface\\ICONS\\misc_arrowleft" - DamageVsHeal.tooltip = Loc ["STRING_HEALVSDAMAGETOOLTIP"] - DamageVsHeal:SetHook ("OnMouseUp", funcInfo) - - DamageVsHeal.iconleft:SetVertexColor (.5, 1, .5, 1) - DamageVsHeal.iconright:SetVertexColor (1, .5, .5, 1) - - Vanguard.DamageVsHeal = DamageVsHeal - - --> Hits vs Avoidance bar - local TookVsAvoid = DetailsFrameWork:NewSplitBar (VanguardFrame, VanguardFrame, "VanguardTookVsAvoidBar", "TookVsAvoidBar", 294, 14) - TookVsAvoid:SetPoint ("topleft", VanguardFrame, 3, -18) - TookVsAvoid.lefticon = "Interface\\TIMEMANAGER\\RWButton" - TookVsAvoid.righticon = "Interface\\TIMEMANAGER\\FFButton" - TookVsAvoid.tooltip = Loc ["STRING_AVOIDVSHITSTOOLTIP"] - TookVsAvoid:SetHook ("OnMouseUp", funcInfo) - - TookVsAvoid.iconleft:SetWidth (18) - TookVsAvoid.iconleft:SetHeight (18) - TookVsAvoid.iconleft:SetPoint ("left", VanguardTookVsAvoidBar, "left", -2, 0) - TookVsAvoid.iconright:SetWidth (18) - TookVsAvoid.iconright:SetHeight (18) - TookVsAvoid.iconright:SetPoint ("right", VanguardTookVsAvoidBar, "right", 3, 0) - - Vanguard.TookVsAvoid = TookVsAvoid - - --> Reset both splits bars - function Vanguard:ResetBars() - - TookVsAvoid:SetSplit (50) - TookVsAvoid:SetLeftText ("Avoid") --> localize-me - TookVsAvoid:SetRightText ("Hits") --> localize-me - TookVsAvoid:SetRightColor (.25, 0, 0, 1) --> .1, .5, .5, 1 cor boa pr pet - TookVsAvoid:SetLeftColor (0, .25, 0, 1) - - DamageVsHeal:SetSplit (50) - DamageVsHeal:SetLeftText ("Inc Heal") --> localize-me - DamageVsHeal:SetRightText ("Inc Damage") --> localize-me - DamageVsHeal:SetLeftColor (.1, .9, .1, 1) - DamageVsHeal:SetRightColor (.9, .1, .1, 1) - end - ----------> build damage text entries --------------------------------------------------------------------------------------------------------------------------------------------------------- - - --> entry functions - Vanguard.DamageLabels = {} - Vanguard.DamageLabels.Spots = 6 - - function Vanguard:InsertDamage (damage, index, hp) - Vanguard.DamageLabels [index]:SetText (_detalhes:ToK (damage)) - local percent = damage / hp - local abs = _math_abs (percent-1) - Vanguard.DamageLabels [index]:SetTextColor (1, abs, abs, 1) - end - - function Vanguard:ResetDamage() - for i = 1, Vanguard.DamageLabels.Spots do - Vanguard.DamageLabels [i]:SetText ("0.0k") - Vanguard.DamageLabels [i]:SetTextColor (1, 1, 1, 1) - Vanguard.DamageLabels [i]:Show() - end - for i = Vanguard.DamageLabels.Spots + 1, #Vanguard.DamageLabels do - Vanguard.DamageLabels [i]:Hide() - end - end - - --> bg frame - local LastHitsBackground = DetailsFrameWork:NewPanel (VanguardFrame, _, "DetailsVanguardRowBackground", "DamageRowBackground", 296, 20) - LastHitsBackground:SetPoint ("topleft", VanguardFrame, 2, -35) - LastHitsBackground.tooltip = Loc ["STRING_DAMAGESCROLL"] - Vanguard.LastHitsBackground = LastHitsBackground - - --> labels - - for i = 1, Vanguard.DamageLabels.Spots do - local ThisLabel = DetailsFrameWork:NewLabel (LastHitsBackground, Vanguard, nil, "DamageLabel"..i, "0.0k", "GameFontHighlightSmall", 11, {1, 1, 1, 1}) - Vanguard.DamageLabels [i] = ThisLabel - ThisLabel:SetPoint ("left", LastHitsBackground.frame, 9 + ((i-1)*50), 0) - end - - function Vanguard:OnResizeDamageLabels() - local w, h = instancia:GetSize() - LastHitsBackground.width = w - 6 - - local amt = math.floor (w / 50) - - if (amt > Vanguard.DamageLabels.Spots) then - for i = Vanguard.DamageLabels.Spots + 1, amt do - local ThisLabel = DetailsFrameWork:NewLabel (LastHitsBackground, Vanguard, nil, "DamageLabel"..i, "0.0k", "GameFontHighlightSmall", 11, {1, 1, 1, 1}) - Vanguard.DamageLabels [i] = ThisLabel - ThisLabel:SetPoint ("left", LastHitsBackground.frame, 9 + ((i-1)*50), 0) - end - end - - Vanguard.DamageLabels.Spots = amt - Vanguard:ResetDamage() - end - - ----------> build 3 tanks debuff frames ------------------------------------------------------------------------------------------------------------------------------------------------------- - - local tankframemeta = {} - tankframemeta.__index = tankframemeta - - - - --> update tank information - function tankframemeta:SetTank (name, index) - if (not name) then - self.name = nil - self.TankName:SetText ("Tank "..index) - self.Frame:SetBackdropBorderColor (.5, .5, .5, 1) - - else - self.name = name - self.TankName:SetText (name) - - -- GetClass return [1] unlocalized class [2-5] TexCoords [6-8] RGB colors - local class, L, R, T, B, Red, Green, Blue = Vanguard:GetClass (name) - if (class) then - local color = RAID_CLASS_COLORS [class] - self.Frame:SetBackdropBorderColor (Red, Green, Blue, 1) - self.Frame:SetBackdropColor (Red, Green, Blue, 1) - self.Frame.tanknamebg:SetVertexColor (Red, Green, Blue, .8) - end - end - - self:Disable() - end - - --> refresh debuff information - function tankframemeta:Update (index, icon, expire, count, name) - - if (not icon) then - self ["Icon"..index]:SetTexture (nil) - self ["Icon"..index.."DurationText"]:SetText ("") - self ["Icon"..index.."StackText"]:SetText ("") - self ["BlackBG"..index]:Hide() - self ["Icon"..index.."Frame"].tooltip = nil - - local debuffName = self.DebuffsName [index] - self.DebuffsName [index] = nil - self.DebuffsIndex [debuffName] = nil - self.FreeSpots [index] = true - self.InUse = self.InUse - 1 - return - end - - self ["Icon"..index]:SetTexture (icon) - local minutos, segundos = _math_floor (expire/60), _math_floor (expire%60) - if (minutos > 0) then - self ["Icon"..index.."DurationText"]:SetText (minutos..":"..segundos) - Vanguard:SetFontSize (self ["Icon"..index.."DurationText"], 10) - self ["Icon"..index.."Frame"].tooltip = Loc ["STRING_DEBUFF"] .. ": " .. name .. "\n" .. Loc ["STRING_DURATION"] .. ":" .. minutos..":"..segundos - else - self ["Icon"..index.."DurationText"]:SetText (_math_floor (expire)) - Vanguard:SetFontSize (self ["Icon"..index.."DurationText"], 18) - self ["Icon"..index.."Frame"].tooltip = Loc ["STRING_DEBUFF"] .. ": " .. name .. "\n" .. Loc ["STRING_DURATION"] .. ":" .. _math_floor (expire) - end - self ["Icon"..index.."StackText"]:SetText (count) - self ["BlackBG"..index]:Show() - end - - --> clear all texts and icons - function tankframemeta:Disable() - self.Icon1:SetTexture (nil) - self.Icon1DurationText:SetText ("") - self.Icon1StackText:SetText ("") - self.Icon1Frame.tooltip = nil - self.BlackBG1:Hide() - - self.Icon2:SetTexture (nil) - self.Icon2DurationText:SetText ("") - self.Icon2StackText:SetText ("") - self.Icon2Frame.tooltip = nil - self.BlackBG2:Hide() - - self.Icon3:SetTexture (nil) - self.Icon3DurationText:SetText ("") - self.Icon3StackText:SetText ("") - self.Icon3Frame.tooltip = nil - self.BlackBG3:Hide() - - table.wipe (self.DebuffsName) - table.wipe (self.DebuffsIndex) - for i = 1, 3 do - self.FreeSpots [i] = true - end - self.InUse = 0 - end - - function Vanguard:ResetDebuffs() - for _, TankFrame in _ipairs (Vanguard.TankFrames) do - TankFrame:Disable() - end - end - - function Vanguard:UpdateHealth (index, unit) - local percent = _UnitHealth (unit) / _UnitHealthMax (unit) * 100 - Vanguard.TankFrames [index].Life (percent) - end - - --> build the boxes - Vanguard.TankFrames = {} - Vanguard.TankFrames.Spots = 5 - - local iconMouseOver = function (iconFrame) - iconFrame.icon:SetBlendMode ("ADD") - local OnEnterColors = iconFrame.parent.Gradient.OnEnter - local _r, _g, _b, _a = iconFrame.parent:GetBackdropColor() - DetailsFrameWork:GradientEffect (iconFrame.parent, "frame", _r, _g, _b, _a, OnEnterColors[1], OnEnterColors[2], OnEnterColors[3], OnEnterColors[4], .3) - end - local iconMouseOut = function (iconFrame) - iconFrame.icon:SetBlendMode ("BLEND") - local _r, _g, _b, _a = iconFrame.parent:GetBackdropColor() - if (_r) then - local OnLeaveColors = iconFrame.parent.Gradient.OnLeave - DetailsFrameWork:GradientEffect (iconFrame.parent, "frame", _r, _g, _b, _a, OnLeaveColors[1], OnLeaveColors[2], OnLeaveColors[3], OnLeaveColors[4], .3) - end - end - - for i = 1, Vanguard.TankFrames.Spots do - - local ThisBoxObject = {} - setmetatable (ThisBoxObject, tankframemeta) - - ThisBoxObject.DebuffsIndex = {} - ThisBoxObject.DebuffsName = {} - ThisBoxObject.FreeSpots = {true, true, true} - ThisBoxObject.InUse = 0 - - local Frame = DetailsFrameWork:NewPanel (VanguardFrame, nil, "DetailsVanguardFrameBox"..i, _, 95, 40) - Frame:SetPoint ("bottomleft", VanguardFrame, 2 + ((i-1)*95), 0) - Frame.color = {.1, .1, .1, 1} - ThisBoxObject.Frame = Frame - - local life = DetailsFrameWork:NewBar (Frame, Frame, "DetailsVanguardFrameBox"..i.."Life", nil, 91, 36, 100) - life:SetPoint (Frame, 2, -2) - life:SetFrameLevel (-1, Frame) - ThisBoxObject.Life = life - - local tanknameTexture = DetailsFrameWork:NewImage (Frame, "Interface\\ACHIEVEMENTFRAME\\UI-Achievement-Parchment-Highlight", 80, 10, nil, nil, "tanknamebg", "DetailsVanguardTankName"..i.."bG" ) - - tanknameTexture:SetTexCoord (0.15234375, 0.82421875, 0, 0.2734375) - tanknameTexture:SetPoint ("center", Frame) - tanknameTexture:SetPoint ("top", Frame, "top", 0, -3) - - - local tankname = DetailsFrameWork:NewLabel (Frame, Vanguard, nil, "DetailsVanguardTankName"..i, "Tank "..i, "GameFontHighlightSmall", 10, {1, 1, 1, 1}) - tankname:SetPoint ("center", Frame) - tankname:SetPoint ("top", Frame, "top", 0, -2) - ThisBoxObject.TankName = tankname - - ------------------------------------------------------------------------------------- - - local Icon1 = DetailsFrameWork:NewImage (Frame, "Interface\\ICONS\\Ability_Creature_Amber_02", 24, 24, nil, nil, nil, "DetailsVanguardFrameBox"..i.."Icon1") - Icon1:SetDrawLayer ("overlay", 1) - Icon1:SetPoint ("bottomleft", ThisBoxObject.Frame.frame, 4, 3) - - local frameIcon1 = DetailsFrameWork:NewPanel (Frame, VanguardFrame, "DetailsVanguardFrameBox"..i.."IconBG1", nil, 24, 24, false) - frameIcon1:SetPoint (Icon1) - frameIcon1.widget.icon = Icon1 - frameIcon1.widget.parent = Frame.widget - frameIcon1:SetHook ("OnEnter", iconMouseOver) - frameIcon1:SetHook ("OnLeave", iconMouseOut) - - local Icon1Text = DetailsFrameWork:NewLabel (ThisBoxObject.Frame.frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text1", nil, "25", "GameFontHighlightLarge", 18, {1, 1, 0, 1}) - Icon1Text:SetPoint ("center", Icon1, "center") - - local blackbg1 = DetailsFrameWork:NewImage (Frame, nil, 12, 12, nil, nil, nil, "DetailsVanguardFrameBox"..i.."BlackBG1") - blackbg1:SetDrawLayer ("overlay", 2) - blackbg1:SetTexture (0, 0, 0, 1) - blackbg1:SetPoint ("bottomright", Icon1, 5, -5) - - local Icon1Text2 = DetailsFrameWork:NewLabel (Frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text21", nil, "1", "GameFontHighlightSmall", 13, {1, 1, 1, 1}) - Icon1Text2:SetPoint ("center", blackbg1, "center") - - ThisBoxObject.Icon1 = Icon1 - ThisBoxObject.Icon1Frame = frameIcon1 - ThisBoxObject.Icon1DurationText = Icon1Text - ThisBoxObject.Icon1StackText = Icon1Text2 - ThisBoxObject.BlackBG1 = blackbg1 - - ------------------------------------------------------------------------------------- - - local Icon2 = DetailsFrameWork:NewImage (Frame, "Interface\\ICONS\\Ability_Creature_Amber_02", 24, 24, nil, nil, nil, "DetailsVanguardFrameBox"..i.."Icon2") - Icon2:SetDrawLayer ("overlay", 1) - Icon2:SetPoint ("bottomleft", Frame, 37, 3) - - local frameIcon2 = DetailsFrameWork:NewPanel (Frame, VanguardFrame, "DetailsVanguardFrameBox"..i.."IconBG2", nil, 24, 24, false) - frameIcon2:SetPoint (Icon2) - frameIcon2.widget.icon = Icon2 - frameIcon2.widget.parent = Frame.widget - frameIcon2:SetHook ("OnEnter", iconMouseOver) - frameIcon2:SetHook ("OnLeave", iconMouseOut) - - local Icon2Text = DetailsFrameWork:NewLabel (Frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text2", nil, "3", "GameFontHighlightLarge", 18, {1, 1, 0, 1}) - Icon2Text:SetPoint ("center", Icon2, "center") - - local blackbg2 = DetailsFrameWork:NewImage (Frame, nil, 12, 12, nil, nil, nil, "DetailsVanguardFrameBox"..i.."BlackBG2") - blackbg2:SetDrawLayer ("overlay", 2) - blackbg2:SetTexture (0, 0, 0, 1) - blackbg2:SetPoint ("bottomright", Icon2, 5, -5) - - local Icon2Text2 = DetailsFrameWork:NewLabel (Frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text22", nil, "2", "GameFontHighlightSmall", 13, {1, 1, 1, 1}) - Icon2Text2:SetPoint ("center", blackbg2, "center") - - ThisBoxObject.Icon2 = Icon2 - ThisBoxObject.Icon2Frame = frameIcon2 - ThisBoxObject.Icon2DurationText = Icon2Text - ThisBoxObject.Icon2StackText = Icon2Text2 - ThisBoxObject.BlackBG2 = blackbg2 - - ------------------------------------------------------------------------------------- - - local Icon3 = DetailsFrameWork:NewImage (Frame, "Interface\\ICONS\\Ability_Creature_Amber_02", 24, 24, nil, nil, nil, "DetailsVanguardFrameBox"..i.."Icon3") - Icon3:SetDrawLayer ("overlay", 1) - Icon3:SetPoint ("bottomleft", ThisBoxObject.Frame.frame, 70, 3) - - local frameIcon3 = DetailsFrameWork:NewPanel (Frame, VanguardFrame, "DetailsVanguardFrameBox"..i.."IconBG3", nil, 24, 24, false) - frameIcon3:SetPoint (Icon3) - frameIcon3.widget.icon = Icon3 - frameIcon3.widget.parent = Frame.widget - frameIcon3:SetHook ("OnEnter", iconMouseOver) - frameIcon3:SetHook ("OnLeave", iconMouseOut) - - local Icon3Text = DetailsFrameWork:NewLabel (ThisBoxObject.Frame.frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text3", nil, "5", "GameFontHighlightLarge", 18, {1, 1, 0, 1}) - Icon3Text:SetPoint ("center", Icon3, "center") - - local blackbg3 = DetailsFrameWork:NewImage (Frame, nil, 12, 12, nil, nil, nil, "DetailsVanguardFrameBox"..i.."BlackBG3") - blackbg3:SetDrawLayer ("overlay", 2) - blackbg3:SetTexture (0, 0, 0, 1) - blackbg3:SetPoint ("bottomright", Icon3, 5, -5) - - local Icon3Text2 = DetailsFrameWork:NewLabel (Frame, Vanguard, "DetailsVanguardFrameBox"..i.."Text23", nil, "3", "GameFontHighlightSmall", 13, {1, 1, 1, 1}) - Icon3Text2:SetPoint ("center", blackbg2, "center") - - ThisBoxObject.Icon3 = Icon3 - ThisBoxObject.Icon3Frame = frameIcon3 - ThisBoxObject.Icon3DurationText = Icon3Text - ThisBoxObject.Icon3StackText = Icon3Text2 - ThisBoxObject.BlackBG3 = blackbg3 - - Vanguard.TankFrames [#Vanguard.TankFrames+1] = ThisBoxObject - - blackbg1:Hide() - blackbg2:Hide() - blackbg3:Hide() - end - - function Vanguard:OnResizeTankBoxes() - local w, h = instancia:GetSize() - local amt = math.floor (w / 95) - - for i = 1, amt do - Vanguard.TankFrames [i].Frame:Show() - end - - for i = amt+1, #Vanguard.TankFrames do - Vanguard.TankFrames [i].Frame:Hide() - end - - Vanguard.TankFrames.Spots = amt - - end - --------> Core function -------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - --> cancel function - function Vanguard:Cancel() - VanguardFrame:SetScript ("OnUpdate", nil) - return true end - --> when target change, need to verify if the new target is a player, if true, cancel everething and restart - function Vanguard:TargetChanged() - - local NewTarget = _UnitName ("target") - if (NewTarget and _UnitIsPlayer ("target")) then - if (VanguardFrame.InfoShown and not Vanguard.Running) then - _track_player_name = NewTarget - Vanguard:VanguardRefreshInfoFrame() - return + function Vanguard:ResetBlocks() + for i, tblock in ipairs (Vanguard.TankBlocks) do + tblock.statusbar:SetValue (100) + tblock.debuffs_using = 0 + tblock.debuffs_next_index = 1 + + for i = 1, 3 do + local dblock = tblock.debuffs_blocks [i] + dblock.texture:SetTexture (nil) + dblock.stack:SetText ("") + dblock.stack_bg:Hide() + dblock:SetCooldown (0, 0, 0, 0) + dblock.in_use = nil + dblock.support.spellid = nil end + end + end + + local SetTank = function (self, index) + local name = Vanguard.TankList [index] + self.tankname:SetText (Vanguard:GetOnlyName (name)) + self.tankname_string = name - Vanguard:Cancel() - Vanguard:Start() + local bar = self.heal_inc + bar.tankname = name + + local class, left, right, top, bottom, r, g, b = Vanguard:GetClass (name) + + local spec = Vanguard:GetSpec (name) + + if (spec) then + self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.spec_file) + self.specicon:SetTexCoord (_unpack (Vanguard.class_specs_coords [spec])) else - _track_player_name = UnitName ("player") + self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.icon_file) + self.specicon:SetTexCoord (left, right, top, bottom) + end + + self.texture:SetVertexColor (r, g, b) + + bar.lefticon = Vanguard.CurrentInstance.row_info.icon_file + bar.iconleft:SetTexCoord (left, right, top, bottom) + bar:SetLeftText (Vanguard:GetOnlyName (name)) + bar:SetLeftText (name) + + end + + local debuff_on_enter = function (self) + if (self.spellid) then + GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT") + GameTooltip:SetSpellByID (self.spellid) + GameTooltip:Show() + end + end + local debuff_on_leave = function (self) + if (self.spellid) then + GameTooltip:Hide() + end + end + + function Vanguard:CreateTankBlock (index) + --frame + local f = CreateFrame ("button", "VanguardTankBlock" .. index, VanguardFrame) + f.SetTank = SetTank + f:SetSize (150, 50) + f:SetPoint ("bottomleft", VanguardFrame, "bottomleft", 5 + ((index-1) * 155), 5) + f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10}) + + --statusbar + f.statusbar = CreateFrame ("statusbar", nil, f) + f.statusbar:SetPoint ("topleft", f, "topleft", 5, -5) + f.statusbar:SetPoint ("bottomright", f, "bottomright", -5, 5) + f.texture = f.statusbar:CreateTexture (nil, "artwork") + f.statusbar:SetStatusBarTexture (f.texture) + f.statusbar:SetMinMaxValues (0, 100) + f.statusbar:SetValue (100) + + f.texture:SetTexture ([[Interface\AddOns\Details\images\bar_serenity]]) + + --spec icon + f.specicon = f.statusbar:CreateTexture (nil, "overlay") + f.specicon:SetPoint ("topleft", f, "topleft", 5, -5) + f.specicon:SetSize (14, 14) + + --tank name + f.tankname = f.statusbar:CreateFontString (nil, "overlay", "GameFontNormal") + f.tankname:SetPoint ("left", f.specicon, "right", 2, 0) + + --debuff icons + f.debufficons = {} + + --inc heals inc damage + f.heal_inc = framework:NewSplitBar (VanguardFrame, VanguardFrame, "VanguardDamageVsHeal" .. index, "DamageVsHeal" .. index, 294, 14) + f.heal_inc:SetPoint ("topleft", VanguardFrame, "topleft", 3, -3 + ((index - 1) * -16)) + f.heal_inc:SetPoint ("topright", VanguardFrame, "topright", -3, -3 + ((index - 1) * -16)) + + f.heal_inc.fontsize = 10 + f.heal_inc.righticon = "Interface\\ICONS\\misc_arrowleft" + f.heal_inc.iconright:SetVertexColor (1, .5, .5, 1) + + --debuffs blocks + f.debuffs_blocks = {} + f.debuffs_using = 0 + f.debuffs_next_index = 1 + for i = 1, 3 do + local support_frame = CreateFrame ("frame", nil, f) + support_frame:SetFrameLevel (f:GetFrameLevel()+1) + support_frame:SetSize (24, 24) + support_frame:SetPoint ("bottomleft", f, "bottomleft", 5 + ((i-1) * 35), 5) + support_frame:SetScript ("OnEnter", debuff_on_enter) + support_frame:SetScript ("OnLeave", debuff_on_leave) + local texture = support_frame:CreateTexture (nil, "overlay") + texture:SetSize (24, 24) + texture:SetPoint ("bottomleft", f, "bottomleft", 5 + ((i-1) * 35), 5) + + local dblock = CreateFrame ("cooldown", "VanguardTankBlock" .. index.. "Cooldown" .. i, support_frame, "CooldownFrameTemplate") + dblock:SetPoint ("topleft", texture, "topleft") + dblock:SetPoint ("bottomright", texture, "bottomright") + dblock.texture = texture + + local stack = dblock:CreateFontString (nil, "overlay", "GameFontNormal") + stack:SetPoint ("bottomright", dblock, "bottomright", 8, 0) + local stack_bg = dblock:CreateTexture (nil, "artwork") + stack_bg:SetTexture (0, 0, 0) + stack_bg:SetPoint ("bottomright", dblock, "bottomright", 8, 0) + stack_bg:SetSize (12, 12) + + dblock.stack = stack + dblock.stack_bg = stack_bg + dblock.support = support_frame + + f.debuffs_blocks [i] = dblock + end + + Vanguard.TankBlocks [index] = f + return f + end + + function Vanguard:RefreshTanks() + + for i = 1, #Vanguard.TankList do + local block = Vanguard.TankBlocks [i] + if (not block) then + block = Vanguard:CreateTankBlock (i) + end + + block:SetTank (i) + end + + if (Vanguard.Running) then + Vanguard:CombatEnd() + Vanguard:CombatStart() end end - --> inject into details a delayed function for vanguard - function _detalhes:VanguardWait() - Vanguard:Start() + function Vanguard:TrackIncoming() + + for tank_name, block_index in pairs (Vanguard.TankHashNames) do + + local shields = UnitGetTotalAbsorbs (tank_name) or 0 + local heals = UnitGetIncomingHeals (tank_name) or 0 + + local events_table = Vanguard.CurrentCombat.player_last_events [tank_name] + local taken = 0 + if (events_table) then + for _, event in ipairs (events_table) do + if (event [1] and event [4]+5 > time()) then --> damage + taken = taken + event [3] + end + end + + taken = taken / 3.5 + end + + local tframe = Vanguard.TankBlocks [block_index] + tframe.heal_inc:SetLeftText (Vanguard:ToK (shields + heals) .. " (|cFFFFFF55A: " .. Vanguard:ToK (shields) .. "|r)") + tframe.heal_inc:SetRightText (Vanguard:ToK ( _math_floor (taken))) + + heals = heals + shields + + if (taken > 0 and heals > 0) then + if (taken > heals) then + local p = heals / taken * 100 + p = _math_abs (p - 100) + + p = p / 2 + p = p + 50 + p = _math_abs (p - 100) + tframe.heal_inc:SetSplit (p) + else + local p = taken / heals * 100 + p = _math_abs (p - 100) + p = p / 2 + p = p + 50 + + tframe.heal_inc:SetSplit (p) + end + elseif (taken > 0) then + tframe.heal_inc:SetSplit (6) + elseif (heals > 0) then + tframe.heal_inc:SetSplit (94) + end + + end end - --> main onupdate locals - local hits_last = 0 - local hits_taken = {} - local hits_now = 0 + function Vanguard:CombatStart() - local avoid_last = 0 - local avoid_taken = {} - local avoid_now = 0 - - local damage_last = 0 - local damage_taken = {} - local damage_now = 0 - - local on_second_tick = 0 - local half_second_tick = 0 - - -- úpdate - local onupdate = function (self, elapsed) - - half_second_tick = half_second_tick + elapsed - on_second_tick = on_second_tick + elapsed + Vanguard.Running = true + VanguardFrame:RegisterEvent ("UNIT_HEALTH") + --Vanguard:TrackDebuffsAlreadyApplied() + VanguardFrame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") - if (on_second_tick >= 0.3) then - - --> capture debuffs - for TankIndex, TankName in _ipairs (Vanguard.TankList) do - - local ThisTankFrame = Vanguard.TankFrames [TankIndex] + if (Vanguard.track_incoming) then + Vanguard:CancelTimer (Vanguard.track_incoming) + end + Vanguard.track_incoming = Vanguard:ScheduleRepeatingTimer ("TrackIncoming", 0.1) + + end + + function Vanguard:CombatEnd() + + Vanguard.Running = false + VanguardFrame:UnregisterEvent ("UNIT_HEALTH") + VanguardFrame:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") + + if (Vanguard.track_incoming) then + Vanguard:CancelTimer (Vanguard.track_incoming) + end + + end + + function Vanguard:DebuffRefreshed (who_name, spellid) + local tank_index = Vanguard.TankHashNames [who_name] + --print ("On Refres tank index:", tank_index) + if (tank_index) then + local tframe = Vanguard.TankBlocks [tank_index] + --print ("Tank index OKE, tframe:", tframe) + for i = 1, 3 do + local dblock = tframe.debuffs_blocks [i] + if (dblock.support.spellid == spellid) then + --print ("REFRESH OKEY!") - if (not ThisTankFrame) then - break + local debuff_name = GetSpellInfo (spellid) + local _, _, icon, count, _, duration, expirationTime = _UnitDebuff (who_name, debuff_name) + + dblock.texture:SetTexture (icon) + if (count and count > 0) then + dblock.stack:SetText (count) + dblock.stack_bg:Show() + else + dblock.stack:SetText ("") + dblock.stack_bg:Hide() end - local updated = {false, false, false} + dblock:SetCooldown (GetTime(), expirationTime-GetTime(), 0, 0) - for i = 1, 41 do - - -- pega o primeiro debuff - local name, _, icon, count, _, duration, expirationTime, _, _, _, spellId = _UnitDebuff (TankName, i) - - if (name) then - - --> already shown? - local debuffShowingIndex = ThisTankFrame.DebuffsIndex [name] - if (debuffShowingIndex) then - - local expire = expirationTime - _GetTime() - updated [debuffShowingIndex] = true - ThisTankFrame:Update (debuffShowingIndex, icon, expire, count, name) - - --> have a free slot? - elseif (ThisTankFrame.InUse < 3) then - - local expire = expirationTime - _GetTime() - if (expire < 180 and expire > 0) then - for o = 1, 3 do - if (ThisTankFrame.FreeSpots [o]) then - ThisTankFrame.DebuffsIndex [name] = o - ThisTankFrame.DebuffsName [o] = name - ThisTankFrame.FreeSpots [o] = false - ThisTankFrame.InUse = ThisTankFrame.InUse + 1 - updated [o] = true - ThisTankFrame:Update (o, icon, expire, count, name) - break - end - end - end - end - - else + break + end + end + end + end + + function Vanguard:DebuffRemoved (who_name, spellid) + local tank_index = Vanguard.TankHashNames [who_name] + if (tank_index) then + local tframe = Vanguard.TankBlocks [tank_index] + for i = 1, 3 do + local dblock = tframe.debuffs_blocks [i] + if (dblock.support.spellid == spellid) then + dblock.texture:SetTexture (nil) + dblock.stack:SetText ("") + dblock.stack_bg:Hide() + dblock:SetCooldown (0, 0, 0, 0) + dblock.in_use = nil + dblock.support.spellid = nil + for o = 1, 3 do + if (not tframe.debuffs_blocks [o].in_use) then + tframe.debuffs_next_index = o break end end + tframe.debuffs_using = tframe.debuffs_using - 1 + break + end + end + end + end + + function Vanguard:DebuffApplied (who_name, spellid) + local tank_index = Vanguard.TankHashNames [who_name] + + if (tank_index) then + local tframe = Vanguard.TankBlocks [tank_index] + if (tframe.debuffs_using < 3) then + local next_index = tframe.debuffs_next_index + if (next_index) then + local dblock = tframe.debuffs_blocks [next_index] + + local debuff_name = GetSpellInfo (spellid) + local _, _, icon, count, _, duration, expirationTime = _UnitDebuff (who_name, debuff_name) + + if (not icon) then + return + end + + if (not duration) then + duration = 999 + end + + dblock.texture:SetTexture (icon) + if (count and count > 0) then + dblock.stack:SetText (count) + dblock.stack_bg:Show() + else + dblock.stack:SetText ("") + dblock.stack_bg:Hide() + end + + dblock:SetCooldown (GetTime(), expirationTime-GetTime(), 0, 0) + dblock.in_use = true + dblock.support.spellid = spellid for i = 1, 3 do - if (not updated [i] and ThisTankFrame.DebuffsName [i]) then - ThisTankFrame:Update (i, false) - end - end - - end - - on_second_tick = 0 - end - - if (half_second_tick > 0.1 and _track_player_object.avoidance) then - - --> capture the amount of hits and avoids - - _table_insert (hits_taken, 1, _track_player_object.avoidance.overall.HITS - hits_last) - hits_now = hits_now + (_track_player_object.avoidance.overall.HITS - hits_last) - if (#hits_taken > 10) then - hits_now = hits_now - hits_taken [11] - _table_remove (hits_taken, 11) - end - hits_last = _track_player_object.avoidance.overall.HITS - - _table_insert (avoid_taken, 1, _track_player_object.avoidance.overall.DODGE + _track_player_object.avoidance.overall.PARRY - avoid_last) - avoid_now = avoid_now + (_track_player_object.avoidance.overall.DODGE + _track_player_object.avoidance.overall.PARRY - avoid_last) - if (#avoid_taken > 10) then - avoid_now = avoid_now - avoid_taken [11] - _table_remove (avoid_taken, 11) - end - avoid_last = _track_player_object.avoidance.overall.DODGE + _track_player_object.avoidance.overall.PARRY - - --> compute the hits vs avoid - - if (hits_now == 0 and avoid_now == 0) then - TookVsAvoid:SetLeftText ("50%") - TookVsAvoid:SetRightText ("50%") - TookVsAvoid:SetSplit (50) - else - local avoidance = avoid_now - - local avoid_percentage = _math_floor (avoidance / (hits_now+avoid_now) * 100) - local hit_percentage = _math_abs (avoid_percentage-100) - - avoid_percentage = avoid_percentage or 0 - hit_percentage = hit_percentage or 0 - - TookVsAvoid:SetLeftText (avoid_percentage.."%") - TookVsAvoid:SetRightText (hit_percentage.."%") - - TookVsAvoid:SetRightColor (hit_percentage/100, 0, 0, 1) - TookVsAvoid:SetLeftColor (0, avoid_percentage/100, 0, 1) - - if (hit_percentage > 0 and avoid_percentage > 0) then - if (hit_percentage > avoid_percentage) then - local p = avoid_percentage / hit_percentage * 100 - p = _math_abs (p - 100) - p = p / 2 - p = p + 50 - p = _math_abs (p - 100) - TookVsAvoid:SetSplit (p) - else - local p = hit_percentage / avoid_percentage * 100 - p = _math_abs (p - 100) - p = p / 2 - p = p + 50 - - TookVsAvoid:SetSplit (p) - end - elseif (hit_percentage > 0) then - TookVsAvoid:SetSplit (6) - elseif (avoid_percentage > 0) then - TookVsAvoid:SetSplit (96) - else - TookVsAvoid:SetSplit (50) - end - end - - --> capture the amount of damage taken in last 5 seconds - - _table_insert (damage_taken, 1, _track_player_object.damage_taken - damage_last) - damage_now = damage_now + (_track_player_object.damage_taken - damage_last) - if (#damage_taken > 10) then - damage_now = damage_now - damage_taken [11] - _table_remove (damage_taken, 11) - end - damage_last = _track_player_object.damage_taken - - --> compute the damage taken vs incoming heal - - local dmgAmt = damage_now / #damage_taken - DamageVsHeal:SetRightText (Vanguard:ToK ( _math_floor (dmgAmt))) - - local shields = UnitGetTotalAbsorbs (_track_player_name) or 0 - local IncomingHeal = _UnitGetIncomingHeals (_track_player_name) or 0 - DamageVsHeal:SetLeftText (Vanguard:ToK (IncomingHeal + shields) .. " (|cFFFFFF55A: " .. Vanguard:ToK (shields) .. "|r)") - - IncomingHeal = IncomingHeal + shields - - if (dmgAmt > 0 and IncomingHeal > 0) then - if (dmgAmt > IncomingHeal) then - local p = IncomingHeal / dmgAmt * 100 - - --DamageVsHeal:SetLeftColor (0, p/100, 0, 1) - p = _math_abs (p - 100) - --DamageVsHeal:SetRightColor (p/100, 0, 0, 1) - - p = p / 2 - p = p + 50 - p = _math_abs (p - 100) - DamageVsHeal:SetSplit (p) - else - local p = dmgAmt / IncomingHeal * 100 - --DamageVsHeal:SetRightColor (p/100, 0, 0, 1) - p = _math_abs (p - 100) - --DamageVsHeal:SetLeftColor (0, p/100, 0, 1) - p = p / 2 - p = p + 50 - - DamageVsHeal:SetSplit (p) - end - elseif (dmgAmt > 0) then - DamageVsHeal:SetSplit (6) - elseif (IncomingHeal > 0) then - DamageVsHeal:SetSplit (94) - end - - --> capture the last 6 hits taken - - local amt = 1 - local hp = _UnitHealthMax (_track_player_name)/3 - - local last_events_table = _combat_object.player_last_events [_track_player_name or MyName] or _combat_object.player_last_events [MyName] - if (last_events_table) then - for _, tabela in _ipairs (last_events_table) do - if (tabela[1]) then - Vanguard:InsertDamage (tabela[3], amt, hp) - if (amt == Vanguard.DamageLabels.Spots) then - break - end - amt = amt+1 + if (not tframe.debuffs_blocks [i].in_use) then + tframe.debuffs_next_index = i + break end end end - - half_second_tick = 0 + end end end - function Vanguard:Start() - - if (not Vanguard.Running) then - --print ("return 1") - return - else - --> reset widgets - Vanguard:ResetDamage() - Vanguard:ResetBars() - end - - --> first, we need to get what we want to track: - local MyTarget, Realm = _UnitName ("target") - if (MyTarget and _UnitIsPlayer ("target")) then - if (Realm and Realm ~= "") then - MyTarget = MyTarget.."-"..Realm - end - _track_player_object = _combat_object (1, MyTarget) - if (not _track_player_object) then - --print ("Vanguard: Object not found 1.") - _detalhes:ScheduleTimer ("VanguardWait", 1) - --print ("return 2") - return - end - - _track_player_name = MyTarget - - local role = UnitGroupRolesAssigned (_track_player_name) - --if (role ~= "TANK") then - -- _detalhes:ScheduleTimer ("VanguardWait", 1) - -- print ("return 3") - -- return - --end - - if (VanguardFrame.InfoShown) then - Vanguard:VanguardRefreshInfoFrame() - end - else - _track_player_object = _combat_object (1, MyName) - if (not _track_player_object) then - --print ("Vanguard: Object not found 2.") - _detalhes:ScheduleTimer ("VanguardWait", 1) - --print ("return 4") - return - end - - _track_player_name = MyName - - local role = UnitGroupRolesAssigned (_track_player_name) - --if (role ~= "TANK") then - -- _detalhes:ScheduleTimer ("VanguardWait", 1) - -- print ("return 5") - -- return - --end - - if (VanguardFrame.InfoShown) then - Vanguard:VanguardRefreshInfoFrame() - end - end - - if (not _track_player_object) then - _detalhes:ScheduleTimer ("VanguardWait", 1) - return - end - - --print ("Vanguard: playername: ".. _track_player_name) - - hits_last = 0 - hits_now = 0 - hits_taken = {} - - avoid_last = 0 - avoid_now = 0 - avoid_taken = {} - - damage_last = 0 - damage_now = 0 - damage_taken = {} + function Vanguard:UpdateHealth (blockid) + local block = Vanguard.TankBlocks [blockid] + block.statusbar:SetValue (UnitHealth (block.tankname_string) / UnitHealthMax (block.tankname_string) * 100) + end - --print ("vanguard starting... 3 ...") - VanguardFrame:SetScript ("OnUpdate", onupdate) - + function Vanguard:HealthChanged (unitId) + local name, realm = UnitName (unitId) + if (realm) then + name = name .. "-" .. realm + end + local block = Vanguard.TankHashNames [name] + if (block) then + Vanguard:UpdateHealth (block) + end end - --> identify tanks on startup - Vanguard:IdentifyTanks() - Vanguard:ResetBars() - end -function Vanguard:OnEvent (_, event, ...) +local ignored_debuffs = { + [80354] = true, --temporal displacement + [57724] = true, --sated + [6788] = true, --weakened soul + [124275] = true, --light stagger + [124274] = true, --moderate stagger +} - if (event == "UNIT_HEALTH") then - Vanguard:HealthChanged (...) +function Vanguard:TrackDebuffsAlreadyApplied() + for tank_name, block_index in pairs (Vanguard.TankHashNames) do + for i = 1, 41 do + local _, _, icon, count, _, duration, expirationTime, unitCaster, _, _, spellid = _UnitDebuff (tank_name, i) + if (icon and spellid and not ignored_debuffs [spellid]) then + Vanguard:DebuffApplied (tank_name, spellid) + end + end + end +end + +function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, who_flags, _, alvo_serial, alvo_name, alvo_flags, _, spellid, spellname, spellschool, tipo) + + if (event == "COMBAT_LOG_EVENT_UNFILTERED") then + + if (token == "SPELL_AURA_APPLIED") then + if (Vanguard.TankHashNames [alvo_name] and tipo == "DEBUFF" and Vanguard.Running and not ignored_debuffs [spellid]) then + Vanguard:DebuffApplied (alvo_name, spellid) + end + + elseif (token == "SPELL_AURA_REMOVED") then + if (Vanguard.TankHashNames [alvo_name] and tipo == "DEBUFF" and Vanguard.Running and not ignored_debuffs [spellid]) then + Vanguard:DebuffRemoved (alvo_name, spellid) + end + + elseif (token == "SPELL_AURA_REFRESH") then + if (Vanguard.TankHashNames [alvo_name] and tipo == "DEBUFF" and Vanguard.Running and not ignored_debuffs [spellid]) then + Vanguard:DebuffRefreshed (alvo_name, spellid) + end + + elseif (token == "SPELL_AURA_APPLIED_DOSE") then + if (Vanguard.TankHashNames [alvo_name] and tipo == "DEBUFF" and Vanguard.Running and not ignored_debuffs [spellid]) then + Vanguard:DebuffRefreshed (alvo_name, spellid) + end + + elseif (token == "SPELL_AURA_REMOVED_DOSE") then + if (Vanguard.TankHashNames [alvo_name] and tipo == "DEBUFF" and Vanguard.Running and not ignored_debuffs [spellid]) then + Vanguard:DebuffRefreshed (alvo_name, spellid) + end + + end + + elseif (event == "UNIT_HEALTH") then + Vanguard:HealthChanged (arg1) elseif (event == "ADDON_LOADED") then - local AddonName = select (1, ...) + + local AddonName = arg1 if (AddonName == "Details_Vanguard") then if (_G._detalhes) then --> create widgets - CreatePluginFrames (data) + CreatePluginFrames() local MINIMAL_DETAILS_VERSION_REQUIRED = 1 + local default_saved_table = {} --> Install - local install = _G._detalhes:InstallPlugin ("TANK", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\INV_Shield_77", Vanguard, "DETAILS_PLUGIN_VANGUARD", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.07") + local install, saveddata = _G._detalhes:InstallPlugin ("TANK", "Vanguard", "Interface\\Icons\\INV_Shield_77", Vanguard, "DETAILS_PLUGIN_VANGUARD", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v2.0", default_saved_table) if (type (install) == "table" and install.error) then print (install.error) end - +-- DETAILS_PLUGIN_VANGUARD.TankHashNames --> Register needed events _G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_ENTER") _G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_LEAVE") _G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_ENDRESIZE") _G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_SIZECHANGED") - _G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_STARTSTRETCH") - _G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_ENDSTRETCH") + _G._detalhes:RegisterEvent (Vanguard, "GROUP_ONLEAVE") VanguardFrame:RegisterEvent ("ZONE_CHANGED_NEW_AREA") VanguardFrame:RegisterEvent ("PLAYER_ENTERING_WORLD") end end - - elseif (event == "PLAYER_LOGOUT") then - _detalhes_databaseVanguard = Vanguard.data - - elseif (event == "PLAYER_TARGET_CHANGED") then - Vanguard:TargetChanged() elseif (event == "ROLE_CHANGED_INFORM" or event == "GROUP_ROSTER_UPDATE") then --> raid changes - Vanguard:IdentifyTanks() + if (Vanguard.CurrentInstance) then + Vanguard:IdentifyTanks() + end elseif (event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD") then --> logon or map changes - Vanguard:IdentifyTanks() + if (Vanguard.CurrentInstance) then + Vanguard:IdentifyTanks() + end end end + + + + + + + + + + + + + + diff --git a/plugins/Details_Vanguard/Details_Vanguard.toc b/plugins/Details_Vanguard/Details_Vanguard.toc index d10619a9..f60f3f6c 100644 --- a/plugins/Details_Vanguard/Details_Vanguard.toc +++ b/plugins/Details_Vanguard/Details_Vanguard.toc @@ -9,7 +9,4 @@ embeds.xml #@end-no-lib-strip@ -enUS.lua -ptBR.lua - Details_Vanguard.lua \ No newline at end of file diff --git a/startup.lua b/startup.lua index 5ee63b3a..86a9ef11 100644 --- a/startup.lua +++ b/startup.lua @@ -283,6 +283,11 @@ function _G._detalhes:Start() end self:ScheduleTimer ("AnnounceStartup", 5) + if (_detalhes.failed_to_load) then + _detalhes:CancelTimer (_detalhes.failed_to_load) + _detalhes.failed_to_load = nil + end + --function self:RunAutoHideMenu() -- local lower_instance = _detalhes:GetLowerInstanceNumber() -- local instance = self:GetInstance (lower_instance) @@ -325,6 +330,25 @@ function _G._detalhes:Start() --> check is this is the first run of this version if (self.is_version_first_run) then + if (_detalhes_database.last_version and _detalhes.userversion == "v3.8c") then + if (not _detalhes:GetTutorialCVar ("UPDATE_WARNING_SPECICONS1")) then + _detalhes:SetTutorialCVar ("UPDATE_WARNING_SPECICONS1", true) + local func = function() + local window1 = _detalhes:GetInstance(1) + if (window1 and window1:IsEnabled()) then + window1:SetBarSpecIconSettings (true, [[Interface\AddOns\Details\images\spec_icons_normal]], true) + end + local window2 = _detalhes:GetInstance(2) + if (window2 and window2:IsEnabled()) then + window2:SetBarSpecIconSettings (true, [[Interface\AddOns\Details\images\spec_icons_normal]], true) + end + + _detalhes:CreateTestBars() + end + _detalhes:GetFramework():ShowTutorialAlertFrame ("Spec Icons!", "Now Available, click here!", func) + end + end + local enable_reset_warning = true local lower_instance = _detalhes:GetLowerInstanceNumber() @@ -358,15 +382,18 @@ function _G._detalhes:Start() dev_icon:SetWidth (40) dev_icon:SetHeight (40) dev_icon:SetPoint ("bottomleft", instance.baseframe, "bottomleft", 4, 8) - dev_icon:SetTexture ([[Interface\DialogFrame\UI-Dialog-Icon-AlertOther]]) dev_icon:SetAlpha (.3) local dev_text = instance.bgdisplay:CreateFontString (nil, "overlay", "GameFontHighlightSmall") dev_text:SetHeight (64) dev_text:SetPoint ("left", dev_icon, "right", 5, 0) dev_text:SetTextColor (1, 1, 1) - dev_text:SetText ("Details is Under\nDevelopment") dev_text:SetAlpha (.3) + + if (self.tutorial.logons < 50) then + dev_text:SetText ("Details is Under\nDevelopment") + dev_icon:SetTexture ([[Interface\DialogFrame\UI-Dialog-Icon-AlertOther]]) + end --version self.gump:Fade (instance._version, 0)