From a2d69a86b3c98e68071386a142984bc438ab026e Mon Sep 17 00:00:00 2001 From: Peter Varaksin Date: Tue, 28 Apr 2020 17:10:14 +0300 Subject: [PATCH] Some styling fixes and bugfixes --- TODO | 3 +- module/blades.js | 21 ++++++++ packs/crew_types.db | 2 +- packs/crew_upgrades.db | 3 +- scss/style.scss | 41 +++++++++++--- styles/blades.css | 89 +++++++++++++++++++------------ template.json | 3 +- templates/actor-sheet.html | 2 +- templates/crew-sheet.html | 67 +++++++++++++++++------ templates/items/crew_type.html | 7 ++- templates/items/crew_upgrade.html | 4 +- 11 files changed, 179 insertions(+), 63 deletions(-) diff --git a/TODO b/TODO index 2f23eee..3c6bcf5 100644 --- a/TODO +++ b/TODO @@ -12,4 +12,5 @@ - Add Usage documentation to README.md - Add Turf Validation (<= 6 max) - Add turf connection validation -- Document usage of "logic" item property (crew_upgrades) \ No newline at end of file +- Document usage of "logic" item property (crew_upgrades) +- Add screenshots \ No newline at end of file diff --git a/module/blades.js b/module/blades.js index 275b33d..4960fac 100644 --- a/module/blades.js +++ b/module/blades.js @@ -100,6 +100,27 @@ Hooks.once("init", async function() { return html; }); + Handlebars.registerHelper('crew_experience', (options) => { + + let html = options.fn(this); + for (let i = 1; i <= 10; i++) { + + html += ''; + } + + return html; + }); + + // Enrich the HTML replace /n with
+ Handlebars.registerHelper('html', (options) => { + + let html = ""; + console.log(options); + let text = options.hash['text'].replace(/\n/g, "
"); + + return new Handlebars.SafeString(text);; + }); + }); /* diff --git a/packs/crew_types.db b/packs/crew_types.db index f2da8d9..6c2655c 100644 --- a/packs/crew_types.db +++ b/packs/crew_types.db @@ -1 +1 @@ -{"_id":"678LJHqxkBAaSJci","name":"Cult","permission":{"default":0},"type":"crew_type","data":{"description":"","turfs":{"1":{"name":"Cloister","value":false,"description":"+1 scale for your Adept cohorts","connects":["right"],"connected":[false,false,false,false]},"2":{"name":"Vice Den","value":false,"description":"(Tier roll) - Heat = coin in Downtime","connects":["left","right","bottom"],"connected":[false,false,false,false]},"3":{"name":"Offertory","value":false,"description":"+2 coin for occult operations","connects":["left"],"connected":[false,false,false,false]},"4":{"name":"Ancient Obelisk","value":false,"description":"-1 stress cost for all arcane powers and rituals","connects":["right"],"connected":[false,false,false,false]},"5":{"name":"Ancient Tower","value":false,"description":"+1d to Consort w/ arcane entities on site","connects":["left","bottom"],"connected":[false,false,false,false]},"6":{"name":"Turf","value":false,"description":"","connects":["top","right"],"connected":[false,false,false,false]},"7":{"name":"Turf","value":false,"description":"","connects":["left","top","right","bottom"],"connected":[false,false,false,false]},"8":{"name":"Lair","value":true,"description":"","connects":["left","top","right","bottom"],"connected":[false,false,false,true]},"9":{"name":"Turf","value":false,"description":"","connects":["left","right","bottom"],"connected":[false,false,false,false]},"10":{"name":"Turf","value":false,"description":"","connects":["left","top","bottom"],"connected":[false,false,false,false]},"11":{"name":"Spirit Well","value":false,"description":"+1d to Attune on site","connects":["right"],"connected":[false,false,false,false]},"12":{"name":"Ancient Gate","value":false,"description":"Safe passage in the Deathlands","connects":["left","top"],"connected":[false,false,false,false]},"13":{"name":"Sanctuary","value":false,"description":"+1d to Command and Sway on site","connects":["top"],"connected":[false,false,false,false]},"14":{"name":"Sacred Nexus","value":false,"description":"+1d to healing rolls","connects":["top","right"],"connected":[false,false,false,false]},"15":{"name":"Ancient Altar","value":false,"description":"+1d engagement for occult plans","connects":["left","top"],"connected":[false,false,false,false]}}},"folder":null,"sort":100001,"flags":{}} +{"_id":"678LJHqxkBAaSJci","name":"Cult","permission":{"default":0},"type":"crew_type","data":{"description":"","experience_clues":"- Advance the agenda of your deity or embody its precepts in action.\n- Contend with challenges above your current station.\n- Bolster your crew's reputation or develop a new one.\n- Express the goals, drives, inner conflict, or essential nature of the crew.","turfs":{"1":{"name":"Cloister","value":false,"description":"+1 scale for your Adept cohorts","connects":["right"],"connected":[false,false,false,false]},"2":{"name":"Vice Den","value":false,"description":"(Tier roll) - Heat = coin in Downtime","connects":["left","right","bottom"],"connected":[false,false,false,false]},"3":{"name":"Offertory","value":false,"description":"+2 coin for occult operations","connects":["left"],"connected":[false,false,false,false]},"4":{"name":"Ancient Obelisk","value":false,"description":"-1 stress cost for all arcane powers and rituals","connects":["right"],"connected":[false,false,false,false]},"5":{"name":"Ancient Tower","value":false,"description":"+1d to Consort w/ arcane entities on site","connects":["left","bottom"],"connected":[false,false,false,false]},"6":{"name":"Turf","value":false,"description":"","connects":["top","right"],"connected":[false,false,false,false]},"7":{"name":"Turf","value":false,"description":"","connects":["left","top","right","bottom"],"connected":[false,false,false,false]},"8":{"name":"Lair","value":true,"description":"","connects":["left","top","right","bottom"],"connected":[false,false,false,true]},"9":{"name":"Turf","value":false,"description":"","connects":["left","right","bottom"],"connected":[false,false,false,false]},"10":{"name":"Turf","value":false,"description":"","connects":["left","top","bottom"],"connected":[false,false,false,false]},"11":{"name":"Spirit Well","value":false,"description":"+1d to Attune on site","connects":["right"],"connected":[false,false,false,false]},"12":{"name":"Ancient Gate","value":false,"description":"Safe passage in the Deathlands","connects":["left","top"],"connected":[false,false,false,false]},"13":{"name":"Sanctuary","value":false,"description":"+1d to Command and Sway on site","connects":["top"],"connected":[false,false,false,false]},"14":{"name":"Sacred Nexus","value":false,"description":"+1d to healing rolls","connects":["top","right"],"connected":[false,false,false,false]},"15":{"name":"Ancient Altar","value":false,"description":"+1d engagement for occult plans","connects":["left","top"],"connected":[false,false,false,false]}}},"folder":null,"sort":100001,"flags":{}} diff --git a/packs/crew_upgrades.db b/packs/crew_upgrades.db index 4284598..23ea0d8 100644 --- a/packs/crew_upgrades.db +++ b/packs/crew_upgrades.db @@ -1 +1,2 @@ -{"_id":"M7k3sdhua5qmJ93M","name":"Vault 1","permission":{"default":0,"BwbqQh8sHfeKmUax":3},"type":"crew_upgrade","data":{"description":"Adds the Vault providing additional 4 Coin space","logic":"{\"attribute\":\"data.vault.max\",\"operator\":\"addition\",\"value\":4,\"requirement\":\"\"}","crew_type":""},"folder":null,"sort":300000,"flags":{}} +{"_id":"EhUz7EZZP0B5IOYn","name":"Vault 1","permission":{"default":0,"BwbqQh8sHfeKmUax":3},"type":"crew_upgrade","data":{"description":"Adds the Vault providing additional 4 Coin space","class":"","price":"1","logic":"{\"attribute\":\"data.vault.max\",\"operator\":\"addition\",\"value\":4,\"requirement\":\"\"}","crew_type":""},"folder":null,"sort":100001,"flags":{}} +{"_id":"RmjU5DHgecia43Cf","name":"Vault 2","permission":{"default":0,"BwbqQh8sHfeKmUax":3},"type":"crew_upgrade","data":{"description":"Extend the Vault to additional +8 coins","class":"","price":"1","logic":"{\"attribute\":\"data.vault.max\",\"operator\":\"addition\",\"value\":8,\"requirement\":\"Vault 1\"}","crew_type":""},"folder":null,"sort":200001,"flags":{}} \ No newline at end of file diff --git a/scss/style.scss b/scss/style.scss index e3e5579..4d7ab4f 100644 --- a/scss/style.scss +++ b/scss/style.scss @@ -149,15 +149,9 @@ $red: red; } + // Abilities #abilities { - #character-experience { - @include toothradio(10px, 30px, "assets/teeth/stresstooth-halfgrey.png", "assets/teeth/stresstooth-red.png"); - position: absolute; - top: 0px; - right: 10px; - } - .item-name { width: 70px; } @@ -170,6 +164,14 @@ $red: red; } + // Experience teeth + .teeth-experience { + @include toothradio(10px, 30px, "assets/teeth/stresstooth-halfgrey.png", "assets/teeth/stresstooth-red.png"); + position: absolute; + top: 0px; + right: 10px; + } + #harm-armor { display: flex; @@ -387,6 +389,7 @@ $red: red; #crew-hold { border-top: 3px solid black; @include toothradio_single(17px, 50px, "assets/teeth/stresstooth-halfgrey.png", "assets/teeth/stresstooth-red.png"); + width: 220px; } #crew-tier { @@ -409,4 +412,28 @@ $red: red; justify-content: none; } + .experience-clues-container { + width: 340px; + font-size: 12px; + + .experience-clues-description { + font-weight: bold; + } + + .experience-clues { + font-style: italic; + } + } + + .class-name { + width: 512px; + height: 120px; + display: flex; + align-items: center; + justify-content: center; + font-size: 48px; + text-transform: uppercase; + border: 3px solid black; + } + } diff --git a/styles/blades.css b/styles/blades.css index 2226ac4..8ee9595 100644 --- a/styles/blades.css +++ b/styles/blades.css @@ -209,40 +209,6 @@ text-decoration: none; font-weight: bold; } -* #abilities #character-experience { - display: flex; - /* Hide the browser's default checkbox */ - position: absolute; - top: 0px; - right: 10px; -} -* #abilities #character-experience label { - height: 30px; - width: 10px; - background-image: url("assets/teeth/stresstooth-red.png"); - background-repeat: no-repeat; - background-size: contain; - margin-right: 5px; -} -* #abilities #character-experience label:last-of-type { - margin-right: 0px; -} -* #abilities #character-experience label[for$="-0"] { - width: auto; - height: auto; - background-image: none !important; - background: black !important; - margin-right: 0px; -} -* #abilities #character-experience input { - display: none; -} -* #abilities #character-experience input:checked ~ label { - background-image: url("assets/teeth/stresstooth-halfgrey.png"); -} -* #abilities #character-experience input:checked + label { - background-image: url("assets/teeth/stresstooth-red.png"); -} * #abilities .item-name { width: 70px; } @@ -252,6 +218,40 @@ * #abilities .item-description { width: 200px; } +* .teeth-experience { + display: flex; + /* Hide the browser's default checkbox */ + position: absolute; + top: 0px; + right: 10px; +} +* .teeth-experience label { + height: 30px; + width: 10px; + background-image: url("assets/teeth/stresstooth-red.png"); + background-repeat: no-repeat; + background-size: contain; + margin-right: 5px; +} +* .teeth-experience label:last-of-type { + margin-right: 0px; +} +* .teeth-experience label[for$="-0"] { + width: auto; + height: auto; + background-image: none !important; + background: black !important; + margin-right: 0px; +} +* .teeth-experience input { + display: none; +} +* .teeth-experience input:checked ~ label { + background-image: url("assets/teeth/stresstooth-halfgrey.png"); +} +* .teeth-experience input:checked + label { + background-image: url("assets/teeth/stresstooth-red.png"); +} * #harm-armor { display: flex; } @@ -685,6 +685,7 @@ border-top: 3px solid black; display: flex; /* Hide the browser's default checkbox */ + width: 220px; } * #crew-hold label { height: 50px; @@ -737,5 +738,25 @@ * #heat-wanted { justify-content: none; } +* .experience-clues-container { + width: 340px; + font-size: 12px; +} +* .experience-clues-container .experience-clues-description { + font-weight: bold; +} +* .experience-clues-container .experience-clues { + font-style: italic; +} +* .class-name { + width: 512px; + height: 120px; + display: flex; + align-items: center; + justify-content: center; + font-size: 48px; + text-transform: uppercase; + border: 3px solid black; +} /*# sourceMappingURL=style.css.map */ diff --git a/template.json b/template.json index fd05eb2..44ca421 100644 --- a/template.json +++ b/template.json @@ -144,11 +144,12 @@ "templates": ["default"] }, "crew_upgrade": { - "templates": ["default", "logic"], + "templates": ["ability", "logic"], "crew_type": "" }, "crew_type": { "description": "", + "experience_clues": "", "turfs": { "1": { "name": "", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 2d26c03..095cf2f 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -243,7 +243,7 @@

-
+
{{#multiboxes data.experience}} diff --git a/templates/crew-sheet.html b/templates/crew-sheet.html index 72788ce..f6e2446 100644 --- a/templates/crew-sheet.html +++ b/templates/crew-sheet.html @@ -87,7 +87,7 @@ {{!-- Coins --}}
- +
@@ -177,20 +177,55 @@
-
-
Hold
- {{#multiboxes data.hold}} -
-
Weak
- - +
+ +
+
Hold
+ {{#multiboxes data.hold}} +
+
Weak
+ + +
+
+
Strong
+ + +
+ {{/multiboxes}}
-
-
Strong
- - + +
+ {{#each actor.items as |item id|}} + {{#eq item.type "crew_type"}} + {{item.name}} + {{/eq}} + {{/each}} +
+
+ + + {{!-- Crew XP --}} +
+
+
+ + {{#multiboxes data.experience}} + + {{#crew_experience}}{{/crew_experience}} + {{/multiboxes}} +
+
+
+
At the end of each session, for each item below, mark 1 xp (or instead mark 2xp if that item occurred multiple times).
+
+ {{#each actor.items as |item id|}} + {{#eq item.type "crew_type"}} + {{html text=item.data.experience_clues}} + {{/eq}} + {{/each}} +
- {{/multiboxes}}
@@ -207,10 +242,12 @@
-
+ + {{!-- Crew Upgrades --}} +

-
+
{{#each actor.items as |item id|}} {{#eq item.type "crew_upgrade"}}
diff --git a/templates/items/crew_type.html b/templates/items/crew_type.html index 0d6ccae..618ae46 100644 --- a/templates/items/crew_type.html +++ b/templates/items/crew_type.html @@ -5,7 +5,12 @@

- +
+ + + + +
{{> "systems/blades-in-the-dark/templates/parts/turf-list.html" turfs_data=data.turfs can_edit=true}} diff --git a/templates/items/crew_upgrade.html b/templates/items/crew_upgrade.html index b640283..a0cca69 100644 --- a/templates/items/crew_upgrade.html +++ b/templates/items/crew_upgrade.html @@ -11,7 +11,9 @@ - + + +