Skip to content

Separate mod menu popup creation for patching #1

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Septikai
Copy link

@Septikai Septikai commented Mar 6, 2025

This separates out the creation of a ModsMenuPopup into a different method, allowing mods to patch it so they can display custom content and settings in their menu underneath the default content.

Example that I threw into the bottom of my InfiniteAmmo mod for testing:

[HarmonyPatch(typeof(Silk.ModsUI), nameof(ModsUI.MakePopup))]
internal class ModsMenuPatch
{
    public static void Postfix((string title, string[] authors, string version, string gameVersion, string id) mod, ref ModsMenuPopup __result)
    {
        if (mod.title != "InfiniteAmmo") return;
        __result.CreateParagraph("testing123");
    }
}

image

@Septikai
Copy link
Author

Septikai commented Mar 7, 2025

This is on hold until I can get a working implementation for checkbox and slider text, which will hopefully be over the weekend/on monday

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.

1 participant