Crafting settings gui

This commit is contained in:
Raoul Van den Berge
2016-04-10 15:34:12 +02:00
parent 849074e452
commit 2c1707c72f
4 changed files with 54 additions and 13 deletions

View 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");
}
}

View File

@@ -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 {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB