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

Make DBML call module patches #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Qkrisi
Copy link
Contributor

@Qkrisi Qkrisi commented Jun 17, 2023

Module patches were executed before DBML loads the mod making so they don't run for people using DBML (at least for the first instance of the mod), so this PR makes DBML execute the patches too when it loads them.

Copy link
Owner

@samfundev samfundev left a comment

Choose a reason for hiding this comment

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

This PR seems a bit over engineered. You're tracking patches and removing applied patches when it seems like it would be easier to just run EnsurePatch after the modules have been loaded and let the existing code handle things.

@Qkrisi
Copy link
Contributor Author

Qkrisi commented Aug 1, 2023

I made it like this to optimize loading times long-term. I'm mainly talking about the ReflectedTypes.UpdateTypes call here, which can be slow especially with more and more mods being loaded. Since we only need to actually call it once, it's kind of a waste to do it every time the module is on a bomb after it's been patched.

That said, I just now realised that that call could just be added to the Prepare method of the patches instead, which'd accomplish almost the same goal while keeping it simple. I'll work on that then.

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.

2 participants