Compare commits

...
2 changed files with 42 additions and 10 deletions

No files matched your search

@@ -131,19 +131,15 @@ public class GuiLevelMaintainer extends GuiSub {
@Override
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
if (btn == 0) {
if (focusedWidget != null) {
focusedWidget.textField.setFocused(false);
}
for (Component com : this.component) {
Widget textField = com.isMouseIn(xCoord, yCoord);
if (textField != null) {
textField.textField.setFocused(true);
this.focusedWidget = textField;
this.focusWidget(textField);
super.mouseClicked(xCoord, yCoord, btn);
return;
}
}
this.focusedWidget = null;
this.focusWidget(null);
}
super.mouseClicked(xCoord, yCoord, btn);
}
@@ -164,12 +160,48 @@ public class GuiLevelMaintainer extends GuiSub {
if (key == Keyboard.KEY_RETURN || key == Keyboard.KEY_NUMPADENTER) {
this.component[this.focusedWidget.componentIndex].submit();
this.focusedWidget.textField.setFocused(false);
this.focusedWidget = null;
this.focusWidget(null);
}
if (key == Keyboard.KEY_TAB) {
this.focusAdjacentWidget(isShiftKeyDown());
}
}
}
private void focusWidget(@Nullable Widget widget) {
if (this.focusedWidget != null) {
this.focusedWidget.textField.setFocused(false);
}
this.focusedWidget = widget;
if (this.focusedWidget != null) {
this.focusedWidget.textField.setFocused(true);
}
}
private void focusAdjacentWidget(boolean backwards) {
this.focusedWidget.validate();
this.focusWidget(this.getAdjacentWidget(backwards));
}
private Widget getAdjacentWidget(boolean backwards) {
int index = this.focusedWidget.componentIndex;
boolean isBatch = this.focusedWidget.action == Action.Batch;
if (backwards) {
if (isBatch) {
return this.component[index].getQty();
}
return this.component[(index + TileLevelMaintainer.REQ_COUNT - 1) % TileLevelMaintainer.REQ_COUNT]
.getBatch();
}
if (isBatch) {
return this.component[(index + 1) % TileLevelMaintainer.REQ_COUNT].getQty();
}
return this.component[index].getBatch();
}
@Override
protected void actionPerformed(final GuiButton btn) {
for (Component com : this.component) {
@@ -61,14 +61,14 @@ public class PartFluidAnnihilationPlane extends PartBaseAnnihilationPlane {
Platform.poweredInsert(power, monitor, toInject, src, Actionable.MODULATE);
block.drain(world, self.x + side.offsetX, self.y + side.offsetY, self.z + side.offsetZ, true);
} else if (meta == 0) {
if (fluidBlock == Blocks.flowing_water) {
if (fluidBlock == Blocks.flowing_water || fluidBlock == Blocks.water) {
final IAEFluidStack toInject = Util.FluidUtil.createAEFluidStack(FluidRegistry.WATER);
final IAEFluidStack notInjected = Platform
.poweredInsert(power, monitor, toInject, src, Actionable.SIMULATE);
if (notInjected != null) return;
Platform.poweredInsert(power, monitor, toInject, src, Actionable.MODULATE);
world.setBlockToAir(self.x + side.offsetX, self.y + side.offsetY, self.z + side.offsetZ);
} else if (fluidBlock == Blocks.flowing_lava) {
} else if (fluidBlock == Blocks.flowing_lava || fluidBlock == Blocks.lava) {
final IAEFluidStack toInject = Util.FluidUtil.createAEFluidStack(FluidRegistry.LAVA);
final IAEFluidStack notInjected = Platform
.poweredInsert(power, monitor, toInject, src, Actionable.SIMULATE);