Hi,
thanks for the reply.
The only way I succeded in let things works is with code like this:
Lua Code:
local function UpdatePg()
if UnitLevel("player") == GetMaxPlayerLevel() then
-- Refresh the current player in the array
GMKEYSTONE_NAMES[realmName.."-"..playerName] = {}
GMKEYSTONE_NAMES[realmName.."-"..playerName]["NAME"] = realmName.."-"..playerName
GMKEYSTONE_NAMES[realmName.."-"..playerName]["CLASS"] = select(2,UnitClass("player"))
GMKEYSTONE_NAMES[realmName.."-"..playerName]["WEEKLYKEY"] = "-"
GMKEYSTONE_NAMES[realmName.."-"..playerName]["MYKEY"] = "-"
if C_MythicPlus.GetOwnedKeystoneChallengeMapID() then
-- you have a keystone
GMKEYSTONE_NAMES[realmName.."-"..playerName]["MYKEY"] = C_ChallengeMode.GetMapUIInfo(C_MythicPlus.GetOwnedKeystoneChallengeMapID()) .. " (" .. C_MythicPlus.GetOwnedKeystoneLevel() ..")"
dataobj.text = short[C_MythicPlus.GetOwnedKeystoneChallengeMapID()] .. ":" .. C_MythicPlus.GetOwnedKeystoneLevel()
-- you have done a dungeon+
if C_MythicPlus.GetWeeklyChestRewardLevel() ~= 0 then
GMKEYSTONE_NAMES[realmName.."-"..playerName]["WEEKLYKEY"], _ = C_MythicPlus.GetWeeklyChestRewardLevel()
end
else -- you don't have a keystone
-- but you have a reward ready
if C_MythicPlus.IsWeeklyRewardAvailable() then
GMKEYSTONE_NAMES[realmName.."-"..playerName]["WEEKLYKEY"] = "*"
dataobj.text = "chest ready"
end
-- if you don't have a reward ready is already defined = "-" as default
end
end
end
-- code
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent", function(self, event, arg1)
UpdatePg()
end)
Probably there will be a more correct way of doing thing but I was not able to find it
I use the idea that if I have a keystone in the bag I did at least a m+ dungeon. I hope that it is right
Thanks.