|
|
|
@ -16,17 +16,28 @@ public class GuiSettings extends GuiScreen {
|
|
|
|
|
//This.width / 2 - 214 is left
|
|
|
|
|
//Inputs
|
|
|
|
|
if(wireEntity instanceof ChipTileEntity){
|
|
|
|
|
if(((ChipTileEntity) wireEntity).mode.equals("constant")){
|
|
|
|
|
initConst();
|
|
|
|
|
switch(((ChipTileEntity) wireEntity).mode){
|
|
|
|
|
case "constant":
|
|
|
|
|
initConst();
|
|
|
|
|
break;
|
|
|
|
|
case "Pulse":
|
|
|
|
|
initPulse();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initPulse() {
|
|
|
|
|
this.controlList.add(new GuiButton(1, this.width /2 - 100, this.height/2 - 20 - 10, "+"));
|
|
|
|
|
this.controlList.add(1,new GuiButton(0, this.width /2 - 100, this.height/2 - 10, ((ChipTileEntity)wireEntity).tickAmount + ""));
|
|
|
|
|
this.controlList.add(new GuiButton(2, this.width /2 - 100, this.height/2 + 20 - 10, "-"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void initConst(){
|
|
|
|
|
this.controlList.add(new GuiButton(1, this.width /2, this.height/2 - 20, "+"));
|
|
|
|
|
this.controlList.add(1,new GuiButton(0, this.width /2, this.height/2 , wireEntity.outputs[0].floatvalue + ""));
|
|
|
|
|
this.controlList.add(new GuiButton(2, this.width /2, this.height/2 + 20, "-"));
|
|
|
|
|
this.controlList.add(new GuiButton(1, this.width /2 - 100, this.height/2 - 20 - 10, "+"));
|
|
|
|
|
this.controlList.add(1,new GuiButton(0, this.width /2 - 100, this.height/2 - 10 , wireEntity.outputs[0].floatvalue + ""));
|
|
|
|
|
this.controlList.add(new GuiButton(2, this.width /2 - 100, this.height/2 + 20 - 10, "-"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GuiSettings(EntityPlayer player, AbstractWireTileEntity wireEntity) {
|
|
|
|
@ -41,10 +52,23 @@ public class GuiSettings extends GuiScreen {
|
|
|
|
|
case "constant":
|
|
|
|
|
constAction(guiButton);
|
|
|
|
|
break;
|
|
|
|
|
case "Pulse":
|
|
|
|
|
pulseAction(guiButton);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void pulseAction(GuiButton guiButton) {
|
|
|
|
|
if(guiButton.id == 1){
|
|
|
|
|
((ChipTileEntity)wireEntity).tickAmount++;
|
|
|
|
|
}
|
|
|
|
|
if(guiButton.id == 2){
|
|
|
|
|
((ChipTileEntity)wireEntity).tickAmount--;
|
|
|
|
|
}
|
|
|
|
|
this.controlList.get(1).displayString = ((ChipTileEntity)wireEntity).tickAmount + "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void constAction(GuiButton guiButton) {
|
|
|
|
|
if(guiButton.id == 1){
|
|
|
|
|
wireEntity.outputs[0].floatvalue++;
|
|
|
|
|