Hi all.
Now to continue the M+ theme
I am adding to an of mine addon the possibility to display the preview of Great Vault.
I'd like to ask if there is a function | event | trigger that can let my addon be aware of the changes of itself.
This because I have this code:
Lua Code:
local runHistory=C_MythicPlus.GetRunHistory(false,true)
if runHistory and #runHistory>0 then
row,col = tooltip:AddLine()
row,col = tooltip:AddLine()
row,col = tooltip:AddLine()
tooltip:SetCell(row,1,L["Vault summary"],"CENTER",4)
tooltip:SetCellTextColor(row,1,1,1,0,1)
tooltip:AddSeparator(1,1,1,0,1)
for index,run in ipairs(runHistory) do
if index<=8 then
table.insert(vaultRewards, run.level)
end
end
table.sort(vaultRewards, function(a, b) return a > b end)
end
for i=1, #vaultRewards do
if (i==1 or i==4 or i==8) then
loot_string = loot_string .. string.format(": %s [ %s ] ", vaultRewards[i] , C_MythicPlus.GetRewardLevelFromKeystoneLevel(vaultRewards[i]))
else
loot_string = loot_string .. string.format(": %s ", vaultRewards[i])
end
end
The problem seems that this:
Lua Code:
runHistory=C_MythicPlus.GetRunHistory(false,true)
doesn't change until I relog or I visit the great vault manually.
So if I finish a m+ run, until I visit the Vault or I relog I am not able to see the new values.
I have tried to use:
To see if something changes ... but without any success...
Anyone knows what (if possible) have to be used to refresh this ?
Thanks.