v0.1.6
This commit is contained in:
@@ -315,7 +315,9 @@ export class VermineActorSheet extends ActorSheet {
|
||||
// Grab any data associated with this control.
|
||||
const data = duplicate(header.dataset);
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
// const name = `New ${type.capitalize()}`;
|
||||
const name = game.i18n.localize('ITEMS.new_' + type);
|
||||
|
||||
// Prepare the item object.
|
||||
const itemData = {
|
||||
name: name,
|
||||
|
||||
@@ -143,20 +143,9 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.isEditable) return;
|
||||
|
||||
// Add Inventory Item
|
||||
html.find('.item-create').click(this._onItemCreate.bind(this));
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.delete();
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Active Effect management
|
||||
html.find(".effect-control").click(ev => onManageActiveEffect(ev, this.actor));
|
||||
|
||||
// Add and delete Inventory Item
|
||||
// already configured in parents listeners
|
||||
|
||||
// Rollable abilities.
|
||||
html.find('.rollable').click(this._onRoll.bind(this));
|
||||
|
||||
@@ -189,32 +178,6 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset
|
||||
* @param {Event} event The originating click event
|
||||
* @private
|
||||
*/
|
||||
async _onItemCreate(event) {
|
||||
event.preventDefault();
|
||||
const header = event.currentTarget;
|
||||
// Get the type of item to create.
|
||||
const type = header.dataset.type;
|
||||
// Grab any data associated with this control.
|
||||
const data = duplicate(header.dataset);
|
||||
// Initialize a default name.
|
||||
const name = `New ${type.capitalize()}`;
|
||||
// Prepare the item object.
|
||||
const itemData = {
|
||||
name: name,
|
||||
type: type,
|
||||
system: data
|
||||
};
|
||||
// Remove the type from the dataset since it's in the itemData.type prop.
|
||||
delete itemData.system["type"];
|
||||
|
||||
// Finally, create the item!
|
||||
return await Item.create(itemData, {parent: this.actor});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle clickable rolls.
|
||||
|
||||
@@ -140,20 +140,7 @@ export class VermineCreatureSheet extends ActorSheet {
|
||||
// -------------------------------------------------------------
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.isEditable) return;
|
||||
|
||||
// Add Inventory Item
|
||||
html.find('.item-create').click(this._onItemCreate.bind(this));
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.delete();
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Active Effect management
|
||||
html.find(".effect-control").click(ev => onManageActiveEffect(ev, this.actor));
|
||||
|
||||
|
||||
// Rollable abilities.
|
||||
html.find('.rollable').click(this._onRoll.bind(this));
|
||||
|
||||
@@ -141,20 +141,6 @@ export class VermineNpcSheet extends VermineActorSheet {
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.isEditable) return;
|
||||
|
||||
// Add Inventory Item
|
||||
html.find('.item-create').click(this._onItemCreate.bind(this));
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("itemId"));
|
||||
item.delete();
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Active Effect management
|
||||
html.find(".effect-control").click(ev => onManageActiveEffect(ev, this.actor));
|
||||
|
||||
// Rollable abilities.
|
||||
html.find('.rollable').click(this._onRoll.bind(this));
|
||||
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
|
||||
|
||||
// Actor partials.
|
||||
"systems/vermine2047/templates/actor/parts/actor-spells.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-features.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-spells.html",
|
||||
// "systems/vermine2047/templates/actor/parts/actor-features.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-id.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-totem.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/character-features.hbs",
|
||||
@@ -19,7 +17,7 @@
|
||||
"systems/vermine2047/templates/actor/parts/actor-weapons.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-defenses.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-stories.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-effects.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-combat.html",
|
||||
|
||||
// Group partials
|
||||
"systems/vermine2047/templates/actor/parts/group-header.hbs",
|
||||
|
||||
Reference in New Issue
Block a user