Skip to content

Commit 736a4b2

Browse files
committed
combine button
1 parent 5747b45 commit 736a4b2

19 files changed

+514
-108
lines changed

src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminal.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
4040
private GuiImgButton clearBtn;
4141
private GuiImgButton doubleBtn;
4242

43+
private GuiFCImgButton combineEnableBtn;
44+
private GuiFCImgButton combineDisableBtn;
45+
4346
public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
4447
{
4548
super( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
@@ -68,6 +71,10 @@ else if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn ==
6871
{
6972
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
7073
}
74+
else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
75+
{
76+
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
77+
}
7178
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
7279
{
7380
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
@@ -100,11 +107,22 @@ public void initGui()
100107
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
101108
this.buttonList.add( this.encodeBtn );
102109

110+
int combineLeft = 74;
111+
103112
if (ModAndClassUtil.isDoubleButton) {
104113
this.doubleBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
105114
this.doubleBtn.setHalfSize( true );
106115
this.buttonList.add( this.doubleBtn );
116+
combineLeft = 84;
107117
}
118+
119+
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "FORCE_COMBINE", "DO_COMBINE" );
120+
this.combineEnableBtn.setHalfSize( true );
121+
this.buttonList.add( this.combineEnableBtn );
122+
123+
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
124+
this.combineDisableBtn.setHalfSize( true );
125+
this.buttonList.add( this.combineDisableBtn );
108126
}
109127

110128
@Override
@@ -136,6 +154,25 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
136154
this.substitutionsDisabledBtn.visible = true;
137155
}
138156

157+
if (!this.container.isCraftingMode())
158+
{
159+
if ( this.container.combine )
160+
{
161+
this.combineEnableBtn.visible = true;
162+
this.combineDisableBtn.visible = false;
163+
}
164+
else
165+
{
166+
this.combineEnableBtn.visible = false;
167+
this.combineDisableBtn.visible = true;
168+
}
169+
}
170+
else
171+
{
172+
this.combineEnableBtn.visible = false;
173+
this.combineDisableBtn.visible = false;
174+
}
175+
139176
super.drawFG( offsetX, offsetY, mouseX, mouseY );
140177
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
141178
}

src/main/java/com/glodblock/github/client/gui/GuiBaseFluidPatternTerminalEx.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
3030
private GuiImgButton clearBtn;
3131
private GuiImgButton doubleBtn;
3232

33+
private GuiFCImgButton combineEnableBtn;
34+
private GuiFCImgButton combineDisableBtn;
35+
3336
public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
3437
{
3538
super( inventoryPlayer, te, new FCBasePartContainerEx( inventoryPlayer, te ) );
@@ -54,6 +57,10 @@ else if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn ==
5457
{
5558
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE ) );
5659
}
60+
else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
61+
{
62+
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
63+
}
5764
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
5865
{
5966
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
@@ -86,6 +93,14 @@ public void initGui()
8693
this.doubleBtn.setHalfSize( true );
8794
this.buttonList.add( this.doubleBtn );
8895
}
96+
97+
this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 153, "FORCE_COMBINE", "DO_COMBINE" );
98+
this.combineEnableBtn.setHalfSize( true );
99+
this.buttonList.add( this.combineEnableBtn );
100+
101+
this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
102+
this.combineDisableBtn.setHalfSize( true );
103+
this.buttonList.add( this.combineDisableBtn );
89104
}
90105

91106
@Override
@@ -105,6 +120,17 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
105120
this.substitutionsDisabledBtn.visible = true;
106121
}
107122

123+
if ( this.container.combine )
124+
{
125+
this.combineEnableBtn.visible = true;
126+
this.combineDisableBtn.visible = false;
127+
}
128+
else
129+
{
130+
this.combineEnableBtn.visible = false;
131+
this.combineDisableBtn.visible = true;
132+
}
133+
108134
super.drawFG( offsetX, offsetY, mouseX, mouseY );
109135
this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
110136
}

0 commit comments

Comments
 (0)