Search in sources :

Example 6 with GuiTexture

use of net.malisis.core.client.gui.GuiTexture in project Almura by AlmuraDev.

the class MembershipGui method construct.

@Override
public void construct() {
    this.guiscreenBackground = true;
    Keyboard.enableRepeatEvents(true);
    this.form = new BasicForm(this, 310, 250, "Almura Memberships");
    this.form.setAnchor(Anchor.CENTER | Anchor.MIDDLE);
    this.form.setMovable(true);
    this.form.setClosable(true);
    this.form.setBorder(FontColors.WHITE, 1, 185);
    this.form.setBackgroundAlpha(215);
    this.form.setBottomPadding(3);
    this.form.setRightPadding(3);
    this.form.setTopPadding(20);
    this.form.setLeftPadding(3);
    final BasicForm citizenArea = new BasicForm(this, 100, 200, "");
    citizenArea.setPosition(0, 0, Anchor.LEFT | Anchor.TOP);
    citizenArea.setMovable(false);
    citizenArea.setClosable(false);
    citizenArea.setBorder(FontColors.WHITE, 1, 185);
    citizenArea.setBackgroundAlpha(215);
    citizenArea.setBottomPadding(3);
    citizenArea.setRightPadding(3);
    citizenArea.setTopPadding(3);
    citizenArea.setLeftPadding(3);
    final UIImage citizenLogo = new UIImage(this, new GuiTexture(GuiConfig.Location.citizen_logo), null);
    citizenLogo.setSize(99, 99);
    citizenLogo.setPosition(0, -3, Anchor.TOP | Anchor.CENTER);
    this.citizen_details_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, citizenLogo.getY() + 100).text("Details").listener(this).enabled(true).build("button.citizen_details");
    final UILabel citizenLabel0 = new UILabel(this, "Chose One");
    citizenLabel0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).underline(true).shadow(true).scale(0.8F).build());
    citizenLabel0.setPosition(0, 125, Anchor.CENTER | Anchor.TOP);
    this.citizen_donation_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, citizenLabel0.getY() + 10).text("$25.00 Donation").listener(this).enabled(currentMembershipLevel == 0).build("button.citizen_donation");
    this.citizen_purchase_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, citizen_donation_button.getY() + 18).text("$2.5 million in-game").listener(this).enabled(availableFunds >= 2500000 && currentMembershipLevel == 0).build("button.citizen_purchase");
    this.citizen_skills_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, citizen_purchase_button.getY() + 18).text("Skills total at 250+").listener(this).enabled(skillsLevel >= 250 && currentMembershipLevel == 0).build("button.citizen_skills");
    citizenArea.add(citizenLogo, citizen_details_button, citizenLabel0, citizen_donation_button, citizen_skills_button, citizen_purchase_button);
    final BasicForm explorerArea = new BasicForm(this, 100, 200, "");
    explorerArea.setPosition(0, 0, Anchor.CENTER | Anchor.TOP);
    explorerArea.setMovable(false);
    explorerArea.setClosable(false);
    explorerArea.setBorder(FontColors.WHITE, 1, 185);
    explorerArea.setBackgroundAlpha(215);
    explorerArea.setBottomPadding(3);
    explorerArea.setRightPadding(3);
    explorerArea.setTopPadding(3);
    explorerArea.setLeftPadding(3);
    final UIImage explorerLogo = new UIImage(this, new GuiTexture(GuiConfig.Location.explorer_logo), null);
    explorerLogo.setSize(99, 99);
    explorerLogo.setPosition(0, -3, Anchor.TOP | Anchor.CENTER);
    this.explorer_details_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, explorerLogo.getY() + 100).text("Details").listener(this).enabled(true).build("button.explorer_details");
    final UILabel explorerLabel0 = new UILabel(this, "Chose One");
    explorerLabel0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).underline(true).shadow(true).scale(0.8F).build());
    explorerLabel0.setPosition(0, 125, Anchor.CENTER | Anchor.TOP);
    this.explorer_donation_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, explorerLabel0.getY() + 10).text("$50.00 Donation").listener(this).enabled(currentMembershipLevel == 0 || currentMembershipLevel == 1).build("button.explorer_donation");
    this.explorer_purchase_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, explorer_donation_button.getY() + 18).text("$5 million in-game").listener(this).enabled(availableFunds >= 5000000 && (currentMembershipLevel == 0 || currentMembershipLevel == 1)).build("button.explorer_purchase");
    this.explorer_skills_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, explorer_purchase_button.getY() + 18).text("Skills total at 375+").listener(this).enabled(skillsLevel >= 375 && (currentMembershipLevel == 0 || currentMembershipLevel == 1)).build("button.explorer_skills");
    explorerArea.add(explorerLogo, explorer_details_button, explorerLabel0, explorer_donation_button, explorer_skills_button, explorer_purchase_button);
    final BasicForm pioneerArea = new BasicForm(this, 100, 200, "");
    pioneerArea.setPosition(0, 0, Anchor.RIGHT | Anchor.TOP);
    pioneerArea.setMovable(false);
    pioneerArea.setClosable(false);
    pioneerArea.setBorder(FontColors.WHITE, 1, 185);
    pioneerArea.setBackgroundAlpha(215);
    pioneerArea.setBottomPadding(3);
    pioneerArea.setRightPadding(3);
    pioneerArea.setTopPadding(3);
    pioneerArea.setLeftPadding(3);
    final UIImage pioneerLogo = new UIImage(this, new GuiTexture(GuiConfig.Location.pioneer_logo), null);
    pioneerLogo.setSize(99, 99);
    pioneerLogo.setPosition(0, -3, Anchor.TOP | Anchor.CENTER);
    this.pioneer_details_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, pioneerLogo.getY() + 100).text("Details").listener(this).enabled(true).build("button.pioneer_details");
    final UILabel pioneerLabel0 = new UILabel(this, "Chose One");
    pioneerLabel0.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).underline(true).shadow(true).scale(0.8F).build());
    pioneerLabel0.setPosition(0, 125, Anchor.CENTER | Anchor.TOP);
    this.pioneer_donation_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, pioneerLabel0.getY() + 10).text("$100.00 Donation").tooltip("Hi").listener(this).enabled(currentMembershipLevel == 0 || currentMembershipLevel == 1 || currentMembershipLevel == 2).build("button.pioneer_donation");
    this.pioneer_purchase_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, pioneer_donation_button.getY() + 18).text("$10 million in-game").listener(this).enabled(availableFunds >= 10000000 && (currentMembershipLevel == 0 || currentMembershipLevel == 1 || currentMembershipLevel == 2)).build("button.pioneer_purchase");
    this.pioneer_skills_button = new UIButtonBuilder(this).fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).hoverFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build()).width(40).anchor(Anchor.TOP | Anchor.CENTER).position(0, pioneer_purchase_button.getY() + 18).text("Skills total at 400+").listener(this).enabled(skillsLevel >= 400 && (currentMembershipLevel == 0 || currentMembershipLevel == 1 || currentMembershipLevel == 2)).build("button.pioneer_skills");
    pioneerArea.add(pioneerLogo, pioneer_details_button, pioneerLabel0, pioneer_donation_button, pioneer_skills_button, pioneer_purchase_button);
    final UILabel skillsLabel = new UILabel(this, "Current Skills Total: ");
    skillsLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(0.8F).build());
    skillsLabel.setPosition(10, -5, Anchor.LEFT | Anchor.BOTTOM);
    final UILabel skillsLevelLabel = new UILabel(this, "" + skillsLevel);
    skillsLevelLabel.setFontOptions(FontOptions.builder().from(FontColors.BLUE_FO).shadow(true).scale(0.8F).build());
    skillsLevelLabel.setPosition(skillsLabel.getX() + skillsLabel.getWidth(), -5, Anchor.LEFT | Anchor.BOTTOM);
    final UISeparator topWindowTitleSeparator = new UISeparator(this);
    topWindowTitleSeparator.setSize(this.form.getWidth(), 1);
    topWindowTitleSeparator.setPosition(0, -5, Anchor.TOP | Anchor.CENTER);
    this.form.add(topWindowTitleSeparator);
    final UISeparator aboveButtonsSeparator = new UISeparator(this);
    aboveButtonsSeparator.setSize(this.form.getWidth() - 5, 1);
    aboveButtonsSeparator.setPosition(0, -20, Anchor.BOTTOM | Anchor.CENTER);
    this.form.add(aboveButtonsSeparator);
    this.buttonClose = new UIButtonBuilder(this).width(40).anchor(Anchor.BOTTOM | Anchor.RIGHT).text(I18n.format("almura.menu_button.close")).listener(this).build("button.close");
    this.form.add(citizenArea, explorerArea, pioneerArea, skillsLabel, skillsLevelLabel, this.buttonClose);
    addToScreen(this.form);
}
Also used : UILabel(net.malisis.core.client.gui.component.decoration.UILabel) BasicForm(net.malisis.core.client.gui.component.container.BasicForm) GuiTexture(net.malisis.core.client.gui.GuiTexture) UIButtonBuilder(net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder) UISeparator(net.malisis.core.client.gui.component.decoration.UISeparator) UIImage(net.malisis.core.client.gui.component.decoration.UIImage)

