mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
Merge branch 'add-073-support' into 'master'
Add support for Foundry 0.7.3 See merge request foundrynet/worldbuilding!11
This commit is contained in:
commit
d641ff96b0
3 changed files with 10 additions and 9 deletions
|
@ -179,23 +179,23 @@ Hooks.on("getItemDirectoryEntryContext", (html, options) => {
|
|||
/**
|
||||
* Adds the actor template selection dialog.
|
||||
*/
|
||||
ActorDirectory.prototype._onCreate = async (event) => {
|
||||
ActorDirectory.prototype._onCreateEntity = async (event) => {
|
||||
// Do not allow the creation event to bubble to other listeners
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_simpleDirectoryTemplates('actor');
|
||||
_simpleDirectoryTemplates('actor', event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the item template selection dialog.
|
||||
*/
|
||||
ItemDirectory.prototype._onCreate = async (event) => {
|
||||
ItemDirectory.prototype._onCreateEntity = async (event) => {
|
||||
// Do not allow the creation event to bubble to other listeners
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_simpleDirectoryTemplates('item');
|
||||
_simpleDirectoryTemplates('item', event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -205,8 +205,9 @@ ItemDirectory.prototype._onCreate = async (event) => {
|
|||
* defined for the entity type.
|
||||
*
|
||||
* @param {string} entityType - 'actor' or 'item'
|
||||
* @param {MouseEvent} event - Triggering event
|
||||
*/
|
||||
async function _simpleDirectoryTemplates(entityType = 'actor') {
|
||||
async function _simpleDirectoryTemplates(entityType = 'actor', event) {
|
||||
// Retrieve the collection and class.
|
||||
const entityCollection = entityType == 'actor' ? game.actors : game.items;
|
||||
const cls = entityType == 'actor' ? Actor : Item;
|
||||
|
@ -252,7 +253,8 @@ async function _simpleDirectoryTemplates(entityType = 'actor') {
|
|||
yes: html => {
|
||||
// Get the form data.
|
||||
const form = html[0].querySelector("form");
|
||||
mergeObject(createData, validateForm(form));
|
||||
const fd = new FormDataExtended(form);
|
||||
mergeObject(createData, fd.toObject());
|
||||
|
||||
// Store the type and name values, and retrieve the template entity.
|
||||
let templateActor = entityCollection.getName(createData.type);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"title": "Simple World-Building",
|
||||
"description": "A minimalist game system with very simple Actor and Item models to support free-form system agnostic gameplay.",
|
||||
"version": 0.36,
|
||||
"minimumCoreVersion": "0.5.6",
|
||||
"compatibleCoreVersion": "0.5.7",
|
||||
"minimumCoreVersion": "0.7.3",
|
||||
"compatibleCoreVersion": "0.7.3",
|
||||
"templateVersion": 2,
|
||||
"author": "Atropos",
|
||||
"esmodules": ["module/simple.js"],
|
||||
|
|
|
@ -11,6 +11,5 @@
|
|||
<option value="{{this.value}}">{{this.label}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
<p class="notes">{{localize "ENTITY.TypeHint"}}</p>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Reference in a new issue