<%* const placeholderPrefix = āNewStarSystemā; let title;
// 1) Prompt only if still using placeholder name if (tp.file.title.startsWith(placeholderPrefix)) { title = await tp.system.prompt(āEnter Star System Nameā); if (!title) { new Notice(āNo name entered. Aborting.ā); return; } await tp.file.rename(title); } else { title = tp.file.title; }
// 2) Gather Galaxy files from folder const galaxyFiles = tp.app.vault.getMarkdownFiles() .filter(f ā f.path.startsWith(ā2-World/Galaxies/ā));
const placeholderLabel = āš No Galaxy Selectedā; const placeholderPath = āplaceholderā;
// 3) Prompt to choose Galaxy (or skip) const galaxyChoices = [placeholderLabel, ā¦galaxyFiles.map(f ā f.basename)]; const galaxyValues = [placeholderPath, ā¦galaxyFiles.map(f ā f.path)];
const chosenPath = await tp.system.suggester(galaxyChoices, galaxyValues, true); if (!chosenPath) return;
// 4) Build wiki-link if selected let wikiLink = null; if (chosenPath !== placeholderPath) { const chosenAlias = chosenPath.split(ā/ā).pop().replace(/.md{chosenPath}|${chosenAlias}]]`; }
// 5) Write to frontmatter setTimeout(() ā { const newFile = tp.file.find_tfile(tp.file.path(true)); if (!newFile) { new Notice(āCould not find file after rename.ā); return; } app.fileManager.processFrontMatter(newFile, fm ā { fm[āMyContainerā] = wikiLink ?? āNoneā; }); }, 200); %>
Parent Continent:
INPUT[suggester(optionQuery(#Category/Galaxy)):MyContainer]
Column
Map
Town Name
INPUT[select( option(1, ā¹ļøGeneral Info), option(2, šStar System), option(3, šGM Notes), class(tabbed) )]Tabbed
NOTE
INPUT[select( option(1, šŗļøPlanets), option(2, šŗļøPoints of Interest), class(tabbed) )]Tabbed
General Info
This is the star system description.
Star System Details
Dominant Races:
GM Notes
Make notes of what you need to track in the star system here.
Planets
BUTTON[button_planet]
properties:
file.name:
displayName: Planet Name(s)
note.MyCategory:
displayName: Type of Planet
views:
- type: cards
name: Planets - Cards
filters:
and:
- file.folder == "2-World/Planets"
- list(MyContainer).contains(this)
order:
- file.name
image: note.image
- type: table
name: Planets - Table
filters:
and:
- file.folder == "2-World/Planets"
- list(MyContainer).contains(this)
order:
- file.name
sort:
- property: file.name
direction: DESC
columnSize:
file.name: 182
Points of Interest
BUTTON[button_pointofinterest]
properties:
file.name:
displayName: Point of Interest Name(s)
note.MyCategory:
displayName: Type of POI
views:
- type: cards
name: Point of Interest - Cards
filters:
and:
- file.folder == "2-World/Points of Interest"
- list(MyContainer).contains(this)
order:
- file.name
image: note.image
- type: table
name: Point of Interest - Table
filters:
and:
- file.folder == "2-World/Points of Interest"
- list(MyContainer).contains(this)
order:
- file.name
sort:
- property: file.name
direction: DESC
columnSize:
file.name: 182
