Skip to content

Commit

Permalink
Finish up todo: button enabled by server compatibility on client
Browse files Browse the repository at this point in the history
  • Loading branch information
topi-banana committed Dec 3, 2024
1 parent 7d0abf2 commit 2a7fded
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.vulpeus.kyoyu.client.mixins.litematica;

//? if client {
import com.vulpeus.kyoyu.Kyoyu;
import com.vulpeus.kyoyu.client.gui.LoadExplorer_ButtonActionListener;
import fi.dy.masa.litematica.gui.GuiMainMenu;
import fi.dy.masa.malilib.gui.GuiBase;
Expand All @@ -25,9 +26,7 @@ public void initGui(CallbackInfo ci) {
int y = this.height - 26;

ButtonGeneric button = new ButtonGeneric(x, y, width, 20, text);
// TODO
// Disable when connecting server is not compatible
// button.setEnabled();
button.setEnabled(Kyoyu.getClient().isPresent());
addButton(button, new LoadExplorer_ButtonActionListener(this));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.vulpeus.kyoyu.client.mixins.litematica;

//? if client {
import com.vulpeus.kyoyu.Kyoyu;
import com.vulpeus.kyoyu.client.gui.Shere_ButtonActionListener;
import fi.dy.masa.litematica.gui.widgets.WidgetListSchematicPlacements;
import fi.dy.masa.litematica.gui.widgets.WidgetSchematicPlacement;
Expand Down Expand Up @@ -33,9 +34,7 @@ protected WidgetSchematicPlacementMixin(int x, int y, int width, int height, @Nu
public void init(int x, int y, int width, int height, boolean isOdd, SchematicPlacement placement, int listIndex, WidgetListSchematicPlacements parent, CallbackInfo ci) {

ButtonGeneric shareButton = new ButtonGeneric(buttonsStartX, y + 1, -1, true, "kyoyu.gui.button.share_litematic");
// TODO
// Disable when connecting server is not compatible
// shareButton.setEnabled();
shareButton.setEnabled(Kyoyu.getClient().isPresent());
addButton(shareButton, new Shere_ButtonActionListener(placement, parent.getParentGui()));
buttonsStartX = shareButton.getX() - 1;
}
Expand Down

0 comments on commit 2a7fded

Please sign in to comment.