Search in sources :

Example 1 with ConfigListWidget

use of org.moon.moonfix.config.widgets.ConfigListWidget in project Moonfix by Kingdom-of-Moon.

the class ConfigScreen method init.

@Override
protected void init() {
    super.init();
    this.addDrawableChild(new ButtonWidget(this.width / 2 - 154, this.height - 29, 150, 20, new TranslatableText("gui.cancel"), (buttonWidgetx) -> {
        ConfigManager.discardConfig();
        this.client.setScreen(parentScreen);
    }));
    this.addDrawableChild(new ButtonWidget(this.width / 2 + 4, this.height - 29, 150, 20, new TranslatableText("gui.done"), (buttonWidgetx) -> {
        ConfigManager.applyConfig();
        ConfigManager.saveConfig();
        this.client.setScreen(parentScreen);
    }));
    this.configListWidget = new ConfigListWidget(this, this.client);
    this.addSelectableChild(this.configListWidget);
    // generate configs...
    configListWidget.addEntries(Config.values());
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) ConfigListWidget(org.moon.moonfix.config.widgets.ConfigListWidget) Screen(net.minecraft.client.gui.screen.Screen) InputUtil(net.minecraft.client.util.InputUtil) MatrixStack(net.minecraft.client.util.math.MatrixStack) TranslatableText(net.minecraft.text.TranslatableText) Config(org.moon.moonfix.config.ConfigManager.Config) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget) KeyBinding(net.minecraft.client.option.KeyBinding) ConfigListWidget(org.moon.moonfix.config.widgets.ConfigListWidget) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget)

Aggregations

Screen (net.minecraft.client.gui.screen.Screen)1 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)1 KeyBinding (net.minecraft.client.option.KeyBinding)1 InputUtil (net.minecraft.client.util.InputUtil)1 MatrixStack (net.minecraft.client.util.math.MatrixStack)1 TranslatableText (net.minecraft.text.TranslatableText)1 Config (org.moon.moonfix.config.ConfigManager.Config)1 ConfigListWidget (org.moon.moonfix.config.widgets.ConfigListWidget)1