From f8d4a9496224ae5038ec1bc62e766651e1af4b99 Mon Sep 17 00:00:00 2001 From: Darth Predator Date: Thu, 3 Nov 2016 23:35:15 +0300 Subject: [PATCH] Raid progress tooltip update --- ElvUI_SLE/defaults/profile.lua | 5 +++ ElvUI_SLE/modules/tooltips/raidprogress.lua | 46 ++++++++++++++++----------- ElvUI_SLE/options/tooltip_c.lua | 13 ++++++++ 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index 9d6f89a..e783e49 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -695,6 +695,11 @@ P["sle"] = { ["enable"] = false, ["NameStyle"] = "SHORT", ["DifStyle"] = "SHORT", + ["raids"] = { + ["nightmare"] = true, + ["trial"] = true, + ["nighthold"] = true, + }, }, }, --UI Buttons diff --git a/ElvUI_SLE/modules/tooltips/raidprogress.lua b/ElvUI_SLE/modules/tooltips/raidprogress.lua index aa0b877..01b5e6f 100644 --- a/ElvUI_SLE/modules/tooltips/raidprogress.lua +++ b/ElvUI_SLE/modules/tooltips/raidprogress.lua @@ -27,6 +27,7 @@ RP.bosses = { { -- LFR 10911, 10920, 10924, 10915, 10928, 10932, 10936, }, + "nightmare", }, { --Trial of Valor { --Mythic @@ -41,6 +42,7 @@ RP.bosses = { { -- LFR 11407, 11411, 11415, }, + "trial", }, { -- Nighthold { --Mythic @@ -55,6 +57,7 @@ RP.bosses = { { -- LFR 10940, 10944, 10948, 10952, 10956, 10961, 10965, 10969, 10973, 10977 }, + "nighthold", }, } RP.Raids = { @@ -89,26 +92,30 @@ function RP:GetProgression(guid) local statFunc = guid == RP.playerGUID and T.GetStatistic or T.GetComparisonStatistic for raid = 1, #RP.Raids["LONG"] do - RP.Cache[guid].header[raid] = {} - RP.Cache[guid].info[raid] = {} - for level = 1, 4 do - RP.highestKill = 0 - for statInfo = 1, #RP.bosses[raid][level] do - kills = T.tonumber((statFunc(RP.bosses[raid][level][statInfo]))) - if kills and kills > 0 then - RP.highestKill = RP.highestKill + 1 + local option = RP.bosses[raid][5] + if E.db.sle.tooltip.RaidProg.raids[option] then + RP.Cache[guid].header[raid] = {} + RP.Cache[guid].info[raid] = {} + for level = 1, 4 do + RP.highestKill = 0 + for statInfo = 1, #RP.bosses[raid][level] do + local bossTable = RP.bosses[raid][level][statInfo] + kills = T.tonumber((statFunc(bossTable))) + if kills and kills > 0 then + RP.highestKill = RP.highestKill + 1 + end end - end - pos = RP.highestKill - if (RP.highestKill > 0) then - RP.Cache[guid].header[raid][level] = T.format("%s [%s]:", RP.Raids[E.db.sle.tooltip.RaidProg.NameStyle][raid], RP.modes[E.db.sle.tooltip.RaidProg.DifStyle][level]) - RP.Cache[guid].info[raid][level] = T.format("%d/%d", RP.highestKill, #RP.bosses[raid][level]) - if RP.highestKill == #RP.bosses[raid][level] then - break + pos = RP.highestKill + if (RP.highestKill > 0) then + RP.Cache[guid].header[raid][level] = T.format("%s [%s]:", RP.Raids[E.db.sle.tooltip.RaidProg.NameStyle][raid], RP.modes[E.db.sle.tooltip.RaidProg.DifStyle][level]) + RP.Cache[guid].info[raid][level] = T.format("%d/%d", RP.highestKill, #RP.bosses[raid][level]) + if RP.highestKill == #RP.bosses[raid][level] then + break + end end end end - end + end end function RP:UpdateProgression(guid) @@ -141,8 +148,11 @@ function RP:SetProgressionInfo(guid, tt) -- add progression tooltip line if RP.highestKill > 0 then tt:AddLine(" ") end for raid = 1, #RP.Raids["LONG"] do - for level = 1, 4 do - tt:AddDoubleLine(RP.Cache[guid].header[raid][level], RP.Cache[guid].info[raid][level], nil, nil, nil, 1, 1, 1) + local option = RP.bosses[raid][5] + if E.db.sle.tooltip.RaidProg.raids[option] then + for level = 1, 4 do + tt:AddDoubleLine(RP.Cache[guid].header[raid][level], RP.Cache[guid].info[raid][level], nil, nil, nil, 1, 1, 1) + end end end end diff --git a/ElvUI_SLE/options/tooltip_c.lua b/ElvUI_SLE/options/tooltip_c.lua index 8336a77..a449dc3 100644 --- a/ElvUI_SLE/options/tooltip_c.lua +++ b/ElvUI_SLE/options/tooltip_c.lua @@ -104,6 +104,19 @@ local function configTable() ["SHORT"] = L["Short"], }, }, + Raids = { + order = 4, + type = "group", + name = RAIDS, + guiInline = true, + get = function(info) return E.db.sle.tooltip.RaidProg.raids[ info[#info] ] end, + set = function(info, value) E.db.sle.tooltip.RaidProg.raids[ info[#info] ] = value end, + args = { + nightmare = { order = 1, type = "toggle", name = T.GetMapNameByID(1094) }, + trial = { order = 2, type = "toggle", name = T.GetMapNameByID(1114) }, + nighthold = { order = 3, type = "toggle", name = T.GetMapNameByID(1088) }, + }, + }, }, }, }, -- 1.7.9.5