Example 7 with GuiTexture

use of net.malisis.core.client.gui.GuiTexture in project Almura by AlmuraDev.

the class ConnectingGui method construct.

@Override
public void construct() {
    this.guiscreenBackground = true;
    Keyboard.enableRepeatEvents(true);
    this.form = new BasicForm(this, 200, 200, "Server Status");
    this.form.setAnchor(Anchor.CENTER | Anchor.MIDDLE);
    this.form.setMovable(false);
    this.form.setClosable(false);
    this.form.setBorder(FontColors.WHITE, 1, 185);
    this.form.setBackgroundAlpha(215);
    this.form.setBottomPadding(3);
    this.form.setRightPadding(3);
    this.form.setTopPadding(20);
    this.form.setLeftPadding(3);
    // Almura header
    final UIImage almuraHeader = new UIImage(this, new GuiTexture(GuiConfig.Location.ALMURA_LOGO), null);
    almuraHeader.setSize(60, 99);
    almuraHeader.setPosition(0, 5, Anchor.TOP | Anchor.CENTER);
    final UISeparator aboveLogoSeparator = new UISeparator(this);
    aboveLogoSeparator.setSize(this.form.getWidth() - 5, 1);
    aboveLogoSeparator.setPosition(0, 107, Anchor.TOP | Anchor.CENTER);
    this.form.add(aboveLogoSeparator);
    this.messageLabel = new UILabel(this, "Connecting from Server...");
    this.messageLabel.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.1F).build());
    this.messageLabel.setPosition(0, 115, Anchor.CENTER | Anchor.TOP);
    this.form.add(this.messageLabel);
    this.messageLabel2 = new UILabel(this, "Synchronizing data...");
    this.messageLabel2.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).scale(1.1F).build());
    this.messageLabel2.setPosition(0, 128, Anchor.CENTER | Anchor.TOP);
    this.form.add(this.messageLabel2);
    this.magic = new UILabel(this, "valuesvalues");
    magic.setFontOptions(FontOptions.builder().from(FontColors.WHITE_FO).obfuscated(true).scale(1.0F).build());
    magic.setPosition(0, -25, Anchor.CENTER | Anchor.BOTTOM);
    this.form.add(magic);
    final UISeparator aboveButtonsSeparator = new UISeparator(this);
    aboveButtonsSeparator.setSize(this.form.getWidth() - 5, 1);
    aboveButtonsSeparator.setPosition(0, -20, Anchor.BOTTOM | Anchor.CENTER);
    this.form.add(aboveButtonsSeparator);
    // Close button
    this.buttonClose = new UIButtonBuilder(this).width(40).anchor(Anchor.BOTTOM | Anchor.CENTER).text("Return to Server Menu").fontOptions(FontOptions.builder().from(FontColors.WHITE_FO).shadow(true).build()).listener(this).build("button.return");
    this.form.add(almuraHeader, this.buttonClose);
    addToScreen(this.form);
}
Also used : UILabel(net.malisis.core.client.gui.component.decoration.UILabel) BasicForm(net.malisis.core.client.gui.component.container.BasicForm) GuiTexture(net.malisis.core.client.gui.GuiTexture) UIButtonBuilder(net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder) UISeparator(net.malisis.core.client.gui.component.decoration.UISeparator) UIImage(net.malisis.core.client.gui.component.decoration.UIImage)

