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

Add Articles: Patching Code, MonoMod Examples & MonoMod Docs #113

Merged
merged 13 commits into from
Apr 10, 2024

Conversation

Hamunii
Copy link
Contributor

@Hamunii Hamunii commented Mar 29, 2024

Adds article Patching Code with the article MonoMod Examples and MonoMod Docs under it, under the Fundamentals section, with various examples for Hooks and ILHooks.

Currently a work in progress. Ready!

@Hamunii Hamunii changed the title Add article: Patching With MonoMod Add Articles: Patching Code & Using MonoMod (for patching code) Mar 30, 2024
@Hamunii Hamunii marked this pull request as ready for review April 2, 2024 18:26
@Hamunii
Copy link
Contributor Author

Hamunii commented Apr 2, 2024

This is still missing an example for patching IEnumerator methods (and patching other mods), but that can be added later. I think it is be better to get this article out sooner.

Also will probably write documentation about ILCursor (also Label stuff cus that's confusing tbh)

@Hamunii
Copy link
Contributor Author

Hamunii commented Apr 7, 2024

Okay I added the IEnumerator stuff already (although very lazily just so it would be there already) and I also wrote a bit of documentation based off of the official documentation, with the most significant parts to help modders find that stuff.

@Hamunii Hamunii changed the title Add Articles: Patching Code & Using MonoMod (for patching code) Add Articles: Patching Code, MonoMod Examples & MonoMod Docs Apr 7, 2024
@xiaoxiao921
Copy link
Contributor

I've read most of it and honestly, it's very good documentation. The only thing I'm not a fan of is that nameof is never used, like here for example

x => x.MatchLdfld<PlayerControllerB>("gameplayCamera"),
x => x.MatchCallvirt<Component>("get_transform"),
x => x.MatchCallvirt<Transform>("get_position"),
x => x.MatchLdcR4(3),
x => x.MatchCall<StartOfRound>("get_Instance"),
x => x.MatchLdfld<StartOfRound>("collidersAndRoomMaskAndDefault"),
x => x.MatchCall<Physics>("CheckSphere")

Which would make updating in case of name changes a lot easier

Copy link
Contributor

@Xilophor Xilophor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good to me, great work! I'll wait to approve until what iDeathHD (xiaoxiao921) mentioned is resolved.

@Hamunii
Copy link
Contributor Author

Hamunii commented Apr 10, 2024

@Xilophor done!

Copy link
Contributor

@Xilophor Xilophor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Xilophor Xilophor merged commit 1b340ba into LethalCompanyCommunity:main Apr 10, 2024
1 check passed
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.

3 participants