Minimal Menu

Minimal Menu

350k Downloads

Visual bug with Mod Menu 1.15.0

supersaiyansubtlety opened this issue ยท 9 comments

commented

Using minimalmenu-1.16.4-0.0.5

{
    "REMOVE_SPLASH": true,
    "REMOVE_EDITION": true,
    "REMOVE_SINGLEPLAYER": false,
    "REMOVE_MULTIPLAYER": false,
    "REMOVE_REALMS": true,
    "REMOVE_LANGUAGE": true,
    "REMOVE_ACCESSIBILITY": true,
    "REMOVE_COPYRIGHT": true,
    "STOP_SPIN": false,
    "X_OFFSET_TITLE": 0,
    "Y_OFFSET_TITLE": 0,
    "REMOVE_REALMS_NOTIF": true,
    "REMOVE_FEEDBACK": true,
    "REMOVE_BUGS": false,
    "REMOVE_LANSP": false,
    "REMOVE_LANMP": true,
    "X_OFFSET_PAUSE": 0,
    "Y_OFFSET_PAUSE": 0,
    "ADD_SAVES": true,
    "ADD_RELOAD_SAVES": true,
    "DEV_MODE": false
}

screenshot

commented
commented

This is a critical bug

commented

Please fix this.

commented

Also happens when both remove feedback button and remove bug report button are enabled
when remove feedback and bug report buttons are enabled

commented

This basically breaks the entire mod

commented

Only when certain features are enabled but yes.

commented

This is caused by TerraformersMC/ModMenu@3d28533 switching ModMenu to the Farbric Screen API. This makes MinimalMenu run before ModMenu, which also causes #19.

commented

A whooping 5 months later, I have appeared. I went on a bit of a bug squashing spree tonight, the only issues left are feature requests and this bug. I haven't had much time to look into this but from the fantastic work by @jackassmc it sounds like this is a mod menu issue?

For now on 1.16 at least, I'd just use v1.14 of mod menu. Sounds like updating to 1.17 might be more of a pain than I thought.

commented

It's a compatibility issue between MinimalMenu and ModMenu, it can be fixed on either side. I made a PR for ModMenu TerraformersMC/ModMenu#258 that would fix it on that side but Prospector, the main developer of ModMenu, has stepped back from modding Minecraft so that PR is in limbo atm.

To fix this in MinimalMenu the button logic has to run after ModMenu has added the Mods button. ModMenu adds the button after Screen.init which calls this.init which is what MinimalMenu uses (TitleScreen.init and GameMenuScreen.initWidgets (called from GameMenuScreen.init)) so MinimalMenu always runs before ModMenu. To fix this MinimalMenu could be restructured to also mixin Screen.init with a higher priority (which confusingly makes it run later).

Something along the lines of this should work:

@Mixin(value = Screen.class, priority = 1100)
public abstract class Screen extends AbstractParentElement implements TickableElement, Drawable {
    @Inject(method = "init", at = @At("TAIL"))
    private void init(MinecraftClient client, int width, int height, CallbackInfo info) {
        if ((Screen)(Object)this instanceof TitleScreen) {
            // TitleScreen button logic here
        } else if ((Screen)(Object)this instanceof GameMenuScreen) {
            // GameMenuScreen button logic here
        }
    }
}

Edit: This is fixed in my PR in e8de92e.