Quantcast
Download
(1 Kb)
Download
Updated: 12/15/20 08:03 PM
Compatibility:
Markarth (6.2.5)
Updated:12/15/20 08:03 PM
Created:12/11/20 03:03 AM
Monthly downloads:1,392
Total downloads:20,084
Favorites:6
MD5:
LibSkillBlocker  Popular! (More than 5000 hits)
Version: 1.0.3
by: Jarva [More]
LibSkillBlocker allows you to register a callback to determine when a skill should be blocked from casting.

RegisterSkillBlock
If customBlockHandler is missing, the skill will always be blocked. Return true from the block handler to block, false to allow.
Lua Code:
  1. LibSkillBlocker.RegisterSkillBlock(addonName, abilityId, customBlockHandler)
  2. LibSkillBlocker.RegisterSkillBlock(addonName, abilityId)

UnregisterSkillBlock
Lua Code:
  1. LibSkillBlocker.UnregisterSkillBlock(addonName, abilityId)

GetRegisteredAbilityIds
Lua Code:
  1. LibSkillBlocker.GetRegisteredAbilityIds() -> {}[abilityId][addonName] = callback

GetRegisteredAbilityId
Lua Code:
  1. LibSkillBlocker.GetRegisteredAbilityId(abilityId) -> {}[addonName] = callback

GetRegisteredAbilityIdsByAddon
Lua Code:
  1. LibSkillBlocker.GetRegisteredAbilityIdsByAddon(addonName) -> {}[abilityIds] = callback

Example
Lua Code:
  1. if (IsPlayerInAvAWorld() or IsActiveWorldBattleground()) then
  2.   LibSkillBlocker.UnregisterSkillBlock("NoInnerLight", 40478)
  3. else
  4.   LibSkillBlocker.RegisterSkillBlock("NoInnerLight", 40478)
  5. end
1.0.3
  • Added metadata for when the skill was pressed

1.0.2
  • Added utility functions to fetch registered callbacks

1.0.1
  • Added gamepad support
Archived Files (3)
File Name
Version
Size
Uploader
Date
1.0.2
1kB
Jarva
12/14/20 01:01 AM
1.0.1
1kB
Jarva
12/13/20 12:14 AM
1.0.0
1kB
12/11/20 03:03 AM


Post A Reply Comment Options
Unread 12/11/20, 07:05 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 3715
File comments: 4524
Uploads: 68
Sounds nice thanks for the lib.
One idea:

Don't you think an additional parameter "AddonName" would be nice to specify which addon has added the skillblock + an API function to read the table of blocked abilityIds per addon / get all blocked ones.

And what if several addons register the same abilityId, but with different customBlockHandler functions for the block? Is the lib just overwriting it then and always using "the last added"'s customBlockHandler?

Maybe I'm thinking to complicated here, but at best all customBlockHandlers registered to the same ailityId should be taken into account then, like if customBlockHandler1 or customBlockHandler2 or customBlockHandler3 then block else unblock end
Last edited by Baertram : 12/11/20 at 07:07 AM.
Report comment to moderator  
Reply With Quote
Unread 12/11/20, 02:57 PM  
Jarva
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 7
Originally Posted by Baertram
Sounds nice thanks for the lib.
One idea:

Don't you think an additional parameter "AddonName" would be nice to specify which addon has added the skillblock + an API function to read the table of blocked abilityIds per addon / get all blocked ones.

And what if several addons register the same abilityId, but with different customBlockHandler functions for the block? Is the lib just overwriting it then and always using "the last added"'s customBlockHandler?

Maybe I'm thinking to complicated here, but at best all customBlockHandlers registered to the same ailityId should be taken into account then, like if customBlockHandler1 or customBlockHandler2 or customBlockHandler3 then block else unblock end
AddonName is currently a parameter, I can add a function to read the table of blocked abilityIds per addon if needed, however it is available under LibSkillBlocker.blockedSkills[addonName]

If several addons register the same abilityId the lib will iterate over them until one returns true or they all return false.
Report comment to moderator  
Reply With Quote
Unread 12/12/20, 08:23 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 3715
File comments: 4524
Uploads: 68
Whoops, my bad eyes
Thanks for the clarification.

Originally Posted by Jarva
Originally Posted by Baertram
Sounds nice thanks for the lib.
One idea:

Don't you think an additional parameter "AddonName" would be nice to specify which addon has added the skillblock + an API function to read the table of blocked abilityIds per addon / get all blocked ones.

And what if several addons register the same abilityId, but with different customBlockHandler functions for the block? Is the lib just overwriting it then and always using "the last added"'s customBlockHandler?

Maybe I'm thinking to complicated here, but at best all customBlockHandlers registered to the same ailityId should be taken into account then, like if customBlockHandler1 or customBlockHandler2 or customBlockHandler3 then block else unblock end
AddonName is currently a parameter, I can add a function to read the table of blocked abilityIds per addon if needed, however it is available under LibSkillBlocker.blockedSkills[addonName]

If several addons register the same abilityId the lib will iterate over them until one returns true or they all return false.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: