Foundry 0.8 Upgrade - 0.8.6
Foundry 0.8.6 upgrade. Hopefully things work out well, I recommend backing up your old worlds before moving to this version. Also includes a couple of new features and bugfixes.
This commit is contained in:
@@ -296,6 +296,20 @@
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.mosh .faded-label {
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 3px;
|
||||
color:rgb(129, 129, 129);
|
||||
font-weight:normal;
|
||||
|
||||
text-align: left;
|
||||
grid-column: 1/-1;
|
||||
/* font-family: "Montserrat", "Arial Black", sans-serif; */
|
||||
font-size: 1.1rem;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mosh .tabs {
|
||||
height: 40px;
|
||||
border-top: 2px solid rgb(56, 56, 56);
|
||||
|
||||
+37
-39
@@ -20,8 +20,10 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
|
||||
data.dtypes = ["String", "Number", "Boolean"];
|
||||
for (let attr of Object.values(data.data.attributes)) {
|
||||
|
||||
for (let attr of Object.values(data.data.data.attributes)) {
|
||||
attr.isCheckbox = attr.dtype === "Boolean";
|
||||
}
|
||||
|
||||
@@ -31,13 +33,14 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
|
||||
if (data.data.settings == null) {
|
||||
data.data.settings = {};
|
||||
if (data.data.data.settings == null) {
|
||||
data.data.data.settings = {};
|
||||
}
|
||||
data.data.settings.useCalm = game.settings.get("mosh", "useCalm");
|
||||
data.data.settings.hideWeight = game.settings.get("mosh", "hideWeight");
|
||||
data.data.data.settings.useCalm = game.settings.get("mosh", "useCalm");
|
||||
data.data.data.settings.hideWeight = game.settings.get("mosh", "hideWeight");
|
||||
|
||||
return data;
|
||||
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,8 +51,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
* @return {undefined}
|
||||
*/
|
||||
_prepareCharacterItems(sheetData) {
|
||||
const actorData = sheetData.actor;
|
||||
|
||||
const actorData = sheetData.data;
|
||||
// Initialize containers.
|
||||
const gear = [];
|
||||
const skills = [];
|
||||
@@ -59,7 +61,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
let curWeight = 0;
|
||||
// Iterate through items, allocating to containers
|
||||
// let totalWeight = 0;
|
||||
for (let i of sheetData.items) {
|
||||
for (let i of sheetData.data.items) {
|
||||
let item = i.data;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
|
||||
@@ -89,13 +91,14 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
|
||||
actorData.data.weight.capacity = Math.ceil((actorData.data.stats.strength.value/10) + 3);
|
||||
actorData.data.weight.current = curWeight;
|
||||
console.log("Current Weight: " + curWeight + " Capacity: " + actorData.data.weight.capacity);
|
||||
//console.log("Current Weight: " + curWeight + " Capacity: " + actorData.data.weight.capacity);
|
||||
|
||||
// Assign and return
|
||||
actorData.gear = gear;
|
||||
actorData.skills = skills;
|
||||
actorData.armors = armors;
|
||||
actorData.weapons = weapons;
|
||||
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@@ -107,11 +110,11 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.data("itemId")))
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
|
||||
item.data.equipped = !item.data.equipped;
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Add Inventory Item
|
||||
@@ -120,14 +123,14 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
//Quantity adjuster
|
||||
html.on('mousedown', '.item-quantity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.data.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -136,14 +139,14 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
item.data.quantity = Number(amount) - 1;
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
this.actor.deleteEmbeddedDocuments("Item",[li.data("itemId")]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
@@ -153,8 +156,8 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.skill-edit').click(ev => {
|
||||
const liSkill = $(ev.currentTarget).parents(".item");
|
||||
const skill = this.actor.getOwnedItem(liSkill.data("itemId"));
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const skill = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
skill.sheet.render(true);
|
||||
});
|
||||
|
||||
@@ -164,8 +167,8 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const liWeapon = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(liWeapon.data("itemId"));
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
});
|
||||
|
||||
@@ -204,7 +207,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.data.ammo;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -217,34 +220,31 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
|
||||
if (event.button == 0) {
|
||||
if (!item.data.useAmmo) {
|
||||
item.data.curShots = item.data.shots;
|
||||
} else {
|
||||
item.data.ammo += item.data.curShots;
|
||||
let reloadAmount = Math.min(item.data.ammo, item.data.shots);
|
||||
item.data.curShots = reloadAmount;
|
||||
if (!item.data.useAmmo) {
|
||||
item.data.curShots = item.data.shots;
|
||||
} else {
|
||||
item.data.ammo += item.data.curShots;
|
||||
let reloadAmount = Math.min(item.data.ammo, item.data.shots);
|
||||
item.data.curShots = reloadAmount;
|
||||
|
||||
item.data.ammo -= reloadAmount;
|
||||
}
|
||||
item.data.ammo -= reloadAmount;
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
|
||||
let actor = this.actor;
|
||||
let speaker = ChatMessage.getSpeaker({ actor });
|
||||
ChatMessage.create({
|
||||
speaker,
|
||||
content: `Reloading ` + item.name + "...",
|
||||
type: CHAT_MESSAGE_TYPES.EMOTE
|
||||
content: `Reloading ` + item.name + "..."
|
||||
},
|
||||
{ chatBubble: true });
|
||||
|
||||
@@ -264,7 +264,7 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
});
|
||||
|
||||
// Drag events for macros.
|
||||
if (this.actor.owner) {
|
||||
if (this.actor.isOwner) {
|
||||
let handler = ev => this._onDragStart(ev);
|
||||
|
||||
html.find('li.dropitem').each((i, li) => {
|
||||
@@ -343,8 +343,6 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
const element = event.currentTarget;
|
||||
const dataset = element.dataset;
|
||||
|
||||
console.log(super.getData());
|
||||
|
||||
if (dataset.roll) {
|
||||
let roll = new Roll(dataset.roll, this.actor.data.data);
|
||||
let label = dataset.label ? `Rolling ${dataset.label} to score under ${dataset.target}` : '';
|
||||
|
||||
+13
-13
@@ -28,7 +28,7 @@ export class MothershipActor extends Actor {
|
||||
const data = actorData.data;
|
||||
|
||||
let armorBonus = 0;
|
||||
const armors = this.getEmbeddedCollection("OwnedItem").filter(e => "armor" === e.type);
|
||||
const armors = this.getEmbeddedCollection("Item").filter(e => "armor" === e.type);
|
||||
|
||||
for (let armor of armors) {
|
||||
if (armor.data.equipped) {
|
||||
@@ -141,7 +141,7 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
|
||||
rollWeapon(itemId, options = { event: null }) {
|
||||
let item = duplicate(this.getEmbeddedEntity("OwnedItem", itemId));
|
||||
let item = duplicate(this.getEmbeddedDocument("Item",itemId));
|
||||
|
||||
console.log(item);
|
||||
|
||||
@@ -149,7 +149,7 @@ export class MothershipActor extends Actor {
|
||||
if (item.data.shots == 0) {
|
||||
if (item.data.ammo > 0) {
|
||||
item.data.ammo -= 1;
|
||||
this.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.updateEmbeddedDocuments('Item', [item]);
|
||||
} else {
|
||||
|
||||
//Select the stat of the roll.
|
||||
@@ -174,7 +174,7 @@ export class MothershipActor extends Actor {
|
||||
let subAmount = Math.max(item.data.shotsPerFire, 1);
|
||||
item.data.curShots = Math.max(item.data.curShots - subAmount, 0);
|
||||
console.log("Unloading Shots");
|
||||
this.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.updateEmbeddedDocuments('Item', [item]);
|
||||
}
|
||||
else {
|
||||
if (item.data.ammo > 0 || !item.data.useAmmo) {
|
||||
@@ -255,8 +255,8 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
|
||||
reloadWeapon(itemId, options = { event: null }) {
|
||||
let item = duplicate(this.getEmbeddedEntity("OwnedItem", itemId));
|
||||
|
||||
let item = duplicate(this.getEmbeddedDocument("Item",itemId));
|
||||
|
||||
if (event.button == 0) {
|
||||
if (!item.data.useAmmo) {
|
||||
item.data.curShots = item.data.shots;
|
||||
@@ -269,17 +269,17 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
this.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.updateEmbeddedDocuments('Item', [item]);
|
||||
}
|
||||
|
||||
|
||||
printDescription(itemId, options = { event: null }) {
|
||||
let item = duplicate(this.getEmbeddedEntity("OwnedItem", itemId));
|
||||
let item = duplicate(this.getEmbeddedDocument("Item",itemId));
|
||||
this.chatDesc(item);
|
||||
}
|
||||
|
||||
rollSkill(itemId, options = { event: null }) {
|
||||
let item = duplicate(this.getEmbeddedEntity("OwnedItem", itemId));
|
||||
let item = duplicate(this.getEmbeddedDocument("Item",itemId));
|
||||
|
||||
// let attLabel = skill.label?.charAt(0).toUpperCase() + skill.label?.toLowerCase().slice(1);
|
||||
// if (!skill.label && isNaN(attLabel))
|
||||
@@ -422,9 +422,9 @@ export class MothershipActor extends Actor {
|
||||
};
|
||||
|
||||
let chatData = {
|
||||
user: game.user._id,
|
||||
user: game.user.id,
|
||||
speaker: {
|
||||
actor: this._id,
|
||||
actor: this.id,
|
||||
token: this.token,
|
||||
alias: this.name
|
||||
}
|
||||
@@ -552,9 +552,9 @@ export class MothershipActor extends Actor {
|
||||
};
|
||||
|
||||
let chatData = {
|
||||
user: game.user._id,
|
||||
user: game.user.id,
|
||||
speaker: {
|
||||
actor: this._id,
|
||||
actor: this.id,
|
||||
token: this.token,
|
||||
alias: this.name
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
*/
|
||||
_getHeaderButtons() {
|
||||
let buttons = super._getHeaderButtons();
|
||||
const canConfigure = game.user.isGM || this.actor.owner;
|
||||
const canConfigure = game.user.isGM || this.actor.isOwner;
|
||||
if (this.options.editable && canConfigure) {
|
||||
buttons = [{
|
||||
label: 'Creature Settings',
|
||||
@@ -70,7 +70,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
this._prepareCreatureItems(data);
|
||||
}
|
||||
|
||||
return data;
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
* @return {undefined}
|
||||
*/
|
||||
_prepareCreatureItems(sheetData) {
|
||||
const actorData = sheetData.actor;
|
||||
const actorData = sheetData.data;
|
||||
|
||||
// Initialize containers.
|
||||
const abilities = [];
|
||||
@@ -89,7 +89,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
|
||||
// Iterate through items, allocating to containers
|
||||
// let totalWeight = 0;
|
||||
for (let i of sheetData.items) {
|
||||
for (let i of sheetData.data.items) {
|
||||
let item = i.data;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
|
||||
@@ -115,14 +115,14 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
this.actor.deleteEmbeddedDocuments("Item",[li.data("itemId")]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
@@ -143,8 +143,8 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const liWeapon = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(liWeapon.data("itemId"));
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
});
|
||||
|
||||
@@ -159,7 +159,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.data.ammo;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -172,13 +172,13 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
|
||||
if (event.button == 0) {
|
||||
if (!item.data.useAmmo) {
|
||||
@@ -192,7 +192,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
// let actor = this.actor;
|
||||
// let speaker = ChatMessage.getSpeaker({ actor });
|
||||
// ChatMessage.create({
|
||||
@@ -212,7 +212,7 @@ export class MothershipCreatureSheet extends ActorSheet {
|
||||
});
|
||||
|
||||
// Drag events for macros.
|
||||
if (this.actor.owner) {
|
||||
if (this.actor.isOwner) {
|
||||
let handler = ev => this._onDragStart(ev);
|
||||
|
||||
html.find('li.dropitem').each((i, li) => {
|
||||
|
||||
+21
-15
@@ -24,7 +24,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
// for (let attr of Object.values(data.data.attributes)) {
|
||||
// attr.isCheckbox = attr.dtype === "Boolean";
|
||||
// }
|
||||
|
||||
console.log(data);
|
||||
// Prepare items.
|
||||
if (this.actor.data.type == 'ship') {
|
||||
this._prepareShipItems(data);
|
||||
@@ -37,7 +37,11 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
data.data.settings.useCalm = game.settings.get("mosh", "useCalm");
|
||||
data.data.settings.hideWeight = game.settings.get("mosh", "hideWeight");
|
||||
|
||||
return data;
|
||||
let maxHull = data.data.data.supplies.hull.max;
|
||||
|
||||
data.data.data.supplies.hull.percentage = " [ "+Math.round(maxHull * 0.25)+" | "+Math.round(maxHull * 0.5)+" | "+Math.round(maxHull * 0.75)+" ]";
|
||||
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +52,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
* @return {undefined}
|
||||
*/
|
||||
_prepareShipItems(sheetData) {
|
||||
const actorData = sheetData.actor;
|
||||
const actorData = sheetData.data;
|
||||
|
||||
// Initialize containers.
|
||||
const abilities = [];
|
||||
@@ -58,7 +62,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
|
||||
// Iterate through items, allocating to containers
|
||||
// let totalWeight = 0;
|
||||
for (let i of sheetData.items) {
|
||||
for (let i of sheetData.data.items) {
|
||||
let item = i.data;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
|
||||
@@ -93,16 +97,18 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
this.actor.deleteEmbeddedDocuments("Item",[li.data("itemId")]);
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
const item = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
|
||||
let amount = item.data.quantity;
|
||||
|
||||
if (item.type == "module") {
|
||||
item.data.totalHull = amount * item.data.hull;
|
||||
}
|
||||
@@ -111,7 +117,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
//Quantity adjuster
|
||||
html.on('mousedown', '.item-quantity', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.data.quantity;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -124,7 +130,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
item.data.totalHull = item.data.quantity * item.data.hull;
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Rollable Attributes
|
||||
@@ -140,8 +146,8 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
html.find('.weapon-create').click(this._onItemCreate.bind(this));
|
||||
// Update Inventory Item
|
||||
html.find('.weapon-edit').click(ev => {
|
||||
const liWeapon = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getOwnedItem(liWeapon.data("itemId"));
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const weapon = this.actor.getEmbeddedDocument("Item", li.data("itemId"));
|
||||
weapon.sheet.render(true);
|
||||
});
|
||||
// Rollable Weapon
|
||||
@@ -154,7 +160,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
|
||||
html.on('mousedown', '.weapon-ammo', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
let amount = item.data.ammo;
|
||||
|
||||
if (event.button == 0) {
|
||||
@@ -167,13 +173,13 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", li.dataset.itemId))
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
|
||||
if (event.button == 0) {
|
||||
if (!item.data.useAmmo) {
|
||||
@@ -187,7 +193,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
}
|
||||
}
|
||||
|
||||
this.actor.updateEmbeddedEntity('OwnedItem', item);
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
// Rollable Item/Anything with a description that we want to click on.
|
||||
@@ -200,7 +206,7 @@ export class MothershipShipSheet extends ActorSheet {
|
||||
|
||||
|
||||
// Drag events for macros.
|
||||
if (this.actor.owner) {
|
||||
if (this.actor.isOwner) {
|
||||
let handler = ev => this._onDragStart(ev);
|
||||
|
||||
html.find('li.dropitem').each((i, li) => {
|
||||
|
||||
@@ -30,7 +30,7 @@ export class MothershipItemSheet extends ItemSheet {
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
return data;
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
"name": "mosh",
|
||||
"title": "MoSh - Unofficial Mothership",
|
||||
"description": "The unofficial Mothership system for FoundryVTT.",
|
||||
"version": "0.1.4",
|
||||
"minimumCoreVersion": "0.7.0",
|
||||
"compatibleCoreVersion": "0.7.9",
|
||||
"version": "0.1.5",
|
||||
"minimumCoreVersion": "0.8.6",
|
||||
"compatibleCoreVersion": "0.8.6",
|
||||
"templateVersion": 2,
|
||||
"author": "Futilrevenge",
|
||||
"esmodules": ["module/mosh.js"],
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<div class="header">
|
||||
<!-- <img class="moshlogo" src="https://images.squarespace-cdn.com/content/5e97675644a24d569352fe17/1587070346832-RKM533ZN7XN778HQEBUW/Mothership-M-Logo-White.png?content-type=image%2Fpng" data-i18n-title="Mothership Logo" title="[Mothership Logo]"> -->
|
||||
<img class="moshlogo" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="150"
|
||||
<img class="moshlogo" src="{{img}}" data-edit="img" title="{{name}}" height="150"
|
||||
width="150" />
|
||||
|
||||
<div class="headergrid">
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="headernamegrid">
|
||||
<div class="headerinputtext">NAME</div>
|
||||
<div class="headerinputfield charname"><input name="name" class="noborder" type="text"
|
||||
value="{{actor.name}}" placeholder="Name" /></div>
|
||||
value="{{name}}" placeholder="Name" /></div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="headerinputtext">Credits</div>
|
||||
@@ -306,7 +306,7 @@
|
||||
Armor</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.armors as |armor id|}}
|
||||
{{#each armors as |armor id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{armor._id}}">
|
||||
<div class="item-image"><img src="{{armor.img}}" title="{{armor.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll">{{armor.name}}</h4>
|
||||
@@ -337,8 +337,8 @@
|
||||
Item</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#if actor.data.settings.hideWeight}}
|
||||
{{#each actor.gear as |item id|}}
|
||||
{{#if data.settings.hideWeight}}
|
||||
{{#each gear as |item id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 1.5;">{{item.name}}</h4>
|
||||
@@ -351,7 +351,7 @@
|
||||
</li>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each actor.gear as |item id|}}
|
||||
{{#each gear as |item id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
|
||||
<h4 class="skill-name list-roll description-roll" style="flex-grow: 1.5;">{{item.name}}</h4>
|
||||
@@ -388,7 +388,7 @@
|
||||
Skill</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.skills as |skill id|}}
|
||||
{{#each skills as |skill id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{skill._id}}">
|
||||
<!-- <div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div> -->
|
||||
<div class="skill-name skill-roll list-roll">{{skill.name}}</div>
|
||||
@@ -418,7 +418,7 @@
|
||||
Add</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.weapons as |weapon id|}}
|
||||
{{#each weapons as |weapon id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{weapon._id}}">
|
||||
<!-- <div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div> -->
|
||||
<div class="item-image"><img src="{{weapon.img}}" title="{{weapon.name}}" width="24" height="24" /></div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<header class="creature-header-grid">
|
||||
<!-- Creature NAME -->
|
||||
<input name="name" class="noborder creaturename" style="grid-area:'name';" type="text" value="{{actor.name}}" placeholder="Name" />
|
||||
<input name="name" class="noborder creaturename" style="grid-area:'name';" type="text" value="{{name}}" placeholder="Name" />
|
||||
<div class="creature-header">
|
||||
{{#if data.stats.combat.enabled}}
|
||||
<!-- Combat -->
|
||||
@@ -124,13 +124,13 @@
|
||||
<div class="healthmaxtext">Maximum</div>
|
||||
</div>
|
||||
</div>
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
<div class="creature-abilities">
|
||||
<img class="img noborder" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="auto" width="100%" />
|
||||
<img class="img noborder" src="{{img}}" data-edit="img" title="{{name}}" height="auto" width="100%" />
|
||||
<div class="creature-ability-container creature-ability-title">Special Abilities</div>
|
||||
<div class="whiteline"></div>
|
||||
{{#each actor.abilities as |ability id|}}
|
||||
{{#each abilities as |ability id|}}
|
||||
<li style="margin-top: -12px" class="creature-ability-container item dropitem" data-item-id="{{ability._id}}">
|
||||
<div class="creature-ability-title list-roll description-roll">{{ability.name}}</div>
|
||||
<div class="creature-ability-text itemtext">{{{ability.data.description}}}</div>
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab biography" data-group="primary" data-tab="description">
|
||||
{{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.biography target="data.biography" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
{{!-- Owned Weapons Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="weapons">
|
||||
@@ -176,7 +176,7 @@
|
||||
Add</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.weapons as |weapon id|}}
|
||||
{{#each weapons as |weapon id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{weapon._id}}">
|
||||
<!-- <div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div> -->
|
||||
<div class="item-image"><img src="{{weapon.img}}" title="{{weapon.name}}" width="24" height="24" /></div>
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
{{!-- Sheet Header --}}
|
||||
<div class="header">
|
||||
<!-- <img class="moshlogo" src="https://images.squarespace-cdn.com/content/5e97675644a24d569352fe17/1587070346832-RKM533ZN7XN778HQEBUW/Mothership-M-Logo-White.png?content-type=image%2Fpng" data-i18n-title="Mothership Logo" title="[Mothership Logo]"> -->
|
||||
<img class="moshlogo" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="150"
|
||||
<img class="moshlogo" src="{{img}}" data-edit="img" title="{{name}}" height="150"
|
||||
width="150" />
|
||||
|
||||
<div class="headergrid" style="grid-template-columns: 1fr 1fr 1fr; padding: 1em;">
|
||||
<!-- <img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="150" width="150"/> -->
|
||||
<!-- <img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" height="150" width="150"/> -->
|
||||
|
||||
<!-- PLAYER NAME -->
|
||||
<div class="headernamegrid">
|
||||
<div class="headerinputtext">NAME</div>
|
||||
<div class="headerinputfield charname"><input name="name" class="noborder" type="text"
|
||||
value="{{actor.name}}" placeholder="Name" /></div>
|
||||
value="{{name}}" placeholder="Name" /></div>
|
||||
</div>
|
||||
<!-- CLASS -->
|
||||
<div class="">
|
||||
@@ -115,6 +115,7 @@
|
||||
<!-- Hull -->
|
||||
<div class="resource healthspread minmaxtopstat flex-center">
|
||||
<label for="data.supplies.hull.value" class="resource-label minmaxtext">Hull</label>
|
||||
<div class="faded-label">{{data.supplies.hull.percentage}}</div>
|
||||
|
||||
<div class="minmaxwrapper">
|
||||
<input class="maxhealth-input darkGreyText" type="text" name="data.supplies.hull.value"
|
||||
@@ -127,6 +128,8 @@
|
||||
<div class="healthmaxtext">Current</div>
|
||||
<div class="healthmaxtext">Maximum</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Fuel -->
|
||||
<div class="resource healthspread minmaxtopstat flex-center">
|
||||
<label for="data.supplies.fuel.value" class="resource-label minmaxtext">Fuel</label>
|
||||
@@ -161,7 +164,7 @@
|
||||
<div class="creature-abilities" style="height: 300px;">
|
||||
<div class="creature-ability-container creature-ability-title">Notes</div>
|
||||
<div class="whiteline"></div>
|
||||
{{#each actor.abilities as |ability id|}}
|
||||
{{#each abilities as |ability id|}}
|
||||
<div class="creature-ability-container item" data-item-id="{{ability._id}}">
|
||||
<div class="creature-ability-title">{{ability.name}}</div>
|
||||
<div class="creature-ability-text itemtext">{{{ability.data.description}}}</div>
|
||||
@@ -216,7 +219,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.weapons as |weapon id|}}
|
||||
{{#each weapons as |weapon id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{weapon._id}}">
|
||||
<!-- <div class="item-image"><img src="{{skill.img}}" title="{{skill.name}}" width="24" height="24"/></div> -->
|
||||
<div class="item-image"><img src="{{weapon.img}}" title="{{weapon.name}}" width="24" height="24" /></div>
|
||||
@@ -257,7 +260,7 @@
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.modules as |module id|}}
|
||||
{{#each modules as |module id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{module._id}}">
|
||||
<div class="item-image"><img src="{{module.img}}" title="{{module.name}}" width="24" height="24" />
|
||||
</div>
|
||||
@@ -288,7 +291,7 @@
|
||||
class="fas fa-plus"></i> Add</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.cargo as |item id|}}
|
||||
{{#each cargo as |item id|}}
|
||||
<li class="item flexrow dropitem" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" />
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||
<div class="grid grid-2col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Roll</label>
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||
<div class="grid grid-2col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Save Bonus</label>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||
<div class="grid grid-3col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Quantity</label>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
|
||||
<div class="grid grid-2col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Quantity</label>
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<!-- <img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/> -->
|
||||
<!-- <img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/> -->
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
|
||||
<div class="grid grid-2col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Bonus</label>
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
|
||||
<div class="grid grid-3col">
|
||||
<div class="resource">
|
||||
<label class="resource-label">Damage</label>
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
|
||||
{{!-- Ranges Tab --}}
|
||||
|
||||
Reference in New Issue
Block a user