hibiii / quilt_loading_screen

Makes loading screen look like the banner of the QuiltMC Community Server.
https://modrinth.com/mod/quilt-loading-screen
MIT License
16 stars 14 forks source link

Fix modmenu integration #9

Closed LostLuma closed 2 years ago

LostLuma commented 2 years ago

Makes the config edit button actually show up in modmenu so users can activate the pride setting.

triphora commented 2 years ago

This should be done automatically as long as you have a new enough MidnightLib version.

LostLuma commented 2 years ago

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.

triphora commented 2 years ago

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?

Motschen commented 2 years ago

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?

LostLuma commented 2 years ago

Setting it to True instead of ModMenu makes a new button show up in the settings menu that works, yeah.

Motschen commented 2 years ago

And is Quilt Loading Screen listed in there?

LostLuma commented 2 years ago

Yes.

Motschen commented 2 years ago

And it still doesn't show up in ModMenu?

Motschen commented 2 years ago

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 ?

LostLuma commented 2 years ago

The button for the leave culling mod does show up correctly within modmenu, quilt loading screen still doesn't.

Motschen commented 2 years ago

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.

triphora commented 2 years ago

If you say so!

Motschen commented 2 years ago

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 ;)