use of ivorius.reccomplex.gui.table.cell.TableCellBoolean 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);
}
use of ivorius.reccomplex.gui.table.cell.TableCellBoolean in project RecurrentComplex by Ivorforce.
the class TableDataSourceMazeRuleConnectAll method cellForIndexInSegment.
@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
if (segment == 0) {
TableCellBoolean preventCell = new TableCellBoolean("prevent", rule.preventConnection, TextFormatting.GOLD + IvTranslations.get("reccomplex.mazerule.connect.prevent"), TextFormatting.GREEN + IvTranslations.get("reccomplex.mazerule.connect.prevent"));
preventCell.addListener(val -> rule.preventConnection = val);
return new TitledCell(preventCell);
} else if (segment == 2) {
TableCellBoolean cell = new TableCellBoolean("additive", rule.additive, TextFormatting.GREEN + IvTranslations.get("reccomplex.mazerule.connectall.additive"), TextFormatting.GOLD + IvTranslations.get("reccomplex.mazerule.connectall.subtractive"));
cell.addListener(val -> {
rule.additive = val;
tableDelegate.reloadData();
});
return new TitledCell(cell);
} else if (segment == 4) {
return new TitledCell(new TableCellTitle("", IvTranslations.get("reccomplex.mazerule.connectall.preview")));
} else if (segment == 5) {
ConnectorFactory factory = new ConnectorFactory();
Set<Connector> blockedConnections = Collections.singleton(factory.get(ConnectorStrategy.DEFAULT_WALL));
List<SavedMazePath> exitPaths = MazeRuleConnectAll.getPaths(rule.exits, expected, blockedConnections, factory).collect(Collectors.toList());
return new TitledCell(new TableCellTitle("", exitPaths.get(index).toString()));
}
return super.cellForIndexInSegment(table, index, segment);
}
use of ivorius.reccomplex.gui.table.cell.TableCellBoolean in project RecurrentComplex by Ivorforce.
the class TableDataSourceMazeRuleConnect method cellForIndexInSegment.
@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
if (segment == 0) {
TableCellBoolean preventCell = new TableCellBoolean("prevent", rule.preventConnection, TextFormatting.GOLD + IvTranslations.get("reccomplex.mazerule.connect.prevent"), TextFormatting.GREEN + IvTranslations.get("reccomplex.mazerule.connect.ensure"));
preventCell.addListener(val -> rule.preventConnection = val);
return new TitledCell(preventCell);
}
return super.cellForIndexInSegment(table, index, segment);
}
Aggregations