Added /keystone command; update on OpenRaid library; Several appearance settings added

This commit is contained in:
Tercio Jose
2022-05-16 14:26:54 -03:00
parent a988f7b429
commit 026aa2223a
5 changed files with 32 additions and 11 deletions
+8 -6
View File
@@ -45,7 +45,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
end
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 36
local CONST_LIB_VERSION = 37
LIB_OPEN_RAID_CAN_LOAD = false
--declae the library within the LibStub
@@ -2090,7 +2090,7 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNFULLLIST_PREFIX, openRai
updateKeystoneInfo(keystoneInfo, level, mapID, challengeMapID, classID, rating, mythicPlusMapID)
--trigger public callback
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", openRaidLib.GetUnitID(unitName), keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", unitName, keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
end
end
openRaidLib.commHandler.RegisterComm(CONST_COMM_KEYSTONE_DATA_PREFIX, openRaidLib.KeystoneInfoManager.OnReceiveKeystoneData)
@@ -2119,8 +2119,9 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNFULLLIST_PREFIX, openRai
openRaidLib.KeystoneInfoManager.OnReceiveRequestData()
--trigger public callback
local keystoneInfo = openRaidLib.KeystoneInfoManager.GetKeystoneInfo(UnitName("player"), true)
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", "player", keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
local unitName = UnitName("player")
local keystoneInfo = openRaidLib.KeystoneInfoManager.GetKeystoneInfo(unitName, true)
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", unitName, keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
end
function openRaidLib.KeystoneInfoManager.OnMythicDungeonFinished()
@@ -2132,8 +2133,9 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNFULLLIST_PREFIX, openRai
openRaidLib.KeystoneInfoManager.OnReceiveRequestData()
--trigger public callback
local keystoneInfo = openRaidLib.KeystoneInfoManager.GetKeystoneInfo(UnitName("player"), true)
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", "player", keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
local unitName = UnitName("player")
local keystoneInfo = openRaidLib.KeystoneInfoManager.GetKeystoneInfo(unitName, true)
openRaidLib.publicCallback.TriggerCallback("KeystoneUpdate", unitName, keystoneInfo, openRaidLib.KeystoneInfoManager.KeystoneData)
end
openRaidLib.internalCallback.RegisterCallback("onEnterWorld", openRaidLib.KeystoneInfoManager.OnPlayerEnterWorld)
+17
View File
@@ -104,12 +104,18 @@ allKeystoneInfo = {
["unitName3"] = keystoneInfo,
}
--@mapID and @challengeMapID are the instanceMapID, also obtained with GetInstanceInfo(), can be used to retrive map name with GetRealZoneText(mapID)
--@mythicPlusMapID is used with C_ChallengeMode.GetMapUIInfo(mythicPlusMapID) to retrive the map name for the dungeon
--@classID: class id as number (1 to 12)
--@rating: mythic plus rating on the current season
local keystoneInfo = openRaidLib.GetKeystoneInfo(unitId)
keystoneInfo = {
.level = number,
.mapID = number,
.challengeMapID = number,
.classID = number,
.rating = number,
.mythicPlusMapID = number,
}
--request all online players in the guild to send their keystone information
@@ -401,3 +407,14 @@ end
--registering the callback:
openRaidLib.RegisterCallback(MyAddonObject, "UnitAlive", "OnUnitRess")
===================================================================================================================================
"KeystoneUpdate": triggered when the list of keystones got an update
===================================================================================================================================
function MyAddonObject.OnKeystoneUpdate(unitName, keystoneInfo, allKeystoneInfo)
local mapName = C_ChallengeMode.GetMapUIInfo(keystoneInfo.mythicPlusMapID)
print(unitName .. " has a " .. keystoneInfo.level .. " keystone for map " .. mapName .. ".")
end
--registering the callback:
openRaidLib.RegisterCallback(MyAddonObject, "KeystoneUpdate", "OnKeystoneUpdate")