From 7682da7f3ec458622df0ebfcec28733f120ecad3 Mon Sep 17 00:00:00 2001 From: Paul Maskelyne Date: Mon, 30 Oct 2023 23:46:37 +0000 Subject: [PATCH 1/5] closes #14 --- system/src/helpers/handlebars.mjs | 4 ++-- system/src/sheets/actor-sheet.mjs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/src/helpers/handlebars.mjs b/system/src/helpers/handlebars.mjs index c6b275d7..4884b18c 100644 --- a/system/src/helpers/handlebars.mjs +++ b/system/src/helpers/handlebars.mjs @@ -28,11 +28,11 @@ export const registerHandlebarsHelpers = function() { Handlebars.registerHelper("ifCond", function(v1, operator, v2, options) { switch (operator) { case "==": - return v1 === v2 ? options.fn(this) : options.inverse(this); + return v1 == v2 ? options.fn(this) : options.inverse(this); case "===": return v1 === v2 ? options.fn(this) : options.inverse(this); case "!=": - return v1 !== v2 ? options.fn(this) : options.inverse(this); + return v1 != v2 ? options.fn(this) : options.inverse(this); case "!==": return v1 !== v2 ? options.fn(this) : options.inverse(this); case "<": diff --git a/system/src/sheets/actor-sheet.mjs b/system/src/sheets/actor-sheet.mjs index a7b7e700..8295bf00 100644 --- a/system/src/sheets/actor-sheet.mjs +++ b/system/src/sheets/actor-sheet.mjs @@ -259,7 +259,8 @@ export class FalloutActorSheet extends ActorSheet { // NPC and Creature Inventory = all physical items that are not weapons if (this.actor.type === "npc" || this.actor.type === "creature") { context.inventory = context.items.filter(i => { - return i.type !== "weapon" && i.system.weight !== null; + const hasWeight = !isNaN(parseInt(i.system.weight ?? null)); + return i.type !== "weapon" && hasWeight; }); } if (this.actor.type === "character") { From 66b35fd2effb24cfd85de19230a4a445e5278fea Mon Sep 17 00:00:00 2001 From: Paul Maskelyne Date: Mon, 30 Oct 2023 23:50:23 +0000 Subject: [PATCH 2/5] closes #15 --- scss/components/_forms.scss | 13 ++++++++++--- system/src/sheets/actor-sheet.mjs | 4 ++-- .../templates/actor/parts/actor-conditions.html | 16 +++++----------- system/templates/actor/parts/actor-status.html | 6 ++++-- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/scss/components/_forms.scss b/scss/components/_forms.scss index ae39b5f7..cbb310ad 100644 --- a/scss/components/_forms.scss +++ b/scss/components/_forms.scss @@ -33,7 +33,7 @@ height: 100%; margin: 0; } - } + } } .chaty{ cursor: pointer; @@ -362,7 +362,7 @@ } &.no-padding { - padding: 0 !important; + padding: 0 !important; .box-header { margin: 0 0 0 0; } @@ -480,7 +480,7 @@ .power-armor-status { position: relative; max-width: 136px; - height: 180px; + height: 160px; .body-part { padding: 5px; text-align: center; @@ -499,3 +499,10 @@ } } } + +.condition-meters { + display: grid; + grid-template-columns: 18px 2fr; + align-items: center; + column-gap: 8px; +} diff --git a/system/src/sheets/actor-sheet.mjs b/system/src/sheets/actor-sheet.mjs index 8295bf00..ca543762 100644 --- a/system/src/sheets/actor-sheet.mjs +++ b/system/src/sheets/actor-sheet.mjs @@ -13,8 +13,8 @@ export class FalloutActorSheet extends ActorSheet { return mergeObject(super.defaultOptions, { classes: ["fallout", "sheet", "actor"], template: "systems/fallout/templates/actor/actor-sheet.html", - width: 720, - height: 780, + width: 780, + height: 930, tabs: [ { navSelector: ".sheet-tabs", diff --git a/system/templates/actor/parts/actor-conditions.html b/system/templates/actor/parts/actor-conditions.html index 53577967..d19866ee 100644 --- a/system/templates/actor/parts/actor-conditions.html +++ b/system/templates/actor/parts/actor-conditions.html @@ -2,7 +2,7 @@ - +
  1. @@ -10,10 +10,8 @@

    {{localize "FALLOUT.TEMPLATES.CONDITIONS"}}

  2. -
    +
    -
    -
    {{#select system.conditions.hunger}} {{#each FALLOUT.conditions.thirst as |value key|}} @@ -38,10 +34,8 @@

    {{localize "FALLOUT.TEMPLATES.CONDITIONS"}}

  3. -
    +
    -
    -
    {{#select system.conditions.sleep}} / +   
    @@ -134,7 +136,7 @@

    {{localize "FALLOUT.TEMPLATES.RADIATION"}}< {{/ifCond}} {{#ifCond actor.type '==' 'character'}} -
    +

    {{localize "FALLOUT.TEMPLATES.POWER_ARMOR_HEALTH"}}

    @@ -238,4 +240,4 @@

    {{item.na
    {{> "systems/fallout/templates/actor/parts/actor-conditions.html"}}
    -

    \ No newline at end of file +
    From 6ccd1bcfafcf16c145c66a612be269687fc191e7 Mon Sep 17 00:00:00 2001 From: Paul Maskelyne Date: Mon, 30 Oct 2023 23:50:58 +0000 Subject: [PATCH 3/5] bump version --- CHANGELOG.md | 8 ++++++++ system/system.json | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 735dfa92..5de42aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## v11.2.2 + +## Bugfixes +- [#14] NPC / Creature inventory items messed up + +## Enhancements +- [#15] Tidy up hunger/thirst/sleep selector layout + ## v11.2.1 ## Bugfixes diff --git a/system/system.json b/system/system.json index 2157954a..96d238d7 100644 --- a/system/system.json +++ b/system/system.json @@ -2,7 +2,7 @@ "id": "fallout", "title": "Fallout 2d20", "description": "The Unofficial Fallout 2d20 System for FoundryVTT", - "version": "11.2.1", + "version": "11.2.2", "compatibility": { "minimum": "11", "verified": "11" @@ -91,5 +91,5 @@ "socket": true, "url": "https://github.com/Muttley/foundryvtt-fallout", "manifest": "https://raw.githubusercontent.com/Muttley/foundryvtt-fallout/main/system/system.json", - "download": "https://github.com/Muttley/foundryvtt-fallout/releases/download/release-11.2.1/fallout-release-11.2.1.zip" + "download": "https://github.com/Muttley/foundryvtt-fallout/releases/download/release-11.2.2/fallout-release-11.2.2.zip" } From cb8e9608261df730c2bfab2820c6c12bbd6a32b4 Mon Sep 17 00:00:00 2001 From: Paul Maskelyne Date: Mon, 30 Oct 2023 23:54:42 +0000 Subject: [PATCH 4/5] ignore these known linting issues --- system/src/helpers/handlebars.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/src/helpers/handlebars.mjs b/system/src/helpers/handlebars.mjs index 4884b18c..8ecce5bf 100644 --- a/system/src/helpers/handlebars.mjs +++ b/system/src/helpers/handlebars.mjs @@ -28,10 +28,12 @@ export const registerHandlebarsHelpers = function() { Handlebars.registerHelper("ifCond", function(v1, operator, v2, options) { switch (operator) { case "==": + // eslint-disable-next-line eqeqeq return v1 == v2 ? options.fn(this) : options.inverse(this); case "===": return v1 === v2 ? options.fn(this) : options.inverse(this); case "!=": + // eslint-disable-next-line eqeqeq return v1 != v2 ? options.fn(this) : options.inverse(this); case "!==": return v1 !== v2 ? options.fn(this) : options.inverse(this); From d66e7434fec005fb693893195bb762d1cbf8da8e Mon Sep 17 00:00:00 2001 From: Paul Maskelyne Date: Mon, 30 Oct 2023 23:55:32 +0000 Subject: [PATCH 5/5] remove live reload from gulp config --- utils/javascript.mjs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/utils/javascript.mjs b/utils/javascript.mjs index fe3696a0..ec039ff4 100644 --- a/utils/javascript.mjs +++ b/utils/javascript.mjs @@ -52,17 +52,10 @@ function lintJavascript() { } export const lint = lintJavascript; -// Wait -// -export const wait = async () => { - await delay(1500); - livereload.reload(); -}; - // Watch for file changes and lint when they do // export async function watchJavascriptUpdates() { livereload.listen(); - gulp.watch(SRC_LINT_PATHS, gulp.parallel(lint, compile, wait)); + gulp.watch(SRC_LINT_PATHS, gulp.parallel(lint, compile)); } export const watchUpdates = watchJavascriptUpdates;