Skip to content

Commit 216cbb6

Browse files
committed
Fix multiple tabs not scrolling properly
- also fix npc behavior section popping up out of nowhere - also fix npc treasures not displaying properly
1 parent 4ba56e6 commit 216cbb6

File tree

6 files changed

+59
-60
lines changed

6 files changed

+59
-60
lines changed

module/sheets/actor-sheet-utils.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ function prepareNpcCombat(context) {
110110

111111
const rules = [];
112112

113+
const treasures = [];
114+
113115
for (let item of context.items) {
114116
switch (item.type) {
115117
case 'basic':
@@ -126,12 +128,18 @@ function prepareNpcCombat(context) {
126128
case 'rule':
127129
rules.push(item);
128130
break;
131+
132+
case 'treasure':
133+
treasures.push(item);
134+
break;
129135
}
130136
}
131137

132138
context.basics = basics;
133139

134140
context.rules = rules;
141+
142+
context.treasures = treasures;
135143
}
136144

137145
/**

module/sheets/actor-standard-sheet.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ export class FUStandardActorSheet extends FUActorSheet {
236236
delete parts.classes;
237237
delete parts.spells;
238238
delete parts.items;
239+
// Behavior roll
240+
if (!game.settings.get('projectfu', 'optionBehaviorRoll')) {
241+
delete parts.behavior;
242+
}
239243
if (!game.settings.get(SYSTEM, SETTINGS.optionNPCNotesTab)) {
240244
delete parts.notes;
241245
}

styles/css/projectfu.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/scss/components/_forms.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@
364364
}
365365

366366
/* Item Description Styles */
367-
.tab.desc.active {
367+
.tab.active {
368368
margin-bottom: 5px;
369369
overflow-y: auto;
370370
min-height: 16em;

templates/actor/character/parts/actor-section-combat.hbs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,29 +141,7 @@
141141
{{/each}}
142142
</ol>
143143

144-
<ol class="items-list">
145-
<li class="item flexrow items-header">
146-
<div class="item-name">{{localize "FU.Treasures"}}</div>
147-
<div class="item-full start">{{localize "FU.Summary"}}</div>
148-
<div class="item-xs">{{localize "FU.Quantity"}}</div>
149-
<div class="item-m end">
150-
<a class="item-control item-create" data-tooltip="{{localize 'FU.TreasureCreate'}}"
151-
data-type="treasure"><i class="fas fa-plus icon"></i>{{localize "FU.Add"}}</a>
152-
</div>
153-
</li>
154-
{{#each treasures as |item id|}}
155-
<li class="item" data-item-id="{{ item._id }}">
156-
<div class="flexrow">
157-
{{!-- Item Name--}}
158-
{{> "systems/projectfu/templates/actor/partials/actor-item-name.hbs" item=item}}
159-
<div class="item-full start"><span class="description-effect">{{ item.quality }}</span></div>
160-
<div class="item-xs">{{ item.system.quantity.value }}</div>
161-
{{!-- Item Control--}}
162-
{{> "systems/projectfu/templates/actor/partials/actor-control.hbs" item=item}}
163-
</div>
164-
</li>
165-
{{/each}}
166-
</ol>
144+
{{> "systems/projectfu/templates/actor/sections/actor-section-items-treasure.hbs"}}
167145

168146
</section>
169147
{{#if actor.system.useEquipment.value}}
Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,45 @@
11
<div class="tab flexcol {{tab.cssClass}}" data-group="primary" data-tab="notes">
2-
<section class="body-section grid grid-4col">
3-
<main class="grid-span-4">
4-
{{>"systems/projectfu/templates/actor/partials/actor-traits.hbs"}}
5-
<section class="body-section grid grid-4col">
6-
{{#if (or (eq (getGameSetting 'optionNPCNotesTab') true) (eq actor.type "character"))}}
7-
<main class="grid-span-4">
8-
{{!-- Bond Section --}}
9-
{{>"systems/projectfu/templates/actor/partials/actor-bonds.hbs" bond=bond
10-
bondIndex=bondIndex}}
11-
{{!-- Enriched Description --}}
12-
<fieldset class="section-container title-fieldset desc resource-content">
13-
<legend class="resource-label-m" aria-describedby="tooltip">
14-
<a class="resource-inputs resource-label-m">
15-
{{localize 'FU.BiographyInfo'}}
16-
</a>
17-
</legend>
18-
{{formInput system.schema.fields.description
19-
toggled=true
20-
value=system.description
21-
enriched=enrichedHtml.description}}
22-
</fieldset>
23-
</main>
24-
{{else}}
25-
<main class="grid-span-4">
26-
{{!-- Enriched Description --}}
27-
{{formInput system.schema.fields.description
28-
toggled=true
29-
value=system.description
30-
enriched=enrichedHtml.description}}
31-
</main>
32-
{{/if}}
33-
</section>
34-
</main>
35-
</section>
2+
<section class="body-section grid grid-4col">
3+
{{#if (eq actor.type "character")}}
4+
<main class="grid-span-4">
5+
{{>"systems/projectfu/templates/actor/partials/actor-traits.hbs"}}
6+
<section class="body-section grid grid-4col">
7+
<main class="grid-span-4">
8+
{{!-- Bond Section --}}
9+
{{>"systems/projectfu/templates/actor/partials/actor-bonds.hbs" bond=bond
10+
bondIndex=bondIndex}}
11+
{{!-- Enriched Description --}}
12+
<fieldset class="section-container title-fieldset desc resource-content">
13+
<legend class="resource-label-m" aria-describedby="tooltip">
14+
<a class="resource-inputs resource-label-m">
15+
{{localize 'FU.BiographyInfo'}}
16+
</a>
17+
</legend>
18+
{{formInput system.schema.fields.description
19+
toggled=true
20+
value=system.description
21+
enriched=enrichedHtml.description}}
22+
</fieldset>
23+
</main>
24+
</section>
25+
</main>
26+
{{else}}
27+
<section class="body-section grid grid-4col">
28+
<main class="grid-span-4">
29+
<fieldset class="section-container title-fieldset desc resource-content">
30+
<legend class="resource-label-m" aria-describedby="tooltip">
31+
<a class="resource-inputs resource-label-m">
32+
{{localize 'FU.BiographyInfo'}}
33+
</a>
34+
</legend>
35+
{{!-- Enriched Description --}}
36+
{{formInput system.schema.fields.description
37+
toggled=true
38+
value=system.description
39+
enriched=enrichedHtml.description}}
40+
</fieldset>
41+
</main>
42+
</section>
43+
{{/if}}
44+
</section>
3645
</div>

0 commit comments

Comments
 (0)