forked from foundryvtt/dnd5e
-
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.
[foundryvtt#1871] Add starting equipment data
- Loading branch information
Showing
14 changed files
with
370 additions
and
15 deletions.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
23 changes: 23 additions & 0 deletions
23
module/applications/advancement/starting-equipment-config.mjs
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,23 @@ | ||
import AdvancementConfig from "./advancement-config.mjs"; | ||
|
||
/** | ||
* Configuration application for Starting Equipment. | ||
*/ | ||
export default class StartingEquipmentConfig extends AdvancementConfig { | ||
|
||
/** @inheritdoc */ | ||
static get defaultOptions() { | ||
return foundry.utils.mergeObject(super.defaultOptions, { | ||
classes: ["dnd5e", "advancement", "starting-equipment"], | ||
template: "systems/dnd5e/templates/advancement/starting-equipment-config.hbs" | ||
}); | ||
} | ||
|
||
/* -------------------------------------------- */ | ||
|
||
/** @inheritdoc */ | ||
getData(options={}) { | ||
const context = super.getData(options); | ||
return context; | ||
} | ||
} |
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
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,40 @@ | ||
/** | ||
* Configuration application for Starting Equipment. | ||
*/ | ||
export default class StartingEquipmentConfig extends DocumentSheet { | ||
|
||
/** @inheritDoc */ | ||
static get defaultOptions() { | ||
return foundry.utils.mergeObject(super.defaultOptions, { | ||
classes: ["dnd5e", "starting-equipment"], | ||
dragDrop: [{ dropSelector: "form" }], | ||
template: "systems/dnd5e/templates/apps/starting-equipment-config.hbs", | ||
width: 400, | ||
height: "auto", | ||
sheetConfig: false, | ||
closeOnSubmit: false, | ||
submitOnChange: true, | ||
submitOnClose: true | ||
}); | ||
} | ||
|
||
/* -------------------------------------------- */ | ||
/* Rendering */ | ||
/* -------------------------------------------- */ | ||
|
||
/** @inheritDoc */ | ||
async getData(options={}) { | ||
const context = await super.getData(options); | ||
context.startingEquipment = this.document.system.startingEquipment; | ||
return context; | ||
} | ||
|
||
/* -------------------------------------------- */ | ||
/* Event Handling */ | ||
/* -------------------------------------------- */ | ||
|
||
/** @inheritDoc */ | ||
async _updateObject(event, formData) { | ||
console.log(event, formData); | ||
} | ||
} |
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
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
Oops, something went wrong.