Adds a round robin and random mode to export buses.

Resolves #85
This commit is contained in:
yueh
2015-07-10 02:55:03 +02:00
committed by thatsIch
parent c5848fe323
commit 67213462db
11 changed files with 287 additions and 176 deletions
@@ -28,6 +28,7 @@ import org.lwjgl.input.Mouse;
import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
import appeng.api.config.SchedulingMode;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
@@ -38,6 +39,7 @@ import appeng.container.implementations.ContainerUpgradeable;
import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.parts.automation.PartExportBus;
import appeng.parts.automation.PartImportBus;
@@ -50,6 +52,7 @@ public class GuiUpgradeable extends AEBaseGui
GuiImgButton redstoneMode;
GuiImgButton fuzzyMode;
GuiImgButton craftMode;
GuiImgButton schedulingMode;
public GuiUpgradeable( InventoryPlayer inventoryPlayer, IUpgradeableHost te )
{
@@ -83,10 +86,12 @@ public class GuiUpgradeable extends AEBaseGui
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
this.craftMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO );
this.schedulingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT );
this.buttonList.add( this.craftMode );
this.buttonList.add( this.redstoneMode );
this.buttonList.add( this.fuzzyMode );
this.buttonList.add( this.schedulingMode );
}
@Override
@@ -109,6 +114,11 @@ public class GuiUpgradeable extends AEBaseGui
{
this.craftMode.set( this.cvb.cMode );
}
if( this.schedulingMode != null )
{
this.schedulingMode.set( this.cvb.schedulingMode );
}
}
@Override
@@ -142,6 +152,10 @@ public class GuiUpgradeable extends AEBaseGui
{
this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 );
}
if( this.schedulingMode != null )
{
this.schedulingMode.setVisibility(this.bc.getInstalledUpgrades( Upgrades.CAPACITY ) > 0 && this.bc instanceof PartExportBus );
}
}
protected String getBackground()
@@ -180,5 +194,10 @@ public class GuiUpgradeable extends AEBaseGui
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
}
if( btn == this.schedulingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
}
}
}