_selectedCircuit--;
if(_selectedCircuit < 0)
{
_selectedCircuit = _logic.getCircuitCount() - 1;
}
MineFactoryReloadedClient.prcPages.put(new BlockPosition(_logic), _selectedCircuit);
requestCircuit();
}
};
_nextCircuit = new Button(this, 344, 76, 30, 30, "Next")
{
@Override
public void onClick()
{
_selectedCircuit++;
if(_selectedCircuit >= _logic.getCircuitCount())
{
_selectedCircuit = 0;
}
MineFactoryReloadedClient.prcPages.put(new BlockPosition(_logic), _selectedCircuit);
requestCircuit();
}
};
addControl(_prevCircuit);
addControl(_nextCircuit);
_reinit = new Button(this, 316, 228, 60, 20, "Reinitialize")
{
@Override
public void onClick()
{
_reinitCountdown = 40;
}
};
_reinitConfirm = new Button(this, 316, 228, 60, 20, "Confirm")
{
@Override
public void onClick()
{
PacketDispatcher.sendPacketToServer(PacketWrapper.createPacket(MineFactoryReloadedCore.modNetworkChannel, Packets.LogicReinitialize,
new Object[] { _logic.xCoord, _logic.yCoord, _logic.zCoord }));
_reinitCountdown = 0;
}
};
addControl(_reinit);
addControl(_reinitConfirm);
_reinitConfirm.setVisible(false);
int rotation = logic.worldObj.getBlockMetadata(logic.xCoord, logic.yCoord, logic.zCoord);
for(int i = 0; i < _inputIOPinButtons.length; i++)
{
_inputIOBufferButtons[i] = new ButtonLogicBufferSelect(this, 22, 16 + i * 14, i, LogicButtonType.Input, rotation);
_inputIOPinButtons[i] = new ButtonLogicPinSelect( this, 52, 16 + i * 14, i, LogicButtonType.Input);
_outputIOBufferButtons[i] = new ButtonLogicBufferSelect(this, 254, 16 + i * 14, i, LogicButtonType.Output, rotation);
_outputIOPinButtons[i] = new ButtonLogicPinSelect( this, 284, 16 + i * 14, i, LogicButtonType.Output);
addControl(_inputIOBufferButtons[i]);
addControl(_outputIOBufferButtons[i]);
addControl(_inputIOPinButtons[i]);
addControl(_outputIOPinButtons[i]);
}
Integer lastPage = MineFactoryReloadedClient.prcPages.get(new BlockPosition(_logic));
if(lastPage != null && lastPage < _logic.getCircuitCount())
{
_selectedCircuit = lastPage;
}
requestCircuit();