Example 8 with GuiTexture

use of net.malisis.core.client.gui.GuiTexture 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);
    }
}
Also used : UILabel(net.malisis.core.client.gui.component.decoration.UILabel) GuiTexture(net.malisis.core.client.gui.GuiTexture) UIButtonBuilder(net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder) UIButton(net.malisis.core.client.gui.component.interaction.UIButton) BasicContainer(net.malisis.core.client.gui.component.container.BasicContainer) UIImage(net.malisis.core.client.gui.component.decoration.UIImage) UIBackgroundContainer(net.malisis.core.client.gui.component.container.UIBackgroundContainer)

Example 9 with GuiTexture

use of net.malisis.core.client.gui.GuiTexture in project Almura by AlmuraDev.

the class SimpleIngameMenu method construct.

@Override
public void construct() {
    this.renderer.setDefaultTexture(GuiConfig.SpriteSheet.ALMURA);
    this.guiscreenBackground = true;
    final BasicContainer<?> contentContainer = new BasicContainer<>(this);
    contentContainer.setBackgroundAlpha(0);
    contentContainer.setSize(220, 202);
    contentContainer.setAnchor(Anchor.MIDDLE | Anchor.CENTER);
    // 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);
    final UIButton backButton = new UIButtonBuilder(this).text(I18n.format("menu.returnToGame")).size(192, 20).position(0, BasicScreen.getPaddedY(almuraHeader, 10)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).container(contentContainer).build("button.back");
    final BasicContainer<?> shortcutContainer = new BasicContainer<>(this);
    shortcutContainer.setBackgroundAlpha(0);
    shortcutContainer.setSize(192, 24);
    shortcutContainer.setPosition(backButton.getX(), BasicScreen.getPaddedY(backButton, PADDING));
    shortcutContainer.setAnchor(Anchor.TOP | Anchor.CENTER);
    final boolean lanAvaiable = Minecraft.getMinecraft().isSingleplayer() && !Minecraft.getMinecraft().getIntegratedServer().getPublic();
    final UIButton shopButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_SHOPPING_BAG).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("almura.menu_button.shop")).build("button.shop");
    final UIButton mapButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_MAP).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(shopButton, PADDING), shopButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("item.map.name")).build("button.instance");
    final UIButton statisticsButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_PIE_CHART).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(mapButton, PADDING), mapButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("gui.stats")).build("button.statistics");
    final UIButton advancementsButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_TROPHY).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(statisticsButton, PADDING), mapButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("gui.advancements")).build("button.advancements");
    final UIButton forumsButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.ENJIN).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(advancementsButton, PADDING), mapButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("almura.menu_button.forums")).build("button.forums");
    final UIButton lanButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_SITEMAP).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(forumsButton, PADDING), mapButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("menu.shareToLan")).enabled(lanAvaiable).build("button.lan");
    final UIButton optionsButton = new UIButtonBuilder(this).container(shortcutContainer).icon(GuiConfig.Icon.FA_COG).size(UIConstants.Button.WIDTH_ICON, UIConstants.Button.HEIGHT_ICON).position(BasicScreen.getPaddedX(lanButton, PADDING), mapButton.getY()).anchor(Anchor.MIDDLE | Anchor.LEFT).listener(this).tooltip(I18n.format("menu.options")).build("button.options");
    final UIButton quitButton = new UIButtonBuilder(this).container(contentContainer).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_SHORT, UIConstants.Button.HEIGHT).position(0, BasicScreen.getPaddedY(shortcutContainer, 25)).anchor(Anchor.TOP | Anchor.CENTER).listener(this).build("button.quit");
    contentContainer.add(almuraHeader, shortcutContainer);
    this.addToScreen(contentContainer);
}
Also used : GuiTexture(net.malisis.core.client.gui.GuiTexture) UIButtonBuilder(net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder) UIButton(net.malisis.core.client.gui.component.interaction.UIButton) BasicContainer(net.malisis.core.client.gui.component.container.BasicContainer) UIImage(net.malisis.core.client.gui.component.decoration.UIImage)

