Merge branch 'master' of ssh://pi.rikspolisen.se:2222/foundryvtt/kopparhavet

v0.1.1 v0.0.7
Erebus 2021-07-28 13:10:53 +02:00
commit 6962d6fc04
34 changed files with 323 additions and 293 deletions

View File

@ -154,7 +154,7 @@ export class ActorSheetKH extends ActorSheet {
icon: '<i class="far dice"></i>',
callback: (li) => {
let itemId = li.data("itemId");
let _item = this.actor.items.find((element) => element._id == itemId);
let _item = this.actor.items.find((element) => element.id == itemId);
// Retrieve skill based on name
let skill = this.actor.items.find((element) => element.name === _item.data.data.skill.value);
@ -186,7 +186,7 @@ export class ActorSheetKH extends ActorSheet {
icon: '<i class="far dice"></i>',
callback: (li) => {
let itemId = li.data("itemId");
let _item = this.actor.items.find((element) => element._id == itemId);
let _item = this.actor.items.find((element) => element.id == itemId);
let skillName = _item.name
let skillValue = _item.data.data.value
@ -214,14 +214,14 @@ export class ActorSheetKH extends ActorSheet {
name: game.i18n.localize("MENU.SHOWROLLDIALOG"),
icon: '<i class="far dice"></i>',
callback: (li) => {
let itemId = li.data("itemId");
let _item = this.actor.items.find((element) => element._id == itemId);
let itemId = li.data("item-id");
let _item = this.actor.items.find((element) => element.id == itemId);
if (!_item) {
_item = game.items.get(itemId);
if (!_item) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 1")
return
}
}
@ -406,7 +406,7 @@ export class ActorSheetKH extends ActorSheet {
html.find(".item-delete").click((ev) => {
let parent = $(ev.currentTarget).data("parent")
const li = $(ev.currentTarget).parents(parent);
const item = this.actor.getOwnedItem(li.data("itemId"));
const item = this.actor.items.get(li.data("itemId"));
if(item) {
if (item.type === "armor") {
@ -417,7 +417,7 @@ export class ActorSheetKH extends ActorSheet {
this.actor.items.map((i) => {
if (i.type === "armor") {
if (i._id !== item._id && i.data.data.equipable.equipped && i.data?.data?.modifications) {
if (i.id !== item.id && i.data.data.equipable.equipped && i.data?.data?.modifications) {
for (let k of Object.keys(i.data.data.modifications)) {
if (i.data.data.modifications[k].modtype === "init") {
initValue = i.data.data.modifications[k].value;
@ -444,13 +444,13 @@ export class ActorSheetKH extends ActorSheet {
let parent = $(ev.currentTarget).data("parent")
let li = $(ev.currentTarget).parents(parent);
let itemId = li.data("itemId");
let item = this.actor.getOwnedItem(itemId);
let item = this.actor.items.get(itemId);
if (!item) {
item = game.items.get(itemId);
if (!item) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 2")
}
}
@ -463,13 +463,13 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-spell-cost").click((ev) => {
const li = $(ev.currentTarget).parents(".item-spell");
let itemId = li.data("itemId");
let spell = this.actor.getOwnedItem(itemId);
let spell = this.actor.items.get(itemId);
if (!spell) {
spell = game.items.get(itemId);
if (!spell) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 3")
return
}
}
@ -486,14 +486,14 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-spell-skill").click((ev) => {
const li = $(ev.currentTarget).parents(".item-spell");
let itemId = li.data("itemId");
let spell = this.actor.getOwnedItem(itemId);
let itemId = li.data("item-id");
let spell = this.actor.items.get(itemId);
if (!spell) {
spell = game.items.get(itemId);
if (!spell) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 4")
return
}
}
@ -614,8 +614,13 @@ export class ActorSheetKH extends ActorSheet {
/* Roll skill */
html.find(".roll-skill").click((ev) => {
const li = $(ev.currentTarget).parents(".item-skill");
let itemId = li.data("itemId");
let _item = this.actor.items.find((element) => element._id == itemId);
let itemId = li.data("item-id");
let _item = this.actor.items.find((element) => element.id === itemId);
console.log(li)
console.log(li.data)
console.log(itemId)
console.log(_item)
let skillName = _item.name
let skillValue = _item.data.data.value
@ -632,13 +637,13 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-weapon-skill").click((ev) => {
const li = $(ev.currentTarget).parents(".item-weapon");
let itemId = li.data("itemId");
let weapon = this.actor.getOwnedItem(itemId);
let weapon = this.actor.items.get(itemId);
if (!weapon) {
weapon = game.items.get(itemId);
if (!weapon) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 5")
return
}
}
@ -661,13 +666,13 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-damage").click((ev) => {
const li = $(ev.currentTarget).parents(".item-weapon");
let itemId = li.data("itemId");
let weapon = this.actor.getOwnedItem(itemId);
let weapon = this.actor.items.get(itemId);
if (!weapon) {
weapon = game.items.get(itemId);
if (!weapon) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 6")
return
}
}
@ -686,13 +691,13 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-armor").click((ev) => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("itemId");
let armor = this.actor.getOwnedItem(itemId);
let armor = this.actor.items.get(itemId);
if (!armor) {
armor = game.items.get(itemId);
if (!armor) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 7")
return
}
}
@ -747,13 +752,13 @@ export class ActorSheetKH extends ActorSheet {
html.find(".roll-attack-damage").click((ev) => {
const li = $(ev.currentTarget).parents(".item-attack");
let itemId = li.data("itemId");
let weapon = this.actor.getOwnedItem(itemId);
let weapon = this.actor.items.get(itemId);
if (!weapon) {
weapon = game.items.get(itemId);
if (!weapon) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 8")
return
}
}
@ -906,7 +911,7 @@ export class ActorSheetKH extends ActorSheet {
async _toggleEquippedItem(event) {
const li = $(event.currentTarget);
const item = this.actor.getOwnedItem(li.data("itemId"));
const item = this.actor.items.get(li.data("itemId"));
const actor = this.actor;
if(item) {
@ -918,7 +923,7 @@ export class ActorSheetKH extends ActorSheet {
actor.items.map((i) => {
if(i.type === "armor") {
if(i._id !== item._id && i.data.data.equipable.equipped && i.data?.data?.modifications) {
if(i.id !== item.id && i.data.data.equipable.equipped && i.data?.data?.modifications) {
for(let k of Object.keys(i.data.data.modifications)) {
if(i.data.data.modifications[k].modtype === "init") {
initValue = i.data.data.modifications[k].value;
@ -953,10 +958,10 @@ export class ActorSheetKH extends ActorSheet {
const li = $(event.currentTarget).parents(".item");
let itemId = li.data("itemId");
let item = this.actor.getOwnedItem(itemId);
let item = this.actor.items.get(itemId);
if (!item) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 9")
}
item.update({ ["data.quantity.value"]: item.data.data.quantity.value + 1 });
@ -967,10 +972,10 @@ export class ActorSheetKH extends ActorSheet {
const li = $(event.currentTarget).parents(".item");
let itemId = li.data("itemId");
let item = this.actor.getOwnedItem(itemId);
let item = this.actor.items.get(itemId);
if (!item) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 10")
}
let count = item.data.data.quantity.value - 1 > 0 ? item.data.data.quantity.value - 1 : 0;
@ -982,14 +987,14 @@ export class ActorSheetKH extends ActorSheet {
event.preventDefault();
const itemId = $(event.currentTarget).data("item-id");
let _item = this.actor.items.find((element) => element._id == itemId);
let _item = this.actor.items.find((element) => element.id == itemId);
if (_item) {
let update = {
_id: _item._id,
_id: _item.id,
data: { value: $(event.currentTarget).val() },
};
await this.actor.updateEmbeddedEntity("OwnedItem", update);
await this.actor.updateEmbeddedEntity("Item", [update]);
}
}
@ -997,20 +1002,23 @@ export class ActorSheetKH extends ActorSheet {
event.preventDefault();
const itemId = $(event.currentTarget).data("item-id");
let _item = this.actor.items.find((element) => element._id == itemId);
let _item = this.actor.items.find((element) => element.id == itemId);
console.log(_item)
console.log(itemId)
if (_item) {
let newVal = true;
if(_item.data.data.used !== undefined) {
newVal = !_item.data.data.used;
if(_item.data.used !== undefined) {
newVal = !_item.data.used;
}
let update = {
_id: _item._id,
_id: _item.id,
data: { used: newVal },
};
await this.actor.updateEmbeddedEntity("OwnedItem", update);
await this.actor.updateEmbeddedEntity("Item", [update]);
}
}
@ -1026,14 +1034,14 @@ export class ActorSheetKH extends ActorSheet {
* @private
*/
async _itemDetailsToChat(itemId) {
let item = this.actor.getOwnedItem(itemId);
let item = this.actor.items.get(itemId);
if (!item) {
item = game.items.get(itemId);
}
if (!item) {
console.log("IMPORT ERROR")
console.log("IMPORT ERROR 11")
return
}
@ -1041,11 +1049,11 @@ export class ActorSheetKH extends ActorSheet {
const html = await renderTemplate("systems/kopparhavet/templates/chat/item-card.html", itemDetails);
const messageData = {
user: game.user._id,
user: game.user.id,
type: CONST.CHAT_MESSAGE_TYPES.OTHER,
content: html,
speaker: {
actor: this.actor._id,
actor: this.actor.id,
token: this.actor.token,
alias: this.actor.name,
},

View File

@ -23,9 +23,9 @@ export default class KHDiceRoller {
await roll.toMessage({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},
@ -50,9 +50,9 @@ export default class KHDiceRoller {
await roll.toMessage({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},
@ -81,9 +81,9 @@ export default class KHDiceRoller {
await roll.toMessage({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},
@ -160,9 +160,9 @@ export default class KHDiceRoller {
await roll.toMessage({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},
@ -354,9 +354,9 @@ export default class KHDiceRoller {
await roll.toMessage({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},
@ -427,9 +427,9 @@ export default class KHDiceRoller {
await ChatMessage.create({
create: true,
content: html,
user: game.user._id,
user: game.user.id,
speaker: {
actor: speaker._id,
actor: speaker.id,
token: speaker.token,
alias: speaker.name,
},

View File

@ -39,23 +39,24 @@ export class ItemSheetKH extends ItemSheet {
let skillList2
if(game.settings.get("kopparhavet", "gameSystem") === "hjaltarnas-tid") {
skillList2 = await game.packs.get("kopparhavet.skills-ht").getContent();
skillList2 = await game.packs.get("kopparhavet.skills-ht").getDocuments();
} else {
skillList2 = await game.packs.get("kopparhavet.skills").getContent();
skillList2 = await game.packs.get("kopparhavet.skills").getDocuments();
}
for (let item of skillList2) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
skillList.push(item.data)
}
}
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
skillList.push(item.data)
}
}
this.position.width = 530;
this.position.height = 750;
break;
@ -77,23 +78,24 @@ export class ItemSheetKH extends ItemSheet {
let skillList3
if(game.settings.get("kopparhavet", "gameSystem") === "hjaltarnas-tid") {
skillList3 = await game.packs.get("kopparhavet.skills-ht").getContent();
skillList3 = await game.packs.get("kopparhavet.skills-ht").getDocuments();
} else {
skillList3 = await game.packs.get("kopparhavet.skills").getContent();
skillList3 = await game.packs.get("kopparhavet.skills").getDocuments();
}
for (let item of skillList3) {
if(item.data.type === "skill") {
skillList.push(item)
skillList.push(item.data)
}
}
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.type === "skill") {
skillList.push(item)
if(item.data.data.type === "skill") {
skillList.push(item.data)
}
}
this.position.width = 450;
this.position.height = 605;
break;
@ -102,21 +104,21 @@ export class ItemSheetKH extends ItemSheet {
let skillList4
if(game.settings.get("kopparhavet", "gameSystem") === "hjaltarnas-tid") {
skillList4 = await game.packs.get("kopparhavet.skills-ht").getContent();
skillList4 = await game.packs.get("kopparhavet.skills-ht").getDocuments();
} else {
skillList4 = await game.packs.get("kopparhavet.skills").getContent();
skillList4 = await game.packs.get("kopparhavet.skills").getDocuments();
}
for (let item of skillList4) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
skillList.push(item.data)
}
}
// Retrieve any created skills as well
for (let item of game.items.entities) {
if(item.data.type === "skill" && item.data.data.type.value === "combat") {
skillList.push(item)
skillList.push(item.data)
}
}
this.position.width = 530;

View File

@ -27,7 +27,7 @@ export class ItemKH extends Item {
const html = await renderTemplate("systems/kopparhavet/templates/chat/item-card.html", itemData);
const chatData = {
user: game.user._id,
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
content: html,
};

View File

@ -57,7 +57,7 @@ class KHDice {
const html2 = await renderTemplate("systems/kopparhavet/templates/dice/roll.html", rollData);
await r.toMessage({
user: game.user._id,
user: game.user.id,
create: true,
content: html2
});

View File

@ -10,10 +10,10 @@ export default class KHHooks {
actor.update({ "data.currency.shekel.label": "CURRENCY.SILVER" });
actorbaseSkills = CONFIG.KH.baseSkillsHT
skillIndex = await game.packs.get("kopparhavet.skills-ht").getContent();
skillIndex = await game.packs.get("kopparhavet.skills-ht").getDocuments();
} else {
actorbaseSkills = CONFIG.KH.baseSkills;
skillIndex = await game.packs.get("kopparhavet.skills").getContent();
skillIndex = await game.packs.get("kopparhavet.skills").getDocuments();
}
// Check if skill already exists by some chance
@ -23,7 +23,15 @@ export default class KHHooks {
// Filter skillIndex array to include only skills for Actor Type.
let _skillsList = skillIndex.filter((i) => skillsToAdd.includes(i.data.name));
await actor.createEmbeddedEntity("OwnedItem", _skillsList);
let _sl = [];
_skillsList.forEach((s) => {
//s.data._source.data["creatureType"] = actor.data.type;
//s.data._source.data["coreSkill"] = true;
_sl.push(s.data);
});
await actor.createEmbeddedDocuments("Item", _sl);
//await actor.createEmbeddedDocuments("Item", [_skillsList.toObject()]);
} else {
setTimeout(async function () {
await actor.sheet.render(true);

View File

@ -9,8 +9,8 @@ import * as migrations from "./helpers/migration-helper.js";
Hooks.once("init", () => {
CONFIG.Combat.initiative = { formula: "(@combat.init)d6kh2", decimals: 0 };
CONFIG.Actor.entityClass = ActorKH;
CONFIG.Item.entityClass = ItemKH;
CONFIG.Actor.documentClass = ActorKH;
CONFIG.Item.documentClass = ItemKH;
// Give global access to FFG config.
CONFIG.KH = KH;

View File

@ -2,9 +2,9 @@
"name": "kopparhavet",
"title": "Kopparhavets Hjältar",
"description": "The Molten Sea is a dangerous but exciting place, where pirates, sorcerers and secretive orders of knighthood struggle for power, wealth and ancient lore.",
"version": "0.0.6",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",
"version": "0.0.7",
"minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "0.8.8",
"templateVersion": 4,
"author": "Erebus",
"scripts": [],

View File

@ -8,25 +8,25 @@
<label style="margin: auto;">{{localize "BIO.NAME"}}:</label>
<h1 class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "BIO.NAME"}}" /></h1>
<label style="margin: auto;">{{localize data.health.label}}:</label>
<label style="margin: auto;">{{localize data.data.health.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.health.value" value="{{data.health.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.value" value="{{data.data.health.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.health.max" value="{{data.health.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.max" value="{{data.data.health.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.stamina.label}}:</label>
<label style="margin: auto;">{{localize data.data.stamina.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.stamina.value" value="{{data.stamina.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.value" value="{{data.data.stamina.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.stamina.max" value="{{data.stamina.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.max" value="{{data.data.stamina.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.mana.label}}:</label>
<label style="margin: auto;">{{localize data.data.mana.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.mana.value" value="{{data.mana.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.value" value="{{data.data.mana.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.mana.max" value="{{data.mana.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.max" value="{{data.data.mana.max}}" data-dtype="Number" />
</div>
</div>
@ -44,7 +44,7 @@
{{> systems/kopparhavet/templates/parts/actor/talent.html}}
</div>
<div class="tab border note" data-group="primary" data-tab="note" style="height: 100%; border-top: none;">
{{editor content=data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
{{editor content=data.data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -8,31 +8,31 @@
<label style="margin: auto;">{{localize "BIO.NAME"}}:</label>
<h1 class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "BIO.NAME"}}" /></h1>
<label style="margin: auto;">{{localize data.bio.kin.label}}:</label>
<input name="data.bio.kin.value" type="text" value="{{data.bio.kin.value}}" placeholder="{{localize data.bio.kin.label}}" />
<label style="margin: auto;">{{localize data.data.bio.kin.label}}:</label>
<input name="data.bio.kin.value" type="text" value="{{data.data.bio.kin.value}}" placeholder="{{localize data.data.bio.kin.label}}" />
<label style="margin: auto;">{{localize data.bio.profession.label}}:</label>
<input name="data.bio.profession.value" type="text" value="{{data.bio.profession.value}}" placeholder="{{localize data.bio.profession.label}}" />
<label style="margin: auto;">{{localize data.data.bio.profession.label}}:</label>
<input name="data.bio.profession.value" type="text" value="{{data.data.bio.profession.value}}" placeholder="{{localize data.data.bio.profession.label}}" />
<label style="margin: auto;">{{localize data.health.label}}:</label>
<label style="margin: auto;">{{localize data.data.health.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.health.value" value="{{data.health.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.value" value="{{data.data.health.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.health.max" value="{{data.health.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.max" value="{{data.data.health.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.stamina.label}}:</label>
<label style="margin: auto;">{{localize data.data.stamina.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.stamina.value" value="{{data.stamina.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.value" value="{{data.data.stamina.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.stamina.max" value="{{data.stamina.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.max" value="{{data.data.stamina.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.mana.label}}:</label>
<label style="margin: auto;">{{localize data.data.mana.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.mana.value" value="{{data.mana.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.value" value="{{data.data.mana.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.mana.max" value="{{data.mana.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.max" value="{{data.data.mana.max}}" data-dtype="Number" />
</div>
</div>
@ -62,7 +62,7 @@
{{> systems/kopparhavet/templates/parts/actor/bio.html}}
</div>
<div class="tab note border" data-group="primary" data-tab="note" style="border-top: none;">
{{editor content=data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
{{editor content=data.data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -8,25 +8,25 @@
<label style="margin: auto;">{{localize "BIO.NAME"}}:</label>
<h1 class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "BIO.NAME"}}" /></h1>
<label style="margin: auto;">{{localize data.health.label}}:</label>
<label style="margin: auto;">{{localize data.data.health.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.health.value" value="{{data.health.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.value" value="{{data.data.health.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.health.max" value="{{data.health.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.max" value="{{data.data.health.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.stamina.label}}:</label>
<label style="margin: auto;">{{localize data.data.stamina.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.stamina.value" value="{{data.stamina.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.value" value="{{data.data.stamina.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.stamina.max" value="{{data.stamina.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.max" value="{{data.data.stamina.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.mana.label}}:</label>
<label style="margin: auto;">{{localize data.data.mana.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.mana.value" value="{{data.mana.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.value" value="{{data.data.mana.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.mana.max" value="{{data.mana.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.max" value="{{data.data.mana.max}}" data-dtype="Number" />
</div>
</div>
@ -44,7 +44,7 @@
{{> systems/kopparhavet/templates/parts/actor/talent.html}}
</div>
<div class="tab border note" data-group="primary" data-tab="note" style="height: 100%; border-top: none;">
{{editor content=data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
{{editor content=data.data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -8,34 +8,34 @@
<label style="margin: auto;">{{localize "BIO.NAME"}}:</label>
<h1 class="charname" style="margin-bottom: 0; grid-column: 3/6;"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "BIO.NAME"}}" /></h1>
<label style="margin: auto;">{{localize data.bio.nickname.label}}:</label>
<input name="data.bio.nickname.value" style="grid-column: 3/6;" type="text" value="{{data.bio.nickname.value}}" placeholder="{{localize data.bio.nickname.label}}" />
<label style="margin: auto;">{{localize data.data.bio.nickname.label}}:</label>
<input name="data.bio.nickname.value" style="grid-column: 3/6;" type="text" value="{{data.data.bio.nickname.value}}" placeholder="{{localize data.data.bio.nickname.label}}" />
<label style="margin: auto;">{{localize data.bio.kin.label}}:</label>
<input name="data.bio.kin.value" type="text" value="{{data.bio.kin.value}}" placeholder="{{localize data.bio.kin.label}}" />
<label style="margin: auto;">{{localize data.data.bio.kin.label}}:</label>
<input name="data.bio.kin.value" type="text" value="{{data.data.bio.kin.value}}" placeholder="{{localize data.data.bio.kin.label}}" />
<label style="margin: auto;">{{localize data.bio.profession.label}}:</label>
<input name="data.bio.profession.value" type="text" value="{{data.bio.profession.value}}" placeholder="{{localize data.bio.profession.label}}" />
<label style="margin: auto;">{{localize data.data.bio.profession.label}}:</label>
<input name="data.bio.profession.value" type="text" value="{{data.data.bio.profession.value}}" placeholder="{{localize data.data.bio.profession.label}}" />
<label style="margin: auto;">{{localize data.health.label}}:</label>
<label style="margin: auto;">{{localize data.data.health.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.health.value" value="{{data.health.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.value" value="{{data.data.health.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.health.max" value="{{data.health.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.health.max" value="{{data.data.health.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.stamina.label}}:</label>
<label style="margin: auto;">{{localize data.data.stamina.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.stamina.value" value="{{data.stamina.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.value" value="{{data.data.stamina.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.stamina.max" value="{{data.stamina.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.stamina.max" value="{{data.data.stamina.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.mana.label}}:</label>
<label style="margin: auto;">{{localize data.data.mana.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.mana.value" value="{{data.mana.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.value" value="{{data.data.mana.value}}" data-dtype="Number" />
<span> / </span>
<input class="center-text" type="text" name="data.mana.max" value="{{data.mana.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.mana.max" value="{{data.data.mana.max}}" data-dtype="Number" />
</div>
</div>
@ -61,7 +61,7 @@
{{> systems/kopparhavet/templates/parts/actor/gear.html}}
</div>
<div class="tab note border" data-group="primary" data-tab="note" style="border-top: none;">
{{editor content=data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
{{editor content=data.data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -8,27 +8,27 @@
<label style="margin-top: auto; margin-bottom: auto;">{{localize "BIO.NAME"}}:</label>
<h1 class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "BIO.NAME"}}" /></h1>
<label style="margin-top: auto; margin-bottom: auto;">{{localize data.class.label}}:</label>
<span class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="data.class.value" type="text" value="{{data.class.value}}" placeholder="{{localize data.class.label}}" /></span>
<label style="margin-top: auto; margin-bottom: auto;">{{localize data.data.class.label}}:</label>
<span class="charname" style="margin-bottom: 0;grid-column: 3/6;"><input name="data.class.value" type="text" value="{{data.data.class.value}}" placeholder="{{localize data.data.class.label}}" /></span>
<label style="margin: auto;">{{localize data.operationscost.label}}:</label>
<input class="center-text" type="text" name="data.operationscost.value" value="{{data.operationscost.value}}" data-dtype="Number" />
<label style="margin: auto;">{{localize data.data.operationscost.label}}:</label>
<input class="center-text" type="text" name="data.operationscost.value" value="{{data.data.operationscost.value}}" data-dtype="Number" />
<label style="margin: auto;">{{localize data.operationssupply.label}}:</label>
<input class="center-text" type="text" name="data.operationssupply.value" value="{{data.operationssupply.value}}" data-dtype="Number" />
<label style="margin: auto;">{{localize data.data.operationssupply.label}}:</label>
<input class="center-text" type="text" name="data.operationssupply.value" value="{{data.data.operationssupply.value}}" data-dtype="Number" />
<label style="margin: auto;">{{localize data.hull.label}}:</label>
<label style="margin: auto;">{{localize data.data.hull.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.hull.value" value="{{data.hull.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.hull.value" value="{{data.data.hull.value}}" data-dtype="Number" />
<span style="margin-bottom: auto; margin-top: auto;"> / </span>
<input class="center-text" type="text" name="data.hull.max" value="{{data.hull.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.hull.max" value="{{data.data.hull.max}}" data-dtype="Number" />
</div>
<label style="margin: auto;">{{localize data.cargo.label}}:</label>
<label style="margin: auto;">{{localize data.data.cargo.label}}:</label>
<div class="grid-container" style="grid-template-columns: auto 1fr auto;">
<input class="center-text" type="text" name="data.cargo.value" value="{{data.cargo.value}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.cargo.value" value="{{data.data.cargo.value}}" data-dtype="Number" />
<span style="margin-bottom: auto; margin-top: auto;"> / </span>
<input class="center-text" type="text" name="data.cargo.max" value="{{data.cargo.max}}" data-dtype="Number" />
<input class="center-text" type="text" name="data.cargo.max" value="{{data.data.cargo.max}}" data-dtype="Number" />
</div>
</div>
@ -46,7 +46,7 @@
{{> systems/kopparhavet/templates/parts/actor/ship-combat.html}}
</div>
<div class="tab border note" data-group="primary" data-tab="note" style="height: 100%; border-top: none;">
{{editor content=data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
{{editor content=data.data.bio.note.value target="data.bio.note.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -100,5 +100,19 @@
{{{data.description.value}}}
{{/if}}
{{/if}}
{{#if isShipWeapon}}
{{#if data.description}}
<h5>{{localize data.description.label}}</h5>
{{{data.description.value}}}
{{/if}}
{{/if}}
{{#if isShipTalent}}
{{#if data.description}}
<h5>{{localize data.description.label}}</h5>
{{{data.description.value}}}
{{/if}}
{{/if}}
</div>
</div>

View File

@ -9,17 +9,17 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<div class="rating">
<label>{{localize data.damage.label}}</label>
<input name="data.damage.value" type="text" value="{{data.damage.value}}" />
<label>{{localize data.data.damage.label}}</label>
<input name="data.damage.value" type="text" value="{{data.data.damage.value}}" />
</div>
<div class="rating">
<label>{{localize data.skill.label}}</label>
<input name="data.skill.value" type="text" value="{{data.skill.value}}" />
<label>{{localize data.data.skill.label}}</label>
<input name="data.skill.value" type="text" value="{{data.data.skill.value}}" />
</div>
<div>
<label>{{localize data.category.label}}</label>
<label>{{localize data.data.category.label}}</label>
<select class="item-weapon-cat-select" name="data.category.value">
{{#select data.category.value}}
{{#select data.data.category.value}}
<option value="melee">{{localize "WEAPON.MELEE"}}</option>
<option value="ranged">{{localize "WEAPON.RANGED"}}</option>
{{/select}}
@ -28,10 +28,10 @@
</div>
<div class="item">
<div class="description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -10,22 +10,22 @@
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<!--
<div class="supply">
<label>{{localize data.quantity.label}}</label>
<input name="data.quantity.value" type="number" value="{{data.quantity.value}}" />
<label>{{localize data.data.quantity.label}}</label>
<input name="data.quantity.value" type="number" value="{{data.data.quantity.value}}" />
</div>
-->
<div class="cost">
<label>{{localize data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.price.value}}" />
<label>{{localize data.data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.data.price.value}}" />
</div>
<div class="rating">
<label>{{localize data.defence.label}}</label>
<input name="data.defence.value" type="text" value="{{data.defence.value}}" />
<label>{{localize data.data.defence.label}}</label>
<input name="data.defence.value" type="text" value="{{data.data.defence.value}}" />
</div>
<div>
<label>{{localize data.type.label}}</label>
<label>{{localize data.data.type.label}}</label>
<select class="item-weapon-cat-select" name="data.type.value">
{{#select data.type.value}}
{{#select data.data.type.value}}
{{#each this.KH.armor_types as |t|}}
<option value="{{t.value}}">{{localize t.label}}</option>
{{/each}}
@ -34,14 +34,14 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr auto;">
<!--
<label>{{localize data.equipable.label}}</label>
<a class="item-bool-click {{#if data.equipable.value}}active{{/if}}" data-name="equipable" title="equipable">
<i class="far {{#if data.equipable.value}}fa-times-circle{{else}}fa-circle{{/if}}"></i>
<label>{{localize data.data.equipable.label}}</label>
<a class="item-bool-click {{#if data.data.equipable.value}}active{{/if}}" data-name="equipable" title="equipable">
<i class="far {{#if data.data.equipable.value}}fa-times-circle{{else}}fa-circle{{/if}}"></i>
</a>
-->
<label>{{localize data.helmet.label}}</label>
<a class="item-bool-click {{#if data.helmet.value}}active{{/if}}" data-name="helmet" title="helmet">
<i class="far {{#if data.helmet.value}}fa-times-circle{{else}}fa-circle{{/if}}"></i>
<label>{{localize data.data.helmet.label}}</label>
<a class="item-bool-click {{#if data.data.helmet.value}}active{{/if}}" data-name="helmet" title="helmet">
<i class="far {{#if data.data.helmet.value}}fa-times-circle{{else}}fa-circle{{/if}}"></i>
</a>
</div>
</div>
@ -55,10 +55,10 @@
<div class="tab scroll-y" data-group="primary" data-tab="description">
<div class="item">
<div class="description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -8,21 +8,21 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<div class="supply">
<label>{{localize data.quantity.label}}</label>
<input name="data.quantity.value" type="number" value="{{data.quantity.value}}" />
<label>{{localize data.data.quantity.label}}</label>
<input name="data.quantity.value" type="number" value="{{data.data.quantity.value}}" />
</div>
<div class="cost">
<label>{{localize data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.price.value}}" />
<label>{{localize data.data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.data.price.value}}" />
</div>
</div>
</div>
<div class="item">
<div class="description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info-mid">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -9,10 +9,10 @@
</div>
<div class="item">
<div class="talent-description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info-mid">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -9,17 +9,17 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<div class="cost">
<label>{{localize data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.price.value}}" />
<label>{{localize data.data.price.label}}</label>
<input name="data.price.value" type="text" value="{{data.data.price.value}}" />
</div>
<div class="rating">
<label>{{localize data.damage.label}}</label>
<input name="data.damage.value" type="text" value="{{data.damage.value}}" />
<label>{{localize data.data.damage.label}}</label>
<input name="data.damage.value" type="text" value="{{data.data.damage.value}}" />
</div>
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.skill.value">
{{#select data.skill.value}}
{{#select data.data.skill.value}}
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
{{/each}}
@ -29,10 +29,10 @@
</div>
<div class="item">
<div class="description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -9,9 +9,9 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<div>
<label>{{localize data.type.label}}</label>
<label>{{localize data.data.type.label}}</label>
<select class="item-weapon-cat-select" name="data.type.value">
{{#select data.type.value}}
{{#select data.data.type.value}}
<option value="base">{{localize "SKILL.BASE"}}</option>
<option value="adventure">{{localize "SKILL.ADVENTURE"}}</option>
<option value="combat">{{localize "SKILL.COMBAT"}}</option>
@ -20,15 +20,15 @@
</div>
<div>
<label>{{localize "SKILL.STARTVALUE"}}</label>
<input name="data.value" type="text" value="{{data.value}}" />
<input name="data.value" type="text" value="{{data.data.value}}" />
</div>
</div>
<div class="item">
<div class="description">
<h2>{{localize data.description.label}}</h2>
<h2>{{localize data.data.description.label}}</h2>
<div class="info-mid">
<div class="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
{{editor content=data.data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -9,13 +9,13 @@
</div>
<div class="grid-container" style="grid-template-columns: 1fr 1fr;">
<div class="cost">
<label>{{localize data.cost.label}}</label>
<input name="data.cost.value" type="text" value="{{data.cost.value}}" />
<label>{{localize data.data.cost.label}}</label>
<input name="data.cost.value" type="text" value="{{data.data.cost.value}}" />
</div>
<div>
<label>{{localize data.difficulty.label}}</label>
<select class="item-weapon-cat-select" name="data.difficulty.value">
{{#select data.difficulty.value}}
<label>{{localize data.data.difficulty.label}}</label>
<select class="item-weapon-cat-select" name="data.data.difficulty.value">
{{#select data.data.difficulty.value}}
<option value="simple">{{localize "DIFFICULTY.SIMPLE"}}</option>
<option value="easy">{{localize "DIFFICULTY.EASY"}}</option>
<option value="average">{{localize "DIFFICULTY.AVERAGE"}}</option>
@ -25,9 +25,9 @@
</select>
</div>
<div style="grid-column-start: 1; grid-column-end: 3;">
<label>{{localize data.roll.label}}</label>
<label>{{localize data.data.roll.label}}</label>
<select class="item-weapon-cat-select" name="data.roll.value">
{{#select data.roll.value}}
{{#select data.data.roll.value}}
<option value="roll">{{localize "SPELL.ROLL"}}</option>
<option value="attackroll">{{localize "SPELL.ATTACKROLL"}}</option>
<option value="opposite">{{localize "SPELL.OPPOSITE"}}</option>
@ -35,11 +35,11 @@
{{/select}}
</select>
</div>
{{#iff data.roll.value '==' "opposite" }}
{{#iff data.data.roll.value '==' "opposite" }}
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.skill">
{{#select data.roll.skill}}
{{#select data.data.roll.skill}}
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
{{/each}}
@ -49,7 +49,7 @@
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.oppositeskill">
{{#select data.roll.oppositeskill}}
{{#select data.data.roll.oppositeskill}}
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
{{/each}}
@ -60,7 +60,7 @@
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.oppositeskilltwo">
{{#select data.roll.oppositeskilltwo}}
{{#select data.data.roll.oppositeskilltwo}}
<option value="">{{localize "SKILL.NONE"}}</option>
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
@ -68,11 +68,11 @@
{{/select}}
</select>
</div>
{{else iff data.roll.value '==' "ritual" }}
{{else iff data.data.roll.value '==' "ritual" }}
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.ritual.skillone">
{{#select data.roll.ritual.skillone}}
{{#select data.data.roll.ritual.skillone}}
<option value="">{{localize "SKILL.NONE"}}</option>
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
@ -83,7 +83,7 @@
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.ritual.skilltwo">
{{#select data.roll.ritual.skilltwo}}
{{#select data.data.roll.ritual.skilltwo}}
<option value="">{{localize "SKILL.NONE"}}</option>
{{#each this.khskills as |t|}}
<option value="{{t.name}}">{{t.name}}</option>
@ -94,7 +94,7 @@
<div>
<label>{{localize "ITEM.SKILL"}}</label>
<select class="item-weapon-skill-select" name="data.roll.ritual.skillthree">
{{#select data.roll.ritual.skillthree}}
{{#select data.data.roll.ritual.skillthree}}
<option value="">{{localize "SKILL.NONE"}}</option>
{{#each this.khskills as |t|}}
<option value=