Thread Tools Display Modes
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
05-01-22, 09:03 AM   #2
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi all,

after some time spent in tries seems to me that:

Lua Code:
  1. C_MythicPlus.RequestMapInfo()

will do the job.

Don't know why, but it seems to work
If someone has a more cleaner solution and mind to share will be really appreciated
Thanks again ...
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
05-03-22, 12:14 AM   #3
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
After some more tests it is not TRUE this

sometime it works sometime it doesn't ...

It seems to me that vault is online refreshed when you use the hearthstone but not when you use a mage portal ... but also this could be a random effect ...

This is really frustrating because to test the code I have to do some m+ runs and then I have only one shot to check before the reload of the addon in case of changes. Then it works 100%.

Could it be related to this ?
https://eu.battle.net/support/en/article/279635


Thanks again and sorry for the wrong info.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.

Last edited by gmarco : 05-03-22 at 12:17 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Refresh the Great Vault values

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off