mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
Update SWB system for FVTT version 0.5.2
This commit is contained in:
parent
c3402a0acf
commit
57b5be22dc
3 changed files with 26 additions and 58 deletions
|
@ -1,38 +1,23 @@
|
|||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class SimpleActorSheet extends ActorSheet {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
/**
|
||||
* Keep track of the currently active sheet tab
|
||||
* @type {string}
|
||||
*/
|
||||
this._sheetTab = "description";
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Extend and override the default options used by the 5e Actor Sheet
|
||||
* @returns {Object}
|
||||
*/
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["worldbuilding", "sheet", "actor"],
|
||||
template: "systems/worldbuilding/templates/actor-sheet.html",
|
||||
width: 600,
|
||||
height: 600
|
||||
height: 600,
|
||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Prepare data for rendering the Actor sheet
|
||||
* The prepared data object contains both the actor data as well as additional sheet options
|
||||
*/
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
data.dtypes = ["String", "Number", "Boolean"];
|
||||
|
@ -44,10 +29,7 @@ export class SimpleActorSheet extends ActorSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Activate event listeners using the prepared sheet HTML
|
||||
* @param html {HTML} The prepared HTML object ready to be rendered into the DOM
|
||||
*/
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
|
@ -82,6 +64,11 @@ export class SimpleActorSheet extends ActorSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Listen for click events on an attribute control to modify the composition of attributes in the sheet
|
||||
* @param {MouseEvent} event The originating left click event
|
||||
* @private
|
||||
*/
|
||||
async _onClickAttributeControl(event) {
|
||||
event.preventDefault();
|
||||
const a = event.currentTarget;
|
||||
|
@ -109,11 +96,7 @@ export class SimpleActorSheet extends ActorSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Implement the _updateObject method as required by the parent class spec
|
||||
* This defines how to update the subject of the form when the form is submitted
|
||||
* @private
|
||||
*/
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
|
||||
// Handle the free-form attributes list
|
||||
|
|
|
@ -1,36 +1,23 @@
|
|||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class SimpleItemSheet extends ItemSheet {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
/**
|
||||
* Keep track of the currently active sheet tab
|
||||
* @type {string}
|
||||
*/
|
||||
this._sheetTab = "description";
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend and override the default options used by the Simple Item Sheet
|
||||
* @returns {Object}
|
||||
*/
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["worldbuilding", "sheet", "item"],
|
||||
template: "systems/worldbuilding/templates/item-sheet.html",
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Prepare data for rendering the Item sheet
|
||||
* The prepared data object contains both the actor data as well as additional sheet options
|
||||
*/
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
data.dtypes = ["String", "Number", "Boolean"];
|
||||
|
@ -42,10 +29,7 @@ export class SimpleItemSheet extends ItemSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Activate event listeners using the prepared sheet HTML
|
||||
* @param html {HTML} The prepared HTML object ready to be rendered into the DOM
|
||||
*/
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
|
@ -66,6 +50,11 @@ export class SimpleItemSheet extends ItemSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Listen for click events on an attribute control to modify the composition of attributes in the sheet
|
||||
* @param {MouseEvent} event The originating left click event
|
||||
* @private
|
||||
*/
|
||||
async _onClickAttributeControl(event) {
|
||||
event.preventDefault();
|
||||
const a = event.currentTarget;
|
||||
|
@ -93,11 +82,7 @@ export class SimpleItemSheet extends ItemSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Implement the _updateObject method as required by the parent class spec
|
||||
* This defines how to update the subject of the form when the form is submitted
|
||||
* @private
|
||||
*/
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
|
||||
// Handle the free-form attributes list
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
"name": "worldbuilding",
|
||||
"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.32,
|
||||
"minimumCoreVersion": "0.4.4",
|
||||
"compatibleCoreVersion": "0.5.0",
|
||||
"version": 0.33,
|
||||
"minimumCoreVersion": "0.5.2",
|
||||
"compatibleCoreVersion": "0.5.3",
|
||||
"templateVersion": 2,
|
||||
"author": "Atropos",
|
||||
"esmodules": ["module/simple.js"],
|
||||
|
|
Loading…
Add table
Reference in a new issue