use of mcjty.lib.gui.layout.PositionalLayout in project RFTools by McJty.
the class GuiStorageFilter method initGui.
@Override
public void initGui() {
super.initGui();
blacklistMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(130, 9, 16, 16)).setTooltips("Black or whitelist mode").addChoiceEvent((parent, newChoice) -> updateSettings());
blacklistMode.addChoice("Black", "Blacklist items", guiElements, 14 * 16, 32);
blacklistMode.addChoice("White", "Whitelist items", guiElements, 15 * 16, 32);
oredictMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(148, 9, 16, 16)).setTooltips("Filter based on ore dictionary").addChoiceEvent((parent, newChoice) -> updateSettings());
oredictMode.addChoice("Off", "Oredict matching off", guiElements, 10 * 16, 32);
oredictMode.addChoice("On", "Oredict matching on", guiElements, 11 * 16, 32);
damageMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(130, 27, 16, 16)).setTooltips("Filter ignoring damage").addChoiceEvent((parent, newChoice) -> updateSettings());
damageMode.addChoice("Off", "Ignore damage", guiElements, 6 * 16, 32);
damageMode.addChoice("On", "Damage must match", guiElements, 7 * 16, 32);
nbtMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(148, 27, 16, 16)).setTooltips("Filter ignoring NBT").addChoiceEvent((parent, newChoice) -> updateSettings());
nbtMode.addChoice("Off", "Ignore NBT", guiElements, 8 * 16, 32);
nbtMode.addChoice("On", "NBT must match", guiElements, 9 * 16, 32);
modMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(130, 45, 16, 16)).setTooltips("Filter ignoring mod").addChoiceEvent((parent, newChoice) -> updateSettings());
modMode.addChoice("Off", "Don't match on mod", guiElements, 12 * 16, 32);
modMode.addChoice("On", "Only mod must match", guiElements, 13 * 16, 32);
NBTTagCompound tagCompound = Minecraft.getMinecraft().player.getHeldItem(EnumHand.MAIN_HAND).getTagCompound();
if (tagCompound != null) {
setBlacklistMode(tagCompound.getString("blacklistMode"));
oredictMode.setCurrentChoice(tagCompound.getBoolean("oredictMode") ? 1 : 0);
damageMode.setCurrentChoice(tagCompound.getBoolean("damageMode") ? 1 : 0);
nbtMode.setCurrentChoice(tagCompound.getBoolean("nbtMode") ? 1 : 0);
modMode.setCurrentChoice(tagCompound.getBoolean("modMode") ? 1 : 0);
}
Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(iconLocation).addChild(blacklistMode).addChild(oredictMode).addChild(damageMode).addChild(nbtMode).addChild(modMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.layout.PositionalLayout in project RFTools by McJty.
the class GuiInvChecker method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
amountField = new TextField(mc, this).setTooltips("Set the amount of items in slot").setLayoutHint(new PositionalLayout.PositionalHint(60, 19, 80, 14)).addTextEvent((parent, newText) -> setAmount());
int amount = tileEntity.getAmount();
amountField.setText(String.valueOf(amount));
slotField = new TextField(mc, this).setTooltips("Set the slot index").setLayoutHint(new PositionalLayout.PositionalHint(60, 3, 80, 14)).addTextEvent((parent, newText) -> setSlot());
int current = tileEntity.getSlot();
slotField.setText(String.valueOf(current));
metaLabel = new ChoiceLabel(mc, this).addChoices(META_IGNORE, META_MATCH).addChoiceEvent((parent, newChoice) -> setMetaUsage()).setChoiceTooltip(META_IGNORE, "Ignore meta/damage on item").setChoiceTooltip(META_MATCH, "Meta/damage on item must match");
metaLabel.setLayoutHint(new PositionalLayout.PositionalHint(60, 35, 80, 14));
metaLabel.setChoice(tileEntity.isUseMeta() ? META_MATCH : META_IGNORE);
oreDictLabel = new ChoiceLabel(mc, this).addChoices(OREDICT_IGNORE, OREDICT_USE).addChoiceEvent((parent, newChoice) -> setOredictUsage()).setChoiceTooltip(OREDICT_IGNORE, "Ingore ore dictionary").setChoiceTooltip(OREDICT_USE, "Use ore dictionary matching");
oreDictLabel.setLayoutHint(new PositionalLayout.PositionalHint(60, 51, 80, 14));
oreDictLabel.setChoice(tileEntity.isOreDict() ? OREDICT_USE : OREDICT_IGNORE);
toplevel.addChild(new Label(mc, this).setText("Slot:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 3, 50, 14))).addChild(slotField).addChild(new Label(mc, this).setText("Amount:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 19, 50, 14))).addChild(amountField).addChild(new Label(mc, this).setText("Meta:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 35, 50, 14))).addChild(metaLabel).addChild(new Label(mc, this).setText("Oredict:").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 51, 50, 14))).addChild(oreDictLabel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.layout.PositionalLayout in project RFTools by McJty.
the class GuiCoalGenerator method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
initRedstoneMode();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(redstoneMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
}
use of mcjty.lib.gui.layout.PositionalLayout in project RFTools by McJty.
the class GuiMachineInfuser method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
// arrow = new ImageLabel(mc, this).setImage(iconGuiElements, 192, 0);
// arrow.setLayoutHint(new PositionalLayout.PositionalHint(90, 26, 16, 16));
// .addChild(arrow);
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
// tileEntity.requestResearchingFromServer();
}
use of mcjty.lib.gui.layout.PositionalLayout in project RFTools by McJty.
the class GuiItemFilter method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
int[] inputMode = tileEntity.getInputMode();
int[] outputMode = tileEntity.getOutputMode();
for (EnumFacing direction : EnumFacing.VALUES) {
final int side = direction.ordinal();
for (int slot = 0; slot < ItemFilterContainer.BUFFER_SIZE; slot++) {
ImageChoiceLabel choiceLabel = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(25 + slot * 18, 4 + side * 13, 12, 12)).addChoice("0", "Disabled", iconGuiElements, 160, 0).addChoice("1", "Input", iconGuiElements, 96, 16).addChoice("2", "Output", iconGuiElements, 80, 16);
bits[side * ItemFilterContainer.BUFFER_SIZE + slot] = choiceLabel;
if ((inputMode[side] & (1 << slot)) != 0) {
choiceLabel.setCurrentChoice(1);
} else if ((outputMode[side] & (1 << slot)) != 0) {
choiceLabel.setCurrentChoice(2);
} else {
choiceLabel.setCurrentChoice(0);
}
final int finalSlot = slot;
choiceLabel.addChoiceEvent((parent, newChoice) -> changeMode(side, finalSlot));
toplevel.addChild(choiceLabel);
}
}
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
Aggregations