Skip to content

Commit

Permalink
Hide Mod Options API Button if unused (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewperiut authored Nov 3, 2023
1 parent 267dc96 commit 0b59fc7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.betterthanupdates.modoptionsapi.mixin.client;

import modoptionsapi.ModOptionsAPI;
import modoptionsapi.gui.ModMenu;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -14,7 +15,8 @@
public class PauseMenuMixin extends Screen {
@Inject(method = "initVanillaScreen", at = @At("RETURN"))
private void modoptionsapi$addButton(CallbackInfo ci) {
this.buttons.add(new ButtonWidget(30, this.width / 2 - 100, this.height / 4 + 148 + -16, "Mod World Options"));
if (ModOptionsAPI.getAllMods().length > 0)
this.buttons.add(new ButtonWidget(30, this.width / 2 - 100, this.height / 4 + 148 + -16, "Mod World Options"));
}

@Inject(method = "buttonClicked", at = @At("RETURN"))
Expand Down

0 comments on commit 0b59fc7

Please sign in to comment.