From 31bd83b0ab20dd899dfd8c7b2798b62e00af1f0f Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 25 Nov 2022 15:50:07 +0100 Subject: [PATCH] Add a PC list summary --- css/bol.css | 13 +++++++++++-- module/system/bol-calendar.js | 2 +- module/system/bol-commands.js | 2 ++ module/system/config.js | 8 ++++++++ module/system/helpers.js | 6 ++++++ system.json | 4 ++-- 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/css/bol.css b/css/bol.css index 4e3562c..7b7786d 100644 --- a/css/bol.css +++ b/css/bol.css @@ -442,6 +442,9 @@ ul.no-bullets { .bol .inc-dec-btns { color: #4b4a44; } +.summmary-number { + padding-left: 4rem; +} /* Items List */ .items-list { list-style: none; @@ -519,7 +522,10 @@ ul.no-bullets { .items-list .item .item-control { color: #4b4a44; } - +.items-list .item-name-fixed-medium { + min-width: 8rem; + width: 8rem; +} /* ----------------------------------------- */ /* Premade colors */ /* ----------------------------------------- */ @@ -1053,4 +1059,7 @@ body.system-bol img#logo { .bol-margin-tb-2 { margin-top: 2px; margin-bottom: 2px; -} \ No newline at end of file +} +.character-summary-container { +  opacity: 0.95; +} diff --git a/module/system/bol-calendar.js b/module/system/bol-calendar.js index c9e970c..727d774 100644 --- a/module/system/bol-calendar.js +++ b/module/system/bol-calendar.js @@ -40,7 +40,7 @@ export class BoLCalendar extends Application { constructor() { super(); // position - this.calendarPos = duplicate(game.settings.get(SYSTEM_RDD, "calendar-pos")); + this.calendarPos = duplicate(game.settings.get("bol", "calendar-pos")); if (this.calendarPos == undefined || this.calendarPos.top == undefined) { this.calendrierPos = BoLCalendar.createCalendarPos() game.settings.set("bol", "calendar-pos", this.calendarPos) diff --git a/module/system/bol-commands.js b/module/system/bol-commands.js index c5fe9bb..0f83a73 100644 --- a/module/system/bol-commands.js +++ b/module/system/bol-commands.js @@ -1,5 +1,6 @@ /* -------------------------------------------- */ import { BoLAdventureGenerator } from "./bol-adventure-generator.js" +import { BoLCharacterSummary } from "./bol-character-summary.js" /* -------------------------------------------- */ export class BoLCommands { @@ -8,6 +9,7 @@ export class BoLCommands { if (!game.bol.commands) { const bolCommands = new BoLCommands() bolCommands.registerCommand({ path: ["/adventure"], func: (content, msg, params) => BoLAdventureGenerator.createAdventure(), descr: "Nouvelle idée d'aventure!" }); + bolCommands.registerCommand({ path: ["/pcview"], func: (content, msg, params) => BoLCharacterSummary.displayPCSummary(), descr: "Affiche la liste des PJs!" }); game.bol.commands = bolCommands } diff --git a/module/system/config.js b/module/system/config.js index 048edd5..1598435 100644 --- a/module/system/config.js +++ b/module/system/config.js @@ -115,6 +115,14 @@ BOL.aptitudes = { "def" : "BOL.aptitudes.def" } +BOL.resources = { + "hp" : "BOL.resources.hp", + "hero" : "BOL.resources.hero", + "faith" : "BOL.resources.faith", + "power" : "BOL.resources.power", + "alchemypoints" : "BOL.resources.alchemypoints" +} + BOL.weaponSizes = { "unarmed" : "BOL.weaponSize.unarmed", "improvised" : "BOL.weaponSize.improvised", diff --git a/module/system/helpers.js b/module/system/helpers.js index 4bf38df..e984deb 100644 --- a/module/system/helpers.js +++ b/module/system/helpers.js @@ -103,6 +103,12 @@ export const registerHandlebarsHelpers = function () { Handlebars.registerHelper('sub', function (a, b) { return parseInt(a) - parseInt(b); }) + Handlebars.registerHelper('abbrev2', function (a) { + return a.substring(0,2); + }) + Handlebars.registerHelper('abbrev3', function (a) { + return a.substring(0,3); + }) Handlebars.registerHelper('valueAtIndex', function (arr, idx) { return arr[idx]; }) diff --git a/system.json b/system.json index 7c44ebc..8c11302 100644 --- a/system.json +++ b/system.json @@ -14,7 +14,7 @@ ], "url": "https://www.uberwald.me/gitea/public/bol", "license": "LICENSE.txt", - "version": "10.4.2", + "version": "10.4.3", "compatibility": { "minimum": "10", "verified": "10", @@ -203,7 +203,7 @@ ], "socket": true, "manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json", - "download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.2.zip", + "download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.3.zip", "background": "systems/images/map_lemurie.webp", "gridDistance": 1.5, "gridUnits": "m",