From 2bb5488770e0da5abd60c4ceb3b86333e1060b32 Mon Sep 17 00:00:00 2001 From: Tercio Date: Fri, 27 Mar 2015 11:50:07 -0300 Subject: [PATCH] - Fixed few bugs when using the key bind to toggle windows. - Added item level on Raid Check plugin panel. --- boot.lua | 11 +- classes/classe_instancia.lua | 43 +++++- core/gears.lua | 2 +- core/network.lua | 2 +- gumps/janela_principal.lua | 6 +- .../Details_RaidCheck/Details_RaidCheck.lua | 145 +++++++++++++++--- startup.lua | 7 + 7 files changed, 179 insertions(+), 37 deletions(-) diff --git a/boot.lua b/boot.lua index 336d8b77..21445048 100644 --- a/boot.lua +++ b/boot.lua @@ -1,10 +1,10 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 711 --it's 731 for release - _detalhes.userversion = "v3.12.0" + _detalhes.userversion = "v3.12.1" _detalhes.realversion = 66 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -21,8 +21,11 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ +|cFFFFFF00-|r .\n\n -|cFFFFFF00v3.12.0 (|cFFFFCC00Mar 26, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v3.12.1 (|cFFFFCC00Mar 27, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n +|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n |cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n |cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n |cFFFFFF00-|r Added more spells for crowd control.\n\n @@ -44,7 +47,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.12.0 (|cFFFFCC00Mar 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.12.1 (|cFFFFCC00Mar 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed few bugs when using keybinds to toggle windows.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use.\n\n|cFFFFFF00-|r Time Line (plugin): added options to change the background color and scale.\n\n|cFFFFFF00-|r Raid Check (plugin): its window is now 'always on top'.\n\n|cFFFFFF00-|r Accuracy adjustments on overheal of Divine Aegis and Illuminated Healing.\n\n|cFFFFFF00-|r Removed healthstone from cooldown list, added Nature's Vigil.\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index e934774a..4f60df8a 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -417,6 +417,40 @@ end end end + function _detalhes:CheckCoupleWindows (instance1, instance2) + instance1 = instance1 or _detalhes:GetInstance (1) + instance2 = instance2 or _detalhes:GetInstance (2) + + if (instance1 and instance2 and not instance1.ignore_mass_showhide and not instance1.ignore_mass_showhide) then + + instance1.baseframe:ClearAllPoints() + instance2.baseframe:ClearAllPoints() + + instance1:RestoreMainWindowPosition() + instance2:RestoreMainWindowPosition() + + instance1:AtualizaPontos() + instance2:AtualizaPontos() + + local _R, _T, _L, _B = _detalhes.VPL (instance2, instance1), _detalhes.VPB (instance2, instance1), _detalhes.VPR (instance2, instance1), _detalhes.VPT (instance2, instance1) + + if (_R) then + --print ("R") + instance2:MakeInstanceGroup ({false, false, 1, false}) + elseif (_T) then + --print ("T") + instance2:MakeInstanceGroup ({false, false, false, 1}) + elseif (_L) then + --print ("L") + instance2:MakeInstanceGroup ({1, false, false, false}) + elseif (_B) then + --print ("B") + instance2:MakeInstanceGroup ({false, 1, false, false}) + end + end + + end + function _detalhes:ToggleWindows() local instance @@ -435,11 +469,10 @@ end else _detalhes:ReabrirTodasInstancias() - local instance2 = _detalhes:GetInstance(2) - if (instance2) then - _detalhes.move_janela_func (instance2.baseframe, true, instance2, true) - _detalhes.move_janela_func (instance2.baseframe, false, instance2, true) - end + local instance1 = _detalhes:GetInstance (1) + local instance2 = _detalhes:GetInstance (2) + + _detalhes:CheckCoupleWindows (instance1, instance2) end end end diff --git a/core/gears.lua b/core/gears.lua index e2220c2c..a8205ffc 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -706,7 +706,7 @@ function _detalhes.ilevel:GetInOrder() local order = {} for guid, t in pairs (_detalhes.item_level_pool) do - order [#order+1] = {t.name, t.ilvl, t.time} + order [#order+1] = {t.name, t.ilvl or 0, t.time} end table.sort (order, _detalhes.Sort2) diff --git a/core/network.lua b/core/network.lua index 2cc90857..1322e7b4 100644 --- a/core/network.lua +++ b/core/network.lua @@ -462,7 +462,7 @@ --> item level function _detalhes:SentMyItemLevel() local overall, equipped = GetAverageItemLevel() - _detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, overall) + _detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, equipped) end function _detalhes.network.ItemLevel_Received (player, realm, core_version, itemlevel) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index f93b67e1..87fa5ae2 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -389,7 +389,7 @@ _detalhes.OnEnterMainWindow = OnEnterMainWindow local function VPL (instancia, esta_instancia) --> conferir esquerda - if (instancia.ponto4.x < esta_instancia.ponto1.x) then --> a janela esta a esquerda + if (instancia.ponto4.x-0.5 < esta_instancia.ponto1.x) then --> a janela esta a esquerda if (instancia.ponto4.x+20 > esta_instancia.ponto1.x) then --> a janela esta a menos de 20 pixels de distância if (instancia.ponto4.y < esta_instancia.ponto1.y + 100 and instancia.ponto4.y > esta_instancia.ponto1.y - 100) then --> a janela esta a +20 ou -20 pixels de distância na vertical return 1 @@ -413,7 +413,7 @@ end local function VPR (instancia, esta_instancia) --> conferir lateral direita - if (instancia.ponto2.x > esta_instancia.ponto3.x) then --> a janela esta a direita + if (instancia.ponto2.x+0.5 > esta_instancia.ponto3.x) then --> a janela esta a direita if (instancia.ponto2.x-20 < esta_instancia.ponto3.x) then --> a janela esta a menos de 20 pixels de distância if (instancia.ponto2.y < esta_instancia.ponto3.y + 100 and instancia.ponto2.y > esta_instancia.ponto3.y - 100) then --> a janela esta a +20 ou -20 pixels de distância na vertical return 3 @@ -435,6 +435,8 @@ local function VPT (instancia, esta_instancia) return nil end +_detalhes.VPT, _detalhes.VPR, _detalhes.VPB, _detalhes.VPL = VPT, VPR, VPB, VPL + local color_red = {1, 0.2, 0.2} local color_green = {0.2, 1, 0.2} diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index ebe1670e..9dec65f4 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -36,19 +36,29 @@ local food_list = { [175222] = true, -- [175223] = true, -- - [180745] = true, -- - [180746] = true, -- - [180747] = true, -- - [180748] = true, -- - [180749] = true, -- - [180750] = true, -- + [180745] = true, --125 crit + [180746] = true, --125 versa + [180747] = true, --187 stam + [180748] = true, --125 haste + [180749] = true, --125 multi + [180750] = true, --125 mastery - [180757] = true, -- - [180758] = true, -- - [180761] = true, -- - [180759] = true, -- - [180762] = true, -- - [180760] = true, -- + --the food it self inside the player backback + [180757] = true, --125 multi + [180758] = true, --125 crit + [180761] = true, --125 haste + [180759] = true, --125 versa + [180762] = true, --125 mastery + [180760] = true, --187 stam +} + +local best_food = { + [180745] = true, --125 crit + [180746] = true, --125 versa + [180747] = true, --187 stam + [180748] = true, --125 haste + [180749] = true, --125 multi + [180750] = true, --125 mastery } local focus_augmentation = 175457 @@ -68,7 +78,7 @@ local runes_id = { tinsert (UISpecialFrames, "DetailsRaidCheck") DetailsRaidCheck:SetPluginDescription (Loc ["STRING_RAIDCHECK_PLUGIN_DESC"]) - local version = "v0.4.1" + local version = "v0.5" local debugmode = false @@ -176,7 +186,7 @@ local runes_id = { end local show_panel = CreateFrame ("frame", nil, UIParent) - show_panel:SetSize (400, 300) + show_panel:SetSize (500, 300) show_panel:SetPoint ("bottom", DetailsRaidCheck.ToolbarButton, "top", 0, 10) show_panel:SetBackdrop ({bgFile = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]], tileSize = 256, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 16, insets = {left = 1, right = 1, top = 1, bottom = 1}}) show_panel:SetBackdropColor (1, 1, 1, 0.9) @@ -262,7 +272,7 @@ local runes_id = { local prepot_title2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") prepot_title2:SetJustifyH ("center") - prepot_title2:SetPoint ("topleft", show_panel, "topleft", 315, -20) + prepot_title2:SetPoint ("topleft", show_panel, "topleft", 300, -20) prepot_title2:SetText ("No Pre Pot") prepot_title2:SetTextColor (1, 0.8, 0.8) @@ -276,12 +286,52 @@ local runes_id = { prepot_image2:SetPoint ("topleft", prepot_title2, "topleft", -11, 3) prepot_image2:SetSize (prepot_title2:GetStringWidth()+22, 19) --208, 48 prepot_image2:SetVertexColor (.65, .65, .65) + + -- + local ilvl_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + ilvl_title:SetJustifyH ("center") + ilvl_title:SetPoint ("topleft", show_panel, "topleft", 400, -20) + ilvl_title:SetText ("Item LvL") + ilvl_title:SetTextColor (0.8, 1, 0.8) + + local ilvl_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + ilvl_str:SetJustifyH ("left") + ilvl_str:SetPoint ("topleft", ilvl_title, "topleft", -11, -20) + + local ilvl_image = show_panel:CreateTexture (nil, "artwork") + ilvl_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + ilvl_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + ilvl_image:SetPoint ("topleft", ilvl_title, "topleft", -11, 3) + ilvl_image:SetSize (ilvl_title:GetStringWidth()+22, 19) --208, 48 + ilvl_image:SetVertexColor (.65, .65, .65) + + --DISABLED + local bestfood_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + bestfood_title:SetJustifyH ("center") + bestfood_title:SetPoint ("topleft", show_panel, "topleft", 400, -20) + bestfood_title:SetText ("125 Food") + bestfood_title:SetTextColor (0.8, 1, 0.8) + + local bestfood_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") + bestfood_str:SetJustifyH ("left") + bestfood_str:SetPoint ("topleft", bestfood_title, "topleft", -11, -20) + + local bestfood_image = show_panel:CreateTexture (nil, "artwork") + bestfood_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]]) + bestfood_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024) + bestfood_image:SetPoint ("topleft", bestfood_title, "topleft", -11, 3) + bestfood_image:SetSize (bestfood_title:GetStringWidth()+22, 19) --208, 48 + bestfood_image:SetVertexColor (.65, .65, .65) + + bestfood_title:Hide() + bestfood_str:Hide() + bestfood_image:Hide() -- - + --DISABLED local prepot_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall") prepot_title:SetJustifyH ("center") - prepot_title:SetPoint ("topleft", show_panel, "topleft", 415, -20) + prepot_title:SetPoint ("topleft", show_panel, "topleft", 410, -20) prepot_title:SetText ("Used Pre Pot") prepot_title:SetTextColor (0.8, 1, 0.8) @@ -298,7 +348,7 @@ local runes_id = { prepot_title:Hide() prepot_str:Hide() - prepot_image:Hide() + prepot_image:Hide() -- @@ -409,13 +459,59 @@ local runes_id = { end) - local update_panel = function (self) + local update_panel = function (self, elapsed) if (not IsInRaid()) then return end - local amount1, amount2, amount3, amount4, amount5 = 0, 0, 0, 0, 0 + local amount1, amount2, amount3, amount4, amount5, amount6, amount7 = 0, 0, 0, 0, 0, 0, 0 + + --item lvl + self.one_second = self.one_second + elapsed + if (self.one_second > 5) then + self.one_second = 0 + local ilvl = "" + for _, ilvl_char in ipairs (_detalhes.ilevel:GetInOrder()) do + local _, class = _UnitClass (ilvl_char [1]) + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + local class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + + ilvl = ilvl .. class_color .. DetailsRaidCheck:GetOnlyName (ilvl_char [1]) .. "|r: " .. floor (ilvl_char[2]) .. "\n" + amount7 = amount7 + 1 + end + end + + self.last_ilvl_amount = amount7 + ilvl_str:SetText (ilvl) + else + amount7 = self.last_ilvl_amount or 0 + end + --t.name, t.ilvl, t.time + + --best food + local b = "" + for name, foodid in pairs (DetailsRaidCheck.havefood_table) do + if (best_food [foodid]) then + --print (name, foodid, best_food [foodid], type (foodid)) + local _, class = _UnitClass (name) + local class_color = "FFFFFFFF" + + if (class) then + local coords = CLASS_ICON_TCOORDS [class] + class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr + end + + b = b .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n" + + amount6 = amount6 + 1 + end + end + bestfood_str:SetText (b) + + --food local s, f, p, n = "", "", "", "" local amt = GetNumGroupMembers() @@ -543,13 +639,14 @@ local runes_id = { focus_aug2:SetText (n) - local bigger = math.max (amount1, amount2, amount3, amount4, amount5) + local bigger = math.max (amount1, amount2, amount3, amount4, amount5, amount6) show_panel:SetHeight (100 + (bigger * 10)) end DetailsRaidCheck.ToolbarButton:SetScript ("OnEnter", function (self) show_panel:Show() + show_panel.one_second = 6 show_panel:SetScript ("OnUpdate", update_panel) end) @@ -620,17 +717,17 @@ local runes_id = { local bname, _, _, _, _, _, _, _, _, _, spellid = _UnitAura ("raid" .. i, buffIndex, nil, "HELPFUL") if (bname and flask_list [spellid]) then - DetailsRaidCheck.haveflask_table [name] = true + DetailsRaidCheck.haveflask_table [name] = spellid with_flask = with_flask + 1 end if (bname and food_list [spellid]) then - DetailsRaidCheck.havefood_table [name] = true + DetailsRaidCheck.havefood_table [name] = spellid with_food = with_food + 1 end if (bname and runes_id [spellid]) then - DetailsRaidCheck.havefocusaug_table [name] = true + DetailsRaidCheck.havefocusaug_table [name] = spellid end end end diff --git a/startup.lua b/startup.lua index 12b216d6..d8385fa5 100644 --- a/startup.lua +++ b/startup.lua @@ -491,6 +491,13 @@ function _G._detalhes:Start() --boss mobs callbacks _detalhes:ScheduleTimer ("BossModsLink", 5) + local now = time() + for guid, t in pairs (_detalhes.item_level_pool) do + if (t.time+3600 < now) then + _detalhes.item_level_pool [guid] = nil + end + end + --[[ function _detalhes:TestResize() _detalhes:OpenNewsWindow ("TESTE, |TInterface\\AddOns\\Details\\images\\key_shift:20:40:0:0:64:64:0:64:0:40|t")