Skip to content

Commit

Permalink
Add Smart Blocking Mode GUI for DualInterface (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
lordIcocain authored Oct 19, 2024
1 parent d68adac commit f8e7aba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.6.41-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-465-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.1:dev')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class GuiDualInterface extends GuiUpgradeable {
private GuiTabButton priority;
private GuiTabButton switcher;
private GuiImgButton BlockMode;
private GuiImgButton SmartBlockMode;
private GuiToggleButton interfaceMode;
private GuiImgButton insertionMode;
private GuiImgButton sidelessMode;
Expand Down Expand Up @@ -82,6 +83,9 @@ protected void addButtons() {
this.BlockMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + offset, Settings.BLOCK, YesNo.NO);
this.buttonList.add(this.BlockMode);

this.SmartBlockMode = new GuiImgButton(this.guiLeft - 36, this.guiTop + offset, Settings.SMART_BLOCK, YesNo.NO);
this.buttonList.add(this.SmartBlockMode);

offset += 18;

this.interfaceMode = new GuiToggleButton(
Expand Down Expand Up @@ -156,7 +160,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final
if (this.BlockMode != null) {
this.BlockMode.set(((ContainerInterface) this.cvb).getBlockingMode());
}

if (this.SmartBlockMode != null) {
this.SmartBlockMode.set(((ContainerInterface) this.cvb).getSmartBlockingMode());
}
if (this.interfaceMode != null) {
this.interfaceMode.setState(((ContainerInterface) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
Expand Down Expand Up @@ -213,6 +219,8 @@ protected void actionPerformed(final GuiButton btn) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(Settings.INTERFACE_TERMINAL, backwards));
} else if (btn == this.BlockMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.BlockMode.getSetting(), backwards));
} else if (btn == this.SmartBlockMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.SmartBlockMode.getSetting(), backwards));
} else if (btn == this.insertionMode) {
NetworkHandler.instance.sendToServer(new PacketConfigButton(this.insertionMode.getSetting(), backwards));
} else if (btn == this.doublePatterns) {
Expand Down

0 comments on commit f8e7aba

Please sign in to comment.