forked from the-metalworks/cosmere-rpg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ancestry items): added base item sheets, included rough data mod…
…el for ancestry advancement, first pass at ancestry sheet
- Loading branch information
Showing
7 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * as actor from './actor'; | ||
export * as combat from './combat'; | ||
export * as item from './item'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { CosmereItem } from '@src/system/documents'; | ||
import { BaseSheet } from './base-sheet'; | ||
import { AncestryItemDataModel } from '@src/system/data/item'; | ||
|
||
export class AncestrySheet extends BaseSheet { | ||
static get defaultOptions() { | ||
return foundry.utils.mergeObject(super.defaultOptions, { | ||
classes: ['cosmere-rpg', 'sheet', 'item', 'ancestry'], | ||
width: 520, | ||
height: 250, | ||
resizeable: true, | ||
}); | ||
} | ||
|
||
get item() { | ||
return super.item as CosmereItem<AncestryItemDataModel>; | ||
} | ||
|
||
getData() { | ||
return { | ||
...super.getData(), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { CosmereItem } from '@system/documents/item'; | ||
|
||
export class BaseSheet extends ItemSheet { | ||
get template() { | ||
return `systems/cosmere-rpg/templates/item/${this.item.type}-sheet.hbs`; | ||
} | ||
|
||
get item(): CosmereItem { | ||
return super.item; | ||
} | ||
|
||
getData() { | ||
return { | ||
...(super.getData() as ItemSheet.ItemSheetData), | ||
desc: this.item.hasDescription() | ||
? this.item.system.description | ||
: undefined, | ||
// effects: prepareActiveEffectCategories(this.item.effects) | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ancestry-sheet'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<form class="sheet" autocomplete="off"> | ||
<header class="sheet-header"> | ||
<img class="profile" src="{{item.img}}" data-tooltip="{{img.name}}" data-edit="img" /> | ||
<h1 class="document-name">{{item.name}}</h1> | ||
</header> | ||
<div> | ||
{{desc.value}} | ||
</div> | ||
</form> |