Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 11.2.2 #16

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 10 additions & 3 deletions scss/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
height: 100%;
margin: 0;
}
}
}
}
.chaty{
cursor: pointer;
Expand Down Expand Up @@ -362,7 +362,7 @@
}

&.no-padding {
padding: 0 !important;
padding: 0 !important;
.box-header {
margin: 0 0 0 0;
}
Expand Down Expand Up @@ -480,7 +480,7 @@
.power-armor-status {
position: relative;
max-width: 136px;
height: 180px;
height: 160px;
.body-part {
padding: 5px;
text-align: center;
Expand All @@ -499,3 +499,10 @@
}
}
}

.condition-meters {
display: grid;
grid-template-columns: 18px 2fr;
align-items: center;
column-gap: 8px;
}
6 changes: 4 additions & 2 deletions system/src/helpers/handlebars.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export const registerHandlebarsHelpers = function() {
Handlebars.registerHelper("ifCond", function(v1, operator, v2, options) {
switch (operator) {
case "==":
return v1 === v2 ? options.fn(this) : options.inverse(this);
// 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 "!=":
return v1 !== v2 ? options.fn(this) : options.inverse(this);
// 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 "<":
Expand Down
7 changes: 4 additions & 3 deletions system/src/sheets/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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") {
Expand Down
4 changes: 2 additions & 2 deletions system/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
16 changes: 5 additions & 11 deletions system/templates/actor/parts/actor-conditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
<!-- <div class="box-header">
<h4>{{localize "FALLOUT.TEMPLATES.CONDITIONS"}}</h4>
</div> -->


<ol class="items-list">
<li class="item consumable flexrow items-header">
<div class="flexrow flexlarge item-name upperC">{{localize 'FALLOUT.TEMPLATES.CONDITIONS'}}</div>
</li>

<li class="item" style="padding: 0.25rem;">
<div class="text-center">
<div class="condition-meters text-center">
<i class="fa-solid fa-pot-food" title="{{localize (concat 'FALLOUT.TEMPLATES.conditions.hunger')}}"></i>
</div>
<div class="text-center">
{{#select system.conditions.hunger}}
<select name="system.conditions.hunger">
{{#each FALLOUT.conditions.hunger as |value key|}}
Expand All @@ -24,10 +22,8 @@ <h4>{{localize "FALLOUT.TEMPLATES.CONDITIONS"}}</h4>
</div>
</li>
<li class="item" style="padding: 0.25rem;">
<div class="text-center">
<div class="condition-meters text-center">
<i class="fa-solid fa-bottle-droplet" title="{{localize (concat 'FALLOUT.TEMPLATES.conditions.thirst')}}"></i>
</div>
<div class="text-center">
{{#select system.conditions.thirst}}
<select name="system.conditions.thirst">
{{#each FALLOUT.conditions.thirst as |value key|}}
Expand All @@ -38,10 +34,8 @@ <h4>{{localize "FALLOUT.TEMPLATES.CONDITIONS"}}</h4>
</div>
</li>
<li class="item" style="padding: 0.25rem;">
<div class="text-center">
<div class="condition-meters text-center">
<i class="fa-solid fa-bed" title="{{localize (concat 'FALLOUT.TEMPLATES.conditions.sleep')}}"></i>
</div>
<div class="text-center">
{{#select system.conditions.sleep}}
<select name="system.conditions.sleep">
{{#each FALLOUT.conditions.sleep as |value key|}}
Expand All @@ -62,4 +56,4 @@ <h4>{{localize "FALLOUT.TEMPLATES.CONDITIONS"}}</h4>
</li>
</ol>

</div>
</div>
6 changes: 4 additions & 2 deletions system/templates/actor/parts/actor-status.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ <h4>{{localize "FALLOUT.TEMPLATES.RESISTANCE_GENERAL_BONUS"}}</h4>
<h3 style="margin:0; border-bottom: none;"><strong>{{localize "FALLOUT.HEALTH.health"}}</strong></h3>
</div>
<div class="flexrow align-mid">
&nbsp;&nbsp;
<input class="num-short-3" style="font-size:18px; background-color: beige; color: black;" type="number"
name="system.health.value" value="{{system.health.value}}" min="0">
<span class="text-center">/</span>
<input class="num-short-3" style="font-size:18px; background-color: beige; color: black;" type="number"
name="system.health.max" value="{{system.health.max}}" min="0">
&nbsp;&nbsp;
</div>
</div>

Expand All @@ -134,7 +136,7 @@ <h4 style="margin:0 5px 0 0"><strong>{{localize "FALLOUT.TEMPLATES.RADIATION"}}<
{{/ifCond}}

{{#ifCond actor.type '==' 'character'}}
<div class="box">
<div class="box" style="width: 139px; margin-left: 19px;">
<div class="box-header">
<h4 class="tab-switch" data-tab="apparel">{{localize "FALLOUT.TEMPLATES.POWER_ARMOR_HEALTH"}}</h4>
</div>
Expand Down Expand Up @@ -238,4 +240,4 @@ <h4 style="margin: 0 -4px; padding: 2px; background-color: #00000040;">{{item.na
<div>
{{> "systems/fallout/templates/actor/parts/actor-conditions.html"}}
</div>
</div>
</div>
9 changes: 1 addition & 8 deletions utils/javascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Loading