Skip to content

Commit

Permalink
Added Search into the options panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Sep 25, 2021
1 parent e607f32 commit 1c20f16
Show file tree
Hide file tree
Showing 14 changed files with 503 additions and 335 deletions.
548 changes: 274 additions & 274 deletions Libs/LibRaidStatus/LibRaidStatus.lua → Libs/LibOpenRaid/LibOpenRaid.lua

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 90002
## Title: Library Raid Status
## Title: Library Open Raid
## Notes: This is a library used by addons.

lib.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

--data which main need maintenance over time

if (not LIB_RAID_STATUS_CAN_LOAD) then
if (not LIB_OPEN_RAID_CAN_LOAD) then
return
end

LIB_RAID_STATUS_AUGMENTATED_RUNE = 347901
LIB_OPEN_RAID_AUGMENTATED_RUNE = 347901

LIB_RAID_STATUS_COVENANT_ICONS = {
LIB_OPEN_RAID_COVENANT_ICONS = {
[[Interface\ICONS\UI_Sigil_Kyrian]], --kyrian
[[Interface\ICONS\UI_Sigil_Venthyr]], --venthyr
[[Interface\ICONS\UI_Sigil_NightFae]], --nightfae
[[Interface\ICONS\UI_Sigil_Necrolord]], --necrolords
}

LIB_RAID_STATUS_MELEE_SPECS = {
LIB_OPEN_RAID_MELEE_SPECS = {
[251] = "DEATHKNIGHT",
[252] = "DEATHKNIGHT",
[577] = "DEMONHUNTER",
Expand All @@ -32,7 +32,7 @@ LIB_RAID_STATUS_MELEE_SPECS = {

--which gear slots can be enchanted on the latest retail version of the game
--when the value is a number, the slot only receives enchants for a specific attribute
LIB_RAID_STATUS_ENCHANT_SLOTS = {
LIB_OPEN_RAID_ENCHANT_SLOTS = {
--[INVSLOT_NECK] = true,

[INVSLOT_BACK] = true, --for all
Expand All @@ -50,7 +50,7 @@ LIB_RAID_STATUS_ENCHANT_SLOTS = {
-- local itemLink = GetInventoryItemLink("player", slotId)
-- local enchandId = select (3, strsplit(":", itemLink))
-- print("enchantId:", enchandId)
LIB_RAID_STATUS_ENCHANT_IDS = {
LIB_OPEN_RAID_ENCHANT_IDS = {
--FEET
--[6207] = INVSLOT_FEET, --[Enchant Boots - Speed of Soul]
[6211] = INVSLOT_FEET, --[Enchant Boots - Eternal Agility] + 15 agi
Expand Down Expand Up @@ -91,13 +91,21 @@ LIB_RAID_STATUS_ENCHANT_IDS = {
[6227] = INVSLOT_MAINHAND, --[Enchant Weapon - Ascended Vigor] + healing received increased
[6228] = INVSLOT_MAINHAND, --[Enchant Weapon - Sinful Revelation] + 6% bleed damage
[6229] = INVSLOT_MAINHAND, --[Enchant Weapon - Celestial Guidance] + 5% agility
[6243] = INVSLOT_MAINHAND, --[Runeforging: Rune of Hysteria]
[3370] = INVSLOT_MAINHAND, --[Runeforging: Rune of Razorice]
[6241] = INVSLOT_MAINHAND, --[Runeforging: Rune of Sanguination]
[6242] = INVSLOT_MAINHAND, --[Runeforging: Rune of Spellwarding]
[6245] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Apocalypse]
[3368] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Fallen Crusader]
[3847] = INVSLOT_MAINHAND, --[Runeforging: Rune of the Stoneskin Gargoyle]
[6244] = INVSLOT_MAINHAND, --[Runeforging: Rune of Unending Thirst]
}

-- how to get the gemId:
-- local itemLink = GetInventoryItemLink("player", slotId)
-- local gemId = select (4, strsplit(":", itemLink))
-- print("gemId:", gemId)
LIB_RAID_STATUS_GEM_IDS = {
LIB_OPEN_RAID_GEM_IDS = {
[173126] = true, --Straddling Jewel Doublet (green, +12 speed)
[173125] = true, --Revitalizing Jewel Doublet (green, +100 health)
[173130] = true, --Masterful Jewel Cluster (blue, master)
Expand All @@ -106,7 +114,8 @@ LIB_RAID_STATUS_GEM_IDS = {
[173128] = true, --Quick Jewel Cluster (blue, haste)
}

LIB_RAID_STATUS_WEAPON_ENCHANT_IDS = {
--/dump GetWeaponEnchantInfo()
LIB_OPEN_RAID_WEAPON_ENCHANT_IDS = {
[6188] = true, --shadowcore oil
[6190] = true, --embalmer's oil
[6201] = true, --weighted
Expand All @@ -115,7 +124,7 @@ LIB_RAID_STATUS_WEAPON_ENCHANT_IDS = {
[5401] = true, --windfury
}

LIB_RAID_STATUS_COOLDOWNS_BY_SPEC = {
LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = {
-- 1 attack cooldown
-- 2 personal defensive cooldown
-- 3 targetted defensive cooldown
Expand Down Expand Up @@ -591,7 +600,7 @@ LIB_RAID_STATUS_COOLDOWNS_BY_SPEC = {
--if talent is required, use the command:
--/dump GetTalentInfo (talentTier, talentColumn, 1)
--example: to get the second talent of the last talent line, use: /dump GetTalentInfo (7, 2, 1)
LIB_RAID_STATUS_COOLDOWNS_INFO = {
LIB_OPEN_RAID_COOLDOWNS_INFO = {
--> paladin
[31884] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "PALADIN", type = 1}, --Avenging Wrath
[216331] = {cooldown = 120, duration = 20, talent = 22190, charges = 1, class = "PALADIN", type = 1}, --Avenging Crusader (talent)
Expand Down
46 changes: 23 additions & 23 deletions Libs/LibRaidStatus/docs.txt → Libs/LibOpenRaid/docs.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@

Raid Status is a library to share the player information while playing in a group or raid.
Open Raid is a library to share the player information while playing in a group or raid.

Install:
Place the library at your addon folder/libs/LibRaidStatus/
Inside LibRaidStatus there's 5 files.
Add <Include file="Libs\LibRaidStatus\lib.xml"/> to your libs.xml located in the root folder of the addon or
<Include file="LibRaidStatus\lib.xml"/> if it is located inside the Libs folder.
Place the library at your addon folder/libs/LibOpenRaid/
Inside LibOpenRaid there's 5 files.
Add <Include file="Libs\LibOpenRaid\lib.xml"/> to your libs.xml located in the root folder of the addon or
<Include file="LibOpenRaid\lib.xml"/> if it is located inside the Libs folder.
Close and open the game client.

Inside your lua file, get the library object, you need to do this in order to grab a reference of the library:
local raidStatusLib = LibStub:GetLibrary("LibRaidStatus-1.0")
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")
With this object, you can start querying the library for information.

Functions:

local sentRequest = raidStatusLib.RequestAllPlayersInfo()
local sentRequest = openRaidLib.RequestAllPlayersInfo()
Request to all players to send all data infomation: cooldowns, gear and player data.
Instants after calling this, expect to receive several callbacks.


local allPlayersGear = raidStatusLib.gearManager.GetAllPlayersGear()
local allPlayersGear = openRaidLib.gearManager.GetAllPlayersGear()
allPlayersGear = {
["playerName1"] = playerGear,
["playerName2"] = playerGear,
["playerName3"] = playerGear,
}

local playerGear = raidStatusLib.gearManager.GetPlayerGear(playerName)
local playerGear = openRaidLib.gearManager.GetPlayerGear(playerName)
playerGear = {
.durability = number
.ilevel = number
Expand All @@ -36,14 +36,14 @@ playerGear = {
}


local allPlayersCooldowns = raidStatusLib.cooldownManager.GetAllPlayersCooldown()
local allPlayersCooldowns = openRaidLib.cooldownManager.GetAllPlayersCooldown()
allPlayersCooldowns = {
["playerName1"] = playerCooldows,
["playerName2"] = playerCooldows,
["playerName3"] = playerCooldows,
}

local playerCooldows = raidStatusLib.cooldownManager.GetPlayerCooldowns(playerName)
local playerCooldows = openRaidLib.cooldownManager.GetPlayerCooldowns(playerName)
playerCooldows = {
[cooldownSpellId] = {
[1] = time left (number),
Expand All @@ -54,14 +54,14 @@ playerCooldows = {
}


local allPlayersInfo = raidStatusLib.playerInfoManager.GetAllPlayersInfo()
local allPlayersInfo = openRaidLib.playerInfoManager.GetAllPlayersInfo()
allPlayersInfo = {
["playerName1"] = playerInfo,
["playerName2"] = playerInfo,
["playerName3"] = playerInfo,
}

local playerInfo = raidStatusLib.playerInfoManager.GetPlayerInfo(playerName)
local playerInfo = openRaidLib.playerInfoManager.GetPlayerInfo(playerName)
playerInfo = {
.specId = number
.renown = number,
Expand Down Expand Up @@ -106,7 +106,7 @@ function MyAddonObject.OnReceiveCooldownListUpdate(unitName, playerCooldows, all
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "CooldownListUpdate", "OnReceiveCooldownListUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "CooldownListUpdate", "OnReceiveCooldownListUpdate")

===================================================================================================================================
"CooldownUpdate": triggered when any unit in the group used a cooldown or the timeleft got an update
Expand All @@ -129,7 +129,7 @@ function MyAddonObject.OnReceiveCooldownUpdate(unitName, spellId, cooldownTimeLe
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "CooldownUpdate", "OnReceiveCooldownUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "CooldownUpdate", "OnReceiveCooldownUpdate")

===================================================================================================================================
"CooldownListWiped": when the list of cooldowns get a wipe, usually when the player leave the group
Expand All @@ -140,7 +140,7 @@ function MyAddonObject.OnCooldownListWipe(allPlayersCooldowns)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "CooldownListWiped", "OnCooldownListWipe")
openRaidLib.RegisterCallback(MyAddonObject, "CooldownListWiped", "OnCooldownListWipe")


===================================================================================================================================
Expand All @@ -163,7 +163,7 @@ function MyAddonObject.OnGearUpdate(playerName, playerGear, allPlayersGear)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "GearUpdate", "OnGearUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "GearUpdate", "OnGearUpdate")

===================================================================================================================================
"GearDurabilityUpdate": when the gear durability of a player in the group changes
Expand All @@ -174,7 +174,7 @@ function MyAddonObject.OnGearDurabilityUpdate(playerName, durability, playerGear
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "GearDurabilityUpdate", "OnGearDurabilityUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "GearDurabilityUpdate", "OnGearDurabilityUpdate")

===================================================================================================================================
"GearListWiped": when the list of gear get a wipe, usually when the player leave the group
Expand All @@ -185,7 +185,7 @@ function MyAddonObject.OnGearListWiped(allPlayersGear)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "GearListWiped", "OnGearListWiped")
openRaidLib.RegisterCallback(MyAddonObject, "GearListWiped", "OnGearListWiped")

===================================================================================================================================
"PlayerUpdate": received a player information about its spec, talents, etc...
Expand All @@ -202,7 +202,7 @@ function MyAddonObject.OnPlayerUpdate(playerName, playerInfo, allPlayersInfo)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "PlayerUpdate", "OnPlayerUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "PlayerUpdate", "OnPlayerUpdate")

===================================================================================================================================
"TalentsUpdate": when a unit changed a talent
Expand All @@ -217,7 +217,7 @@ function MyAddonObject.OnTalentUpdate(playerName, talents, playerInfo, allPlayer
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "TalentUpdate", "OnTalentUpdate")
openRaidLib.RegisterCallback(MyAddonObject, "TalentUpdate", "OnTalentUpdate")


===================================================================================================================================
Expand All @@ -229,7 +229,7 @@ function MyAddonObject.OnPlayerDeath(playerName)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "OnPlayerDeath", "OnPlayerDeath")
openRaidLib.RegisterCallback(MyAddonObject, "OnPlayerDeath", "OnPlayerDeath")

===================================================================================================================================
"OnPlayerRess": when a player revives
Expand All @@ -240,5 +240,5 @@ function MyAddonObject.OnPlayerRess(playerName)
end

--registering the callback:
raidStatusLib.RegisterCallback(MyAddonObject, "OnPlayerRess", "OnPlayerRess")
openRaidLib.RegisterCallback(MyAddonObject, "OnPlayerRess", "OnPlayerRess")

2 changes: 1 addition & 1 deletion Libs/LibRaidStatus/lib.xml → Libs/LibOpenRaid/lib.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="LibRaidStatus.lua" />
<Script file="LibOpenRaid.lua" />
<Script file="ThingsToMantain.lua" />
</Ui>
2 changes: 1 addition & 1 deletion Libs/libs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Include file="LibDeflate\lib.xml"/>
<Include file="LibItemUpgradeInfo-1.0\LibItemUpgradeInfo-1.0.xml"/>
<!-- <Include file="LibGroupInSpecT-1.1\lib.xml"/> temp disabled due to classic-->
<Include file="LibRaidStatus\lib.xml"/>
<Include file="LibOpenRaid\lib.xml"/>
<Include file="DF\load.xml"/>
<Include file="LibTranslit\LibTranslit-1.0.xml"/>
</Ui>
18 changes: 9 additions & 9 deletions frames/window_cdtracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

local Details = _G.Details
local DF = _G.DetailsFramework
local raidStatusLib = LibStub:GetLibrary("LibRaidStatus-1.0")
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")

local width = 170
local height = 300
Expand Down Expand Up @@ -42,9 +42,9 @@ function Details.CooldownTracking.EnableTracker()
Details.ocd_tracker.enabled = true

--register callbacks
raidStatusLib.RegisterCallback(Details.CooldownTracking, "CooldownListUpdate", "CooldownListUpdateFunc")
raidStatusLib.RegisterCallback(Details.CooldownTracking, "CooldownListWiped", "CooldownListWipedFunc")
raidStatusLib.RegisterCallback(Details.CooldownTracking, "CooldownUpdate", "CooldownUpdateFunc")
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownListUpdate", "CooldownListUpdateFunc")
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownListWiped", "CooldownListWipedFunc")
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownUpdate", "CooldownUpdateFunc")

--Details.CooldownTracking.RefreshCooldownFrames()
end
Expand All @@ -58,9 +58,9 @@ function Details.CooldownTracking.DisableTracker()
end

--unregister callbacks
raidStatusLib.UnregisterCallback(Details.CooldownTracking, "CooldownListUpdate", "CooldownUpdateFunc")
raidStatusLib.UnregisterCallback(Details.CooldownTracking, "CooldownListWiped", "CooldownUpdateFunc")
raidStatusLib.UnregisterCallback(Details.CooldownTracking, "CooldownUpdate", "CooldownUpdateFunc")
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownListUpdate", "CooldownUpdateFunc")
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownListWiped", "CooldownUpdateFunc")
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownUpdate", "CooldownUpdateFunc")
end
function Details.CooldownTracking.CooldownUpdateFunc()
Details.CooldownTracking.RefreshCooldowns()
Expand Down Expand Up @@ -116,7 +116,7 @@ function Details.CooldownTracking.ProcessUnitCooldowns(unitId, statusBarFrameId,
return
end

local allPlayersInfo = raidStatusLib.playerInfoManager.GetAllPlayersInfo()
local allPlayersInfo = openRaidLib.playerInfoManager.GetAllPlayersInfo()
local allCooldownsFromLib = LIB_RAID_STATUS_COOLDOWNS_BY_SPEC
local cooldownsEnabled = Details.ocd_tracker.cooldowns

Expand Down Expand Up @@ -249,7 +249,7 @@ function Details.CooldownTracking.RefreshCooldowns()

--local cache saved with the character savedVariables
local cooldownCache = screenPanel.cooldownCache
local cooldownStatus = raidStatusLib.cooldownManager.GetAllPlayersCooldown()
local cooldownStatus = openRaidLib.cooldownManager.GetAllPlayersCooldown()
local cooldownIndex = 1

for unitName, allPlayerCooldowns in pairs(cooldownStatus) do
Expand Down
Loading

0 comments on commit 1c20f16

Please sign in to comment.