Rebranded and change how to register as well as some funcitonality
This is a library meant for disabling target interactions by filters.
Filters are registered by add-on per action.
Or by addon for any action, by ommiting the action name while registering.
Lua Code:
local registerOnTryHandlingInteraction = LibInteractionHook.RegisterOnTryHandlingInteraction
local function tryHandlingInteractionCallback(action, interactableName, currentFrameTimeSeconds)
if isActionDisabled(action, interactableName, currentFrameTimeSeconds) then
-- Disabled
return true
end
return false
end
-- Register for specific actions
registerOnTryHandlingInteraction("Addon_Name", actionName, tryHandlingInteractionCallback)
-- Register for any action by ommiting actionName
registerOnTryHandlingInteraction("Addon_Name", tryHandlingInteractionCallback)
local action, interactableName = GetGameCameraInteractableActionInfo()
The function, isActionDisabled, is the filter used in
IsJusta Disable Actions While Moving.
Filters may also be unregistered.
Lua Code:
local unregisterOnTryHandlingInteraction = LibInteractionHook.UnregisterOnTryHandlingInteraction
unregisterOnTryHandlingInteraction("Addon_Name", actionName)
unregisterOnTryHandlingInteraction("Addon_Name")
Can also be used to monitor Reticle target for updates.
Lua Code:
local function tryHandlingInteractionCallback(action, interactableName, currentFrameTimeSeconds)
if currentFrameTimeSeconds > lastTime and tableOfNames[interactableName] then
lastTime = currentFrameTimeSeconds + 30
-- do the things
end
end
To hide an interaction
Lua Code:
local hideInteraction = LibInteractionHook.HideInteraction
local function tryHandlingInteractionCallback(action, interactableName, currentFrameTimeSeconds)
if isActionDisabled(action, interactableName, currentFrameTimeSeconds) then
-- Disabled
hideInteraction()
return true
end
return false
end