Skip to content

Commit 66fbf2c

Browse files
committed
add self apply icon, apply tooltips, other fixes
1 parent 4937902 commit 66fbf2c

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

src/apps/script-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class WarhammerScriptEditor extends HandlebarsApplicationMixin(Ap
2727
};
2828

2929
static PARTS = {
30-
choices : {template : "modules/warhammer-lib/templates/scripts/script-config-v2.hbs"}
30+
choices : {template : "modules/warhammer-lib/templates/scripts/script-editor.hbs"}
3131
};
3232

3333
constructor(document, options)

src/document/effect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export default class WarhammerActiveEffect extends CONFIG.ActiveEffect.documentC
481481

482482
get baseName()
483483
{
484-
return (/^(?<base>.+?)[[|(<](?<specifier>.+?)[\]|)>]$/gm).exec(this.name)?.groups.base.trim();
484+
return (/^(?<base>.+?)[[|(<](?<specifier>.+?)[\]|)>]$/gm).exec(this.name)?.groups.base.trim() || this.name;;
485485
}
486486

487487
get isCondition()

src/sheets/effect.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default class WarhammerActiveEffectConfig extends WarhammerSheetMixin(Act
2929
// Replace transfer field with Effect Application data (used to derive transfer value)
3030
this.element.find("[name='transfer']").parents(".form-group").replaceWith(transferDataHTML);
3131

32+
this.element.find("[name='statuses']").parents(".form-group").remove();
33+
3234
// // Replace attribute key field with a select field
3335
let effectsTab = this.element.find("section[data-tab='effects']");
3436

static/lang/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@
160160
"Zone" : "Zone",
161161
"Other" : "Other"
162162
},
163+
"ApplyTooltips" : {
164+
"Self" : "Applies the Effect to the source Actor",
165+
"Target" : "Applies the Effect to the targets of the action or the tokens currently targeted.",
166+
"Area" : "Place an Area Template for the Effect, applying to tokens within.",
167+
"Zone" : "Select a Zone to apply this Effect to, applying to tokens within."
168+
},
163169
"Dialog.Modifiers": "Dialog Modifiers",
164170
"Dialog.UserEntry": "User Entry",
165171
"Dialog.Initial": "Initial",
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
{{#if targetEffects.length}}
22
<div class="test-buttons">
33
{{#each targetEffects as |effect e|}}
4-
<button class="apply-target" data-uuid="{{effect.uuid}}" type="button"><i class="fa-solid fa-crosshairs"></i><img src="{{effect.img}}" width="25" height="25"> <p>{{localize 'WH.ApplyEffect' name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
4+
{{#if effect.system.transferData.selfOnly}}
5+
<button class="apply-target" data-uuid="{{effect.uuid}}" type="button"><i data-tooltip="WH.ApplyTooltips.Self" data-tooltip-direction="LEFT" class="fa-solid fa-person-rays"></i><img src="{{effect.img}}" width="25" height="25"> <p>{{localize 'WH.ApplyEffect' name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
6+
{{else}}
7+
<button class="apply-target" data-uuid="{{effect.uuid}}" type="button"><i data-tooltip="WH.ApplyTooltips.Target" data-tooltip-direction="LEFT" class="fa-solid fa-crosshairs"></i><img src="{{effect.img}}" width="25" height="25"> <p>{{localize 'WH.ApplyEffect' name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
8+
{{/if}}
59
{{/each}}
610
</div>
711
{{/if}}
812

913
{{#if areaEffects.length}}
1014
<div class="test-buttons">
1115
{{#each areaEffects as |effect e|}}
12-
<button class="place-area" data-uuid={{effect.uuid}} type="button"><i class="fa-solid fa-ruler-combined"></i><img src="{{effect.img}}" width="25" height="25"> {{localize "WH.PlaceEffect" name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
16+
<button class="place-area" data-uuid={{effect.uuid}} type="button"><i data-tooltip="WH.ApplyTooltips.Area" data-tooltip-direction="LEFT" class="fa-solid fa-ruler-combined"></i><img src="{{effect.img}}" width="25" height="25"> {{localize "WH.PlaceEffect" name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
1317
{{/each}}
1418
</div>
1519
{{/if}}
1620

1721
{{#if zoneEffects.length}}
1822
<div class="test-buttons">
1923
{{#each zoneEffects as |effect e|}}
20-
<button class="place-zone" data-uuid={{effect.uuid}} type="button"><i class="fa-solid fa-game-board-simple"></i><img src="{{effect.img}}" width="25" height="25"> {{localize "WH.PlaceEffect" name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
24+
<button class="place-zone" data-uuid={{effect.uuid}} type="button"><i data-tooltip="WH.ApplyTooltips.Zone" data-tooltip-direction="LEFT" class="fa-solid fa-game-board-simple"></i><img src="{{effect.img}}" width="25" height="25"> {{localize "WH.PlaceEffect" name=effect.name}}{{#if effect.testDisplay}}<br><span class="test-label">{{effect.testDisplay}}</span>{{/if}}</p></button>
2125
{{/each}}
2226
</div>
2327
{{/if}}

0 commit comments

Comments
 (0)