Refactor and restructure
This commit is contained in:
parent
fee245cfcd
commit
928767e365
21 changed files with 319 additions and 456 deletions
|
@ -1,126 +0,0 @@
|
|||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
export class SimpleActorSheet extends ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["worldbuilding", "sheet", "actor"],
|
||||
template: "systems/worldbuilding/templates/actor-sheet.html",
|
||||
width: 600,
|
||||
height: 600,
|
||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
data.dtypes = ["String", "Number", "Boolean"];
|
||||
for ( let attr of Object.values(data.data.attributes) ) {
|
||||
attr.isCheckbox = attr.dtype === "Boolean";
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Activate tabs
|
||||
let tabs = html.find('.tabs');
|
||||
let initial = this._sheetTab;
|
||||
new Tabs(tabs, {
|
||||
initial: initial,
|
||||
callback: clicked => this._sheetTab = clicked.data("tab")
|
||||
});
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Add or Remove Attribute
|
||||
html.find(".attributes").on("click", ".attribute-control", this._onClickAttributeControl.bind(this));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Listen for click events on an attribute control to modify the composition of attributes in the sheet
|
||||
* @param {MouseEvent} event The originating left click event
|
||||
* @private
|
||||
*/
|
||||
async _onClickAttributeControl(event) {
|
||||
event.preventDefault();
|
||||
const a = event.currentTarget;
|
||||
const action = a.dataset.action;
|
||||
const attrs = this.object.data.data.attributes;
|
||||
const form = this.form;
|
||||
|
||||
// Add new attribute
|
||||
if ( action === "create" ) {
|
||||
const nk = Object.keys(attrs).length + 1;
|
||||
let newKey = document.createElement("div");
|
||||
newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="attr${nk}"/>`;
|
||||
newKey = newKey.children[0];
|
||||
form.appendChild(newKey);
|
||||
await this._onSubmit(event);
|
||||
}
|
||||
|
||||
// Remove existing attribute
|
||||
else if ( action === "delete" ) {
|
||||
const li = a.closest(".attribute");
|
||||
li.parentElement.removeChild(li);
|
||||
await this._onSubmit(event);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
|
||||
// Handle the free-form attributes list
|
||||
const formAttrs = expandObject(formData).data.attributes || {};
|
||||
const attributes = Object.values(formAttrs).reduce((obj, v) => {
|
||||
let k = v["key"].trim();
|
||||
if ( /[\s\.]/.test(k) ) return ui.notifications.error("Attribute keys may not contain spaces or periods");
|
||||
delete v["key"];
|
||||
obj[k] = v;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
// Remove attributes which are no longer used
|
||||
for ( let k of Object.keys(this.object.data.data.attributes) ) {
|
||||
if ( !attributes.hasOwnProperty(k) ) attributes[`-=${k}`] = null;
|
||||
}
|
||||
|
||||
// Re-combine formData
|
||||
formData = Object.entries(formData).filter(e => !e[0].startsWith("data.attributes")).reduce((obj, e) => {
|
||||
obj[e[0]] = e[1];
|
||||
return obj;
|
||||
}, {_id: this.object._id, "data.attributes": attributes});
|
||||
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
}
|
||||
}
|
|
@ -9,8 +9,8 @@ export class BladesActorSheet extends ActorSheet {
|
|||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["blades-in-the-dark", "sheet", "actor"],
|
||||
template: "systems/blades-in-the-dark/templates/actor-sheet.html",
|
||||
width: 1400,
|
||||
height: 1200
|
||||
width: 800,
|
||||
height: 1000
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -34,65 +34,30 @@ export class BladesActorSheet extends ActorSheet {
|
|||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Activate tabs
|
||||
let tabs = html.find('.tabs');
|
||||
let initial = this._sheetTab;
|
||||
new Tabs(tabs, {
|
||||
initial: initial,
|
||||
callback: clicked => this._sheetTab = clicked.data("tab")
|
||||
});
|
||||
// // Activate tabs
|
||||
// let tabs = html.find('.tabs');
|
||||
// let initial = this._sheetTab;
|
||||
// new Tabs(tabs, {
|
||||
// initial: initial,
|
||||
// callback: clicked => this._sheetTab = clicked.data("tab")
|
||||
// });
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
html.find('.item-body').click(ev => {
|
||||
const element = $(ev.currentTarget).parents(".item");
|
||||
const item = this.actor.getOwnedItem(element.data("itemId"));
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(li.data("itemId"));
|
||||
const element = $(ev.currentTarget).parents(".item");
|
||||
this.actor.deleteOwnedItem(element.data("itemId"));
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Add or Remove Attribute
|
||||
html.find(".attributes").on("click", ".attribute-control", this._onClickAttributeControl.bind(this));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Listen for click events on an attribute control to modify the composition of attributes in the sheet
|
||||
* @param {MouseEvent} event The originating left click event
|
||||
* @private
|
||||
*/
|
||||
async _onClickAttributeControl(event) {
|
||||
event.preventDefault();
|
||||
const a = event.currentTarget;
|
||||
const action = a.dataset.action;
|
||||
const attrs = this.object.data.data.attributes;
|
||||
const form = this.form;
|
||||
|
||||
// Add new attribute
|
||||
if ( action === "create" ) {
|
||||
const nk = Object.keys(attrs).length + 1;
|
||||
let newKey = document.createElement("div");
|
||||
newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="attr${nk}"/>`;
|
||||
newKey = newKey.children[0];
|
||||
form.appendChild(newKey);
|
||||
await this._onSubmit(event);
|
||||
}
|
||||
|
||||
// Remove existing attribute
|
||||
else if ( action === "delete" ) {
|
||||
const li = a.closest(".attribute");
|
||||
li.parentElement.removeChild(li);
|
||||
await this._onSubmit(event);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -190,4 +155,41 @@ export class BladesActorSheet extends ActorSheet {
|
|||
FD._dtypes = dtypes;
|
||||
return FD;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
async _onDrop (event) {
|
||||
|
||||
event.preventDefault();
|
||||
const actor = this.actor;
|
||||
|
||||
// Get dropped data
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(event.dataTransfer.getData('text/plain'));
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (data.type === "Item") {
|
||||
|
||||
// Class must be distinct.
|
||||
let item = game.items.get(data.id);
|
||||
if (item.data.type === "class") {
|
||||
actor.items.forEach(i => {
|
||||
if (i.data.type === "class") {
|
||||
actor.deleteOwnedItem(i.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Call parent on drop logic
|
||||
return super._onDrop(event);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// Import Modules
|
||||
import { preloadHandlebarsTemplates } from "./templates.js";
|
||||
// import { SimpleItemSheet } from "./item-sheet.js";
|
||||
import { BladesItemSheet } from "./item-sheet.js";
|
||||
import { BladesActorSheet } from "./actor-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -28,8 +28,8 @@ Hooks.once("init", async function() {
|
|||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet("bitd", BladesActorSheet, { makeDefault: true });
|
||||
// Items.unregisterSheet("core", ItemSheet);
|
||||
// Items.registerSheet("bitd", SimpleItemSheet, {makeDefault: true});
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("bitd", BladesItemSheet, {makeDefault: true});
|
||||
preloadHandlebarsTemplates();
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* Extend the basic ItemSheet
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class SimpleItemSheet extends ItemSheet {
|
||||
export class BladesItemSheet extends ItemSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["worldbuilding", "sheet", "item"],
|
||||
template: "systems/worldbuilding/templates/item-sheet.html",
|
||||
classes: ["blades-in-the-dark", "sheet", "item"],
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
|
@ -17,13 +16,17 @@ export class SimpleItemSheet extends ItemSheet {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
get template() {
|
||||
const path = "systems/blades-in-the-dark/templates/items/";
|
||||
return `${path}/${this.item.data.type}.html`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
data.dtypes = ["String", "Number", "Boolean"];
|
||||
for ( let attr of Object.values(data.data.attributes) ) {
|
||||
attr.isCheckbox = attr.dtype === "Boolean";
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -33,14 +36,6 @@ export class SimpleItemSheet extends ItemSheet {
|
|||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Activate tabs
|
||||
let tabs = html.find('.tabs');
|
||||
let initial = this._sheetTab;
|
||||
new Tabs(tabs, {
|
||||
initial: initial,
|
||||
callback: clicked => this._sheetTab = clicked.data("tab")
|
||||
});
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
|
|
|
@ -9,15 +9,7 @@ export const preloadHandlebarsTemplates = async function() {
|
|||
const templatePaths = [
|
||||
|
||||
// Actor Sheet Partials
|
||||
"systems/blades-in-the-dark/templates/parts/attributes.html",
|
||||
|
||||
"systems/blades-in-the-dark/templates/parts/cutter-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/hound-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/leech-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/lurk-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/slide-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/spider-class.html",
|
||||
"systems/blades-in-the-dark/templates/parts/whisper-class.html"
|
||||
"systems/blades-in-the-dark/templates/parts/attributes.html"
|
||||
];
|
||||
|
||||
// Load the template parts
|
||||
|
|
1
packs/items.db
Normal file
1
packs/items.db
Normal file
|
@ -0,0 +1 @@
|
|||
{"_id":"tXgoknEdkgZrDOiI","name":"Test item","permission":{"default":0},"type":"base","data":{},"folder":null,"sort":100001,"flags":{}}
|
117
scss/mixin.scss
117
scss/mixin.scss
|
@ -1,12 +1,29 @@
|
|||
/*
|
||||
* Custom single radio.
|
||||
*/
|
||||
@mixin custom_radio_with_bg($width, $height, $unchecked_background, $checked_background) {
|
||||
|
||||
display: none;
|
||||
|
||||
&:checked {
|
||||
|
||||
& ~ label {
|
||||
background-image: url($unchecked_background);
|
||||
}
|
||||
& + label {
|
||||
background-image: url($checked_background);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Toothradio
|
||||
*/
|
||||
@mixin toothradio($width, $height, $unchecked_background, $checked_background) {
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
|
||||
display: block;
|
||||
float: left;
|
||||
label {
|
||||
|
||||
& {
|
||||
height: $height;
|
||||
|
@ -19,31 +36,65 @@
|
|||
&:last-of-type {
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
&[for$="-0"] {
|
||||
height: auto !important;
|
||||
width: auto !important;
|
||||
background-image: none !important;
|
||||
background: black !important;
|
||||
margin-right: 0px !important;
|
||||
&[for$="-0"] {
|
||||
width: auto;
|
||||
height: auto;
|
||||
background-image: none !important;
|
||||
background: black !important;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide the browser's default checkbox */
|
||||
input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
height: 0;
|
||||
width: 0;
|
||||
@include custom_radio_with_bg($width, $height, $unchecked_background, $checked_background);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Custom Radio
|
||||
*/
|
||||
@mixin custom_radio($width, $height) {
|
||||
|
||||
display: flex;
|
||||
$default_color: white;
|
||||
$accent_color: black;
|
||||
$circle_border_color: black;
|
||||
|
||||
label {
|
||||
|
||||
& {
|
||||
height: $height;
|
||||
width: $width;
|
||||
background-color: $accent_color;
|
||||
|
||||
vertical-align: middle;
|
||||
border: 2px solid $circle_border_color;
|
||||
border-radius: 24px;
|
||||
|
||||
&[for$="-0"] {
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
border-radius: 24px;
|
||||
background-image: none !important;
|
||||
background-color: red !important;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide the browser's default checkbox */
|
||||
input {
|
||||
display: none;
|
||||
|
||||
&:checked {
|
||||
|
||||
|
||||
& ~ label {
|
||||
background-image: url($unchecked_background);
|
||||
background-color: $default_color;
|
||||
}
|
||||
& + label {
|
||||
background-image: url($checked_background);
|
||||
background-color: $accent_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,27 +104,22 @@
|
|||
* Checkboxes underscored.
|
||||
*/
|
||||
@mixin check_underscore() {
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
label {
|
||||
// width: $width;
|
||||
// height: $height;
|
||||
float: left;
|
||||
display: block;
|
||||
position: relative;
|
||||
padding-left: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 22px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
margin-right: 10px;
|
||||
|
||||
/* Hide the browser's default checkbox */
|
||||
input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
height: 0;
|
||||
width: 0;
|
||||
|
||||
display: none;
|
||||
|
||||
&:checked ~ .checkmark {
|
||||
color: red;
|
||||
|
@ -88,7 +134,6 @@
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create Clock
|
||||
*/
|
||||
|
@ -120,10 +165,7 @@
|
|||
|
||||
input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
height: 0;
|
||||
width: 0;
|
||||
display: none;
|
||||
|
||||
&:checked {
|
||||
& ~ label {
|
||||
|
@ -137,12 +179,15 @@
|
|||
|
||||
// Zero value to clear everything.
|
||||
input[value="0"] {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
z-index: 10;
|
||||
left: #{($size + 2 * $border_width)/2 - 9}px;
|
||||
top: #{($size + 2 * $border_width)/2 - 9}px;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
// left: #{($size + 2 * $border_width)/2 - 9}px;
|
||||
// top: #{($size + 2 * $border_width)/2 - 9}px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
|
111
scss/style.scss
111
scss/style.scss
|
@ -6,6 +6,32 @@
|
|||
* {
|
||||
font-family: Georgia, "Bitstream Charter", "Times New Roman", serif;
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.black-label {
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-size: 35px;
|
||||
text-align: center;
|
||||
padding: 0px 5px;
|
||||
height: 50px !important;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.label-stripe {
|
||||
text-transform: uppercase;
|
||||
background-color: #888;
|
||||
}
|
||||
|
||||
// Stress and Trauma
|
||||
|
||||
#stress-trauma {
|
||||
|
@ -22,13 +48,6 @@
|
|||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.stress-trauma-label {
|
||||
background-color: black;
|
||||
color: white;
|
||||
font-size: 35px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// Stress
|
||||
#character-stress {
|
||||
@include toothradio(32px, 100px, "assets/teeth/stresstooth-halfgrey.png", "assets/teeth/stresstooth-red.png");
|
||||
|
@ -39,45 +58,81 @@
|
|||
|
||||
#character-trauma {
|
||||
@include toothradio(32px, 100px, "assets/teeth/shorttooth-grey.png", "assets/teeth/shorttooth-red.png");
|
||||
}
|
||||
.stress-trauma-label {
|
||||
float: none !important;
|
||||
flex-direction: column;
|
||||
|
||||
#trauma-teeth {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#trauma-list {
|
||||
@include check_underscore();
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Harm
|
||||
#character-harm {
|
||||
#harm-armor {
|
||||
|
||||
display: flex;
|
||||
|
||||
float: left;
|
||||
width: 70%;
|
||||
|
||||
table {
|
||||
// Harm
|
||||
#character-harm {
|
||||
|
||||
width: 100%;
|
||||
|
||||
th {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
input {
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
|
||||
th {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clock
|
||||
#character-health-clock {
|
||||
@include clock(4, 100, white, red);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#character-armor-uses {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clock
|
||||
#character-healing {
|
||||
|
||||
float: left;
|
||||
#attributes {
|
||||
.attributes-exp {
|
||||
@include toothradio(17px, 50px, "assets/teeth/xptooth-white.png", "assets/teeth/xptooth-red.png");
|
||||
}
|
||||
.attributes-exp {
|
||||
border-top: 5px solid black;
|
||||
}
|
||||
|
||||
.attributes-container {
|
||||
display: flex;
|
||||
margin: 5px 0px;
|
||||
@include custom_radio(20px, 20px);
|
||||
|
||||
#character-health-clock {
|
||||
@include clock(4, 100, white, purple);
|
||||
* {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"Actor": {
|
||||
"types": ["character"],
|
||||
"types": ["character", "crew"],
|
||||
"character": {
|
||||
"alias": "",
|
||||
"heritage": "",
|
||||
|
@ -9,7 +9,10 @@
|
|||
"stress": [0],
|
||||
"traumas": [],
|
||||
"healing-clock": [0],
|
||||
"class": "cutter",
|
||||
"experience": [0],
|
||||
"coins": [0],
|
||||
"coins_stashed": [0],
|
||||
"special_abilities": [],
|
||||
"harm": {
|
||||
"light": {
|
||||
"one": "",
|
||||
|
@ -193,11 +196,33 @@
|
|||
}
|
||||
},
|
||||
"Item": {
|
||||
"types": ["item"],
|
||||
"types": ["item", "class", "ability", "heritages", "backgrounds", "vices"],
|
||||
"item": {
|
||||
"class_restriction": "",
|
||||
"load": 0,
|
||||
"description": ""
|
||||
},
|
||||
"class": {
|
||||
"description": "",
|
||||
"base_skills": {
|
||||
"hunt": [0],
|
||||
"study": [0],
|
||||
"survey": [0],
|
||||
"tinker": [0],
|
||||
"finesse": [0],
|
||||
"prowl": [0],
|
||||
"skirmish": [0],
|
||||
"wreck": [0],
|
||||
"attune": [0],
|
||||
"command": [0],
|
||||
"consort": [0],
|
||||
"sway": [0]
|
||||
},
|
||||
"class_items": []
|
||||
},
|
||||
"ability": {
|
||||
"class": "",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
<form class="{{cssClass}}" autocomplete="off">
|
||||
|
||||
{{!-- Sheet Header --}}
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
|
||||
<div class="resource">
|
||||
<input type="text" name="data.health.value" value="{{data.health.value}}" data-dtype="Number"/>
|
||||
<span> / </span>
|
||||
<input type="text" name="data.health.max" value="{{data.health.max}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="resource">
|
||||
<input type="text" name="data.power.value" value="{{data.power.value}}" data-dtype="Number"/>
|
||||
<span> / </span>
|
||||
<input type="text" name="data.power.max" value="{{data.power.max}}" data-dtype="Number"/>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">Description</a>
|
||||
<a class="item" data-tab="items">Items</a>
|
||||
<a class="item" data-tab="attributes">Attributes</a>
|
||||
</nav>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab biography active" data-group="primary" data-tab="description">
|
||||
{{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
|
||||
{{!-- Owned Items Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
<ol class="items-list">
|
||||
{{#each actor.items as |item id|}}
|
||||
<li class="item flexrow" data-item-id="{{item._id}}">
|
||||
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>
|
||||
<h4 class="item-name">{{item.name}}</h4>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab attributes" data-group="primary" data-tab="attributes">
|
||||
<header class="attributes-header flexrow">
|
||||
<span class="attribute-key">Attribute Key</span>
|
||||
<span class="attribute-value">Value</span>
|
||||
<span class="attribute-label">Label</span>
|
||||
<span class="attribute-dtype">Data Type</span>
|
||||
<a class="attribute-control" data-action="create"><i class="fas fa-plus"></i></a>
|
||||
</header>
|
||||
|
||||
<ol class="attributes-list">
|
||||
{{#each data.attributes as |attr key|}}
|
||||
<li class="attribute flexrow" data-attribute="{{key}}">
|
||||
<input class="attribute-key" type="text" name="data.attributes.{{key}}.key" value="{{key}}"/>
|
||||
{{#if attr.isCheckbox}}
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="data.attributes.{{key}}.value" {{checked attr.value}}/></label>
|
||||
{{else}}
|
||||
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
|
||||
{{/if}}
|
||||
<input class="attribute-label" type="text" name="data.attributes.{{key}}.label" value="{{attr.label}}"/>
|
||||
<select class="attribute-dtype" name="data.attributes.{{key}}.dtype">
|
||||
{{#select attr.dtype}}
|
||||
{{#each ../dtypes as |t|}}
|
||||
<option value="{{t}}">{{t}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<a class="attribute-control" data-action="delete"><i class="fas fa-trash"></i></a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
|
@ -45,16 +45,17 @@
|
|||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="character-class">Class</label>
|
||||
<select id="character-class" name="data.class">
|
||||
{{#select data.class}}
|
||||
{{#each data.classes as |class key|}}
|
||||
<option value="{{key}}">{{key}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{#each actor.items as |item id|}}
|
||||
{{#eq item.type "class"}}
|
||||
<div class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-body">
|
||||
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>
|
||||
<h4 class="item-name">{{item.name}}</h4>
|
||||
</div>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
{{/eq}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
{{!-- Stress and Trauma --}}
|
||||
|
@ -215,10 +216,20 @@
|
|||
|
||||
{{!-- Attributes --}}
|
||||
{{> "systems/blades-in-the-dark/templates/parts/attributes.html"}}
|
||||
|
||||
{{!-- Test --}}
|
||||
{{#eq data.class "cutter"}}
|
||||
{{> "systems/blades-in-the-dark/templates/parts/cutter-class.html"}}
|
||||
{{/eq}}
|
||||
|
||||
{{!-- Owned Items Tab --}}
|
||||
<!-- <div class="tab items" data-group="primary" data-tab="items"> -->
|
||||
<ol class="items-list">
|
||||
{{#each actor.items as |item id|}}
|
||||
<li class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-body">
|
||||
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>
|
||||
<h4 class="item-name">{{item.name}}</h4>
|
||||
</div>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
<!-- </div> -->
|
||||
|
||||
</form>
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
<div class="resource">
|
||||
<label>Quantity</label>
|
||||
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number"/>
|
||||
</div>
|
||||
<div class="resource">
|
||||
<label>Weight</label>
|
||||
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="description">Description</a>
|
||||
<a class="item" data-tab="attributes">Attributes</a>
|
||||
</nav>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
|
||||
{{!-- Attributes Tab --}}
|
||||
<div class="tab attributes" data-group="primary" data-tab="attributes">
|
||||
<header class="attributes-header flexrow">
|
||||
<span class="attribute-key">Attribute Key</span>
|
||||
<span class="attribute-value">Value</span>
|
||||
<span class="attribute-label">Label</span>
|
||||
<span class="attribute-dtype">Data Type</span>
|
||||
<a class="attribute-control" data-action="create"><i class="fas fa-plus"></i></a>
|
||||
</header>
|
||||
|
||||
<ol class="attributes-list">
|
||||
{{#each data.attributes as |attr key|}}
|
||||
<li class="attribute flexrow" data-attribute="{{key}}">
|
||||
<input class="attribute-key" type="text" name="data.attributes.{{key}}.key" value="{{key}}"/>
|
||||
{{#if attr.isCheckbox}}
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="data.attributes.{{key}}.value" {{checked attr.value}}/></label>
|
||||
{{else}}
|
||||
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
|
||||
{{/if}}
|
||||
<input class="attribute-label" type="text" name="data.attributes.{{key}}.label" value="{{attr.label}}"/>
|
||||
<select class="attribute-dtype" name="data.attributes.{{key}}.dtype">
|
||||
{{#select attr.dtype}}
|
||||
{{#each ../dtypes as |t|}}
|
||||
<option value="{{t}}">{{t}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<a class="attribute-control" data-action="delete"><i class="fas fa-trash"></i></a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
17
templates/items/class.html
Normal file
17
templates/items/class.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
17
templates/items/item.html
Normal file
17
templates/items/item.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab" data-group="primary" data-tab="description">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||
<div>
|
||||
TESTOOOOO
|
||||
</div>
|
Reference in a new issue