Closed LostLuma closed 2 years ago
This should be done automatically as long as you have a new enough MidnightLib version.
It doesn't work for me with the version you linked, and the midnightlib docs state that you still need to implement this yourself at the bottom of the page.
Huh, it should be automatic according to https://github.com/TeamMidnightDust/MidnightLib/blob/main/src/main/java/eu/midnightdust/lib/config/AutoModMenu.java. @Motschen any idea why it might not be working?
Yeah, MidnightLib should automatically register the config screen to mod menu, the code at the bottom of the documentation is just an example on how to get an instance of the screen for usage in other mods and custom GUIs, I'll make that more clear.
Could you please set "Config Screen List" in MidnightLib's config to True and tell me if Quilt Loading Screen appears in the new menu that gets added to the Options Screen?
Setting it to True
instead of ModMenu
makes a new button show up in the settings menu that works, yeah.
And is Quilt Loading Screen listed in there?
Yes.
And it still doesn't show up in ModMenu?
Could you tell me if the config button in ModMenu appears for any other mod using MidnightLib, for example https://modrinth.com/mod/cull-leaves ?
The button for the leave culling mod does show up correctly within modmenu, quilt loading screen still doesn't.
That's really weird... I tried every single mod using MidnightLib, and Quilt Loading Screen is the only one the ModMenu integration doesn't work for. At first I assumed it was caused by it using a quilt.mod.json, but Music Duration Reducer does too and it works there. Not really sure what's going on here, I'll definitely look into it further. For now it might be best to merge this PR.
If you say so!
Oh, right, I figured it out, the reason is actually pretty simple: The actual mod id differs from the one you use internally, thus AutoModMenu can't map the config screen to the mod: https://github.com/emmods/quilt-loading-screen/blob/1.19/src/main/java/coffee/waffle/qls/QuiltLoadingScreen.java#L25 https://github.com/emmods/quilt-loading-screen/blob/1.19/src/main/resources/quilt.mod.json#L5 In this case you'll have to implement the ModMenu integration by yourself, as MidnightLib can't do magic ;)
Makes the config edit button actually show up in modmenu so users can activate the pride setting.