Search in sources :

Example 6 with TitledCell

use of ivorius.reccomplex.gui.table.cell.TitledCell in project RecurrentComplex by Ivorforce.

the class TableDataSourceStaticPattern method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    switch(segment) {
        case 0:
            {
                if (index == 0) {
                    TableCellStringInt cell = new TableCellStringInt("repeatX", pattern.repeatX);
                    cell.addPropertyConsumer(val -> pattern.repeatX = val);
                    return new TitledCell(IvTranslations.get("reccomplex.generationInfo.static.pattern.repeat.x"), cell).withTitleTooltip(IvTranslations.getLines("reccomplex.generationInfo.static.pattern.repeat.tooltip"));
                } else if (index == 1) {
                    TableCellStringInt cell = new TableCellStringInt("repeatZ", pattern.repeatZ);
                    cell.addPropertyConsumer(val -> pattern.repeatZ = val);
                    return new TitledCell(IvTranslations.get("reccomplex.generationInfo.static.pattern.repeat.z"), cell).withTitleTooltip(IvTranslations.getLines("reccomplex.generationInfo.static.pattern.repeat.tooltip"));
                }
            }
        case 1:
            {
                if (index == 0) {
                    TableCellInteger cell = new TableCellInteger("shiftX", pattern.randomShiftX, 0, 10);
                    cell.addPropertyConsumer(val -> pattern.randomShiftX = val);
                    return new TitledCell(IvTranslations.get("reccomplex.generationInfo.static.pattern.rshift.x"), cell).withTitleTooltip(IvTranslations.getLines("reccomplex.generationInfo.static.pattern.rshift.tooltip"));
                } else if (index == 1) {
                    TableCellInteger cell = new TableCellInteger("shiftZ", pattern.randomShiftZ, 0, 10);
                    cell.addPropertyConsumer(val -> pattern.randomShiftZ = val);
                    return new TitledCell(IvTranslations.get("reccomplex.generationInfo.static.pattern.rshift.z"), cell).withTitleTooltip(IvTranslations.getLines("reccomplex.generationInfo.static.pattern.rshift.tooltip"));
                }
            }
    }
    return super.cellForIndexInSegment(table, index, segment);
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) IvTranslations(ivorius.ivtoolkit.tools.IvTranslations) StaticGeneration(ivorius.reccomplex.world.gen.feature.structure.generic.generation.StaticGeneration) ivorius.reccomplex.gui.table(ivorius.reccomplex.gui.table) TableCell(ivorius.reccomplex.gui.table.cell.TableCell) TableCellInteger(ivorius.reccomplex.gui.table.cell.TableCellInteger) TableDataSourceSegmented(ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented) TableCellStringInt(ivorius.reccomplex.gui.table.cell.TableCellStringInt) Nonnull(javax.annotation.Nonnull) TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) TableCellInteger(ivorius.reccomplex.gui.table.cell.TableCellInteger) TableCellStringInt(ivorius.reccomplex.gui.table.cell.TableCellStringInt)

Example 7 with TitledCell

use of ivorius.reccomplex.gui.table.cell.TitledCell in project RecurrentComplex by Ivorforce.

the class TableDataSourceBlockPatternIngredient method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    if (segment == 0) {
        TableCellString cell = new TableCellString("", ingredient.identifier);
        cell.addPropertyConsumer(s -> ingredient.identifier = s);
        return new TitledCell(IvTranslations.get("reccomplex.blockpattern.ingredient.identifier"), cell);
    } else if (segment == 2) {
        TableCellBoolean cell = new TableCellBoolean("", ingredient.delete);
        cell.addPropertyConsumer(d -> ingredient.delete = d);
        return new TitledCell(IvTranslations.get("reccomplex.blockpattern.ingredient.delete"), cell);
    }
    return super.cellForIndexInSegment(table, index, segment);
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) IvTranslations(ivorius.ivtoolkit.tools.IvTranslations) TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) ivorius.reccomplex.gui.table(ivorius.reccomplex.gui.table) TableCell(ivorius.reccomplex.gui.table.cell.TableCell) TableCellBoolean(ivorius.reccomplex.gui.table.cell.TableCellBoolean) TableDataSourceSegmented(ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented) BlockPattern(ivorius.reccomplex.world.gen.feature.structure.generic.BlockPattern) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString) TableDataSourceExpression(ivorius.reccomplex.gui.TableDataSourceExpression) Nonnull(javax.annotation.Nonnull) TableCellBoolean(ivorius.reccomplex.gui.table.cell.TableCellBoolean) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString)

Example 8 with TitledCell

use of ivorius.reccomplex.gui.table.cell.TitledCell in project RecurrentComplex by Ivorforce.

the class TableDataSourceBlockSurfacePos method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    IntegerRange range;
    int val;
    String title;
    switch(index) {
        case 0:
            range = rangeX;
            val = coord.getX();
            title = titleX;
            break;
        default:
            range = rangeZ;
            val = coord.getZ();
            title = titleZ;
            break;
    }
    if (range != null) {
        TableCellInteger cell = new TableCellInteger(null, val, range.min, range.max);
        cell.addPropertyConsumer(createConsumer(index));
        return new TitledCell(title, cell);
    } else {
        TableCellStringInt cell = new TableCellStringInt(null, val);
        cell.addPropertyConsumer(createConsumer(index));
        return new TitledCell(title, cell);
    }
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) IntegerRange(ivorius.ivtoolkit.gui.IntegerRange) TableCellInteger(ivorius.reccomplex.gui.table.cell.TableCellInteger) TableCellStringInt(ivorius.reccomplex.gui.table.cell.TableCellStringInt)

Example 9 with TitledCell

use of ivorius.reccomplex.gui.table.cell.TitledCell in project RecurrentComplex by Ivorforce.

the class TableDataSourceInvGenMultiTag method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    if (segment == 0) {
        if (index == 0) {
            TableCellIntegerRange cell = new TableCellIntegerRange("itemCount", item.getGenerationCount(stack), 0, 64);
            cell.addPropertyConsumer(range -> item.setGenerationCount(stack, range));
            return new TitledCell(IvTranslations.get("reccomplex.gui.inventorygen.multi.count"), cell);
        }
    }
    return null;
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) TableCellIntegerRange(ivorius.reccomplex.gui.table.cell.TableCellIntegerRange)

Example 10 with TitledCell

use of ivorius.reccomplex.gui.table.cell.TitledCell in project RecurrentComplex by Ivorforce.

the class TableDataSourceMazeRoom method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    IntegerRange range = ranges.get(index);
    int val = room.getCoordinate(index);
    String title = titles.get(index);
    List<String> tooltip = tooltips.get(index);
    if (range != null) {
        TableCellInteger cell = new TableCellInteger(null, val, range.min, range.max);
        cell.addPropertyConsumer(createConsumer(index));
        return new TitledCell(title, cell).withTitleTooltip(tooltip);
    } else {
        TableCellStringInt cell = new TableCellStringInt(null, val);
        cell.addPropertyConsumer(createConsumer(index));
        return new TitledCell(title, cell).withTitleTooltip(tooltip);
    }
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) IntegerRange(ivorius.ivtoolkit.gui.IntegerRange) TableCellInteger(ivorius.reccomplex.gui.table.cell.TableCellInteger) TableCellStringInt(ivorius.reccomplex.gui.table.cell.TableCellStringInt)

Aggregations

TitledCell (ivorius.reccomplex.gui.table.cell.TitledCell)15 IvTranslations (ivorius.ivtoolkit.tools.IvTranslations)5 TableCell (ivorius.reccomplex.gui.table.cell.TableCell)5 TableDataSourceSegmented (ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented)5 TableCellInteger (ivorius.reccomplex.gui.table.cell.TableCellInteger)4 TableCellString (ivorius.reccomplex.gui.table.cell.TableCellString)4 TableCellStringInt (ivorius.reccomplex.gui.table.cell.TableCellStringInt)4 Nonnull (javax.annotation.Nonnull)4 IntegerRange (ivorius.ivtoolkit.gui.IntegerRange)3 TableDataSourceExpression (ivorius.reccomplex.gui.TableDataSourceExpression)3 ivorius.reccomplex.gui.table (ivorius.reccomplex.gui.table)3 TableCellBoolean (ivorius.reccomplex.gui.table.cell.TableCellBoolean)3 GuiTable (ivorius.reccomplex.gui.table.GuiTable)2 TableDelegate (ivorius.reccomplex.gui.table.TableDelegate)2 TableNavigator (ivorius.reccomplex.gui.table.TableNavigator)2 TableCellEnum (ivorius.reccomplex.gui.table.cell.TableCellEnum)2 TableCellTitle (ivorius.reccomplex.gui.table.cell.TableCellTitle)2 EnumFacing (net.minecraft.util.EnumFacing)2 Directions (ivorius.ivtoolkit.blocks.Directions)1 FloatRange (ivorius.ivtoolkit.gui.FloatRange)1