Skip to content

Commit

Permalink
Merge pull request #1036 from ben/move-names-from-compendium
Browse files Browse the repository at this point in the history
Use the compendium name for moves
  • Loading branch information
ben authored Nov 4, 2024
2 parents 92b3b5b + eab0001 commit b69cea7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
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

0 comments on commit b69cea7

Please sign in to comment.