Skip to content

Commit

Permalink
Merge pull request #36 from asdflj/IOPort&LevelMaintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Nov 15, 2022
2 parents 3a0eeea + dc7c33b commit 1c79148
Show file tree
Hide file tree
Showing 44 changed files with 1,851 additions and 236 deletions.
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

dependencies {
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.10-GTNH:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-116-GTNH:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-117-GTNH:dev')
compile('curse.maven:cofh-core-69162:2388751')
compile('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")

compileOnly('com.github.GTNewHorizons:ForestryMC:4.4.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.27:dev')
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/com/glodblock/github/client/gui/FCGuiTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

public class FCGuiTextField extends GuiTextField {
private static final int PADDING = 2;
private final FontRenderer _fontRender;
private String tooltip;

private final int _xPos;
private final int _yPos;
private final int _width;
private final int _height;
private int _border;
private int _color;

/**
* Uses the values to instantiate a padded version of a text field.
Expand All @@ -30,6 +33,48 @@ public FCGuiTextField(final FontRenderer fontRenderer, final int xPos, final int
this._yPos = yPos;
this._width = width;
this._height = height;
this._fontRender = fontRenderer;
}

@Override
public void drawTextBox() {
super.drawTextBox();
if (this.getBorder() > 0 && this.getVisible()) {
GuiTextField.drawRect(
this._xPos - this.getBorder(),
this._yPos - this.getBorder(),
this._width - 2 * PADDING - this._fontRender.getCharWidth('_') + this.getBorder(),
this._height - 2 * PADDING + this.getBorder(),
this.getColor()
);
}
}

public int getBorder() {
return this._border;
}

public void setBorder(int border) {
this._border = border;
this._color = 0;
}

public void setBorder(int border, int color) {
this._border = border;
this._color = color;
}

public void setBorder() {
this._border = 0;
this._color = 0;
}

public int getColor() {
return this._color;
}

public void setColor(int color) {
this._color = color;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ public class GuiBaseFluidPatternTerminal extends GuiFCBaseMonitor {
private GuiImgButton encodeBtn;
private GuiImgButton clearBtn;
private GuiImgButton doubleBtn;
private GuiImgButton beSubstitutionsEnabledBtn;
private GuiImgButton beSubstitutionsDisabledBtn;

private GuiFCImgButton combineEnableBtn;
private GuiFCImgButton combineDisableBtn;

public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
public GuiBaseFluidPatternTerminal(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
super(inventoryPlayer, te, new FCBasePartContainer(inventoryPlayer, te));
this.container = (FCBasePartContainer) this.inventorySlots;
setReservedSpace(81);
}
Expand Down Expand Up @@ -73,9 +74,12 @@ else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
{
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
}
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
{
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminal.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsEnabledBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "0"));
}
}

Expand Down Expand Up @@ -103,24 +107,36 @@ public void initGui()
this.buttonList.add( this.clearBtn );

this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
this.buttonList.add( this.encodeBtn );
this.buttonList.add(this.encodeBtn);

int combineLeft = 74;

int combineTop = 153;
if (ModAndClassUtil.isDoubleButton) {
this.doubleBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
this.doubleBtn.setHalfSize( true );
this.buttonList.add( this.doubleBtn );
this.doubleBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE);
this.doubleBtn.setHalfSize(true);
this.buttonList.add(this.doubleBtn);
combineLeft = 84;
}

this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "FORCE_COMBINE", "DO_COMBINE" );
this.combineEnableBtn.setHalfSize( true );
this.buttonList.add( this.combineEnableBtn );

this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + combineLeft, this.guiTop + this.ySize - 153, "NOT_COMBINE", "DONT_COMBINE" );
this.combineDisableBtn.setHalfSize( true );
this.buttonList.add( this.combineDisableBtn );
// if (ModAndClassUtil.isBeSubstitutionsButton) {
// combineLeft = 74;
// combineTop -= 11;
// this.beSubstitutionsEnabledBtn = new GuiImgButton(
// this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
// this.beSubstitutionsEnabledBtn.setHalfSize(true);
// this.buttonList.add(this.beSubstitutionsEnabledBtn);
//
// this.beSubstitutionsDisabledBtn = new GuiImgButton(
// this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.DISABLED);
// this.beSubstitutionsDisabledBtn.setHalfSize(true);
// this.buttonList.add(this.beSubstitutionsDisabledBtn);
// }
this.combineEnableBtn = new GuiFCImgButton(this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "FORCE_COMBINE", "DO_COMBINE");
this.combineEnableBtn.setHalfSize(true);
this.buttonList.add(this.combineEnableBtn);

this.combineDisableBtn = new GuiFCImgButton(this.guiLeft + combineLeft, this.guiTop + this.ySize - combineTop, "NOT_COMBINE", "DONT_COMBINE");
this.combineDisableBtn.setHalfSize(true);
this.buttonList.add(this.combineDisableBtn);
}

@Override
Expand Down Expand Up @@ -159,20 +175,26 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
this.combineEnableBtn.visible = true;
this.combineDisableBtn.visible = false;
}
else
{
else {
this.combineEnableBtn.visible = false;
this.combineDisableBtn.visible = true;
}
}
else
{
} else {
this.combineEnableBtn.visible = false;
this.combineDisableBtn.visible = false;
}
if (ModAndClassUtil.isBeSubstitutionsButton) {
if (this.container.beSubstitute) {
this.beSubstitutionsEnabledBtn.visible = true;
this.beSubstitutionsDisabledBtn.visible = false;
} else {
this.beSubstitutionsEnabledBtn.visible = false;
this.beSubstitutionsDisabledBtn.visible = true;
}
}

super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ public class GuiBaseFluidPatternTerminalEx extends GuiFCBaseMonitor {
private GuiImgButton invertBtn;
private GuiImgButton clearBtn;
private GuiImgButton doubleBtn;
private GuiImgButton beSubstitutionsEnabledBtn;
private GuiImgButton beSubstitutionsDisabledBtn;

private GuiFCImgButton combineEnableBtn;
private GuiFCImgButton combineDisableBtn;
private final GuiScrollbar processingScrollBar = new GuiScrollbar();

public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new FCBasePartContainerEx( inventoryPlayer, te ) );
public GuiBaseFluidPatternTerminalEx(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
super(inventoryPlayer, te, new FCBasePartContainerEx(inventoryPlayer, te));
this.container = (FCBasePartContainerEx) this.inventorySlots;
setReservedSpace(81);

Expand Down Expand Up @@ -80,9 +81,12 @@ else if( this.combineDisableBtn == btn || this.combineEnableBtn == btn )
{
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Combine", this.combineDisableBtn == btn ? "1" : "0" ) );
}
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn)
{
FluidCraft.proxy.netHandler.sendToServer( new CPacketFluidPatternTermBtns( "PatternTerminalEx.Double", Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) ? "1": "0") );
else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.beSubstitute", "1"));
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsEnabledBtn == btn) {
FluidCraft.proxy.netHandler.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminalEx.beSubstitute", "0"));
}
}

Expand All @@ -100,12 +104,12 @@ public void initGui()
this.substitutionsDisabledBtn.setHalfSize( true );
this.buttonList.add( this.substitutionsDisabledBtn );

this.fluidPrioritizedEnabledBtn = new GuiFCImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 143, "FORCE_PRIO", "DO_PRIO" );
this.fluidPrioritizedEnabledBtn.setHalfSize( true );
this.fluidPrioritizedEnabledBtn = new GuiFCImgButton(this.guiLeft + 97, this.guiTop + this.ySize - 114, "FORCE_PRIO", "DO_PRIO");
this.fluidPrioritizedEnabledBtn.setHalfSize(true);
this.buttonList.add( this.fluidPrioritizedEnabledBtn );

this.fluidPrioritizedDisabledBtn = new GuiFCImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 143, "NOT_PRIO", "DONT_PRIO" );
this.fluidPrioritizedDisabledBtn.setHalfSize( true );
this.fluidPrioritizedDisabledBtn = new GuiFCImgButton(this.guiLeft + 97, this.guiTop + this.ySize - 114, "NOT_PRIO", "DONT_PRIO");
this.fluidPrioritizedDisabledBtn.setHalfSize(true);
this.buttonList.add( this.fluidPrioritizedDisabledBtn );

invertBtn = new GuiImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 153, Settings.ACTIONS, container.inverted ? PatternSlotConfig.C_4_16 : PatternSlotConfig.C_16_4);
Expand All @@ -122,17 +126,27 @@ public void initGui()
if (ModAndClassUtil.isDoubleButton) {
this.doubleBtn = new GuiImgButton( this.guiLeft + 97, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE );
this.doubleBtn.setHalfSize( true );
this.buttonList.add( this.doubleBtn );
this.buttonList.add(this.doubleBtn);
}

this.combineEnableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "FORCE_COMBINE", "DO_COMBINE" );
this.combineEnableBtn.setHalfSize( true );
this.buttonList.add( this.combineEnableBtn );

this.combineDisableBtn = new GuiFCImgButton( this.guiLeft + 87, this.guiTop + this.ySize - 143, "NOT_COMBINE", "DONT_COMBINE" );
this.combineDisableBtn.setHalfSize( true );
this.buttonList.add( this.combineDisableBtn );

this.combineEnableBtn = new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 114, "FORCE_COMBINE", "DO_COMBINE");
this.combineEnableBtn.setHalfSize(true);
this.buttonList.add(this.combineEnableBtn);

this.combineDisableBtn = new GuiFCImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 114, "NOT_COMBINE", "DONT_COMBINE");
this.combineDisableBtn.setHalfSize(true);
this.buttonList.add(this.combineDisableBtn);
// if (ModAndClassUtil.isBeSubstitutionsButton) {
// this.beSubstitutionsEnabledBtn = new GuiImgButton(
// this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS, PatternBeSubstitution.ENABLED);
// this.beSubstitutionsEnabledBtn.setHalfSize(true);
// this.buttonList.add(this.beSubstitutionsEnabledBtn);
//
// this.beSubstitutionsDisabledBtn = new GuiImgButton(
// this.guiLeft + 87, this.guiTop + this.ySize - 103, Settings.ACTIONS, PatternBeSubstitution.DISABLED);
// this.beSubstitutionsDisabledBtn.setHalfSize(true);
// this.buttonList.add(this.beSubstitutionsDisabledBtn);
// }
processingScrollBar.setTop(this.ySize - 164);
}

Expand Down Expand Up @@ -163,19 +177,25 @@ public void drawFG( final int offsetX, final int offsetY, final int mouseX, fina
this.fluidPrioritizedDisabledBtn.visible = false;
}

if ( this.container.combine )
{
if (this.container.combine) {
this.combineEnableBtn.visible = true;
this.combineDisableBtn.visible = false;
}
else
{
} else {
this.combineEnableBtn.visible = false;
this.combineDisableBtn.visible = true;
}
if (ModAndClassUtil.isBeSubstitutionsButton) {
if (this.container.beSubstitute) {
this.beSubstitutionsEnabledBtn.visible = true;
this.beSubstitutionsDisabledBtn.visible = false;
} else {
this.beSubstitutionsEnabledBtn.visible = false;
this.beSubstitutionsDisabledBtn.visible = true;
}
}

super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752 );
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.fontRendererObj.drawString(StatCollector.translateToLocal(NameConst.GUI_FLUID_PATTERN_TERMINAL_EX), 8, this.ySize - 96 + 2 - getReservedSpace(), 4210752);
this.processingScrollBar.draw(this);
}

Expand Down
Loading

0 comments on commit 1c79148

Please sign in to comment.