I've posted the update to
LibInteractionHook
I suggest registering for a specific action. Funny thing is, I can't recall what it is for a wayshrine. "Use" right?
Lua Code:
local registerOnTryHandlingInteraction = LibInteractionHook.RegisterOnTryHandlingInteraction
local wayshrineString = tolower(GetString(SI_DEATH_PROMPT_WAYSHRINE))
--Replace _action_ with GetString(SI_LIB_IF_GAMECAMERAACTION5) or SI_LIB_IF_GAMECAMERAACTION5 or "Use"
-- All of the SI_LIB_IF_GAMECAMERAACTION can be found in the lib
registerOnTryHandlingInteraction(self.name, _action_ , function(action, interactableName, interactionBlocked, isOwned, additionalInteractInfo, context, contextLink, isCriminalInteract, currentFrameTimeSeconds)
-- There is no need to check for if interactionPossible, this will only run if it is.
if interactableName:match(wayshrineString) then -- This is in theory
return true -- to disable it
end
end)
-- Omitting the action will register the function for any action.
registerOnTryHandlingInteraction(self.name, function(action, interactableName, interactionBlocked, isOwned, additionalInteractInfo, context, contextLink, isCriminalInteract, currentFrameTimeSeconds)
-- There is no need to check for if interactionPossible, this will only run if it is.
if interactableName:match(wayshrineString) then -- This is in theory
return true -- to disable it
end
end)
Unregistering can be done using the same info used in registering.
Lua Code:
local unregisterOnTryHandlingInteraction = LibInteractionHook.UnregisterOnTryHandlingInteraction
unregisterOnTryHandlingInteraction(self.name, _action_ )
unregisterOnTryHandlingInteraction(self.name)