Final grid tweaks
This commit is contained in:
@@ -21,11 +21,11 @@ public class ContainerGrid extends ContainerBase {
|
|||||||
|
|
||||||
this.grid = grid;
|
this.grid = grid;
|
||||||
|
|
||||||
addPlayerInventory(8, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 167 : 126);
|
addPlayerInventory(8, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 165 : 126);
|
||||||
|
|
||||||
if (grid.getType() == EnumGridType.CRAFTING) {
|
if (grid.getType() == EnumGridType.CRAFTING) {
|
||||||
int x = 26;
|
int x = 26;
|
||||||
int y = 98;
|
int y = 96;
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
addSlotToContainer(new SlotGridCrafting(((TileGrid) grid).getMatrix(), i, x, y));
|
addSlotToContainer(new SlotGridCrafting(((TileGrid) grid).getMatrix(), i, x, y));
|
||||||
@@ -38,10 +38,10 @@ public class ContainerGrid extends ContainerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, player, (TileGrid) grid, 0, 130 + 4, 112 + 4));
|
addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, player, (TileGrid) grid, 0, 130 + 4, 110 + 4));
|
||||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||||
int x = 8;
|
int x = 8;
|
||||||
int y = 98;
|
int y = 96;
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
addSlotToContainer(new SlotSpecimenLegacy(((TileGrid) grid).getMatrix(), i, x, y, false));
|
addSlotToContainer(new SlotSpecimenLegacy(((TileGrid) grid).getMatrix(), i, x, y, false));
|
||||||
@@ -54,10 +54,10 @@ public class ContainerGrid extends ContainerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addSlotToContainer(patternResultSlot = new SlotDisabled(((TileGrid) grid).getResult(), 0, 112 + 4, 112 + 4));
|
addSlotToContainer(patternResultSlot = new SlotDisabled(((TileGrid) grid).getResult(), 0, 112 + 4, 110 + 4));
|
||||||
|
|
||||||
addSlotToContainer(new SlotItemHandler(((TileGrid) grid).getPatterns(), 0, 152, 97));
|
addSlotToContainer(new SlotItemHandler(((TileGrid) grid).getPatterns(), 0, 152, 96));
|
||||||
addSlotToContainer(new SlotOutput(((TileGrid) grid).getPatterns(), 1, 152, 137));
|
addSlotToContainer(new SlotOutput(((TileGrid) grid).getPatterns(), 1, 152, 132));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class SlotGridCraftingResult extends SlotCrafting {
|
|||||||
onCrafting(stack);
|
onCrafting(stack);
|
||||||
|
|
||||||
if (!player.worldObj.isRemote) {
|
if (!player.worldObj.isRemote) {
|
||||||
grid.onCrafted(container);
|
grid.onCrafted();
|
||||||
|
|
||||||
container.sendCraftingSlots();
|
container.sendCraftingSlots();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
private int slotNumber;
|
private int slotNumber;
|
||||||
|
|
||||||
public GuiGrid(ContainerGrid container, IGrid grid) {
|
public GuiGrid(ContainerGrid container, IGrid grid) {
|
||||||
super(container, 193, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 249 : 208);
|
super(container, 193, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 247 : 208);
|
||||||
|
|
||||||
setScrollbar(new Scrollbar(174, 20, 12, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 70 : 88));
|
setScrollbar(new Scrollbar(174, 20, 12, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 70 : 88));
|
||||||
getScrollbar().setCanScroll(false);
|
getScrollbar().setCanScroll(false);
|
||||||
@@ -204,16 +204,16 @@ public class GuiGrid extends GuiBase {
|
|||||||
public boolean isOverClear(int mouseX, int mouseY) {
|
public boolean isOverClear(int mouseX, int mouseY) {
|
||||||
switch (grid.getType()) {
|
switch (grid.getType()) {
|
||||||
case CRAFTING:
|
case CRAFTING:
|
||||||
return inBounds(82, 97, 7, 7, mouseX, mouseY);
|
return inBounds(82, 95, 7, 7, mouseX, mouseY);
|
||||||
case PATTERN:
|
case PATTERN:
|
||||||
return inBounds(64, 97, 7, 7, mouseX, mouseY);
|
return inBounds(64, 95, 7, 7, mouseX, mouseY);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOverCreatePattern(int mouseX, int mouseY) {
|
public boolean isOverCreatePattern(int mouseX, int mouseY) {
|
||||||
return grid.getType() == EnumGridType.PATTERN && inBounds(152, 117, 16, 16, mouseX, mouseY) && ((TileGrid) grid).canCreatePattern();
|
return grid.getType() == EnumGridType.PATTERN && inBounds(152, 114, 16, 16, mouseX, mouseY) && ((TileGrid) grid).canCreatePattern();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -239,7 +239,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
ty = 2;
|
ty = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawTexture(x + 152, y + 117, 195, ty * 16, 16, 16);
|
drawTexture(x + 152, y + 114, 195, ty * 16, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
searchField.drawTextBox();
|
searchField.drawTextBox();
|
||||||
@@ -248,7 +248,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
@Override
|
@Override
|
||||||
public void drawForeground(int mouseX, int mouseY) {
|
public void drawForeground(int mouseX, int mouseY) {
|
||||||
drawString(7, 7, t(grid instanceof WirelessGrid ? "gui.refinedstorage:wireless_grid" : "gui.refinedstorage:grid"));
|
drawString(7, 7, t(grid instanceof WirelessGrid ? "gui.refinedstorage:wireless_grid" : "gui.refinedstorage:grid"));
|
||||||
drawString(7, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 155 : 114, t("container.inventory"));
|
drawString(7, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 153 : 114, t("container.inventory"));
|
||||||
|
|
||||||
int x = 8;
|
int x = 8;
|
||||||
int y = 20;
|
int y = 20;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, worldObj));
|
result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, worldObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCrafted(ContainerGrid container) {
|
public void onCrafted() {
|
||||||
ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, worldObj);
|
ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, worldObj);
|
||||||
|
|
||||||
for (int i = 0; i < matrix.getSizeInventory(); ++i) {
|
for (int i = 0; i < matrix.getSizeInventory(); ++i) {
|
||||||
@@ -146,10 +146,6 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onCraftingMatrixChanged();
|
onCraftingMatrixChanged();
|
||||||
|
|
||||||
if (container != null) {
|
|
||||||
container.sendCraftingSlots();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCraftedShift(ContainerGrid container, EntityPlayer player) {
|
public void onCraftedShift(ContainerGrid container, EntityPlayer player) {
|
||||||
@@ -158,7 +154,7 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
ItemStack crafted = result.getStackInSlot(0);
|
ItemStack crafted = result.getStackInSlot(0);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
onCrafted(null);
|
onCrafted();
|
||||||
|
|
||||||
craftedItemsList.add(crafted.copy());
|
craftedItemsList.add(crafted.copy());
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user