Skip to content

Commit

Permalink
dont get this infos if not max level and datatext m+ score schows lev…
Browse files Browse the repository at this point in the history
…el as text if not max level
  • Loading branch information
mBlinkii committed May 12, 2024
1 parent 2aade4c commit 98037dc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
7 changes: 4 additions & 3 deletions Addon/ElvUI_mMediaTag/modules/Dock/mLFDTool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ end

local function mLFDTooltip()
local _, hc, myth, mythp, other, title, tip = mMT:mColorDatatext()
local isMaxLevel = E:XPIsLevelMax()

mInstanceInfoText = mMT:InstanceInfo()
if mInstanceInfoText then
Expand All @@ -122,7 +123,7 @@ local function mLFDTooltip()
DT.tooltip:AddLine(mInstanceInfoText[3])
end

if E.Retail and E.db.mMT.dockdatatext.lfd.keystone then
if E.Retail and E.db.mMT.dockdatatext.lfd.keystone and isMaxLevel then
keyText = mMT:OwenKeystone()
if keyText then
DT.tooltip:AddLine(" ")
Expand All @@ -131,7 +132,7 @@ local function mLFDTooltip()
end
end

if E.Retail and E.db.mMT.dockdatatext.lfd.score then
if E.Retail and E.db.mMT.dockdatatext.lfd.score and isMaxLevel then
DT.tooltip:AddLine(" ")
DT.tooltip:AddDoubleLine(DUNGEON_SCORE, mMT:GetDungeonScore())
end
Expand All @@ -149,7 +150,7 @@ local function mLFDTooltip()
end
end

if E.Retail and E.db.mMT.dockdatatext.lfd.greatvault and UnitLevel("player") == 70 then
if E.Retail and E.db.mMT.dockdatatext.lfd.greatvault and isMaxLevel then
local vaultinfohighest, ok = nil, false
vaultinforaidText, vaultinfomplusText, vaultinfopvpText, vaultinfohighest, ok = mMT:mGetVaultInfo()
if ok then
Expand Down
6 changes: 4 additions & 2 deletions Addon/ElvUI_mMediaTag/modules/datatexts/Dungeon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ local C_ChallengeMode = C_ChallengeMode
local mText = L["Dungeon"]

local function mSetup(self)
local isMaxLevel = E:XPIsLevelMax()

local mInstanceInfo = mMT:InstanceInfo()
if mInstanceInfo then
DT.tooltip:AddLine(" ")
Expand All @@ -41,7 +43,7 @@ local function mSetup(self)
DT.tooltip:AddLine(infoMythicPlus[2] or "-")
end

if E.Retail and E.db.mMT.dungeon.key then
if E.Retail and E.db.mMT.dungeon.key and isMaxLevel then
local key = mMT:OwenKeystone()
if key then
DT.tooltip:AddLine(" ")
Expand All @@ -50,7 +52,7 @@ local function mSetup(self)
end
end

