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