Skip to content

Commit

Permalink
Added shift to compare items in the m+ end panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Sep 30, 2024
1 parent ea35922 commit 97cb6a7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
9 changes: 9 additions & 0 deletions frames/window_mythicplus/window_end_of_run.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
25 changes: 13 additions & 12 deletions plugins/Details_EncounterDetails/frames_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 97cb6a7

Please sign in to comment.