Skip to content

Commit 7c06b60

Browse files
committed
a
1 parent 64496b7 commit 7c06b60

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/config.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function initConfig() {
8686
target = item.labels?.target || "-";
8787
range = item.labels?.range || "-";
8888
properties = [];
89-
dt = item.labels?.damageTypes?.split(", ");
89+
dt = item?.labels?.damages?.map(d => d.damageType);
9090
damageTypes = dt && dt.length ? dt : [];
9191
materialComponents = "";
9292

@@ -140,9 +140,9 @@ export function initConfig() {
140140
value: item.labels.toHit,
141141
});
142142
}
143-
if (item?.labels?.derivedDamage?.length) {
143+
if (item?.labels?.damages?.length) {
144144
let dmgString = "";
145-
item.labels.derivedDamage.forEach((dDmg) => {
145+
item.labels.damages.forEach((dDmg) => {
146146
dmgString += dDmg.formula + " " + getDamageTypeIcon(dDmg.damageType) + " ";
147147
});
148148
details.push({
@@ -158,6 +158,7 @@ export function initConfig() {
158158
}
159159

160160
function getDamageTypeIcon(damageType) {
161+
damageType ??= "";
161162
switch (damageType.toLowerCase()) {
162163
case "acid":
163164
return '<i class="fas fa-flask"></i>';
@@ -188,7 +189,7 @@ export function initConfig() {
188189
case "healing":
189190
return '<i class="fas fa-heart"></i>';
190191
default:
191-
return "";
192+
return '<i class="fas fa-sparkles"></i>';
192193
}
193194
}
194195

@@ -777,6 +778,13 @@ export function initConfig() {
777778
const used = await this.item.use({ event, legacy: false }, { event });
778779
if (used) {
779780
DND5eItemButton.consumeActionEconomy(this.activity);
781+
const useOtherItem = this.activity?.consumption?.targets?.find(t => t.type === "itemUses");
782+
if (useOtherItem) {
783+
const otherItem = this.actor.items.get(useOtherItem.target);
784+
const allConnectedItems = this.actor.items.filter(i => i.system.activities?.find(a => a.consumption?.targets?.find(t => t.type === "itemUses" && t.target === otherItem.id)));
785+
ui.ARGON.updateItemButtons(allConnectedItems);
786+
}
787+
this.render(true)
780788
}
781789
}
782790

0 commit comments

Comments
 (0)