From 97cb6a73a082ce9af39ad7b1aee5fa0147ac951d Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 30 Sep 2024 00:15:36 -0300 Subject: [PATCH] Added shift to compare items in the m+ end panel --- .../window_mythicplus/window_end_of_run.lua | 9 +++++++ .../frames_summary.lua | 25 ++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/frames/window_mythicplus/window_end_of_run.lua b/frames/window_mythicplus/window_end_of_run.lua index cb726673a..0f02c0ad2 100644 --- a/frames/window_mythicplus/window_end_of_run.lua +++ b/frames/window_mythicplus/window_end_of_run.lua @@ -346,11 +346,20 @@ local createLootSquare = function(playerBanner, name, parent, lootIndex) GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT") GameTooltip:SetHyperlink(lootSquare.itemLink) GameTooltip:Show() + + self:SetScript("OnUpdate", function() + if (IsShiftKeyDown()) then + GameTooltip_ShowCompareItem() + else + GameTooltip_HideShoppingTooltips(GameTooltip) + end + end) end end) lootSquare:SetScript("OnLeave", function(self) GameTooltip:Hide() + self:SetScript("OnUpdate", nil) end) local shadowTexture = playerBanner:CreateTexture("$parentShadowTexture", "artwork") diff --git a/plugins/Details_EncounterDetails/frames_summary.lua b/plugins/Details_EncounterDetails/frames_summary.lua index ff97b59b5..0485a00b5 100644 --- a/plugins/Details_EncounterDetails/frames_summary.lua +++ b/plugins/Details_EncounterDetails/frames_summary.lua @@ -664,7 +664,7 @@ do -- ~interrupt end end - GameCooltip:SetOwner(bar:GetParent(), "topleft", "topright", 2, 0) + GameCooltip:SetOwner(bar:GetParent(), "bottom", "top", 0, 5) GameCooltip:Show() local spellName = GetSpellInfo(spellId) @@ -693,6 +693,7 @@ do -- ~interrupt local spellId = thisData[3] local totalCasts = thisData[5] + line.spellId = spellId line.whoInterrupted = interruptingPlayers local spellName, _, spellIcon = GetSpellInfo(spellId) @@ -848,7 +849,7 @@ do -- ~dispel end end - GameCooltip:SetOwner(bar:GetParent(), "topleft", "topright", 2, 0) + GameCooltip:SetOwner(bar:GetParent(), "bottom", "top", 0, 5) GameCooltip:Show() local spellName = GetSpellInfo(spellId) @@ -1041,9 +1042,9 @@ do --~deaths ~dead --death parser for index, thisEvent in ipairs(eventsBeforeDeath) do - local health = math.floor(thisEvent[5] / maxHealth * 100) - if (health > 100) then - health = 100 + local healthPercent = math.floor(thisEvent[5] * 100) + if (healthPercent > 100) then + healthPercent = 100 end local evType = thisEvent[1] @@ -1071,30 +1072,30 @@ do --~deaths ~dead local cleanSourceName = detailsFramework:CleanUpName(source) - GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. cleanSourceName .. ")", "-" .. Details:Format(amount) .. overkillString .. " (" .. health .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. cleanSourceName .. ")", "-" .. Details:Format(amount) .. overkillString .. " (" .. healthPercent .. "%)", 1, "white", "white") GameCooltip:AddIcon(spellIcon, 1, 1, 16, 16, .1, .9, .1, .9) if (thisEvent[9]) then --friendly fire - GameCooltip:AddStatusBar(health, 1, "darkorange", false, statusBarBackground) + GameCooltip:AddStatusBar(healthPercent, 1, "darkorange", false, statusBarBackground) else --from a enemy - GameCooltip:AddStatusBar(health, 1, "red", false, statusBarBackground) + GameCooltip:AddStatusBar(healthPercent, 1, "red", false, statusBarBackground) end else --boolean false --heal local class = Details:GetClass(source) local spec = Details:GetSpec(source) - GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. detailsFramework:CleanUpName(Details:AddClassOrSpecIcon(source, class, spec, 16, true)) .. ") ", "+" .. Details:Format(amount) .. "(" .. health .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. detailsFramework:CleanUpName(Details:AddClassOrSpecIcon(source, class, spec, 16, true)) .. ") ", "+" .. Details:Format(amount) .. "(" .. healthPercent .. "%)", 1, "white", "white") GameCooltip:AddIcon(spellIcon, 1, 1, 16, 16, .1, .9, .1, .9) - GameCooltip:AddStatusBar(health, 1, "green", false, statusBarBackground) + GameCooltip:AddStatusBar(healthPercent, 1, "green", false, statusBarBackground) end elseif (type(evType) == "number") then if (evType == 1) then --cooldown - GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ") ", "cooldown (" .. health .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s " .. spellName .. " (" .. source .. ") ", "cooldown (" .. healthPercent .. "%)", 1, "white", "white") GameCooltip:AddIcon(spellIcon, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip:AddStatusBar(100, 1, "yellow", false, statusBarBackground) @@ -1104,7 +1105,7 @@ do --~deaths ~dead source = source:gsub("%[%*%] ", "") end - GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s [x" .. amount .. "] " .. spellName .. " (" .. source .. ")", "debuff (" .. health .. "%)", 1, "white", "white") + GameCooltip:AddLine("" .. string.format("%.1f", time - timeOfDeath) .. "s [x" .. amount .. "] " .. spellName .. " (" .. source .. ")", "debuff (" .. healthPercent .. "%)", 1, "white", "white") GameCooltip:AddIcon(spellIcon, 1, 1, 16, 16, .1, .9, .1, .9) GameCooltip:AddStatusBar(100, 1, "purple", false, statusBarBackground) end