Search in sources :

Example 1 with SettingColor

use of mathax.client.utils.render.color.SettingColor in project Client by MatHax.

the class SBlockDataScreen method initWidgets.

@Override
public void initWidgets() {
    Settings settings = new Settings();
    SettingGroup sgGeneral = settings.getDefaultGroup();
    SettingGroup sgTracer = settings.createGroup("Tracer");
    sgGeneral.add(new EnumSetting.Builder<ShapeMode>().name("shape-mode").description("How the shape is rendered.").defaultValue(ShapeMode.Lines).onModuleActivated(shapeModeSetting -> shapeModeSetting.set(blockData.shapeMode)).onChanged(shapeMode -> {
        blockData.shapeMode = shapeMode;
        changed(blockData, block, setting);
    }).build());
    sgGeneral.add(new ColorSetting.Builder().name("line-color").description("Color of lines.").defaultValue(new SettingColor(MatHax.INSTANCE.MATHAX_COLOR.r, MatHax.INSTANCE.MATHAX_COLOR.g, MatHax.INSTANCE.MATHAX_COLOR.b)).onModuleActivated(settingColorSetting -> settingColorSetting.set(blockData.lineColor)).onChanged(settingColor -> {
        blockData.lineColor.set(settingColor);
        changed(blockData, block, setting);
    }).build());
    sgGeneral.add(new ColorSetting.Builder().name("side-color").description("Color of sides.").defaultValue(new SettingColor(MatHax.INSTANCE.MATHAX_COLOR.r, MatHax.INSTANCE.MATHAX_COLOR.g, MatHax.INSTANCE.MATHAX_COLOR.b, 75)).onModuleActivated(settingColorSetting -> settingColorSetting.set(blockData.sideColor)).onChanged(settingColor -> {
        blockData.sideColor.set(settingColor);
        changed(blockData, block, setting);
    }).build());
    sgTracer.add(new BoolSetting.Builder().name("tracer").description("If tracer line is allowed to this block.").defaultValue(true).onModuleActivated(booleanSetting -> booleanSetting.set(blockData.tracer)).onChanged(aBoolean -> {
        blockData.tracer = aBoolean;
        changed(blockData, block, setting);
    }).build());
    sgTracer.add(new ColorSetting.Builder().name("tracer-color").description("Color of tracer line.").defaultValue(new SettingColor(MatHax.INSTANCE.MATHAX_COLOR.r, MatHax.INSTANCE.MATHAX_COLOR.g, MatHax.INSTANCE.MATHAX_COLOR.b)).onModuleActivated(settingColorSetting -> settingColorSetting.set(blockData.tracerColor)).onChanged(settingColor -> {
        blockData.tracerColor = settingColor;
        changed(blockData, block, setting);
    }).build());
    settings.onActivated();
    add(theme.settings(settings)).expandX();
}
Also used : MatHax(mathax.client.MatHax) Block(net.minecraft.block.Block) GuiTheme(mathax.client.gui.GuiTheme) SettingColor(mathax.client.utils.render.color.SettingColor) WindowScreen(mathax.client.gui.WindowScreen) ShapeMode(mathax.client.renderer.ShapeMode) mathax.client.settings(mathax.client.settings) ShapeMode(mathax.client.renderer.ShapeMode) SettingColor(mathax.client.utils.render.color.SettingColor)

Aggregations

MatHax (mathax.client.MatHax)1 GuiTheme (mathax.client.gui.GuiTheme)1 WindowScreen (mathax.client.gui.WindowScreen)1 ShapeMode (mathax.client.renderer.ShapeMode)1 mathax.client.settings (mathax.client.settings)1 SettingColor (mathax.client.utils.render.color.SettingColor)1 Block (net.minecraft.block.Block)1