Also Fixes: - Enter key confirms the "Confirm Crafting" dialog again - Right Mouse Button correctly cycles backwards through CPUs, while left mouse button forward - Fixes an internal problem with syncing CPU names - Naming of unnamed CPUs begins at #1 now
This commit is contained in:
@@ -27,6 +27,8 @@ import com.google.common.base.Joiner;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
@@ -76,10 +78,6 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
this.setScrollBar(scrollbar);
|
||||
}
|
||||
|
||||
boolean isAutoStart() {
|
||||
return this.container.isAutoStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
@@ -90,8 +88,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
this.addButton(this.start);
|
||||
|
||||
this.selectCPU = new Button(this.guiLeft + (219 - 180) / 2, this.guiTop + this.ySize - 68, 180, 20,
|
||||
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic),
|
||||
btn -> selectNextCpu());
|
||||
getNextCpuButtonLabel(), btn -> selectNextCpu());
|
||||
this.selectCPU.active = false;
|
||||
this.addButton(this.selectCPU);
|
||||
|
||||
@@ -139,22 +136,22 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
}
|
||||
|
||||
private void updateCPUButtonText() {
|
||||
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal();
|
||||
if (this.container.getSelectedCpu() >= 0)// && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if (this.container.getName() != null) {
|
||||
final String name = this.container.getName().getStringTruncated(20);
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
||||
} else {
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.container.getSelectedCpu();
|
||||
}
|
||||
}
|
||||
this.selectCPU.setMessage(getNextCpuButtonLabel());
|
||||
}
|
||||
|
||||
private ITextComponent getNextCpuButtonLabel() {
|
||||
if (this.container.hasNoCPU()) {
|
||||
btnTextText = GuiText.NoCraftingCPUs.getLocal();
|
||||
return GuiText.NoCraftingCPUs.text();
|
||||
}
|
||||
|
||||
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
|
||||
ITextComponent cpuName;
|
||||
if (this.container.cpuName == null) {
|
||||
cpuName = GuiText.Automatic.text();
|
||||
} else {
|
||||
cpuName = this.container.cpuName;
|
||||
}
|
||||
|
||||
return GuiText.CraftingCPU.withSuffix(": ").append(cpuName);
|
||||
}
|
||||
|
||||
private boolean isSimulation() {
|
||||
@@ -447,7 +444,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
if (!this.checkHotbarKeys(InputMappings.getInputByCode(keyCode, scanCode))) {
|
||||
if (keyCode == 28) {
|
||||
if (keyCode == GLFW.GLFW_KEY_ENTER || keyCode == GLFW.GLFW_KEY_KP_ENTER) {
|
||||
this.start();
|
||||
return true;
|
||||
}
|
||||
@@ -456,7 +453,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
}
|
||||
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
final boolean backwards = isHandlingRightClick();
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
@@ -27,7 +23,6 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
|
||||
import appeng.container.implementations.CraftingStatusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
@@ -50,8 +45,7 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.selectCPU = new Button(this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20,
|
||||
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs),
|
||||
this.selectCPU = new Button(this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20, getNextCpuButtonLabel(),
|
||||
btn -> selectNextCpu());
|
||||
this.addButton(this.selectCPU);
|
||||
|
||||
@@ -68,23 +62,14 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
|
||||
}
|
||||
|
||||
private void updateCPUButtonText() {
|
||||
String btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
|
||||
if (this.container.selectedCpu >= 0)// && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if (this.container.myName != null) {
|
||||
final String name = this.container.myName.getStringTruncated(20);
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
|
||||
} else {
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.container.selectedCpu;
|
||||
}
|
||||
}
|
||||
this.selectCPU.setMessage(getNextCpuButtonLabel());
|
||||
}
|
||||
|
||||
private ITextComponent getNextCpuButtonLabel() {
|
||||
if (this.container.noCPU) {
|
||||
btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
return GuiText.NoCraftingJobs.text();
|
||||
}
|
||||
|
||||
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
|
||||
return GuiText.CraftingCPU.withSuffix(": ").append(container.cpuName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,9 +77,8 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
|
||||
return in; // the cup name is on the button
|
||||
}
|
||||
|
||||
// FIXME: Extract to separate class? Shared with GuiCraftConfirm
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
final boolean backwards = isHandlingRightClick();
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
||||
}
|
||||
|
||||
private void selectNextInterfaceMode() {
|
||||
final boolean backwards = getMinecraft().mouseHelper.isRightDown();
|
||||
final boolean backwards = isHandlingRightClick();
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(Settings.INTERFACE_TERMINAL, backwards));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user