Search in sources :

Example 1 with RedstoneMode

use of mcjty.lib.varia.RedstoneMode in project RFTools by McJty.

the class GuiCrafter method initGui.

@Override
public void initGui() {
    super.initGui();
    int maxEnergyStored = tileEntity.getMaxEnergyStored();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(12, 141, 10, 76)).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
    initKeepMode();
    initInternalRecipe();
    Slider listSlider = initRecipeList();
    applyButton = new Button(mc, this).setText("Apply").setTooltips("Press to apply the", "recipe to the crafter").addButtonEvent(parent -> applyRecipe()).setEnabled(false).setLayoutHint(new PositionalLayout.PositionalHint(212, 65, 34, 16));
    Button rememberButton = new Button(mc, this).setText("R").setTooltips("Remember the current items", "in the internal and", "external buffers").addButtonEvent(widget -> rememberItems()).setLayoutHint(new PositionalLayout.PositionalHint(148, 74, 18, 16));
    Button forgetButton = new Button(mc, this).setText("F").setTooltips("Forget the remembered layout").addButtonEvent(widget -> forgetItems()).setLayoutHint(new PositionalLayout.PositionalHint(168, 74, 18, 16));
    initRedstoneMode();
    initSpeedMode();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(keepItem).addChild(internalRecipe).addChild(recipeList).addChild(listSlider).addChild(applyButton).addChild(redstoneMode).addChild(speedMode).addChild(rememberButton).addChild(forgetButton);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    if (lastSelected != -1 && lastSelected < tileEntity.getSizeInventory()) {
        recipeList.setSelected(lastSelected);
    }
    // sendChangeToServer(-1, null, null, false, CraftingRecipe.CraftMode.EXT);
    window = new Window(this, toplevel);
    tileEntity.requestRfFromServer(RFTools.MODID);
}
Also used : GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) Rectangle(java.awt.Rectangle) BlockTools(mcjty.lib.varia.BlockTools) OpenGlHelper(net.minecraft.client.renderer.OpenGlHelper) mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) HorizontalAlignment(mcjty.lib.gui.layout.HorizontalAlignment) StyleConfig(mcjty.lib.base.StyleConfig) Window(mcjty.lib.gui.Window) ItemStackList(mcjty.lib.varia.ItemStackList) ItemStack(net.minecraft.item.ItemStack) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) DefaultSelectionEvent(mcjty.lib.gui.events.DefaultSelectionEvent) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) RFTools(mcjty.rftools.RFTools) IRecipe(net.minecraft.item.crafting.IRecipe) GlStateManager(net.minecraft.client.renderer.GlStateManager) TextFormatting(net.minecraft.util.text.TextFormatting) GenericEnergyStorageTileEntity(mcjty.lib.entity.GenericEnergyStorageTileEntity) RedstoneMode(mcjty.lib.varia.RedstoneMode) Argument(mcjty.lib.network.Argument) CraftingRecipe(mcjty.rftools.craftinggrid.CraftingRecipe) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Slot(net.minecraft.inventory.Slot) ResourceLocation(net.minecraft.util.ResourceLocation) RenderHelper(mcjty.lib.gui.RenderHelper) Container(net.minecraft.inventory.Container) InventoryCrafting(net.minecraft.inventory.InventoryCrafting) Window(mcjty.lib.gui.Window) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Rectangle(java.awt.Rectangle)

Example 2 with RedstoneMode

use of mcjty.lib.varia.RedstoneMode in project RFTools by McJty.

the class EnvironmentalControllerTileEntity method setRedstoneMode.

private Object[] setRedstoneMode(String mode) {
    RedstoneMode redstoneMode = RedstoneMode.getMode(mode);
    if (redstoneMode == null) {
        throw new IllegalArgumentException("Not a valid mode");
    }
    setRSMode(redstoneMode);
    return null;
}
Also used : RedstoneMode(mcjty.lib.varia.RedstoneMode)