if E.Retail and E.db.mMT.dungeon.score then
if E.Retail and E.db.mMT.dungeon.score and isMaxLevel then
DT.tooltip:AddLine(" ")
DT.tooltip:AddDoubleLine(DUNGEON_SCORE, mMT:GetDungeonScore())
end
Expand Down
51 changes: 30 additions & 21 deletions Addon/ElvUI_mMediaTag/modules/datatexts/Score.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ local IconOverall = E:TextureString("Interface\\AddOns\\ElvUI_mMediaTag\\media\\
local IconTyrannical = E:TextureString("Interface\\AddOns\\ElvUI_mMediaTag\\media\\icons\\datatext\\tyrannical.tga", ":14:14")
local IconFortified = E:TextureString("Interface\\AddOns\\ElvUI_mMediaTag\\media\\icons\\datatext\\fortified.tga", ":14:14")
local LeadIcon = E:TextureString("Interface\\AddOns\\ElvUI_mMediaTag\\media\\icons\\misc\\crown1.tga", ":14:14")
local isMaxLevel = E:XPIsLevelMax()

local function GetPlayerScore()
local ratingSummary = C_PlayerInfo_GetPlayerMythicPlusRatingSummary("PLAYER")
Expand Down Expand Up @@ -138,7 +139,7 @@ local function GetDungeonScores()

if overAllScore then
color = C_ChallengeMode_GetSpecificDungeonOverallScoreRarityColor(overAllScore)
ScoreTable[mapID].color = color and color:GenerateHexColor() or 'FFFFFFFF'
ScoreTable[mapID].color = color and color:GenerateHexColor() or "FFFFFFFF"
else
ScoreTable[mapID].color = "FFB2BABB"
end
Expand All @@ -156,7 +157,7 @@ local function GetDungeonScores()
ScoreTable[mapID][affixScores[j].name].color = "FFB2BABB"
else
color = C_ChallengeMode_GetSpecificDungeonScoreRarityColor(affixScores[j].score)
ScoreTable[mapID][affixScores[j].name].color = color and color:GenerateHexColor() or 'FFFFFFFF'
ScoreTable[mapID][affixScores[j].name].color = color and color:GenerateHexColor() or "FFFFFFFF"
end
else
if tmpName and tmpName == tyrannical then
Expand Down Expand Up @@ -268,7 +269,7 @@ local function GetGroupKeystone()
local mapName, _, _, icon = C_ChallengeMode.GetMapUIInfo(info.mythicPlusMapID)
if mapName then
local scoreColor = C_ChallengeMode_GetDungeonScoreRarityColor(info.rating)
scoreColor = scoreColor and scoreColor:GenerateHexColor() or 'FFFFFFFF'
scoreColor = scoreColor and scoreColor:GenerateHexColor() or "FFFFFFFF"
icon = E:TextureString(icon, ":14:14")
local key = format("%s %s%s|r %s", icon, E.db.mMT.datatextcolors.colormyth.hex, mapName, mMT:GetKeyColor(info.level))

Expand All @@ -283,16 +284,20 @@ local function GetGroupKeystone()
end
end
local function OnEnter(self)
isMaxLevel = E:XPIsLevelMax()

local inCombat = InCombatLockdown()
DT.tooltip:ClearLines()

if not inCombat then
SaveMyKeystone()

local keyText = mMT:OwenKeystone()
if keyText then
DT.tooltip:AddLine(keyText[1])
DT.tooltip:AddLine(keyText[2])
if isMaxLevel then
local keyText = mMT:OwenKeystone()
if keyText then
DT.tooltip:AddLine(keyText[1])
DT.tooltip:AddLine(keyText[2])
end
end

DT.tooltip:AddLine(" ")
Expand All @@ -301,7 +306,7 @@ local function OnEnter(self)
DT.tooltip:AddDoubleLine(v.name, v.key)
end

if E.db.mMT.mpscore.groupkeys and LOR and IsInGroup() then
if E.db.mMT.mpscore.groupkeys and LOR and IsInGroup() and isMaxLevel then
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(L["Keystones in your Group"])
GetGroupKeystone()
Expand All @@ -319,7 +324,7 @@ local function OnEnter(self)
end
end

if MPlusDataLoaded and GetPlayerScore() > 0 then
if isMaxLevel and MPlusDataLoaded and GetPlayerScore() > 0 then
DT.tooltip:AddLine(" ")
DT.tooltip:AddDoubleLine(DUNGEON_SCORE, mMT:GetDungeonScore())
DT.tooltip:AddLine(" ")
Expand All @@ -334,23 +339,27 @@ local function OnEnter(self)

DT.tooltip:Show()

self.text:SetFormattedText(displayString, mMT:GetDungeonScore())
self.text:SetFormattedText(displayString, isMaxLevel and mMT:GetDungeonScore() or L["Level: "] .. E.mylevel)
end

local function OnEvent(self, event, ...)
if event == "ELVUI_FORCE_UPDATE" then
C_MythicPlus_RequestMapInfo()
C_MythicPlus_RequestCurrentAffixes()
elseif event == "MYTHIC_PLUS_CURRENT_AFFIX_UPDATE" then
affixes = C_MythicPlus_GetCurrentAffixes()
weeklyAffixID = affixes and affixes[1] and affixes[1].id
weeklyAffixName = weeklyAffixID and C_ChallengeMode_GetAffixInfo(weeklyAffixID)
MPlusDataLoaded = true
end
isMaxLevel = E:XPIsLevelMax()

if isMaxLevel then
if event == "ELVUI_FORCE_UPDATE" then
C_MythicPlus_RequestMapInfo()
C_MythicPlus_RequestCurrentAffixes()
elseif event == "MYTHIC_PLUS_CURRENT_AFFIX_UPDATE" then
affixes = C_MythicPlus_GetCurrentAffixes()
weeklyAffixID = affixes and affixes[1] and affixes[1].id
weeklyAffixName = weeklyAffixID and C_ChallengeMode_GetAffixInfo(weeklyAffixID)
MPlusDataLoaded = true
end

SaveMyKeystone()
SaveMyKeystone()
end

self.text:SetFormattedText(displayString, mMT:GetDungeonScore())
self.text:SetFormattedText(displayString, isMaxLevel and mMT:GetDungeonScore() or L["Level: "] .. E.mylevel)
end

local function ValueColorUpdate(self, hex)
Expand Down

0 comments on commit 98037dc

Please sign in to comment.