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);
}
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;
}
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;
}
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;
}
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);
}
Aggregations