Example 10 with GuiTexture

use of net.malisis.core.client.gui.GuiTexture in project Almura by AlmuraDev.

the class UIAvatarImage method drawForeground.

@Override
public void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTicks) {
    if (this.playerInfo == null) {
        return;
    }
    final GuiTexture texture = new GuiTexture(this.playerInfo.getLocationSkin(), 64, 64);
    // Draw base face
    ((GuiIconProvider) this.iconProvider).setIcon(texture.createIcon(FACE_X_BASE, FACE_Y_BASE, FACE_WIDTH, FACE_HEIGHT));
    renderer.bindTexture(texture);
    renderer.drawShape(this.shape, this.rp);
    // Reset shape
    this.shape.resetState();
    this.shape.setSize(this.width, this.height);
    this.shape.setPosition(0, 0);
    // Draw overlay face
    ((GuiIconProvider) this.iconProvider).setIcon(texture.createIcon(FACE_X_OVERLAY, FACE_Y_OVERLAY, FACE_WIDTH, FACE_HEIGHT));
    renderer.drawShape(this.shape, this.rp);
}
Also used : GuiTexture(net.malisis.core.client.gui.GuiTexture) GuiIconProvider(net.malisis.core.renderer.icon.provider.GuiIconProvider)

Aggregations

GuiTexture (net.malisis.core.client.gui.GuiTexture)10 UIImage (net.malisis.core.client.gui.component.decoration.UIImage)9 UIButtonBuilder (net.malisis.core.client.gui.component.interaction.button.builder.UIButtonBuilder)8 UILabel (net.malisis.core.client.gui.component.decoration.UILabel)7 BasicForm (net.malisis.core.client.gui.component.container.BasicForm)4 UISeparator (net.malisis.core.client.gui.component.decoration.UISeparator)4 UIButton (net.malisis.core.client.gui.component.interaction.UIButton)4 BasicContainer (net.malisis.core.client.gui.component.container.BasicContainer)3 UIBackgroundContainer (net.malisis.core.client.gui.component.container.UIBackgroundContainer)2 GuiRemoteTexture (com.almuradev.almura.shared.client.texture.GuiRemoteTexture)1 UIButtonBuilder (com.almuradev.almura.shared.client.ui.component.button.UIButtonBuilder)1 DecimalFormat (java.text.DecimalFormat)1 Optional (java.util.Optional)1 BasicTextBox (net.malisis.core.client.gui.component.interaction.BasicTextBox)1 UITextField (net.malisis.core.client.gui.component.interaction.UITextField)1 GuiIconProvider (net.malisis.core.renderer.icon.provider.GuiIconProvider)1 GuiMultiplayer (net.minecraft.client.gui.GuiMultiplayer)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 PluginContainer (org.spongepowered.api.plugin.PluginContainer)1 Text (org.spongepowered.api.text.Text)1