Search in sources :

Example 31 with UIButtonBuilder

use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.

the class ApplyTexturePackConfirmGui method construct.

@Override
public void construct() {
    this.guiscreenBackground = true;
    Keyboard.enableRepeatEvents(true);
    final BasicForm form = new BasicForm(this, 350, 125, "Almura Resource Loader");
    form.setZIndex(10);
    form.setClosable(false);
    form.setBackgroundAlpha(255);
    final UILabel label0 = new UILabel(this, "We noticed you're not using the preferred texture pack.");
    label0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
    label0.setPosition(0, 10, Anchor.CENTER | Anchor.TOP);
    final UILabel label1 = new UILabel(this, "Do you want to apply the following texture pack?");
    label1.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
    label1.setPosition(0, label0.getY() + 15, Anchor.CENTER | Anchor.TOP);
    final UILabel label2 = new UILabel(this, AlmuraSettings.getPreferredTexturePack());
    label2.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
    label2.setPosition(0, label1.getY() + 15, Anchor.CENTER | Anchor.TOP);
    final UISeparator belowAmountSeparator = new UISeparator(this);
    belowAmountSeparator.setSize(form.getWidth() - 5, 1);
    belowAmountSeparator.setPosition(0, -45, Anchor.BOTTOM | Anchor.CENTER);
    final UIButton buttonYes = new UIButtonBuilder(this).text("Yes").anchor(Anchor.BOTTOM | Anchor.CENTER).position(-20, -25).width(40).listener(this).build("button.yes");
    final UIButton buttonNo = new UIButtonBuilder(this).text("No").anchor(Anchor.BOTTOM | Anchor.CENTER).position(20, -25).width(40).listener(this).build("button.close");
    final UISeparator aboveCloseSeparator = new UISeparator(this);
    aboveCloseSeparator.setSize(form.getWidth() - 5, 1);
    aboveCloseSeparator.setPosition(0, -20, Anchor.BOTTOM | Anchor.CENTER);
    final UIButton buttonClose = new UIButtonBuilder(this).text(I18n.format("almura.button.close")).anchor(Anchor.BOTTOM | Anchor.RIGHT).position(0, 0).width(40).listener(this).build("button.close");
    form.add(buttonClose, label0, label1, label2, aboveCloseSeparator, buttonYes, buttonNo, belowAmountSeparator);
    addToScreen(form);
}
Also used : UILabel(net.malisis.core.client.gui.component.decoration.UILabel) BasicForm(net.malisis.core.client.gui.component.container.BasicForm) UIButtonBuilder(net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder) UIButton(net.malisis.core.client.gui.component.interaction.UIButton) UISeparator(net.malisis.core.client.gui.component.decoration.UISeparator)

Aggregations

UIButtonBuilder (net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder)31 UILabel (net.malisis.core.client.gui.component.decoration.UILabel)27 BasicForm (net.malisis.core.client.gui.component.container.BasicForm)25 UIButton (net.malisis.core.client.gui.component.interaction.UIButton)21 UISeparator (net.malisis.core.client.gui.component.decoration.UISeparator)11 UIImage (net.malisis.core.client.gui.component.decoration.UIImage)10 BasicTextBox (net.malisis.core.client.gui.component.interaction.BasicTextBox)10 GuiTexture (net.malisis.core.client.gui.GuiTexture)8 BasicContainer (net.malisis.core.client.gui.component.container.BasicContainer)8 UICheckBox (net.malisis.core.client.gui.component.interaction.UICheckBox)5 UITextField (net.malisis.core.client.gui.component.interaction.UITextField)5 BasicLine (net.malisis.core.client.gui.component.decoration.BasicLine)3 ItemStack (net.minecraft.item.ItemStack)3 Subscribe (com.google.common.eventbus.Subscribe)2 DecimalFormat (java.text.DecimalFormat)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Inject (javax.inject.Inject)2 Anchor (net.malisis.core.client.gui.Anchor)2