Shift+ctrl opens crafting window

This commit is contained in:
Raoul Van den Berge
2016-05-01 12:18:52 +02:00
parent acdb9082fc
commit 1f29163922
3 changed files with 17 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ public class GuiCraftingMonitor extends GuiBase {
scrollbar.update(this, mouseX, mouseY);
drawString(7, 7, t("gui.refinedstorage:crafting_monitor"));
drawString(7, 114, t("container.inventory"));
drawString(7, 116, t("container.inventory"));
int ox = 11;
int x = ox;

View File

@@ -4,6 +4,7 @@ import com.google.common.primitives.Ints;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraftforge.fml.client.FMLClientHandler;
import org.lwjgl.input.Keyboard;
import refinedstorage.container.ContainerDummy;
import java.io.IOException;
@@ -57,7 +58,11 @@ public class GuiCraftingSettings extends GuiBase {
if (!checkHotbarKeys(keyCode) && amountField.textboxKeyTyped(character, keyCode)) {
// NO OP
} else {
super.keyTyped(character, keyCode);
if (keyCode == Keyboard.KEY_RETURN) {
startRequest();
} else {
super.keyTyped(character, keyCode);
}
}
}
@@ -66,13 +71,17 @@ public class GuiCraftingSettings extends GuiBase {
super.actionPerformed(button);
if (button.id == startButton.id) {
Integer quantity = Ints.tryParse(amountField.getText());
startRequest();
}
}
if (quantity != null && quantity > 0) {
gridGui.getGrid().onCraftingRequested(id, quantity);
private void startRequest() {
Integer quantity = Ints.tryParse(amountField.getText());
FMLClientHandler.instance().showGuiScreen(gridGui);
}
if (quantity != null && quantity > 0) {
gridGui.getGrid().onCraftingRequested(id, quantity);
FMLClientHandler.instance().showGuiScreen(gridGui);
}
}
}

View File

@@ -312,7 +312,7 @@ public class GuiGrid extends GuiBase {
} else if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null && (clickedButton == 0 || clickedButton == 1)) {
grid.onItemPush(-1, clickedButton == 1);
} else if (isHoveringOverItemInSlot() && container.getPlayer().inventory.getItemStack() == null) {
if (items.get(hoveringSlot).getQuantity() == 0) {
if (items.get(hoveringSlot).getQuantity() == 0 || (GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown())) {
FMLCommonHandler.instance().showGuiScreen(new GuiCraftingSettings(this, hoveringItemId));
} else {
int flags = 0;