Search in sources :

Example 1 with TableCellString

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

the class TableDataSourceItemCollectionComponent method cellForIndexInSegment.

@Override
public TableCell cellForIndexInSegment(GuiTable table, int index, int segment) {
    if (segment == 0) {
        TableCellString cell = new TableCellString(null, key);
        cell.setShowsValidityState(true);
        cell.setValidityState(currentKeyState());
        cell.addPropertyConsumer(val -> {
            key = val;
            cell.setValidityState(currentKeyState());
        });
        return new TitledCell(IvTranslations.get("reccomplex.gui.inventorygen.componentid"), cell).withTitleTooltip(IvTranslations.formatLines("reccomplex.gui.inventorygen.componentid.tooltip"));
    } else if (segment == 2) {
        TableCellString cell = new TableCellString(null, component.inventoryGeneratorID);
        cell.setShowsValidityState(true);
        cell.setValidityState(currentGroupIDState());
        cell.addPropertyConsumer(val -> {
            component.inventoryGeneratorID = val;
            cell.setValidityState(currentGroupIDState());
        });
        return new TitledCell(IvTranslations.get("reccomplex.gui.inventorygen.groupid"), cell).withTitleTooltip(IvTranslations.formatLines("reccomplex.gui.inventorygen.groupid.tooltip"));
    }
    return super.cellForIndexInSegment(table, index, segment);
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) IvTranslations(ivorius.ivtoolkit.tools.IvTranslations) TableDataSourceSupplied(ivorius.reccomplex.gui.table.datasource.TableDataSourceSupplied) TableCell(ivorius.reccomplex.gui.table.cell.TableCell) WeightedItemCollectionRegistry(ivorius.reccomplex.world.storage.loot.WeightedItemCollectionRegistry) GuiTable(ivorius.reccomplex.gui.table.GuiTable) TableDataSourceSegmented(ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented) RCGuiHandler(ivorius.reccomplex.gui.RCGuiHandler) GenericItemCollection(ivorius.reccomplex.world.storage.loot.GenericItemCollection) TableNavigator(ivorius.reccomplex.gui.table.TableNavigator) TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) GuiValidityStateIndicator(ivorius.reccomplex.gui.GuiValidityStateIndicator) SaveDirectoryData(ivorius.reccomplex.utils.SaveDirectoryData) EntityPlayer(net.minecraft.entity.player.EntityPlayer) TableElementSaveDirectory(ivorius.reccomplex.gui.TableElementSaveDirectory) TableCellMultiBuilder(ivorius.reccomplex.gui.table.cell.TableCellMultiBuilder) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString) RecurrentComplex(ivorius.reccomplex.RecurrentComplex) TableDelegate(ivorius.reccomplex.gui.table.TableDelegate) GenericItemCollectionRegistry(ivorius.reccomplex.world.storage.loot.GenericItemCollectionRegistry) TableDataSourceExpression(ivorius.reccomplex.gui.TableDataSourceExpression) Nonnull(javax.annotation.Nonnull) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString)

Example 2 with TableCellString

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

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

the class TableDataSourceExpression method cellForIndex.

@Override
public TableCell cellForIndex(GuiTable table, int index) {
    if (index == 0) {
        expressionCell = new TableCellString("expression", e.getExpression());
        expressionCell.setTooltip(expressionTooltip);
        expressionCell.setEnabled(canEdit());
        expressionCell.setShowsValidityState(true);
        expressionCell.setValidityState(getValidityState(e, u));
        expressionCell.addPropertyConsumer(val -> {
            e.setExpression(val);
            expressionCell.setValidityState(getValidityState(e, u));
        });
        expressionCell.setChangeListener(() -> {
            if (parsed != null)
                parsed.setDisplayString(parsedString());
        });
        return new TitledCell(title, expressionCell).withTitleTooltip(tooltip);
    } else if (index == 1) {
        parsed = new TableCellTitle("parsedExpression", parsedString());
        parsed.setPositioning(TableCellTitle.Positioning.TOP);
        return new TitledCell(parsed);
    }
    return null;
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) TableCellTitle(ivorius.reccomplex.gui.table.cell.TableCellTitle) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString)

Example 4 with TableCellString

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

the class TableDataSourceBTNatural method cellForBlock.

public static TableCellString cellForBlock(String id, String block) {
    TableCellString cell = new TableCellString(id, block);
    cell.setShowsValidityState(true);
    setStateForBlockTextfield(cell);
    return cell;
}
Also used : TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString)

Example 5 with TableCellString

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

the class TableDataSourceConnector method cellForIndex.

@Override
public TableCell cellForIndex(GuiTable table, int index) {
    TableCellString cell = new TableCellString("connectorID", connector.id);
    cell.addPropertyConsumer(val -> connector.id = val);
    return new TitledCell(title, cell).withTitleTooltip(IvTranslations.formatLines("reccomplex.maze.connector.tooltip"));
}
Also used : TitledCell(ivorius.reccomplex.gui.table.cell.TitledCell) TableCellString(ivorius.reccomplex.gui.table.cell.TableCellString)

Aggregations

TableCellString (ivorius.reccomplex.gui.table.cell.TableCellString)5 TitledCell (ivorius.reccomplex.gui.table.cell.TitledCell)4 IvTranslations (ivorius.ivtoolkit.tools.IvTranslations)2 TableDataSourceExpression (ivorius.reccomplex.gui.TableDataSourceExpression)2 TableCell (ivorius.reccomplex.gui.table.cell.TableCell)2 TableDataSourceSegmented (ivorius.reccomplex.gui.table.datasource.TableDataSourceSegmented)2 Nonnull (javax.annotation.Nonnull)2 RecurrentComplex (ivorius.reccomplex.RecurrentComplex)1 GuiValidityStateIndicator (ivorius.reccomplex.gui.GuiValidityStateIndicator)1 RCGuiHandler (ivorius.reccomplex.gui.RCGuiHandler)1 TableElementSaveDirectory (ivorius.reccomplex.gui.TableElementSaveDirectory)1 ivorius.reccomplex.gui.table (ivorius.reccomplex.gui.table)1 GuiTable (ivorius.reccomplex.gui.table.GuiTable)1 TableDelegate (ivorius.reccomplex.gui.table.TableDelegate)1 TableNavigator (ivorius.reccomplex.gui.table.TableNavigator)1 TableCellBoolean (ivorius.reccomplex.gui.table.cell.TableCellBoolean)1 TableCellMultiBuilder (ivorius.reccomplex.gui.table.cell.TableCellMultiBuilder)1 TableCellTitle (ivorius.reccomplex.gui.table.cell.TableCellTitle)1 TableDataSourceSupplied (ivorius.reccomplex.gui.table.datasource.TableDataSourceSupplied)1 SaveDirectoryData (ivorius.reccomplex.utils.SaveDirectoryData)1