Gui/Priority Tab/Storage work.

This commit is contained in:
AlgorithmX2
2014-01-26 00:44:50 -06:00
parent 2e8ffc4a09
commit 5a6cd05e20
21 changed files with 250 additions and 237 deletions
@@ -6,6 +6,9 @@ import net.minecraft.inventory.IInventory;
import appeng.api.config.AccessRestriction;
import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.container.slot.OptionalSlotFakeTypeOnly;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.parts.misc.PartStorageBus;
@@ -25,7 +28,7 @@ public class ContainerStorageBus extends ContainerUpgradeable
@Override
protected int getHeight()
{
return 245;
return 251;
}
@Override
@@ -40,16 +43,38 @@ public class ContainerStorageBus extends ContainerUpgradeable
return true;
}
@Override
public boolean isSlotEnabled(int idx)
{
int upgrades = myte.getInstalledUpgrades( Upgrades.CAPACITY );
return upgrades > idx;
}
@Override
protected void setupConfig()
{
int xo = 8;
int yo = 23 + 6;
IInventory config = myte.getInventoryByName( "config" );
for (int y = 0; y < 7; y++)
{
for (int x = 0; x < 9; x++)
{
if ( y < 2 )
addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) );
else
addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) );
}
}
IInventory upgrades = myte.getInventoryByName( "upgrades" );
addSlotToContainer( (new SlotRestrictedInput( PlaceableItemType.UPGRADES, upgrades, 0, 187, 8 + 18 * 0 )).setNotDraggable() );
addSlotToContainer( (new SlotRestrictedInput( PlaceableItemType.UPGRADES, upgrades, 1, 187, 8 + 18 * 1 )).setNotDraggable() );
addSlotToContainer( (new SlotRestrictedInput( PlaceableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2 )).setNotDraggable() );
addSlotToContainer( (new SlotRestrictedInput( PlaceableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3 )).setNotDraggable() );
addSlotToContainer( (new SlotRestrictedInput( PlaceableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4 )).setNotDraggable() );
}
@Override