Bug fixes on default plugins

This commit is contained in:
Tercio Jose
2023-01-03 23:52:46 -03:00
parent bfe15744e5
commit 20a0bb7bcd
3 changed files with 983 additions and 1004 deletions
@@ -212,6 +212,7 @@ local CreatePluginFrames = function()
{text = "Food", width = 45},
{text = "Flask", width = 45},
{text = "Rune", width = 45},
{text = "M+ Score", width = 60},
--{text = "Pre-Pot Last Try", width = 100},
--{text = "Using Details!", width = 100},
}
@@ -294,6 +295,9 @@ local CreatePluginFrames = function()
--no rune
local runeIndicator = DF:CreateImage(line, "", scrollLineHeight, scrollLineHeight)
--mythic+
local mythicPlusIndicator = DF:CreateLabel(line)
--no pre pot
--local PrePotIndicator = DF:CreateImage (line, "", scroll_line_height, scroll_line_height)
--using details!
@@ -306,6 +310,7 @@ local CreatePluginFrames = function()
line:AddFrameToHeaderAlignment(foodIndicator)
line:AddFrameToHeaderAlignment(flaskIndicator)
line:AddFrameToHeaderAlignment(runeIndicator)
line:AddFrameToHeaderAlignment(mythicPlusIndicator)
--line:AddFrameToHeaderAlignment(PrePotIndicator)
--line:AddFrameToHeaderAlignment(DetailsIndicator)
@@ -323,6 +328,7 @@ local CreatePluginFrames = function()
line.FlaskIndicator = flaskIndicator
line.FlaskTierIndicator = flaskTierIndicator
line.RuneIndicator = runeIndicator
line.MythicPlusIndicator = mythicPlusIndicator
--line.PrePotIndicator = PrePotIndicator
--line.DetailsIndicator = DetailsIndicator
@@ -407,8 +413,6 @@ local CreatePluginFrames = function()
line.TalentsRow:ClearIcons()
--print("dssd", playerTable.Talents)
if (playerTable.Talents) then
for i = 1, #playerTable.Talents do
local talent = playerTable.Talents[i]
@@ -454,6 +458,9 @@ local CreatePluginFrames = function()
line.RuneIndicator.texture = playerTable.Rune and [[Interface\Scenarios\ScenarioIcon-Check]] or ""
--line.PrePotIndicator.texture = playerTable.PrePot and [[Interface\Scenarios\ScenarioIcon-Check]] or ""
--line.DetailsIndicator.texture = playerTable.UseDetails and [[Interface\Scenarios\ScenarioIcon-Check]] or ""
--mythic+ score
line.MythicPlusIndicator.text = playerTable.MythicPlusScore and playerTable.MythicPlusScore > 0 and playerTable.MythicPlusScore or ""
end
end
end
@@ -638,6 +645,26 @@ local CreatePluginFrames = function()
end
end
local mythicPlusScore = 0
local RaiderIO = _G.RaiderIO
if (RaiderIO) then
local playerName, playerRealm = unitNameWithRealm:match("(.+)%-(.+)")
local faction = UnitFactionGroup(unitNameWithRealm)
faction = faction == "Horde" and 2 or 1
--local rioProfile = RaiderIO.GetProfile(playerName, playerRealm, faction == "Horde" and 2 or 1)
local rioProfile = RaiderIO.GetProfile(playerName, playerRealm) or RaiderIO.GetProfile(unitName, GetRealmName())
if (rioProfile and rioProfile.mythicKeystoneProfile) then
local mythicPlusProfile = rioProfile.mythicKeystoneProfile
local previousScore = mythicPlusProfile.previousScore or 0
local currentScore = mythicPlusProfile.currentScore or 0
mythicPlusScore = previousScore and previousScore > currentScore and previousScore or currentScore
mythicPlusScore = mythicPlusScore or currentScore
end
end
--order by class > alphabetically by the unit name
unitClassID = (((unitClassID or 0) + 128) ^ 4) + tonumber(string.byte (unitName, 1) .. "" .. string.byte(unitName, 2))
@@ -656,6 +683,7 @@ local CreatePluginFrames = function()
Rune = DetailsRaidCheck.havefocusaug_table[unitSerial],
Eating = DetailsRaidCheck.iseating_table[unitSerial],
UseDetails = Details.trusted_characters[unitSerial],
MythicPlusScore = mythicPlusScore,
})
end
@@ -683,6 +711,20 @@ local CreatePluginFrames = function()
end
end
local mythicPlusScore = 0
local RaiderIO = _G.RaiderIO
if (RaiderIO) then
local rioProfile = RaiderIO.GetProfile(unitName, GetRealmName())
if (rioProfile and rioProfile.mythicKeystoneProfile) then
local mythicPlusProfile = rioProfile.mythicKeystoneProfile
local previousScore = mythicPlusProfile.previousScore or 0
local currentScore = mythicPlusProfile.currentScore or 0
mythicPlusScore = previousScore and previousScore > currentScore and previousScore or currentScore
mythicPlusScore = mythicPlusScore or currentScore
end
end
tinsert (PlayerData, {unitName, unitClassID,
Name = unitName,
UnitNameRealm = unitNameWithRealm,
@@ -698,6 +740,7 @@ local CreatePluginFrames = function()
Rune = DetailsRaidCheck.havefocusaug_table[unitSerial],
Eating = DetailsRaidCheck.iseating_table[unitSerial],
UseDetails = Details.trusted_characters[unitSerial],
MythicPlusScore = mythicPlusScore,
})
end
@@ -795,7 +838,7 @@ local CreatePluginFrames = function()
local unitSerial = UnitGUID(unitId)
local function handleAuraBuff(aura)
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID)
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID(unitId, aura.auraInstanceID)
if (auraInfo) then
local buffName = auraInfo.name
local spellId = auraInfo.spellId