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()));
}
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));
}
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);
}
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()));
}
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();
};
}
}
Aggregations