Search in sources :

Example 21 with WButton

use of mathax.client.gui.widgets.pressable.WButton in project Client by MatHax.

the class DefaultSettingsWidgetFactory method itemW.

private void itemW(WTable table, ItemSetting setting) {
    WHorizontalList list = table.add(theme.horizontalList()).expandX().widget();
    WItem item = list.add(theme.item(setting.get().asItem().getDefaultStack())).widget();
    WButton select = list.add(theme.button("Select")).widget();
    select.action = () -> {
        ItemSettingScreen screen = new ItemSettingScreen(theme, setting);
        screen.onClosed(() -> item.set(setting.get().getDefaultStack()));
        mc.setScreen(screen);
    };
    reset(table, setting, () -> item.set(setting.get().getDefaultStack()));
}
Also used : WButton(mathax.client.gui.widgets.pressable.WButton)

Example 22 with WButton

use of mathax.client.gui.widgets.pressable.WButton in project Client by MatHax.

the class DefaultSettingsWidgetFactory method potionW.

private void potionW(WTable table, PotionSetting setting) {
    WHorizontalList list = table.add(theme.horizontalList()).expandX().widget();
    WItemWithLabel item = list.add(theme.itemWithLabel(setting.get().potion, setting.get().potion.getName().getString())).widget();
    WButton button = list.add(theme.button("Select")).expandCellX().widget();
    button.action = () -> {
        WidgetScreen screen = new PotionSettingScreen(theme, setting);
        screen.onClosed(() -> item.set(setting.get().potion));
        mc.setScreen(screen);
    };
    reset(list, setting, () -> item.set(setting.get().potion));
}
Also used : WButton(mathax.client.gui.widgets.pressable.WButton)

Example 23 with WButton

use of mathax.client.gui.widgets.pressable.WButton in project Client by MatHax.

the class DefaultSettingsWidgetFactory method blockDataW.

private void blockDataW(WTable table, BlockDataSetting<?> setting) {
    WButton button = table.add(theme.button(GuiRenderer.EDIT)).expandCellX().widget();
    button.action = () -> mc.setScreen(new BlockDataSettingScreen(theme, setting));
    reset(table, setting, null);
}
Also used : WButton(mathax.client.gui.widgets.pressable.WButton)

Example 24 with WButton

use of mathax.client.gui.widgets.pressable.WButton in project Client by MatHax.

the class DefaultSettingsWidgetFactory method blockW.

private void blockW(WTable table, BlockSetting setting) {
    WHorizontalList list = table.add(theme.horizontalList()).expandX().widget();
    WItem item = list.add(theme.item(setting.get().asItem().getDefaultStack())).widget();
    WButton select = list.add(theme.button("Select")).widget();
    select.action = () -> {
        BlockSettingScreen screen = new BlockSettingScreen(theme, setting);
        screen.onClosed(() -> item.set(setting.get().asItem().getDefaultStack()));
        mc.setScreen(screen);
    };
    reset(table, setting, () -> item.set(setting.get().asItem().getDefaultStack()));
}
Also used : WButton(mathax.client.gui.widgets.pressable.WButton)

Example 25 with WButton

use of mathax.client.gui.widgets.pressable.WButton in project Client by MatHax.

the class WBlockPosEdit method init.

@Override
public void init() {
    setTextBox();
    if (canUpdate()) {
        WButton click = add(theme.button("Click")).expandX().widget();
        click.action = () -> {
            StringBuilder sb = new StringBuilder("Click!\n");
            sb.append("Right click to pick a new position.\n");
            sb.append("Left click to cancel.");
            Modules.get().get(Marker.class).info(sb.toString());
            clicking = true;
            MatHax.EVENT_BUS.subscribe(this);
            previousScreen = mc.currentScreen;
            mc.setScreen(null);
        };
        WButton here = add(theme.button("Set Here")).expandX().widget();
        here.action = () -> {
            lastValue = value;
            set(new BlockPos(mc.player.getBlockPos()));
            newValueCheck();
            clear();
            init();
        };
    }
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) Marker(mathax.client.systems.modules.render.marker.Marker) WButton(mathax.client.gui.widgets.pressable.WButton)

Aggregations

WButton (mathax.client.gui.widgets.pressable.WButton)29 WHorizontalList (mathax.client.gui.widgets.containers.WHorizontalList)9 WTable (mathax.client.gui.widgets.containers.WTable)4 WMinus (mathax.client.gui.widgets.pressable.WMinus)4 WLabel (mathax.client.gui.widgets.WLabel)3 WCheckbox (mathax.client.gui.widgets.pressable.WCheckbox)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 WItemWithLabel (mathax.client.gui.widgets.WItemWithLabel)2 Block (net.minecraft.block.Block)2 NbtString (net.minecraft.nbt.NbtString)2 CommandSyntaxException (com.mojang.brigadier.exceptions.CommandSyntaxException)1 AudioTrack (com.sedmelluq.discord.lavaplayer.track.AudioTrack)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 Map (java.util.Map)1 PlaylistsScreen (mathax.client.gui.screens.music.PlaylistsScreen)1 WVerticalList (mathax.client.gui.widgets.containers.WVerticalList)1 WTextBox (mathax.client.gui.widgets.input.WTextBox)1 WPlus (mathax.client.gui.widgets.pressable.WPlus)1