Example 3 with RedstoneMode

use of mcjty.lib.varia.RedstoneMode in project RFTools by McJty.

the class BlockProtectorTileEntity method setRedstoneMode.

private Object[] setRedstoneMode(String mode) {
    RedstoneMode redstoneMode = RedstoneMode.getMode(mode);
    if (redstoneMode == null) {
        throw new IllegalArgumentException("Not a valid mode");
    }
    setRSMode(redstoneMode);
    return null;
}
Also used : RedstoneMode(mcjty.lib.varia.RedstoneMode)

Example 4 with RedstoneMode

use of mcjty.lib.varia.RedstoneMode in project RFTools by McJty.

the class ShieldTEBase method setRedstoneMode.

private Object[] setRedstoneMode(String mode) {
    RedstoneMode redstoneMode = RedstoneMode.getMode(mode);
    if (redstoneMode == null) {
        throw new IllegalArgumentException("Not a valid mode");
    }
    setRSMode(redstoneMode);
    return null;
}
Also used : RedstoneMode(mcjty.lib.varia.RedstoneMode)

Example 5 with RedstoneMode

use of mcjty.lib.varia.RedstoneMode in project RFTools by McJty.

the class GuiShield method initGui.

@Override
public void initGui() {
    super.initGui();
    int maxEnergyStored = tileEntity.getMaxEnergyStored();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(12, 141, 10, 76)).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
    initVisibilityMode();
    initActionOptions();
    initTypeOptions();
    initRedstoneMode();
    initDamageType();
    filterList = new WidgetList(mc, this).setDesiredHeight(120).addSelectionEvent(new DefaultSelectionEvent() {

        @Override
        public void select(Widget parent, int index) {
            selectFilter();
        }
    });
    Slider filterSlider = new Slider(mc, this).setVertical().setScrollable(filterList).setDesiredWidth(11).setDesiredHeight(120);
    Panel filterPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).setLayoutHint(new PositionalLayout.PositionalHint(12, 10, 154, 124)).addChild(filterList).addChild(filterSlider).setFilledBackground(0xff9e9e9e);
    Button applyCamo = new Button(mc, this).setText("Set").setTooltips("Set the camouflage block").setLayoutHint(new PositionalLayout.PositionalHint(51, 142, 28, 16)).addButtonEvent(parent -> applyCamoToShield());
    // applyCamo.setEnabled(false);
    // applyCamo.setTooltips("Not implemented yet");   // @todo
    colorSelector = new ColorChoiceLabel(mc, this).setTooltips("Color for the shield").setLayoutHint(new PositionalLayout.PositionalHint(31, 177, 48, 16));
    colorSelector.addColors(0x96ffc8);
    for (EnumDyeColor color : EnumDyeColor.values()) {
        colorSelector.addColors(color.getColorValue());
    }
    colorSelector.setCurrentColor(tileEntity.getShieldColor());
    colorSelector.addChoiceEvent((parent, newColor) -> sendServerCommand(RFToolsMessages.INSTANCE, ShieldTEBase.CMD_SETCOLOR, new Argument("color", newColor)));
    player = new TextField(mc, this).setTooltips("Optional player name").setLayoutHint(new PositionalLayout.PositionalHint(170, 44, 80, 14));
    addFilter = new Button(mc, this).setText("Add").setTooltips("Add selected filter").setLayoutHint(new PositionalLayout.PositionalHint(4, 6, 36, 14)).addButtonEvent(parent -> addNewFilter());
    delFilter = new Button(mc, this).setText("Del").setTooltips("Delete selected filter").setLayoutHint(new PositionalLayout.PositionalHint(39, 6, 36, 14)).addButtonEvent(parent -> removeSelectedFilter());
    upFilter = new Button(mc, this).setText("Up").setTooltips("Move filter up").setLayoutHint(new PositionalLayout.PositionalHint(4, 22, 36, 14)).addButtonEvent(parent -> moveFilterUp());
    downFilter = new Button(mc, this).setText("Down").setTooltips("Move filter down").setLayoutHint(new PositionalLayout.PositionalHint(39, 22, 36, 14)).addButtonEvent(parent -> moveFilterDown());
    Panel controlPanel = new Panel(mc, this).setLayout(new PositionalLayout()).setLayoutHint(new PositionalLayout.PositionalHint(170, 58, 80, 43)).addChild(addFilter).addChild(delFilter).addChild(upFilter).addChild(downFilter).setFilledRectThickness(-2).setFilledBackground(StyleConfig.colorListBackground);
    Label lootingBonus = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGN_RIGHT).setText("Looting:");
    lootingBonus.setTooltips("Insert dimensional shards", "for looting bonus").setLayoutHint(new PositionalLayout.PositionalHint(160, 118, 60, 18));
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(visibilityOptions).addChild(applyCamo).addChild(redstoneMode).addChild(filterPanel).addChild(actionOptions).addChild(typeOptions).addChild(player).addChild(controlPanel).addChild(damageType).addChild(colorSelector).addChild(lootingBonus);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    listDirty = 0;
    requestFilters();
    tileEntity.requestRfFromServer(RFTools.MODID);
}
Also used : GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) TextField(mcjty.lib.gui.widgets.TextField) mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) HorizontalAlignment(mcjty.lib.gui.layout.HorizontalAlignment) Label(mcjty.lib.gui.widgets.Label) ArrayList(java.util.ArrayList) StyleConfig(mcjty.lib.base.StyleConfig) Window(mcjty.lib.gui.Window) ItemStack(net.minecraft.item.ItemStack) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) DefaultSelectionEvent(mcjty.lib.gui.events.DefaultSelectionEvent) mcjty.rftools.blocks.shield.filters(mcjty.rftools.blocks.shield.filters) Panel(mcjty.lib.gui.widgets.Panel) Block(net.minecraft.block.Block) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) RFTools(mcjty.rftools.RFTools) GenericEnergyStorageTileEntity(mcjty.lib.entity.GenericEnergyStorageTileEntity) RedstoneMode(mcjty.lib.varia.RedstoneMode) java.awt(java.awt) Argument(mcjty.lib.network.Argument) List(java.util.List) EnumDyeColor(net.minecraft.item.EnumDyeColor) Button(mcjty.lib.gui.widgets.Button) ResourceLocation(net.minecraft.util.ResourceLocation) Window(mcjty.lib.gui.Window) Argument(mcjty.lib.network.Argument) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Label(mcjty.lib.gui.widgets.Label) EnumDyeColor(net.minecraft.item.EnumDyeColor) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) TextField(mcjty.lib.gui.widgets.TextField) DefaultSelectionEvent(mcjty.lib.gui.events.DefaultSelectionEvent)

Aggregations

RedstoneMode (mcjty.lib.varia.RedstoneMode)5 StyleConfig (mcjty.lib.base.StyleConfig)2 GenericGuiContainer (mcjty.lib.container.GenericGuiContainer)2 GenericEnergyStorageTileEntity (mcjty.lib.entity.GenericEnergyStorageTileEntity)2 Window (mcjty.lib.gui.Window)2 DefaultSelectionEvent (mcjty.lib.gui.events.DefaultSelectionEvent)2 HorizontalAlignment (mcjty.lib.gui.layout.HorizontalAlignment)2 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)2 PositionalLayout (mcjty.lib.gui.layout.PositionalLayout)2 mcjty.lib.gui.widgets (mcjty.lib.gui.widgets)2 Argument (mcjty.lib.network.Argument)2 RFTools (mcjty.rftools.RFTools)2 RFToolsMessages (mcjty.rftools.network.RFToolsMessages)2 ItemStack (net.minecraft.item.ItemStack)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 java.awt (java.awt)1 Rectangle (java.awt.Rectangle)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 RenderHelper (mcjty.lib.gui.RenderHelper)1