Note: You are not logged in.
Table Edit Extension

by tjlee

500
5.00 Avg. rating

Forum Thread
Total Subscribers:


Description

Best used in conjunction with:
Story Template Enhanced (extension)

This extension was developed to be only dependant upon the CoreRPG ruleset. It is currently, only tested on 5E, Shadowdark, and Pathfinder 2E, but should work with any CoreRPG-based ruleset.

The Table Edit extension supports (numbers below correspond to the red numbered controls in the numbered image below):

  • Auto-numbering of rows with a specified weight. (3- #)
  • Sort table columns ascending/descending. (5- A-Z)
  • Upper/Lower/Template casing result  cells individually or a column as a whole. (6- Aa)
  • Print out information about the table to the chat window. (7- i)
  • Move Columns left/right.
  • Move Rows up/down.

As shown in the red-numbered screenshot, this extension when loaded at start-up is enabled by unlocking the table (1) and then enabling edit mode (2).

When edit mode is in effect, the following controls show up:

(#) Auto-Numbering of rows with a specified weight

The numeric input field (4) to the right of the button labed '#' (3) allows for specifying the weight to newly numbered rows. The default value is 1 and the maximum is 999. 

Pressing the '#' button performs the following under the specified conditions:

  • With no column selected and If there are any un-numbered rows, numbering starts with the largest integer that is greater than the largest numbered row and then continues to increment by the specified weight.
  • With no column selected and If all rows are already numbered, the rows are re-numbered starting at 1 according to their weights, eliminating any numbering gaps.
  • With no column selected and if all rows are already numbered sequentially with no gaps, the rows are re-numbered in reverse order preserving their weights.
  • With a column selected, if there are any un-numbered results in that column, numbering starts with the largest integer that is greater than the largest numbered result in that column and then continues by incrementing by the specified weight.
  • With a column selected, if there no un-numbered results in the column, nothing happens.

(A-Z) Sort table columns

The button labeled 'A-Z' is the sort button (5). Pressing this button performs the following under the specified conditions:

  • With no columns selected and an ascending sort is applied starting with the first column and uses the adjacent right columns as tiebreakers.
  • With a column selected, the ascending sort is applied starting with the selected column and uses the adjacent right columns as tiebreakers.
  • If no rows change positions when applying ascending sort, the rows are reversed in descending sort order.
  • A side effect of the sort is that the rows are re-numbered with their corresponding weights starting with 1, thus eliminating gaps in row numbering.

The sort algorithm orders numeric values before text-based values and applies numeric sort order to the numeric values. That means leading zeros in numeric values are ignored when sorting. Empty columns are shown with space followed by two dashes, but aren't actually there. Incidentally, you can type a space followed by two dashes as a valid value and they are sorted as such. Un-numbered rows always sort to the top of the table per CoreRPG table behavior.

(Aa) Casing

The button labed 'Aa' is the casing button (6). Pressing this button performs the following under the specified conditions:

  • When a result cell is selected, the text with in the cell is modified in a tri-toggle manner. If the text starts with a lower case, all words are changed to start with an upper case. If the text starts with an upper case, all words are changed to start with story template case by surrounding the lowercase first letter with left and right parenthesis. If the text starts with story template casing, all words are changed to start with a lower case letter.
  • When a column is selected, the result cells in that column are cased individually according to the same algorithm as when a single cell is selected.
  • When a column is selected, holding down the Shift button while pressing the casing button forces all cells within the column to lowercase.
  • If neither a cell nor a column is selected, nothing happens.

Example: lower case becomes Lower Case becomes (l)ower (c)ase becomes lower case

(i) Information

This button is labeled with 'i' (7) and is always visible when the Table Edit extension is loaded. Pressing this button displays information about the table in the chat window similar to something like:

Table: TableName (tables.id-00001)
Has: 2 columns, 8 rows

Moving Columns/Rows

The ability to move columns left/right and rows up/down only requires the table to be unlocked so that a column or result cell may be selected. Once selected, hold the Alt key down and press the arrow keys to affect the move under the following conditions:

  • When a column is selected and the cursor is at the last character in the column label text, pressing the right arrow moves the column right if there are other columns to the right of the selected column.
  • When a column is selected and the cursor is at the first character in the column label text, pressing the left arrow moves the column left if there are other columns to the left of the selected column.
  • When a result cell is selected, the column is moved left/right under the same cursor positioning conditions as when a column is selected.
  • When a result cell is selected and the cursor is on the first row of text in the cell, pressing the up arrow moves the row up if there are other rows above the selected row.
  • When a result cell is selected and the cursor is on the last row of text in the cell, pressing the down arrow moves the row down if there are other rows below the selected row.
  • In all other cases, pressing the arrow keys with the Alt key held down merely moves the cursor around within the selected text wither it is a column label or a result cell.

Usage Hints

  • You do not need to keep the Table Extension loaded after you have edited your tables. It is only needed when you wish to make use of the enhanced editing capabilities the extension provides.
  • Using the Shift key in conjunction with the Casing button allows you to make the values within the selected column have consistent casing by changing everything to lowercase. Subsequent presses of the Casing button performs the tri-toggle as described above.
  • Even though your rows are fully numbered, pressing the Auto-Numbering button with nothing selected will remove gaps in row numbering if there are any. Otherwise the rows will be reversed, a visual indication that there are no gaps which you can then remedy by pressing the button once more to restore the original ordering.

Option Setting

There is a single option setting named 'Leave TO nil in single unit range' which defaults to 'No'. By default, a row with a weight of 1 will have the from and to values set to the same value.

When set to 'Yes', only the from value contains a number while the to value is set to empty (or nil). This makes it visually easier to identify rows that have a special weight of 1.



UUID 0f2258fc-5c9f-11ef-af21-0050562be458