Crafting settings gui
This commit is contained in:
36
src/main/java/refinedstorage/gui/GuiCraftingSettings.java
Executable file
36
src/main/java/refinedstorage/gui/GuiCraftingSettings.java
Executable file
@@ -0,0 +1,36 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class GuiCraftingSettings extends GuiBase {
|
||||
public GuiCraftingSettings() {
|
||||
super(new Container() {
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
}, 143, 61);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(int x, int y) {
|
||||
addButton(x + 56, y + 38, 50, 50, "Craft");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int x, int y, int mouseX, int mouseY) {
|
||||
bindTexture("gui/crafting_settings.png");
|
||||
|
||||
drawTexture(x, y, 0, 0, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawForeground(int mouseX, int mouseY) {
|
||||
drawString(55, 7, "Crafting");
|
||||
}
|
||||
}
|
@@ -7,6 +7,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.block.EnumGridType;
|
||||
import refinedstorage.container.ContainerGrid;
|
||||
@@ -266,21 +267,25 @@ public class GuiGrid extends GuiBase {
|
||||
if (isHoveringOverSlot() && container.getPlayer().inventory.getItemStack() != null && (clickedButton == 0 || clickedButton == 1)) {
|
||||
grid.onItemPush(-1, clickedButton == 1);
|
||||
} else if (isHoveringOverItemInSlot() && container.getPlayer().inventory.getItemStack() == null) {
|
||||
int flags = 0;
|
||||
if (items.get(hoveringSlot).getQuantity() == 0) {
|
||||
FMLCommonHandler.instance().showGuiScreen(new GuiCraftingSettings());
|
||||
} else {
|
||||
int flags = 0;
|
||||
|
||||
if (clickedButton == 1) {
|
||||
flags |= GridPullFlags.PULL_HALF;
|
||||
if (clickedButton == 1) {
|
||||
flags |= GridPullFlags.PULL_HALF;
|
||||
}
|
||||
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
flags |= GridPullFlags.PULL_SHIFT;
|
||||
}
|
||||
|
||||
if (clickedButton == 2) {
|
||||
flags |= GridPullFlags.PULL_ONE;
|
||||
}
|
||||
|
||||
grid.onItemPull(hoveringItemId, flags);
|
||||
}
|
||||
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
flags |= GridPullFlags.PULL_SHIFT;
|
||||
}
|
||||
|
||||
if (clickedButton == 2) {
|
||||
flags |= GridPullFlags.PULL_ONE;
|
||||
}
|
||||
|
||||
grid.onItemPull(hoveringItemId, flags);
|
||||
} else if (clickedClear) {
|
||||
RefinedStorage.NETWORK.sendToServer(new MessageGridCraftingClear((TileGrid) grid));
|
||||
} else {
|
||||
|
BIN
src/main/resources/assets/refinedstorage/textures/gui/crafting_settings.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/gui/crafting_settings.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Reference in New Issue
Block a user