View Single Post
05-01-22, 02:04 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Refresh the Great Vault values

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:
  1. local runHistory=C_MythicPlus.GetRunHistory(false,true)
  2. if runHistory and #runHistory>0 then
  3.  
  4. row,col = tooltip:AddLine()
  5. row,col = tooltip:AddLine()        
  6. row,col = tooltip:AddLine()
  7. tooltip:SetCell(row,1,L["Vault summary"],"CENTER",4)
  8. tooltip:SetCellTextColor(row,1,1,1,0,1)
  9.  
  10. tooltip:AddSeparator(1,1,1,0,1)
  11.  
  12.     for index,run in ipairs(runHistory) do
  13.         if index<=8 then
  14.             table.insert(vaultRewards, run.level)
  15.         end
  16.     end
  17.     table.sort(vaultRewards, function(a, b) return a > b end)      
  18. end
  19.  
  20. for i=1, #vaultRewards do
  21.     if (i==1 or i==4 or i==8) then
  22.         loot_string = loot_string .. string.format(": %s [ %s ] ", vaultRewards[i] , C_MythicPlus.GetRewardLevelFromKeystoneLevel(vaultRewards[i]))  
  23.     else
  24.         loot_string = loot_string .. string.format(": %s ", vaultRewards[i])
  25.     end
  26. end

The problem seems that this:
Lua Code:
  1. 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:
Lua Code:
  1. WeeklyRewards_LoadUI()

To see if something changes ... but without any success...

Anyone knows what (if possible) have to be used to refresh this ?

Thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote