Search in sources :

Example 1 with TableCellStringInt

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

the class TableDataSourceBlockPos 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;
        case 1:
            range = rangeY;
            val = coord.getY();
            title = titleY;
            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 2 with TableCellStringInt

use of ivorius.reccomplex.gui.table.cell.TableCellStringInt 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 3 with TableCellStringInt

use of ivorius.reccomplex.gui.table.cell.TableCellStringInt 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 4 with TableCellStringInt

use of ivorius.reccomplex.gui.table.cell.TableCellStringInt 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

TableCellInteger (ivorius.reccomplex.gui.table.cell.TableCellInteger)4 TableCellStringInt (ivorius.reccomplex.gui.table.cell.TableCellStringInt)4 TitledCell (ivorius.reccomplex.gui.table.cell.TitledCell)4 IntegerRange (ivorius.ivtoolkit.gui.IntegerRange)3 IvTranslations (ivorius.ivtoolkit.tools.IvTranslations)1 ivorius.reccomplex.gui.table (ivorius.reccomplex.gui.table)1 TableCell (ivorius.reccomplex.gui.table.cell.TableCell)1 TableDataSourceSegmented (ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented)1 StaticGeneration (ivorius.reccomplex.world.gen.feature.structure.generic.generation.StaticGeneration)1 Nonnull (javax.annotation.Nonnull)1