Enum sheets in the Studio
A sheet that defines enums has no records, so the Data Studio gives it its own grid instead of the record table. For the sheet format, see Enum sheets.
The enum grid
The grid shows one column per enum, with its members listed in order. The sidebar shows an Enum definitions badge and a count of how many enums the sheet holds.
The grid reads like every other sheet:
- Column letters across the top
- Real sheet row numbers in the gutter
- The same right-click menus in the same order
- Staged changes marked with the same colors the data table uses
Cells show exactly what the sheet says. A member pinned with the Name=value syntax appears as written.
Define an enum
The sheet's structure is authored in place, like a data sheet's. Define a new enum in one of two ways:
- Press + Column on the sheet's tool line, in the sheet header bar. On an enum definition sheet it adds an enum. This is the only way to put the first enum on a definition sheet that has none yet.
- Right-click a column header and use its menu to add the enum at a chosen position.
The form takes the name, the underlying type and the description, both optional, and the first members. It needs at least one member, because an enum with no members cannot be imported.
The members' order is their integer values.
Rename or edit an enum
When you rename an enum, every @type cell that refers to it across all sheets is rewritten in the same batch. So the re-import after the write still resolves.
Edit the underlying type and the description in place. The marker rows are shown even before the sheet has them. They are created when the change lands.
Delete or reorder enums
Deleting an enum is refused while any sheet still uses it. The refusal names the columns that use it.
Reorder columns freely. An enum's column position carries no meaning, so reordering is always safe.
Add members
To add a member on the enum sheet, type its name in the empty cell at the bottom of the enum's column, then press Enter. The member is staged, and the cell clears for the next name. The empty cell is absent when the sheet cannot be edited.
Member rows only append, and there is no sorting. A member's position is its value. Rearranging members would renumber data already baked into assets.
Duplicate checks compare the name part only. Staging Rare onto a sheet that already holds Rare=10 is refused rather than doubled.
Add a member from a cell
You do not have to open the enum sheet to add a member. Click an Enum<T> cell anywhere in the project. The picker that opens carries Add a new member… at the bottom.
Press it and type the name. The new member is staged onto the enum sheet as one Ctrl+Z step, and it is marked as staged until the next reflect writes it.
This works when the enum is defined in another workbook, too. The member is staged for the workbook that owns the enum sheet and written to that workbook's source, in the same Ctrl+Z step as the cell. Adding a member directly on the other workbook's definition sheet stays refused, because that tab is read-only here.
On an enum that a plugin registered from C#, the Add a new member… row is absent, because the sheet does not own that enum. The row is absent rather than present and failing.
Staging and rulings
Everything is staged like any other edit: visible immediately, one Ctrl+Z step per gesture, written by one reflect.
Every ruling is made by the same code that validates the import. So the form and the re-import cannot disagree. The rulings are:
- Is the name legal or taken
- Is a member valid
- Is the underlying type allowed
- Is the enum still in use
A blocked action stays in its menu with the reason instead of disappearing.
Enum sheets in the web app
The web app authors these sheets the same way, with the same rules. See Enum definition sheets.
Next steps
- Enum sheets
The format of an enum definition sheet.
- Edit structure
Create a sheet from the enum template.
- Edit cells
Pick enum values in a data sheet.