Shift+ctrl opens crafting window
This commit is contained in:
@@ -52,7 +52,7 @@ public class GuiCraftingMonitor extends GuiBase {
|
|||||||
scrollbar.update(this, mouseX, mouseY);
|
scrollbar.update(this, mouseX, mouseY);
|
||||||
|
|
||||||
drawString(7, 7, t("gui.refinedstorage:crafting_monitor"));
|
drawString(7, 7, t("gui.refinedstorage:crafting_monitor"));
|
||||||
drawString(7, 114, t("container.inventory"));
|
drawString(7, 116, t("container.inventory"));
|
||||||
|
|
||||||
int ox = 11;
|
int ox = 11;
|
||||||
int x = ox;
|
int x = ox;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.google.common.primitives.Ints;
|
|||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
import refinedstorage.container.ContainerDummy;
|
import refinedstorage.container.ContainerDummy;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -57,7 +58,11 @@ public class GuiCraftingSettings extends GuiBase {
|
|||||||
if (!checkHotbarKeys(keyCode) && amountField.textboxKeyTyped(character, keyCode)) {
|
if (!checkHotbarKeys(keyCode) && amountField.textboxKeyTyped(character, keyCode)) {
|
||||||
// NO OP
|
// NO OP
|
||||||
} else {
|
} 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);
|
super.actionPerformed(button);
|
||||||
|
|
||||||
if (button.id == startButton.id) {
|
if (button.id == startButton.id) {
|
||||||
Integer quantity = Ints.tryParse(amountField.getText());
|
startRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (quantity != null && quantity > 0) {
|
private void startRequest() {
|
||||||
gridGui.getGrid().onCraftingRequested(id, quantity);
|
Integer quantity = Ints.tryParse(amountField.getText());
|
||||||
|
|
||||||
FMLClientHandler.instance().showGuiScreen(gridGui);
|
if (quantity != null && quantity > 0) {
|
||||||
}
|
gridGui.getGrid().onCraftingRequested(id, quantity);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().showGuiScreen(gridGui);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
} else if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null && (clickedButton == 0 || clickedButton == 1)) {
|
} else if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null && (clickedButton == 0 || clickedButton == 1)) {
|
||||||
grid.onItemPush(-1, clickedButton == 1);
|
grid.onItemPush(-1, clickedButton == 1);
|
||||||
} else if (isHoveringOverItemInSlot() && container.getPlayer().inventory.getItemStack() == null) {
|
} 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));
|
FMLCommonHandler.instance().showGuiScreen(new GuiCraftingSettings(this, hoveringItemId));
|
||||||
} else {
|
} else {
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user