Added M+ Score into the player info tooltip (hover over the spec icon)

This commit is contained in:
Tercio Jose
2022-04-07 14:33:46 -03:00
parent 0d8b09ffb7
commit 2f94bd93b8
2 changed files with 70 additions and 19 deletions
+65 -17
View File
@@ -2100,14 +2100,10 @@ local set_bar_value = function (self, value)
end
-- ~talent ~icon
--code for when hovering over the class/spec icon in the player bar
local icon_frame_on_enter = function (self)
local actor = self.row.minha_tabela
if (self.row.icone_classe:GetTexture() ~= "") then
--self.row.icone_classe:SetSize (self.row.icone_classe:GetWidth()+1, self.row.icone_classe:GetWidth()+1)
--self.row.icone_classe:SetBlendMode ("ADD")
end
if (actor) then
if (actor.frags) then
@@ -2211,7 +2207,7 @@ local icon_frame_on_enter = function (self)
local diff = combat:GetDifficulty()
local attribute, subattribute = instance:GetDisplay()
--> check if is a raid encounter and if is heroic or mythic
--check if is a raid encounter and if is heroic or mythic
if (diff and (diff == 15 or diff == 16) and (attribute == 1 or attribute == 2)) then
local db = _detalhes.OpenStorage()
if (db) then
@@ -2239,7 +2235,68 @@ local icon_frame_on_enter = function (self)
end
end
end
local actorName = actor:GetName()
local RaiderIO = _G.RaiderIO
if (RaiderIO) then
local addedInfo = false
local playerName, playerRealm = actorName:match("(%w+)%-(%w+)")
playerName = playerName or actorName
playerRealm = playerRealm or GetRealmName()
local faction = actor.enemy and Details.faction_against or UnitFactionGroup("player")
faction = faction == "Horde" and 2 or 1
local rioProfile = RaiderIO.GetProfile(playerName, playerRealm, faction)
if (rioProfile and rioProfile.mythicKeystoneProfile) then
rioProfile = rioProfile.mythicKeystoneProfile
local previousScore = rioProfile.previousScore
local currentScore = rioProfile.currentScore
if (previousScore > currentScore) then
GameCooltip:AddLine("M+ Score:", previousScore .. " (|cFFFFDD11" .. currentScore .. "|r)", 1, "white")
addedInfo = true
else
GameCooltip:AddLine("M+ Score:", currentScore, 1, "white")
addedInfo = true
end
else
local dungeonPlayerInfo = C_PlayerInfo.GetPlayerMythicPlusRatingSummary(actorName)
if (dungeonPlayerInfo) then
local currentScore = dungeonPlayerInfo.currentSeasonScore or 0
if (currentScore > 0) then
GameCooltip:AddLine("M+ Score:", currentScore, 1, "white")
addedInfo = true
end
end
end
if (addedInfo) then
GameCooltip:AddIcon ([[]], 1, 1, 1, 20)
_detalhes:AddTooltipBackgroundStatusbar()
height = height + 19 --frame height
end
else
local dungeonPlayerInfo = C_PlayerInfo.GetPlayerMythicPlusRatingSummary(actorName)
if (dungeonPlayerInfo) then
local currentScore = dungeonPlayerInfo.currentSeasonScore or 0
if (currentScore > 0) then
GameCooltip:AddLine("M+ Score:", currentScore, 1, "white")
GameCooltip:AddIcon ([[]], 1, 1, 1, 20)
_detalhes:AddTooltipBackgroundStatusbar()
height = height + 19 --frame height
end
end
end
--dps
--[=[
local attribute, subAttribute = instance:GetDisplay()
if (attribute == 1) then
local realDps = actor.total / instance:GetShowingCombat():GetCombatTime()
@@ -2253,17 +2310,8 @@ local icon_frame_on_enter = function (self)
height = height + 21
end
end
--[=[
if (RaiderIO and RaiderIO.GetScore) then
local mythicPlusScore = RaiderIO.GetScore (name)
if (mythicPlusScore and mythicPlusScore.allScore) then
GameCooltip:AddLine ("Mythic+ Score:", mythicPlusScore.allScore, 1, "white", "white")
_detalhes:AddTooltipBackgroundStatusbar()
end
end
--]=]
GameCooltip:SetOption ("FixedHeight", height)
GameCooltip:ShowCooltip()