From fee245cfcd64c2cc4a68268628a29f1063a95f2d Mon Sep 17 00:00:00 2001 From: Peter Varaksin Date: Tue, 21 Apr 2020 09:51:49 +0300 Subject: [PATCH] Progress --- module/actor-sheet.js | 4 +- module/blades.js | 15 +- module/templates.js | 25 ++ styles/assets/teeth/xptooth-red.png | Bin 0 -> 1683 bytes styles/assets/teeth/xptooth-white.png | Bin 0 -> 1742 bytes styles/blades.css | 218 +++++++++++------ template.json | 86 ++++++- templates/actor-sheet.html | 340 ++++++++++++++------------ templates/parts/attributes.html | 268 ++++++++++++++++++++ templates/parts/cutter-class.html | 3 + templates/parts/hound-class.html | 3 + templates/parts/leech-class.html | 3 + templates/parts/lurk-class.html | 3 + templates/parts/slide-class.html | 3 + templates/parts/spider-class.html | 3 + templates/parts/whisper-class.html | 3 + 16 files changed, 732 insertions(+), 245 deletions(-) create mode 100644 module/templates.js create mode 100644 styles/assets/teeth/xptooth-red.png create mode 100644 styles/assets/teeth/xptooth-white.png create mode 100644 templates/parts/attributes.html create mode 100644 templates/parts/cutter-class.html create mode 100644 templates/parts/hound-class.html create mode 100644 templates/parts/leech-class.html create mode 100644 templates/parts/lurk-class.html create mode 100644 templates/parts/slide-class.html create mode 100644 templates/parts/spider-class.html create mode 100644 templates/parts/whisper-class.html diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 6914948..d178bcc 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -9,7 +9,7 @@ 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: 1200, + width: 1400, height: 1200 }); } @@ -131,7 +131,7 @@ export class BladesActorSheet extends ActorSheet { const FD = new FormData(form); const dtypes = {}; const editorTargets = Object.keys(this.editors); - console.log('YAMAMMMMMMAAAAAAAAAAAAAA!!!!'); + // Always include checkboxes for ( let el of form.elements ) { if ( !el.name ) continue; diff --git a/module/blades.js b/module/blades.js index 139f88e..99bc6fd 100644 --- a/module/blades.js +++ b/module/blades.js @@ -5,7 +5,8 @@ */ // Import Modules -import { SimpleItemSheet } from "./item-sheet.js"; +import { preloadHandlebarsTemplates } from "./templates.js"; +// import { SimpleItemSheet } from "./item-sheet.js"; import { BladesActorSheet } from "./actor-sheet.js"; /* -------------------------------------------- */ @@ -26,9 +27,10 @@ Hooks.once("init", async function() { // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); - Actors.registerSheet("dnd5e", BladesActorSheet, { makeDefault: true }); - Items.unregisterSheet("core", ItemSheet); - Items.registerSheet("dnd5e", SimpleItemSheet, {makeDefault: true}); + Actors.registerSheet("bitd", BladesActorSheet, { makeDefault: true }); + // Items.unregisterSheet("core", ItemSheet); + // Items.registerSheet("bitd", SimpleItemSheet, {makeDefault: true}); + preloadHandlebarsTemplates(); // Multiboxes. @@ -58,4 +60,9 @@ Hooks.once("init", async function() { }); + // Equals handlebar. + Handlebars.registerHelper('eq', function (a, b, options) { + return (a === b) ? options.fn(this) : ''; + }); + }); diff --git a/module/templates.js b/module/templates.js new file mode 100644 index 0000000..a79d956 --- /dev/null +++ b/module/templates.js @@ -0,0 +1,25 @@ +/** + * Define a set of template paths to pre-load + * Pre-loaded templates are compiled and cached for fast access when rendering + * @return {Promise} + */ +export const preloadHandlebarsTemplates = async function() { + + // Define template paths to load + 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" + ]; + + // Load the template parts + return loadTemplates(templatePaths); +}; diff --git a/styles/assets/teeth/xptooth-red.png b/styles/assets/teeth/xptooth-red.png new file mode 100644 index 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m9_y7BFMC;B@EGO=l6B%}_ za8B~-@b!7RearXn|NrkT^B;X4#ZT8;G-Retx;|5Fa{D2Tr74$9^j(xD_E%L^&5H<` ztyJFqu|4s_>uFEbS~WQMzczGOh;ZHQa9gZ=_Uze@pA2(uZ(D0*$Q9%#b7hvSW@P0W z&PIm^VLD>fWhp5tTPi<4yVUpR!UciQn6w=(HL+fGx1T2`O3Yj4u6U$GL14$Nix)p; z{d_;ysx<54JK1}jheNy0YnlG-6Oj3KLnCsUY3}WB{Jp)s`t$5+ts(-YR~je25pFu4 zb@sdjoBfinQ^Z*g8(7Hj$>(QgR%ZSG_jlo=ztz>%+TzU}79L0XjxWl%ZDwv_B9on! z^~z&u5WmR#*Ud{%zGy@jD+;^m<3 z1cMW8i3JJ*62&sc4g3I3AaP&6($HeDs VF1Jqa%T7?;;OXk;vd$@?2>^ui-kSgb literal 0 HcmV?d00001 diff --git a/styles/assets/teeth/xptooth-white.png b/styles/assets/teeth/xptooth-white.png new file mode 100644 index 0000000000000000000000000000000000000000..df81a24b4102c3c403048e355f4a53ed86f21ca2 GIT binary patch literal 1742 zcmaJ?eK-?Z7@xv?tz37_#A->JqBaR#w@HXeN?qlnY(6&3$Cmae*T>vdT&x+Z6`@i# zCW<9Vcb>y6cbo$E|zsbDsBo&-uOQ{Lb$^=XuV_Jmlj6(p#$s z002N3Pq)MB=&H7M9c{Je3yw#sgLdeC4>!Q)FYUU3%Tgn{WY2(8003mu7t_ETwwO_a zKnmu7J8)EQ%^DO!-1xn}8iGarK$w`ZZ1Ea8JrsY9Q}QS8E{5cZ+AJm#yYqv;%c8=kqz6BYjY(eh_lI^$_zBj(kb$} zu(f|xgbjz0iM>m6e!8S#i@5Lnt3i0#b;ucOnUNUq zm`Lh=VVOc5NsZhtK=)+#?Cz1Fjkk$xg<~hvaozw8WEv_6Ecl=)dvtxXj~hRX-2IB@ zSK$vg#7$5h!Z#>}1frJF8PVqO0LwQ2`H{l@=CiSy^c}GQ>o! z^mT=&aJa62=KmIe02@?@^|WBFhD@^u2mVI?eeRxb6n|X@{J#k3KY~~tnsnI>5D0Xj zi&7GavN~QLfBw_l+?93cWQ4UBJ>0gVq%V@!&=B~~>AqL-ey6)n`axXL!Dd4a`-u;I zk;W=PtjsF0(>&`U>}}!qqRex3#A0zSBFki>4h_y6kPE5_U292r{J6fU8y1UQ4zV!O zeVC$3*kY&y?Of5lOP4ltna6X!Ut24F`e5C=AObxnhuc%+9cZOC~tmJ}`QY+^9DHXSf@; zUQNwE=#j}gVXD#AjNv#FCoHsp()eqP^LIGLP=e_xc!qDb42+CX4=V`DKL?WjxJBVyY$d}p97hla&0 zDBjRfZT4}m9h-6*N%~=-p|q+K4QyguT(NzD79@L96{53LTygA}d@PDYqMlAk`<#i| zjYbzwOiy#AQbKD0JnJn}G_GtcFP~s(iNT3S=-h+Xp7q`I*x59EZM4vo#>6jXN~RR$ zw{Oo$86oORSj^1r2saW41h)`+`QDbUItdLa&&EC`5B2wNBn{rPlH@BC3PR##lLC&f zHRL91^Fbro>)!eHT~tDyWc|R47pW}O=eVIq_2i_CJFUHT7fSlx^N(>mGb;+?D^)tss1~)>5cLOVP*wz8FQ-ih9*!QJcXPa9RVGgG0 zqVWP=Rn_v~czntg)#-@tLaRr{_wKYXEhaJt8LFSr>O$b>PbMU}`CjY>u3i_eU&>~)h39>Pf>fvc{QM;8Ak&(zi&K(1 cz7R@XN&Z - - -

- - -

- - -

- - -

- - - -
+
+
+ + +
+
+ +
+
+ + +
+
+ + + + {{!-- Stress and Trauma --}} +
{{#multiboxes data.stress}} - + @@ -59,142 +84,141 @@ {{/multiboxes}}
-
+ {{#traumacounter data.traumas}}
- {{#traumacounter data.traumas}} - - - - - - - - - - - {{/traumacounter}} + +
+ + + + + + + + + +
+ {{/traumacounter}}
{{#multiboxes data.traumas}} -
- - - - -
-
- - - - -
+ + + + + + + + {{/multiboxes}}
- -
- - - - - - - - - - - - - - - - - - - - - - - -
Harm
3 - - Need Help
2 - - - - -1D
1 - - - - Less Effect
-
-
- Healing -
- {{#multiboxes data.healing-clock}} - - - - - - - - - - {{/multiboxes}} + {{!-- Harm, Healing and Armor --}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
HarmHealingArmor
3 + + Need Help + {{#multiboxes data.healing-clock}} +
+ + + + + + + + + + {{/multiboxes}} +
+
+
+ + +
+
+ + +
+
+ + +
+
2 + + + + -1D
1 + + + + Less Effect
-
- Armor -
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
+ + {{!-- 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}} diff --git a/templates/parts/attributes.html b/templates/parts/attributes.html new file mode 100644 index 0000000..16dc156 --- /dev/null +++ b/templates/parts/attributes.html @@ -0,0 +1,268 @@ +
+ +
+
+ {{#multiboxes data.attributes.insight.exp}} + + + + + + + + + + + + + + + {{/multiboxes}} +
+ + {{!-- Skills --}} +
+ {{#multiboxes data.attributes.insight.skills.hunt}} + + + + + | + + + + + + +
Hunt
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.insight.skills.study}} + + + + + | + + + + + + +
study
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.insight.skills.survey}} + + + + + | + + + + + + +
survey
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.insight.skills.tinker}} + + + + + | + + + + + + +
tinker
+ {{/multiboxes}} +
+ +
+ +
+
+ {{#multiboxes data.attributes.prowess.exp}} + + + + + + + + + + + + + + + {{/multiboxes}} +
+ + {{!-- Skills --}} +
+ {{#multiboxes data.attributes.prowess.skills.finesse}} + + + + + | + + + + + + +
finesse
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.prowess.skills.prowl}} + + + + + | + + + + + + +
prowl
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.prowess.skills.skirmish}} + + + + + | + + + + + + +
skirmish
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.prowess.skills.wreck}} + + + + + | + + + + + + +
wreck
+ {{/multiboxes}} +
+ +
+ + +
+
+ {{#multiboxes data.attributes.resolve.exp}} + + + + + + + + + + + + + + + {{/multiboxes}} +
+ + {{!-- Skills --}} +
+ {{#multiboxes data.attributes.resolve.skills.attune}} + + + + + | + + + + + + +
attune
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.resolve.skills.command}} + + + + + | + + + + + + +
command
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.resolve.skills.consort}} + + + + + | + + + + + + +
consort
+ {{/multiboxes}} +
+
+ {{#multiboxes data.attributes.resolve.skills.sway}} + + + + + | + + + + + + +
sway
+ {{/multiboxes}} +
+ +
+ +
\ No newline at end of file diff --git a/templates/parts/cutter-class.html b/templates/parts/cutter-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/cutter-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/hound-class.html b/templates/parts/hound-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/hound-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/leech-class.html b/templates/parts/leech-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/leech-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/lurk-class.html b/templates/parts/lurk-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/lurk-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/slide-class.html b/templates/parts/slide-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/slide-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/spider-class.html b/templates/parts/spider-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/spider-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file diff --git a/templates/parts/whisper-class.html b/templates/parts/whisper-class.html new file mode 100644 index 0000000..f1f2fbf --- /dev/null +++ b/templates/parts/whisper-class.html @@ -0,0 +1,3 @@ +
+ TESTOOOOO +
\ No newline at end of file