Search in sources :

Example 1 with ScrollableButtonList

use of logictechcorp.libraryex.client.gui.ScrollableButtonList in project NetherEx by LogicTechCorp.

the class CustomizeNetherExWorldTypeScreen method init.

@Override
public void init() {
    this.addButton(new Button((this.width / 2) - 45, (this.height - 27), 90, 20, I18n.format("gui.done"), (button) -> this.minecraft.displayGuiScreen(this.createWorldScreen)));
    List<ScrollableButtonList.ButtonData> buttonDataList = new ArrayList<>();
    for (int i = 0; i < this.compatibleWorldTypes.size(); i++) {
        WorldType worldType = this.compatibleWorldTypes.get(i);
        buttonDataList.add(new ScrollableButtonList.ButtonData(I18n.format("selectWorld.customizeType") + " " + I18n.format(worldType.getTranslationKey()), i * 160, button -> worldType.onCustomizeButton(this.minecraft, this.createWorldScreen)));
    }
    this.guiScrollableButtonList = new ScrollableButtonList(this.createWorldScreen, this.width, this.height, 32, this.height - 32, buttonDataList);
}
Also used : I18n(net.minecraft.client.resources.I18n) ScrollableButtonList(logictechcorp.libraryex.client.gui.ScrollableButtonList) WorldType(net.minecraft.world.WorldType) List(java.util.List) Screen(net.minecraft.client.gui.screen.Screen) CreateWorldScreen(net.minecraft.client.gui.screen.CreateWorldScreen) Button(net.minecraft.client.gui.widget.button.Button) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ArrayList(java.util.ArrayList) WorldType(net.minecraft.world.WorldType) Button(net.minecraft.client.gui.widget.button.Button) ScrollableButtonList(logictechcorp.libraryex.client.gui.ScrollableButtonList) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 ScrollableButtonList (logictechcorp.libraryex.client.gui.ScrollableButtonList)1 CreateWorldScreen (net.minecraft.client.gui.screen.CreateWorldScreen)1 Screen (net.minecraft.client.gui.screen.Screen)1 Button (net.minecraft.client.gui.widget.button.Button)1 I18n (net.minecraft.client.resources.I18n)1 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)1 WorldType (net.minecraft.world.WorldType)1