mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
Add support for Foundry 0.7.3
- Fixed an issue with the actor/item creation dialog that prevented it from working on Foundry 0.7.x versions. - Removed obsolete translation string. - Bumped minimum core version now that 0.7.3 is in beta.
This commit is contained in:
parent
f69f9c80ea
commit
8daec8bd92
3 changed files with 10 additions and 9 deletions
|
@ -179,23 +179,23 @@ Hooks.on("getItemDirectoryEntryContext", (html, options) => {
|
||||||
/**
|
/**
|
||||||
* Adds the actor template selection dialog.
|
* 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
|
// Do not allow the creation event to bubble to other listeners
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
_simpleDirectoryTemplates('actor');
|
_simpleDirectoryTemplates('actor', event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the item template selection dialog.
|
* 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
|
// Do not allow the creation event to bubble to other listeners
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
_simpleDirectoryTemplates('item');
|
_simpleDirectoryTemplates('item', event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,8 +205,9 @@ ItemDirectory.prototype._onCreate = async (event) => {
|
||||||
* defined for the entity type.
|
* defined for the entity type.
|
||||||
*
|
*
|
||||||
* @param {string} entityType - 'actor' or 'item'
|
* @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.
|
// Retrieve the collection and class.
|
||||||
const entityCollection = entityType == 'actor' ? game.actors : game.items;
|
const entityCollection = entityType == 'actor' ? game.actors : game.items;
|
||||||
const cls = entityType == 'actor' ? Actor : Item;
|
const cls = entityType == 'actor' ? Actor : Item;
|
||||||
|
@ -252,7 +253,8 @@ async function _simpleDirectoryTemplates(entityType = 'actor') {
|
||||||
yes: html => {
|
yes: html => {
|
||||||
// Get the form data.
|
// Get the form data.
|
||||||
const form = html[0].querySelector("form");
|
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.
|
// Store the type and name values, and retrieve the template entity.
|
||||||
let templateActor = entityCollection.getName(createData.type);
|
let templateActor = entityCollection.getName(createData.type);
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
"title": "Simple World-Building",
|
"title": "Simple World-Building",
|
||||||
"description": "A minimalist game system with very simple Actor and Item models to support free-form system agnostic gameplay.",
|
"description": "A minimalist game system with very simple Actor and Item models to support free-form system agnostic gameplay.",
|
||||||
"version": 0.36,
|
"version": 0.36,
|
||||||
"minimumCoreVersion": "0.5.6",
|
"minimumCoreVersion": "0.7.3",
|
||||||
"compatibleCoreVersion": "0.5.7",
|
"compatibleCoreVersion": "0.7.3",
|
||||||
"templateVersion": 2,
|
"templateVersion": 2,
|
||||||
"author": "Atropos",
|
"author": "Atropos",
|
||||||
"esmodules": ["module/simple.js"],
|
"esmodules": ["module/simple.js"],
|
||||||
|
|
|
@ -11,6 +11,5 @@
|
||||||
<option value="{{this.value}}">{{this.label}}</option>
|
<option value="{{this.value}}">{{this.label}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
<p class="notes">{{localize "ENTITY.TypeHint"}}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Reference in a new issue