Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reorganizes the top-level module and results in a simpler user-facing API.
This is achieved by changing the
Hooks
trait so that its implementors must no longer be in charge of applying the hooks themselves, but must implement a function that returns a slice ofMhHook
s which will be acted upon by the library itself.A builder pattern API was added that allows initializing potentially multiple different hooks via repeated invocations of the
with
method.The entry point generator macro's API was not changed, but its generated code was greatly simplified, and the
lifecycle
andlifecycle::global_state
modules were removed as those implementation details are now hidden behind the newHudhookBuilder
object.This has been tested on the Dark Souls III practice tool, and everything seems to be working just fine.
@Godnoken this could be of particular interest to you, as this now allows for the addition of optional hooks and we may now implement the input blocker properly, in a way that allows it to be opt-in. Do you mind giving this a spin before I merge it in?
Closes #124.