Skip to content

Commit

Permalink
Added /keystone command; update on OpenRaid library; Several appearan…
Browse files Browse the repository at this point in the history
…ce settings added
  • Loading branch information
Tercioo committed May 16, 2022
1 parent a988f7b commit 026aa22
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
14 changes: 8 additions & 6 deletions Libs/LibOpenRaid/LibOpenRaid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions Libs/LibOpenRaid/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
8 changes: 4 additions & 4 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 9780
_detalhes.alpha_build_counter = 9780 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 9814
_detalhes.alpha_build_counter = 9814 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 37
_detalhes.dont_open_news = true
_detalhes.game_version = version
Expand All @@ -33,8 +33,8 @@ do
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )

local news = {
--[=[
{"v9.2.0.9814.146", "May 15th, 2022"},
"Added slash command /keystone, this command show keystones of other users with addons using Open Raid library.",
"Added a second Title Bar (disabled by default), is recomended to make the Skin Color (under Window Body) full transparent while using it.",
"Added Overlay Texture and Color options under Bars: General.",
"Added Wallpaper Alignment 'Full Body', this alignment make the wallpaper fill over the title bar.",
Expand All @@ -48,7 +48,7 @@ do
"Fixed several bugs with 'Bar Orientation: Right to Left' (fix by Flamanis).",
"Fixed an error on Vanguard plugin.",
"Fixed Spec Icons 'Specialization Alpha' offseted by 2 pixels to the right.",
--]=]

{"v9.2.0.9778.146", "April 26th, 2022"},
--"A cooldown tracker experiment has been added, its options is visible at the Options Panel.",
"Added a search box in the '/details scroll' feature.",
Expand Down
2 changes: 1 addition & 1 deletion core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
local escudo = _detalhes.escudos --details local
local parser = _detalhes.parser --details local
local absorb_spell_list = _detalhes.AbsorbSpells --details local
local arena_enemies = _detalhes.arena_enemies --details local
--local arena_enemies = _detalhes.arena_enemies --details local (not in use - deprecated)

local cc_spell_list = DetailsFramework.CrowdControlSpells
local container_habilidades = _detalhes.container_habilidades --details local
Expand Down
2 changes: 2 additions & 0 deletions functions/slash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
end

openRaidLib.RequestKeystoneDataFromGuild()

DetailsKeystoneInfoFrame.RefreshData()
end
end
end

0 comments on commit 026aa22

Please sign in to comment.