Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the compendium name for moves #1036

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Next Release

- Fix a bug where changing the name of a move in the compendium doesn't change it in the move sheet ([#1036](https://github.com/ben/foundry-ironsworn/pull/1036))

## 1.24.5

- Fix a bug where cinder/wraith and cursed-die rolls wouldn't work unless Dice So Nice was enabled ([#1035](https://github.com/ben/foundry-ironsworn/pull/1035))
Expand Down
2 changes: 1 addition & 1 deletion src/module/features/custommoves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function createMoveTreeForRuleset(
)
return {
color: move.color ?? null,
displayName: move.name,
displayName: indexEntry.name,
uuid: indexEntry.uuid, // TODO: move.uuid
triggerText: indexEntry.system?.Trigger?.Text,
isRollable: moveTriggerIsRollable(indexEntry?.system?.Trigger),
Expand Down
33 changes: 0 additions & 33 deletions src/module/features/customoracles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,6 @@ const emptyNode: () => IOracleTreeNode = () => ({
children: []
})

async function augmentWithFolderContents(node: IOracleTreeNode) {
const name = game.i18n.localize('IRONSWORN.OracleCategories.Custom')
const rootFolder = game.tables?.directory?.folders.find(
(x) => x.name === name
)
if (rootFolder == null) return

function walkFolder(parent: IOracleTreeNode, folder: Folder) {
// Add this folder
const newNode: IOracleTreeNode = {
...emptyNode(),
displayName: folder.name ?? '(folder)'
}
parent.children.push(newNode)

// Add its folder children
for (const sub of folder.getSubfolders()) {
walkFolder(newNode, sub)
}

// Add its table children
for (const table of folder.contents) {
newNode.children.push({
...emptyNode(),
tables: [table.uuid],
displayName: table.name ?? '(table)'
})
}
}

walkFolder(node, rootFolder)
}

function customFolderOracleCategory(): [IOracleTreeNode, number] {
const name = game.i18n.localize('IRONSWORN.OracleCategories.Custom')
const ret = { ...emptyNode(), displayName: name }
Expand Down
Loading