From 026aa2223ace0cbec92e1e016c358ba2b8a6eada Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Mon, 16 May 2022 14:26:54 -0300 Subject: [PATCH] Added /keystone command; update on OpenRaid library; Several appearance settings added --- Libs/LibOpenRaid/LibOpenRaid.lua | 14 ++++++++------ Libs/LibOpenRaid/docs.txt | 17 +++++++++++++++++ boot.lua | 8 ++++---- core/parser.lua | 2 +- functions/slash.lua | 2 ++ 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 8a3e8f35e..263165d84 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -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) diff --git a/Libs/LibOpenRaid/docs.txt b/Libs/LibOpenRaid/docs.txt index f400944f3..b4b66fe5e 100644 --- a/Libs/LibOpenRaid/docs.txt +++ b/Libs/LibOpenRaid/docs.txt @@ -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") \ No newline at end of file diff --git a/boot.lua b/boot.lua index 212de8d73..fbc6317a5 100644 --- a/boot.lua +++ b/boot.lua @@ -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 @@ -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.", @@ -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.", diff --git a/core/parser.lua b/core/parser.lua index f7b1781a6..905ad4eb2 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -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 diff --git a/functions/slash.lua b/functions/slash.lua index 7240561c0..f1e6c3a6d 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -2197,6 +2197,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then end openRaidLib.RequestKeystoneDataFromGuild() + + DetailsKeystoneInfoFrame.RefreshData() end end end \ No newline at end of file