Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change top-level API #126

Merged
merged 4 commits into from
Aug 24, 2023
Merged

Change top-level API #126

merged 4 commits into from
Aug 24, 2023

Conversation

veeenu
Copy link
Owner

@veeenu veeenu commented Aug 19, 2023

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 of MhHooks 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 and lifecycle::global_state modules were removed as those implementation details are now hidden behind the new HudhookBuilder 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.

@veeenu veeenu mentioned this pull request Aug 22, 2023
@veeenu
Copy link
Owner Author

veeenu commented Aug 24, 2023

Merging this in anyway to unblock #127.

@veeenu veeenu merged commit ad13c5d into main Aug 24, 2023
@veeenu veeenu deleted the play-hooky branch August 24, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up lifecycle API and entry point
1 participant