Skip to content

Commit

Permalink
Add dedicated buttons for EMI and REI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Oct 23, 2024
1 parent 048a631 commit 7da284f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ release_type=release
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44

integrateddynamics_version=1.19.2-1.22.0-726
integratedterminals_version=1.19.2-1.5.1-385
integratedterminals_version=1.19.2-1.5.1-386
commoncapabilities_version=1.19.2-2.9.0-88
curios_version=1.19.2-5.1.1.0
jei_version=1.19.2-forge:11.5.2.1007
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.cyclops.cyclopscore.client.gui.component.button.ButtonImage;
import org.cyclops.cyclopscore.client.gui.image.Image;
import org.cyclops.integratedterminals.api.terminalstorage.ITerminalButton;
import org.cyclops.integratedterminals.api.terminalstorage.ITerminalStorageTabClient;
import org.cyclops.integratedterminals.client.gui.image.Images;
Expand All @@ -30,14 +31,16 @@ public class TerminalButtonItemStackCraftingGridSearchSync
private final TerminalStorageState state;
private final String buttonName;
private final ITerminalStorageTabClient<?> clientTab;
private final Image image;

private boolean active;

public TerminalButtonItemStackCraftingGridSearchSync(String mod, TerminalStorageState state, ITerminalStorageTabClient<?> clientTab) {
public TerminalButtonItemStackCraftingGridSearchSync(String mod, TerminalStorageState state, ITerminalStorageTabClient<?> clientTab, Image image) {
this.mod = mod;
this.state = state;
this.buttonName = "itemstack_grid_" + mod + "searchsync";
this.clientTab = clientTab;
this.image = image;

reloadFromState();
}
Expand All @@ -59,7 +62,7 @@ public ButtonImage createButton(int x, int y) {
Component.translatable("gui.integratedterminalscompat.terminal_storage.craftinggrid." + mod + "sync"),
(b) -> {},
active ? Images.BUTTON_BACKGROUND_ACTIVE : Images.BUTTON_BACKGROUND_INACTIVE,
Images.BUTTON_MIDDLE_JEI_SYNC);
this.image);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientLoadButtonsEvent;
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientSearchFieldUpdateEvent;
import org.cyclops.integratedterminals.client.gui.container.ContainerScreenTerminalStorage;
import org.cyclops.integratedterminals.client.gui.image.Images;
import org.cyclops.integratedterminalscompat.modcompat.common.button.TerminalButtonItemStackCraftingGridSearchSync;
import org.cyclops.integratedterminalscompat.modcompat.emi.terminalstorage.TerminalStorageEmiRecipeHandler;
import org.cyclops.integratedterminalscompat.modcompat.emi.terminalstorage.TerminalStorageEmiStackProvider;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void onTerminalStorageButtons(TerminalStorageTabClientLoadButtonsEvent ev
if (this.loaded && !event.getButtons().stream()
.anyMatch((button) -> button instanceof TerminalButtonItemStackCraftingGridSearchSync)) {
event.getButtons().add(new TerminalButtonItemStackCraftingGridSearchSync(
"emi", event.getContainer().getGuiState(), event.getClientTab()));
"emi", event.getContainer().getGuiState(), event.getClientTab(), Images.BUTTON_MIDDLE_EMI_SYNC));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientLoadButtonsEvent;
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientSearchFieldUpdateEvent;
import org.cyclops.integratedterminals.client.gui.container.ContainerScreenTerminalStorage;
import org.cyclops.integratedterminals.client.gui.image.Images;
import org.cyclops.integratedterminals.inventory.container.ContainerTerminalStorageItem;
import org.cyclops.integratedterminals.inventory.container.ContainerTerminalStoragePart;
import org.cyclops.integratedterminals.part.PartTypes;
Expand Down Expand Up @@ -103,7 +104,7 @@ public void onTerminalStorageButtons(TerminalStorageTabClientLoadButtonsEvent ev
if (jeiRuntime != null && !event.getButtons().stream()
.anyMatch((button) -> button instanceof TerminalButtonItemStackCraftingGridSearchSync)) {
event.getButtons().add(new TerminalButtonItemStackCraftingGridSearchSync(
"jei", event.getContainer().getGuiState(), event.getClientTab()));
"jei", event.getContainer().getGuiState(), event.getClientTab(), Images.BUTTON_MIDDLE_JEI_SYNC));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientLoadButtonsEvent;
import org.cyclops.integratedterminals.api.terminalstorage.event.TerminalStorageTabClientSearchFieldUpdateEvent;
import org.cyclops.integratedterminals.client.gui.container.ContainerScreenTerminalStorage;
import org.cyclops.integratedterminals.client.gui.image.Images;
import org.cyclops.integratedterminalscompat.modcompat.common.button.TerminalButtonItemStackCraftingGridSearchSync;
import org.cyclops.integratedterminalscompat.modcompat.rei.terminalstorage.TerminalStorageReiFocusedStackProvider;
import org.cyclops.integratedterminalscompat.modcompat.rei.terminalstorage.TerminalStorageReiTransferHandler;
Expand Down Expand Up @@ -67,7 +68,7 @@ public void onTerminalStorageButtons(TerminalStorageTabClientLoadButtonsEvent ev
if (this.loaded && !event.getButtons().stream()
.anyMatch((button) -> button instanceof TerminalButtonItemStackCraftingGridSearchSync)) {
event.getButtons().add(new TerminalButtonItemStackCraftingGridSearchSync(
"rei", event.getContainer().getGuiState(), event.getClientTab()));
"rei", event.getContainer().getGuiState(), event.getClientTab(), Images.BUTTON_MIDDLE_REI_SYNC));
}
}

Expand Down

0 comments on commit 7da284f

Please sign in to comment.