Please describe your feature request.
Add support for being able to reference a sub-value of a define id.
Add support for including additional define files for a given project / layout (ideally available on both).
Describe the solution you'd like
For referencing columns:
Example:
| define id |
name |
movement |
cost |
| alpha |
The Alpha |
4 |
10 |
| beta |
The Beta |
3 |
6 |
An element could reference a sub value with: @[alpha.name] and for complicated nested lookups: @[@[character].name]
The delimiter . will not work with JavaScript so in that context __ (double underscore) is used.
Functionality in Beta Build
- Allow project to reference multiple custom defines files (the old fixed name style is still supported)
- All define files now support fields (completely optional).
- This is a bit like introducing objects (for those programmers out there)
Work-in-progress build link: v.1.5.0.0-unstable.v.a5
How To Use
Create defines files (slightly new format)
| define |
name |
move |
cost |
| alpha |
Alpha Ship |
4 |
25 |
| beta |
Beta Barge |
2 |
40 |
Backwards compatibility: Old style define references like @[alpha] will still refer to the second column (in this case the name column)
Add global defines to the project
- Right-click the Layouts node (or click the Project menu) >
Global Defines...
- Add define files the project (can mix and match CSV, Google, and Excel)
Use the define fields
Examples:
@[alpha.name]
@[alpha.cost]
@[alpha] (result will still be the second column, so Alpha Ship )
More complicated example
engines.csv
| engine |
name |
move |
cost |
| slow |
Slow XL |
2 |
10 |
| turbo |
Turbo Fast |
5 |
20 |
ships.csv
| ship |
name |
engine |
cost |
| alpha |
Alpha Ship |
slow |
25 |
| beta |
Beta Barge |
turbo |
40 |
Usage
Now you can reference the move of the ship's engine via: @[@[alpha.engine].move]
You could make this even further nested as necessary based on the context. There are a ton of opportunities using this style of object definition.
The Defines window is also helpful to debug/see what was loaded.
Prefix
Additionally you can give any of the global define sources a prefix to uniquely identify the entries within.
Example from above:
engines.csv
| engine |
name |
move |
cost |
| slow |
Slow XL |
2 |
10 |
| turbo |
Turbo Fast |
5 |
20 |
With a prefix: engine
Accessing the defines within engines.csv:
@[engine.slow.move]
@[engine.slow.cost]
Note: The prefix in this example happens to match the first column name but could be stuff and the following would apply:
Accessing the defines within engines.csv:
@[stuff.slow.move]
@[stuff.slow.cost]
Please describe your feature request.
Add support for being able to reference a sub-value of a define id.
Add support for including additional define files for a given project / layout (ideally available on both).
Describe the solution you'd like
For referencing columns:
Example:
An element could reference a sub value with:
@[alpha.name]and for complicated nested lookups:@[@[character].name]The delimiter
.will not work with JavaScript so in that context__(double underscore) is used.Functionality in Beta Build
Work-in-progress build link: v.1.5.0.0-unstable.v.a5
How To Use
Create defines files (slightly new format)
Backwards compatibility: Old style define references like
@[alpha]will still refer to the second column (in this case thenamecolumn)Add global defines to the project
Global Defines...Use the define fields
Examples:
@[alpha.name]@[alpha.cost]@[alpha](result will still be the second column, soAlpha Ship)More complicated example
engines.csv
ships.csv
Usage
Now you can reference the
moveof the ship's engine via:@[@[alpha.engine].move]You could make this even further nested as necessary based on the context. There are a ton of opportunities using this style of object definition.
The Defines window is also helpful to debug/see what was loaded.
Prefix
Additionally you can give any of the global define sources a
prefixto uniquely identify the entries within.Example from above:
engines.csv
With a prefix:
engineAccessing the defines within engines.csv:
Note: The prefix in this example happens to match the first column name but could be
stuffand the following would apply:Accessing the defines within engines.csv: