use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.
the class PanoramicMainMenu method construct.
@SuppressWarnings("deprecation")
@Override
public void construct() {
final UIBackgroundContainer contentContainer = new UIBackgroundContainer(this);
contentContainer.setBackgroundAlpha(0);
contentContainer.setPosition(0, -10, Anchor.MIDDLE | Anchor.CENTER);
contentContainer.setSize(UIConstants.Button.WIDTH_LONG, 205);
// Almura header
final UIImage almuraHeader = new UIImage(this, new GuiTexture(GuiConfig.Location.ALMURA_LOGO), null);
almuraHeader.setSize(60, 99);
almuraHeader.setPosition(0, 0, Anchor.TOP | Anchor.CENTER);
this.buttonContainer = new UIBackgroundContainer(this, UIConstants.Button.WIDTH_LONG + PADDING, (UIConstants.Button.HEIGHT * 4) + (PADDING * 3));
this.buttonContainer.setPosition(0, BasicScreen.getPaddedY(almuraHeader, 10), Anchor.TOP | Anchor.CENTER);
this.buttonContainer.setBackgroundAlpha(0);
final UIButton singleplayerButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("menu.singleplayer")).size(UIConstants.Button.WIDTH_LONG, UIConstants.Button.HEIGHT).position(0, 0).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.singleplayer");
final UIButton multiplayerButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("menu.multiplayer")).size(UIConstants.Button.WIDTH_LONG, UIConstants.Button.HEIGHT).position(0, BasicScreen.getPaddedY(singleplayerButton, PADDING)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.multiplayer");
final UIButton optionsButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("options.title")).size(UIConstants.Button.WIDTH_TINY, UIConstants.Button.HEIGHT).position(-68, BasicScreen.getPaddedY(multiplayerButton, PADDING)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.options");
final UIButton modsButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("almura.menu_button.mods")).size(UIConstants.Button.WIDTH_TINY, UIConstants.Button.HEIGHT).position(BasicScreen.getPaddedX(optionsButton, PADDING), BasicScreen.getPaddedY(multiplayerButton, PADDING)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.mods");
final UIButton aboutButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("almura.menu_button.about")).size(UIConstants.Button.WIDTH_TINY, UIConstants.Button.HEIGHT).position(BasicScreen.getPaddedX(modsButton, PADDING), BasicScreen.getPaddedY(multiplayerButton, PADDING)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.about");
final UIButton quitButton = new UIButtonBuilder(this).container(this.buttonContainer).text(I18n.format("almura.menu_button.quit")).fontOptions(FontOptions.builder().from(FontColors.RED_FO).shadow(true).build()).hoverFontOptions(FontOptions.builder().color(Color.ofRgb(255, 89, 89).getRgb()).shadow(true).build()).size(UIConstants.Button.WIDTH_LONG, UIConstants.Button.HEIGHT).position(singleplayerButton.getX(), BasicScreen.getPaddedY(optionsButton, PADDING)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.quit");
final UIButton forumsButton = new UIButtonBuilder(this).container(this.buttonContainer).icon(GuiConfig.Icon.ENJIN).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(-PADDING, -PADDING).anchor(Anchor.BOTTOM | Anchor.RIGHT).listener(this).tooltip(I18n.format("almura.menu_button.forums")).build("button.forums");
final UIButton issuesButton = new UIButtonBuilder(this).container(this.buttonContainer).icon(GuiConfig.Icon.FA_GITHUB).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(forumsButton, PADDING, Anchor.RIGHT), forumsButton.getY()).anchor(Anchor.BOTTOM | Anchor.RIGHT).listener(this).tooltip(I18n.format(I18n.format("almura.menu_button.issues"))).build("button.issues");
final UIButton shopButton = new UIButtonBuilder(this).container(this.buttonContainer).icon(GuiConfig.Icon.FA_SHOPPING_BAG).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(issuesButton, PADDING, Anchor.RIGHT), issuesButton.getY()).anchor(Anchor.BOTTOM | Anchor.RIGHT).listener(this).tooltip(I18n.format("almura.menu_button.shop")).build("button.shop");
final UILabel trademarkLabel = new UILabel(this, TextFormatting.YELLOW + I18n.format("almura.menu.main.trademark"));
trademarkLabel.setPosition(PADDING, -PADDING, Anchor.BOTTOM | Anchor.LEFT);
final UILabel copyrightLabel = new UILabel(this, TextFormatting.YELLOW + I18n.format("almura.menu.main.copyright"));
copyrightLabel.setPosition(trademarkLabel.getX(), BasicScreen.getPaddedY(trademarkLabel, PADDING, Anchor.BOTTOM), trademarkLabel.getAnchor());
contentContainer.add(almuraHeader, this.buttonContainer);
// Disable escape key press
registerKeyListener((keyChar, keyCode) -> keyCode == Keyboard.KEY_ESCAPE);
final BasicContainer<?> container = new BasicContainer(this, UIComponent.INHERITED, UIComponent.INHERITED);
container.setBackgroundAlpha(0);
container.add(contentContainer);
container.add(trademarkLabel);
container.add(copyrightLabel);
container.add(shopButton);
container.add(forumsButton);
container.add(issuesButton);
// Add content to screen
addToScreen(container);
// OpenGL Warning
if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.areShadersSupported()) {
final UILabel glWarning1 = new UILabel(this, TextFormatting.BOLD + "" + TextFormatting.DARK_RED + I18n.format("almura.menu.main.opengl.0"));
glWarning1.setPosition(2, 2, Anchor.TOP | Anchor.LEFT);
final UILabel glWarning2 = new UILabel(this, TextFormatting.BOLD + "" + TextFormatting.DARK_RED + I18n.format("almura.menu.main.opengl.1"));
glWarning2.setPosition(2, BasicScreen.getPaddedY(glWarning1, 2), Anchor.TOP | Anchor.LEFT);
addToScreen(glWarning1);
addToScreen(glWarning2);
}
}
use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.
the class MembershipAppliedGui method construct.
@Override
public void construct() {
this.guiscreenBackground = true;
Keyboard.enableRepeatEvents(true);
final BasicForm form = new BasicForm(this, 150, 100, "Almura Memberships");
form.setZIndex(10);
form.setBackgroundAlpha(255);
final UILabel label0 = new UILabel(this, "Congratulations!");
label0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
label0.setPosition(0, 10, Anchor.CENTER | Anchor.TOP);
final UILabel membershipLabel = new UILabel(this, membership);
membershipLabel.setFontOptions(FontOptions.builder().from(FontColors.GOLD_FO).shadow(true).scale(1.0F).build());
membershipLabel.setPosition(0, label0.getY() + 15, Anchor.CENTER | Anchor.TOP);
final UILabel valueLabel = new UILabel(this, "Successfully applied!");
valueLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
valueLabel.setPosition(0, membershipLabel.getY() + 15, Anchor.CENTER | Anchor.TOP);
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, membershipLabel, valueLabel, aboveCloseSeparator);
addToScreen(form);
}
use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.
the class MembershipDetailsGui method construct.
@Override
public void construct() {
this.guiscreenBackground = true;
Keyboard.enableRepeatEvents(true);
final BasicForm form = new BasicForm(this, 250, 200, membership);
form.setZIndex(10);
form.setBackgroundAlpha(255);
final UILabel unlocksWorldsLabel = new UILabel(this, "Unlocks Worlds:");
unlocksWorldsLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
unlocksWorldsLabel.setPosition(25, 10, Anchor.LEFT | Anchor.TOP);
form.add(unlocksWorldsLabel);
final UILabel cemariaWorldLabel = new UILabel(this, "Cemaria");
cemariaWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
cemariaWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, unlocksWorldsLabel.getY(), Anchor.LEFT | Anchor.TOP);
form.add(cemariaWorldLabel);
final UILabel highgardenWorldLabel = new UILabel(this, "Highgarden");
highgardenWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
highgardenWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, cemariaWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(highgardenWorldLabel);
final UILabel forestRiverWorldLabel = new UILabel(this, "ForestRiver");
forestRiverWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
forestRiverWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, highgardenWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(forestRiverWorldLabel);
if (membershipLevel >= 2) {
final UILabel atlantisWorldLabel = new UILabel(this, "Atlantis");
atlantisWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
atlantisWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, forestRiverWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(atlantisWorldLabel);
final UILabel keystoneWorldLabel = new UILabel(this, "Keystone");
keystoneWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
keystoneWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, atlantisWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(keystoneWorldLabel);
final UILabel marionWorldLabel = new UILabel(this, "Marion");
marionWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
marionWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, keystoneWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(marionWorldLabel);
if (membershipLevel == 3) {
final UILabel zealWorldLabel = new UILabel(this, "Zeal");
zealWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
zealWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, marionWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(zealWorldLabel);
final UILabel tollanaWorldLabel = new UILabel(this, "Tollana");
tollanaWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
tollanaWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, zealWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(tollanaWorldLabel);
final UILabel othalaWorldLabel = new UILabel(this, "Othala");
othalaWorldLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
othalaWorldLabel.setPosition(unlocksWorldsLabel.getX() + unlocksWorldsLabel.getWidth() + 5, tollanaWorldLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(othalaWorldLabel);
}
}
final UILabel featuresLabel = new UILabel(this, "Features: ");
featuresLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
if (membershipLevel == 1) {
featuresLabel.setPosition(25, 45, Anchor.LEFT | Anchor.TOP);
form.setSize(form.getWidth(), 170);
}
if (membershipLevel == 2) {
featuresLabel.setPosition(25, 75, Anchor.LEFT | Anchor.TOP);
form.setSize(form.getWidth(), 210);
}
if (membershipLevel == 3) {
featuresLabel.setPosition(25, 105, Anchor.LEFT | Anchor.TOP);
form.setSize(form.getWidth(), 300);
}
form.add(featuresLabel);
final UILabel keepInventoryOnDeathLabel = new UILabel(this, "- Keep Inventory on Death");
keepInventoryOnDeathLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
keepInventoryOnDeathLabel.setPosition(35, featuresLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(keepInventoryOnDeathLabel);
final UILabel keepExperienceOnDeathLabel = new UILabel(this, "- Keep Experience on Death");
keepExperienceOnDeathLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
keepExperienceOnDeathLabel.setPosition(keepInventoryOnDeathLabel.getX(), keepInventoryOnDeathLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(keepExperienceOnDeathLabel);
final UILabel abilityToReviveLabel = new UILabel(this, "- Ability to Revive");
abilityToReviveLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
abilityToReviveLabel.setPosition(keepInventoryOnDeathLabel.getX(), keepExperienceOnDeathLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(abilityToReviveLabel);
final UILabel griefPreventionLeaseLabel = new UILabel(this, "- 90 day Grief Prevention Leases");
griefPreventionLeaseLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
griefPreventionLeaseLabel.setPosition(keepInventoryOnDeathLabel.getX(), abilityToReviveLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(griefPreventionLeaseLabel);
final UILabel priorityPlayerTechnicalSupportLabel = new UILabel(this, "- Priority Player Technical Support");
priorityPlayerTechnicalSupportLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
priorityPlayerTechnicalSupportLabel.setPosition(keepInventoryOnDeathLabel.getX(), griefPreventionLeaseLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(priorityPlayerTechnicalSupportLabel);
final UILabel earlyAccessToNewContentLabel = new UILabel(this, "- Early access to new content");
earlyAccessToNewContentLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
earlyAccessToNewContentLabel.setPosition(keepInventoryOnDeathLabel.getX(), priorityPlayerTechnicalSupportLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(earlyAccessToNewContentLabel);
if (membershipLevel == 1) {
final UILabel citizenItemSlotsLabel = new UILabel(this, "- 100 item slots on Exchange");
citizenItemSlotsLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
citizenItemSlotsLabel.setPosition(keepInventoryOnDeathLabel.getX(), earlyAccessToNewContentLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(citizenItemSlotsLabel);
}
if (membershipLevel >= 2) {
final UILabel abilityToFlyLabel = new UILabel(this, "- Ability to Fly!");
abilityToFlyLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
abilityToFlyLabel.setPosition(keepInventoryOnDeathLabel.getX(), earlyAccessToNewContentLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(abilityToFlyLabel);
if (membershipLevel == 2) {
final UILabel explorerItemSlotsLabel = new UILabel(this, "- 500 item slots on Exchange");
explorerItemSlotsLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
explorerItemSlotsLabel.setPosition(keepInventoryOnDeathLabel.getX(), abilityToFlyLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(explorerItemSlotsLabel);
}
if (membershipLevel == 3) {
final UILabel pioneerItemSlotLabel = new UILabel(this, "- 5,000 item slots on Exchange");
pioneerItemSlotLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
pioneerItemSlotLabel.setPosition(keepInventoryOnDeathLabel.getX(), abilityToFlyLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(pioneerItemSlotLabel);
final UILabel commandsLabel = new UILabel(this, "Additional Commands: ");
commandsLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
commandsLabel.setPosition(25, pioneerItemSlotLabel.getY() + 15, Anchor.LEFT | Anchor.TOP);
form.add(commandsLabel);
final UILabel backCommandLabel = new UILabel(this, "- /back");
backCommandLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
backCommandLabel.setPosition(keepInventoryOnDeathLabel.getX(), commandsLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(backCommandLabel);
final UILabel nicknameCommandLabel = new UILabel(this, "- /nickname");
nicknameCommandLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
nicknameCommandLabel.setPosition(keepInventoryOnDeathLabel.getX(), backCommandLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(nicknameCommandLabel);
final UILabel anvilCommandLabel = new UILabel(this, "- /anvil");
anvilCommandLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
anvilCommandLabel.setPosition(keepInventoryOnDeathLabel.getX(), nicknameCommandLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(anvilCommandLabel);
final UILabel enchantingTableCommandLabel = new UILabel(this, "- /enchantingtable");
enchantingTableCommandLabel.setFontOptions(FontOptions.builder().from(FontColors.GRAY_FO).shadow(true).scale(1.0F).build());
enchantingTableCommandLabel.setPosition(keepInventoryOnDeathLabel.getX(), anvilCommandLabel.getY() + 10, Anchor.LEFT | Anchor.TOP);
form.add(enchantingTableCommandLabel);
}
}
final UISeparator aboveCloseSeparator = new UISeparator(this);
aboveCloseSeparator.setSize(form.getWidth() - 5, 1);
aboveCloseSeparator.setPosition(0, -18, 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, aboveCloseSeparator);
addToScreen(form);
}
use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.
the class PurchaseConfirmGui method construct.
@Override
public void construct() {
this.guiscreenBackground = true;
Keyboard.enableRepeatEvents(true);
final BasicForm form = new BasicForm(this, 150, 125, "Confirmation");
form.setZIndex(10);
form.setBackgroundAlpha(255);
final UILabel label0 = new UILabel(this, "Do you wish to purchase:");
label0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
label0.setPosition(0, 10, Anchor.CENTER | Anchor.TOP);
final UILabel membershipLabel = new UILabel(this, membership);
membershipLabel.setFontOptions(FontOptions.builder().from(FontColors.GOLD_FO).shadow(true).scale(1.0F).build());
membershipLabel.setPosition(0, label0.getY() + 15, Anchor.CENTER | Anchor.TOP);
final UILabel amountLabel = new UILabel(this, "Amount: ");
amountLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
amountLabel.setPosition(-25, membershipLabel.getY() + 15, Anchor.CENTER | Anchor.TOP);
final UILabel valueLabel = new UILabel(this, value);
valueLabel.setFontOptions(FontOptions.builder().from(FontColors.GREEN_FO).shadow(true).scale(1.0F).build());
valueLabel.setPosition(amountLabel.getX() + amountLabel.getWidth() + 5, membershipLabel.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 buttonPurchase = new UIButtonBuilder(this).text("Purchase").anchor(Anchor.BOTTOM | Anchor.CENTER).position(0, -25).width(40).listener(this).build("button.purchase");
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.cancel")).anchor(Anchor.BOTTOM | Anchor.RIGHT).position(0, 0).width(40).listener(this).build("button.close");
form.add(buttonClose, label0, membershipLabel, amountLabel, valueLabel, aboveCloseSeparator, buttonPurchase, belowAmountSeparator);
addToScreen(form);
}
use of net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder in project Almura by AlmuraDev.
the class SkillsUpgradeConfirmGui method construct.
@Override
public void construct() {
this.guiscreenBackground = true;
Keyboard.enableRepeatEvents(true);
final BasicForm form = new BasicForm(this, 150, 125, "Confirmation");
form.setZIndex(10);
form.setBackgroundAlpha(255);
final UILabel label0 = new UILabel(this, "Do you wish to upgrade to:");
label0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.0F).build());
label0.setPosition(0, 10, Anchor.CENTER | Anchor.TOP);
final UILabel membershipLabel = new UILabel(this, membership);
membershipLabel.setFontOptions(FontOptions.builder().from(FontColors.GOLD_FO).shadow(true).scale(1.0F).build());
membershipLabel.setPosition(0, label0.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 buttonPurchase = new UIButtonBuilder(this).text("Upgrade Me!").anchor(Anchor.BOTTOM | Anchor.CENTER).position(0, -25).width(40).listener(this).build("button.upgrade");
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.cancel")).anchor(Anchor.BOTTOM | Anchor.RIGHT).position(0, 0).width(40).listener(this).build("button.close");
form.add(buttonClose, label0, membershipLabel, aboveCloseSeparator, buttonPurchase, belowAmountSeparator);
addToScreen(form);
}
Aggregations