Fix stuff

This commit is contained in:
sladecraven 2021-05-29 23:20:50 +02:00
parent 2f5722e0df
commit c4b8f30188
15 changed files with 109 additions and 96 deletions

View File

@ -0,0 +1,3 @@
{
}

View File

@ -7,7 +7,7 @@ export class frostgraveActorSheet extends ActorSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["frostgrave", "sheet", "actor"],
template: "systems/frostgrave/templates/actor/actor-sheet.html",
template: "systems/foundryvtt-frostgrave/templates/actor/actor-sheet.html",
width: 650,
height: 650,
tabs: [{
@ -23,17 +23,23 @@ export class frostgraveActorSheet extends ActorSheet {
/** @override */
getData() {
const data = super.getData();
data.dtypes = ["String", "Number", "Boolean"];
let formData = {
data: data.data,
actor: this.actor,
dtypes: ["String", "Number", "Boolean"]
}
//for (let attr of Object.values(data.data.attributes)) {
// attr.isCheckbox = attr.dtype === "Boolean";
// }
// Prepare items.
if (this.actor.data.type == "character") {
this._prepareCharacterItems(data);
this._prepareCharacterItems(formData);
}
return data;
console.log("FORMDATA", formData);
return formData;
}
/** @override */
@ -203,9 +209,9 @@ export class frostgraveActorSheet extends ActorSheet {
// Iterate through items, allocating to containers
// let totalWeight = 0;
for (let i of sheetData.items) {
for (let i of actorData.data.items) {
let item = i.data;
i.img = i.img || DEFAULT_TOKEN;
//i.img = i.img || DEFAULT_TOKEN;
// Append to gear.
if (i.type === "item") {
gear.push(i);
@ -221,8 +227,8 @@ export class frostgraveActorSheet extends ActorSheet {
}
// Assign and return
actorData.gear = gear;
actorData.features = features;
actorData.spells = spells;
sheetData.gear = gear;
sheetData.features = features;
sheetData.spells = spells;
}
}

View File

@ -21,16 +21,16 @@ Hooks.once("init", async function () {
};
// Define custom Entity classes
CONFIG.Actor.entityClass = frostgraveActor;
CONFIG.Item.entityClass = frostgraveItem;
CONFIG.Actor.documentClas = frostgraveActor;
CONFIG.Item.documentClas = frostgraveItem;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("frostgrave", frostgraveActorSheet, {
Actors.registerSheet("foundryvtt-frostgrave", frostgraveActorSheet, {
makeDefault: true,
});
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("frostgrave", frostgraveItemSheet, {
Items.registerSheet("foundryvtt-frostgrave", frostgraveItemSheet, {
types: ["item", "feature", "spell"],
makeDefault: true,
});

View File

@ -99,7 +99,7 @@ function (_ItemSheet) {
/** @override */
get: function get() {
return mergeObject(_get(_getPrototypeOf(frostgraveItemSheet), "defaultOptions", this), {
classes: ["frostgrave", "sheet", "item"],
classes: ["foundryvtt-frostgrave", "sheet", "item"],
width: 450,
height: 500,
tabs: [{

View File

@ -6,7 +6,7 @@ export class frostgraveItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["frostgrave", "sheet", "item"],
classes: ["foundryvtt-frostgrave", "sheet", "item"],
width: 450,
height: 500,
tabs: [{
@ -19,7 +19,7 @@ export class frostgraveItemSheet extends ItemSheet {
/** @override */
get template() {
const path = "systems/frostgrave/templates/item";
const path = "systems/foundryvtt-frostgrave/templates/item";
// Return a single sheet for all item types.
// return `${path}/item-sheet.html`;
@ -33,7 +33,11 @@ export class frostgraveItemSheet extends ItemSheet {
/** @override */
getData() {
const data = super.getData();
return data;
let formData = duplicate(data.data)
console.log("ITEM", formData);
return formData;
}
/* -------------------------------------------- */

View File

@ -9,14 +9,14 @@ export const preloadHandlebarsTemplates = async function() {
const templatePaths = [
// Actor Sheet Partials
"systems/frostgrave/templates/actor/partials/actor-header.html",
"systems/frostgrave/templates/actor/partials/actor-stats.html",
"systems/frostgrave/templates/actor/partials/actor-tab-navigation.html",
"systems/frostgrave/templates/actor/partials/actor-tab-notes.html",
"systems/frostgrave/templates/actor/partials/actor-tab-experience.html",
"systems/frostgrave/templates/actor/partials/actor-tab-homebase.html",
"systems/frostgrave/templates/actor/partials/actor-tab-items.html",
"systems/frostgrave/templates/actor/partials/actor-tab-spells.html"
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-header.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-stats.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-navigation.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-notes.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-experience.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-homebase.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-items.html",
"systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-spells.html"
// Item Sheet Partials

View File

@ -1,10 +1,10 @@
{
"name": "frostgrave",
"name": "foundryvtt-frostgrave",
"title": "Frostgrave",
"description": "The Frostgrave system for Foundry VTT",
"version": "1.0.0",
"minimumCoreVersion": "0.6.5",
"compatibleCoreVersion": "0.6.6",
"version": "2.0.0",
"minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "0.8.5",
"templateVersion": 2,
"author": "Phenomen",
"esmodules": [
@ -17,35 +17,35 @@
"packs": [{
"name": "spellcasters",
"label": "Spellcasters",
"system": "frostgrave",
"system": "foundryvtt-frostgrave",
"path": "./packs/spellcasters.db",
"entity": "Actor"
},
{
"name": "soldiers",
"label": "Soldiers",
"system": "frostgrave",
"system": "foundryvtt-frostgrave",
"path": "./packs/soldiers.db",
"entity": "Actor"
},
{
"name": "armour",
"label": "Armour",
"system": "frostgrave",
"system": "foundryvtt-frostgrave",
"path": "./packs/armour.db",
"entity": "Item"
},
{
"name": "weapons",
"label": "Weapons",
"system": "frostgrave",
"system": "foundryvtt-frostgrave",
"path": "./packs/weapons.db",
"entity": "Item"
},
{
"name": "potions",
"label": "Potions",
"system": "frostgrave",
"system": "foundryvtt-frostgrave",
"path": "./packs/potions.db",
"entity": "Item"
}
@ -58,8 +58,8 @@
"gridDistance": 5,
"gridUnits": "ft",
"primaryTokenAttribute": "health",
"url": "https://github.com/Phenomen/foundry-frostgrave",
"manifest": "https://raw.githubusercontent.com/Phenomen/foundry-frostgrave/master/system.json",
"download": "https://github.com/Phenomen/foundry-frostgrave/archive/master.zip",
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave",
"manifest": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave/-/raw/master/system.json",
"download": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave/archive/master.zip",
"license": "LICENSE.txt"
}

View File

@ -1,30 +1,30 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Actor Header --}}
{{> "systems/frostgrave/templates/actor/partials/actor-header.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-header.html"}}
{{!-- Actor Stats --}}
{{> "systems/frostgrave/templates/actor/partials/actor-stats.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-stats.html"}}
{{!-- Tab Navigation --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-navigation.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-navigation.html"}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Notes Tab --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-notes.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-notes.html"}}
{{!-- Experience Tab --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-experience.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-experience.html"}}
{{!-- Homebase Tab --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-homebase.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-homebase.html"}}
{{!-- Items Tab --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-items.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-items.html"}}
{{!-- Spells Tab --}}
{{> "systems/frostgrave/templates/actor/partials/actor-tab-spells.html"}}
{{> "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-spells.html"}}
</section>
</form>

View File

@ -16,7 +16,7 @@
<div class="column is-6">
<div class="select is-fullwidth">
<select name="data.category" data-dtype="String">
{{#select data.category}}
{{#select data.data.category}}
<option value="Wizard">Wizard</option>
<option value="Apprentice">Apprentice</option>
<option value="Soldier">Soldier</option>
@ -30,8 +30,8 @@
<div class="column is-6">
<div class="select is-fullwidth">
<select name="data.class" data-dtype="String">
{{#select data.class}}
{{#if (or (eq data.category "Wizard") (eq data.category "Apprentice"))}}
{{#select data.data.class}}
{{#if (or (eq data.data.category "Wizard") (eq data.data.category "Apprentice"))}}
<option value="Chronomancer">Chronomancer</option>
<option value="Elementalist">Elementalist</option>
<option value="Enchanter">Enchanter</option>
@ -43,15 +43,15 @@
<option value="Thaumaturge">Thaumaturge</option>
<option value="Witch">Witch</option>
{{/if}}
{{#if (eq data.category "Soldier")}}
{{#if (eq data.data.category "Soldier")}}
<option value="Standard">Standard</option>
<option value="Specialist">Specialist</option>
{{/if}}
{{#if (eq data.category "Creature")}}
{{#if (eq data.data.category "Creature")}}
<option value="Uncontrolled">Uncontrolled</option>
<option value="Controlled">Controlled</option>
{{/if}}
{{#if (eq data.category "Base")}}
{{#if (eq data.data.category "Base")}}
<option value="Inn">Inn</option>
<option value="Temple">Temple</option>
<option value="Crypt">Crypt</option>

View File

@ -10,7 +10,7 @@
<p class="control">
<span class="help">&nbsp;</span>
<button class="button is-danger is-outlined is-fullwidth rollable is-capitalized"
data-roll="d20+@data.health.value" data-label="{{data.health.rollname}}"> <span class="icon">
data-roll="d20+@data.health.value" data-label="{{data.data.health.rollname}}"> <span class="icon">
<i class="fas fa-dice-d20"></i>
</span>
<span>
@ -21,21 +21,21 @@
<div class="column">
<p class="control">
<span class="help">Actual</span>
<input class="input" type="text" name="data.health.actual" value="{{data.health.actual}}"
<input class="input" type="text" name="data.health.actual" value="{{data.data.health.actual}}"
data-dtype="Number">
</p>
</div>
<div class="column">
<span class="help">Effective</span>
<p class="control">
<input class="input" type="text" name="data.health.max" value="{{data.health.max}}"
<input class="input" type="text" name="data.health.max" value="{{data.data.health.max}}"
data-dtype="Number">
</p>
</div>
<div class="column">
<span class="help">Current</span>
<p class="control">
<input class="input is-danger" type="text" name="data.health.value" value="{{data.health.value}}"
<input class="input is-danger" type="text" name="data.health.value" value="{{data.data.health.value}}"
data-dtype="Number">
</p>
</div>
@ -44,7 +44,7 @@
</div>
{{#each data.stats as |stat key|}}
{{#each data.data.stats as |stat key|}}
<div class="column is-half py-1">
<div class="columns is-variable is-1">

View File

@ -4,24 +4,24 @@
<div class="column">
<label class="label">Level</label>
<input class="input" name="data.level" type="text" value="{{data.level}}" data-dtype="Number" />
<input class="input" name="data.level" type="text" value="{{data.data.level}}" data-dtype="Number" />
</div>
<div class="column">
<label class="label">Scenario Experience</label>
<input class="input" name="data.expscenario" type="text" value="{{data.expscenario}}" data-dtype="Number" />
<input class="input" name="data.expscenario" type="text" value="{{data.data.expscenario}}" data-dtype="Number" />
</div>
<div class="column">
<label class="label">Banked Experience</label>
<input class="input" name="data.expbanked" type="text" value="{{data.expbanked}}" data-dtype="Number" />
<input class="input" name="data.expbanked" type="text" value="{{data.data.expbanked}}" data-dtype="Number" />
</div>
</div>
<progress class="progress is-large is-info" value="{{data.exptotal}}" max="100"></progress>
<progress class="progress is-large is-info" value="{{data.data.exptotal}}" max="100"></progress>
<h2 class="mb-2">Leveling Log</h2>
{{editor content=data.levellog target="data.levellog" button=true owner=owner editable=editable}}
{{editor content=data.data.levellog target="data.levellog" button=true owner=owner editable=editable}}
</div>

View File

@ -1,6 +1,6 @@
<div class="tab gear container is-fluid" data-group="primary" data-tab="items">
{{#each actor.gear as |item id|}}
{{#each gear as |item id|}}
<div class="box item-card my-2 py-2" data-item-id="{{item._id}}">
<div class="media">
<div class="media-left">
@ -35,41 +35,41 @@
<div class="control">
<div class="tags has-addons">
<span class="tag is-dark">{{item.data.category}}</span>
<span class="tag is-dark">{{item.data.data.category}}</span>
{{#if (ne item.data.subcategory "None")}}
<span class="tag is-light">{{item.data.subcategory}}</span>
<span class="tag is-light">{{item.data.data.subcategory}}</span>
{{/if}}
</div>
</div>
{{#if (ne item.data.damage null)}}
{{#if (ne item.data.data.damage null)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-info">Damage</span>
<span class="tag is-info is-light">{{item.data.damage}}</span>
<span class="tag is-info is-light">{{item.data.data.damage}}</span>
</div>
</div>
{{/if}}
{{#if (ne item.data.range null)}}
{{#if (ne item.data.data.range null)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-info">Range</span>
<span class="tag is-info is-light">{{item.data.range}}</span>
<span class="tag is-info is-light">{{item.data.data.range}}</span>
</div>
</div>
{{/if}}
{{#if (ne item.data.armour null)}}
{{#if (ne item.data.data.armour null)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-info">Armour</span>
<span class="tag is-info is-light">{{item.data.armour}}</span>
<span class="tag is-info is-light">{{item.data.data.armour}}</span>
</div>
</div>
{{/if}}
{{#if (and (ne item.data.effect "") (ne item.data.effect null))}}
{{#if (and (ne item.data.data.effect "") (ne item.data.data.effect null))}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-primary">Effect</span>
@ -78,26 +78,26 @@
</div>
{{/if}}
{{#if (ne item.data.price null)}}
{{#if (ne item.data.data.price null)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-warning">Price</span>
<span class="tag is-warning is-light">{{item.data.price}}</span>
<span class="tag is-warning is-light">{{item.data.data.price}}</span>
</div>
</div>
{{/if}}
{{#if (ne item.data.sale null)}}
{{#if (ne item.data.data.sale null)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-warning">Sale</span>
<span class="tag is-warning is-light">{{item.data.sale}}</span>
<span class="tag is-warning is-light">{{item.data.data.sale}}</span>
</div>
</div>
{{/if}}
</div>
<div class="media-content">{{formatHTMLMessage item.data.description}}</div>
<div class="media-content">{{{item.data.data.description}}}</div>
</div>
</div>
</div>

View File

@ -2,15 +2,15 @@
<ul>
<li><a class="item" data-tab="items">{{#if (eq data.category "Base")}}Vault{{else}}Items{{/if}}</a></li>
{{#if (eq data.category "Base")}}
{{#if (eq data.data.category "Base")}}
<li><a class="item" data-tab="homebase">Homebase</a></li>
{{/if}}
{{#if (or (eq data.category "Wizard") (eq data.category "Apprentice"))}}
{{#if (or (eq data.data.category "Wizard") (eq data.category "Apprentice"))}}
<li><a class="item" data-tab="spells">Spells</a></li>
{{/if}}
{{#if (eq data.category "Wizard")}}
{{#if (eq data.data.category "Wizard")}}
<li><a class="item" data-tab="progression">Experience</a></li>
{{/if}}

View File

@ -10,7 +10,7 @@
</a>
</p>
<p class="control is-expanded">
<input class="input" type="text" name="data.empowerment" value="{{data.empowerment}}"
<input class="input" type="text" name="data.empowerment" value="{{data.data.empowerment}}"
data-dtype="Number">
</p>
</div>
@ -19,7 +19,7 @@
</div>
{{#each actor.spells as |item id|}}
{{#each spells as |item id|}}
<div class="box item-card my-2 py-2" data-item-id="{{item._id}}">
<div class="media">
<div class="media-left">
@ -55,39 +55,39 @@
<div class="control">
<div class="tags has-addons">
<span class="tag is-dark">{{item.data.school}}</span>
<span class="tag is-light">{{item.data.category}}</span>
<span class="tag is-dark">{{item.data.data.school}}</span>
<span class="tag is-light">{{item.data.data.category}}</span>
</div>
</div>
<div class="control">
<span class="tag is-primary is-light">{{item.data.alignment}}</span>
<span class="tag is-primary is-light">{{item.data.data.alignment}}</span>
</div>
<div class="control">
<div class="tags has-addons">
<span class="tag is-info">BCN</span>
<span class="tag is-info is-light">{{item.data.bcn}}</span>
<span class="tag is-info is-light">{{item.data.data.bcn}}</span>
</div>
</div>
{{#if (ne item.data.improved 0)}}
{{#if (ne item.data.data.improved 0)}}
<div class="control">
<div class="tags has-addons">
<span class="tag is-info">Improved</span>
<span class="tag is-info is-light">{{item.data.improved}}</span>
<span class="tag is-info is-light">{{item.data.data.improved}}</span>
</div>
</div>
{{/if}}
</div>
<div class="media-content">{{formatHTMLMessage item.data.description}}</div>
<div class="media-content">{{{item.data.data.description}}}</div>
<button class="button is-info is-outlined is-fullwidth rollable is-capitalized mt-2"
data-spell="1d20" data-label="{{name}}" data-bcn="{{item.data.bcn}}"
data-improved="{{item.data.improved}}" data-alignment="{{item.data.alignment}}"
data-empowerment="{{data.empowerment}}" data-description="{{item.data.description}}">
data-spell="1d20" data-label="{{name}}" data-bcn="{{item.data.data.bcn}}"
data-improved="{{item.data.improved}}" data-alignment="{{item.data.data.alignment}}"
data-empowerment="{{data.empowerment}}" data-description="{{item.data.data.description}}">
<span class="icon">
<i class="fas fa-dice-d20"></i>
</span>

View File

@ -4,13 +4,13 @@
<div class="column is-2">
<figure class="image is-square">
<img class="is-cover" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<img class="is-cover" src="{{img}}" data-edit="img" title="{{name}}" />
</figure>
</div>
<div class="column">
<input class="input is-info is-medium" name="name" type="text" value="{{item.name}}" placeholder="Name" />
<input class="input is-info is-medium" name="name" type="text" value="{{name}}" placeholder="Name" />
<div class="columns pt-2">
@ -167,7 +167,7 @@
</div>
</div>
{{#if (eq data.subcategory "Greater Potion")}}
{{#if (eq data.data.subcategory "Greater Potion")}}
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Ingredient Price</label>