@@ -21,7 +21,7 @@ export function initConfig() {
21
21
consumable : [ "consumable" , "equipment" , "loot" ] ,
22
22
} ;
23
23
24
- const mainBarFeatures = [ ]
24
+ const mainBarFeatures = [ ] ;
25
25
26
26
if ( game . settings . get ( MODULE_ID , "showWeaponsItems" ) ) itemTypes . consumable . push ( "weapon" ) ;
27
27
if ( game . settings . get ( MODULE_ID , "showClassActions" ) ) mainBarFeatures . push ( "class" ) ;
@@ -221,7 +221,7 @@ export function initConfig() {
221
221
}
222
222
223
223
class DND5eDrawerButton extends ARGON . DRAWER . DrawerButton {
224
- constructor ( buttons , item , type ) {
224
+ constructor ( buttons , item , type ) {
225
225
super ( buttons ) ;
226
226
this . item = item ;
227
227
this . type = type ;
@@ -231,7 +231,7 @@ export function initConfig() {
231
231
return true ;
232
232
}
233
233
234
- get tooltipOrientation ( ) {
234
+ get tooltipOrientation ( ) {
235
235
return TooltipManager . TOOLTIP_DIRECTIONS . RIGHT ;
236
236
}
237
237
@@ -258,46 +258,57 @@ export function initConfig() {
258
258
259
259
const abilitiesButtons = Object . keys ( abilities ) . map ( ( ability ) => {
260
260
const abilityData = abilities [ ability ] ;
261
- return new DND5eDrawerButton ( [
262
- {
263
- label : CONFIG . DND5E . abilities [ ability ] . label ,
264
- onClick : ( event ) => this . actor . rollAbility ( ability , { event } ) ,
265
- } ,
266
- {
267
- label : addSign ( abilityData . mod ) ,
268
- onClick : ( event ) => this . actor . rollAbilityTest ( ability , { event } ) ,
269
- } ,
270
- {
271
- label : addSign ( abilityData . save ) ,
272
- onClick : ( event ) => this . actor . rollAbilitySave ( ability , { event } ) ,
273
- } ,
274
- ] , ability , "save" ) ;
261
+ return new DND5eDrawerButton (
262
+ [
263
+ {
264
+ label : CONFIG . DND5E . abilities [ ability ] . label ,
265
+ onClick : ( event ) => this . actor . rollAbility ( ability , { event } ) ,
266
+ } ,
267
+ {
268
+ label : addSign ( abilityData . mod ) ,
269
+ onClick : ( event ) => this . actor . rollAbilityTest ( ability , { event } ) ,
270
+ } ,
271
+ {
272
+ label : addSign ( abilityData . save ) ,
273
+ onClick : ( event ) => this . actor . rollAbilitySave ( ability , { event } ) ,
274
+ } ,
275
+ ] ,
276
+ ability ,
277
+ "save" ,
278
+ ) ;
275
279
} ) ;
276
280
277
281
const skillsButtons = Object . keys ( skills ) . map ( ( skill ) => {
278
282
const skillData = skills [ skill ] ;
279
- return new DND5eDrawerButton ( [
280
- {
281
- label : getProficiencyIcon ( skillData . proficient ) + CONFIG . DND5E . skills [ skill ] . label ,
282
- onClick : ( event ) => this . actor . rollSkill ( skill , { event } ) ,
283
- } ,
284
- {
285
- label : `${ addSign ( skillData . mod ) } <span style="margin: 0 1rem; filter: brightness(0.8)">(${ skillData . passive } )</span>` ,
286
- style : "display: flex; justify-content: flex-end;" ,
287
- } ,
288
- ] , skill , "skill" ) ;
283
+ return new DND5eDrawerButton (
284
+ [
285
+ {
286
+ label : getProficiencyIcon ( skillData . proficient ) + CONFIG . DND5E . skills [ skill ] . label ,
287
+ onClick : ( event ) => this . actor . rollSkill ( skill , { event } ) ,
288
+ } ,
289
+ {
290
+ label : `${ addSign ( skillData . mod ) } <span style="margin: 0 1rem; filter: brightness(0.8)">(${ skillData . passive } )</span>` ,
291
+ style : "display: flex; justify-content: flex-end;" ,
292
+ } ,
293
+ ] ,
294
+ skill ,
295
+ "skill" ,
296
+ ) ;
289
297
} ) ;
290
298
291
299
const toolButtons = tools . map ( ( tool ) => {
292
- return new DND5eDrawerButton ( [
293
- {
294
- label : getProficiencyIcon ( tool . system . proficient ) + tool . name ,
295
- onClick : ( event ) => tool . rollToolCheck ( { event } ) ,
296
- } ,
297
- {
298
- label : addSign ( abilities [ tool . abilityMod ] . mod + tool . system . proficiencyMultiplier * this . actor . system . attributes . prof ) ,
299
- } ,
300
- ] , tool ) ;
300
+ return new DND5eDrawerButton (
301
+ [
302
+ {
303
+ label : getProficiencyIcon ( tool . system . proficient ) + tool . name ,
304
+ onClick : ( event ) => tool . rollToolCheck ( { event } ) ,
305
+ } ,
306
+ {
307
+ label : addSign ( abilities [ tool . abilityMod ] . mod + tool . system . proficiencyMultiplier * this . actor . system . attributes . prof ) ,
308
+ } ,
309
+ ] ,
310
+ tool ,
311
+ ) ;
301
312
} ) ;
302
313
303
314
return [
@@ -364,7 +375,7 @@ export function initConfig() {
364
375
get maxActions ( ) {
365
376
return this . actor . inCombat ? 1 : null ;
366
377
}
367
-
378
+
368
379
get currentActions ( ) {
369
380
return this . isActionUsed ? 0 : 1 ;
370
381
}
@@ -382,12 +393,12 @@ export function initConfig() {
382
393
const specialActions = Object . values ( ECHItems ) ;
383
394
384
395
const buttons = [ new DND5eItemButton ( { item : null , isWeaponSet : true , isPrimary : true } ) , new ARGON . MAIN . BUTTONS . SplitButton ( new DND5eSpecialActionButton ( specialActions [ 0 ] ) , new DND5eSpecialActionButton ( specialActions [ 1 ] ) ) , new DND5eButtonPanelButton ( { type : "spell" , items : spellItems , color : 0 } ) , new DND5eButtonPanelButton ( { type : "feat" , items : featItems , color : 0 } ) , new ARGON . MAIN . BUTTONS . SplitButton ( new DND5eSpecialActionButton ( specialActions [ 2 ] ) , new DND5eSpecialActionButton ( specialActions [ 3 ] ) ) , new ARGON . MAIN . BUTTONS . SplitButton ( new DND5eSpecialActionButton ( specialActions [ 4 ] ) , new DND5eSpecialActionButton ( specialActions [ 5 ] ) ) , new DND5eButtonPanelButton ( { type : "consumable" , items : consumableItems , color : 0 } ) ] ;
385
-
386
- const barItems = this . actor . items . filter ( ( item ) => mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . action . includes ( item . system . activation ?. type ) ) ;
387
- for ( const item of barItems ) {
396
+
397
+ const barItems = this . actor . items . filter ( ( item ) => CoreHUD . DND5E . mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . action . includes ( item . system . activation ?. type ) ) ;
398
+ for ( const item of barItems ) {
388
399
buttons . push ( new DND5eItemButton ( { item, inActionPanel : true } ) ) ;
389
400
}
390
-
401
+
391
402
return buttons . filter ( ( button ) => button . items == undefined || button . items . length ) ;
392
403
}
393
404
}
@@ -404,7 +415,7 @@ export function initConfig() {
404
415
get maxActions ( ) {
405
416
return this . actor . inCombat ? 1 : null ;
406
417
}
407
-
418
+
408
419
get currentActions ( ) {
409
420
return this . isActionUsed ? 0 : 1 ;
410
421
}
@@ -422,8 +433,8 @@ export function initConfig() {
422
433
buttons . push ( new DND5eButtonPanelButton ( { type, items, color : 1 } ) ) ;
423
434
}
424
435
425
- const barItems = this . actor . items . filter ( ( item ) => mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . bonus . includes ( item . system . activation ?. type ) ) ;
426
- for ( const item of barItems ) {
436
+ const barItems = this . actor . items . filter ( ( item ) => CoreHUD . DND5E . mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . bonus . includes ( item . system . activation ?. type ) ) ;
437
+ for ( const item of barItems ) {
427
438
buttons . push ( new DND5eItemButton ( { item, inActionPanel : true } ) ) ;
428
439
}
429
440
@@ -443,7 +454,7 @@ export function initConfig() {
443
454
get maxActions ( ) {
444
455
return this . actor . inCombat ? 1 : null ;
445
456
}
446
-
457
+
447
458
get currentActions ( ) {
448
459
return this . isActionUsed ? 0 : 1 ;
449
460
}
@@ -462,8 +473,8 @@ export function initConfig() {
462
473
buttons . push ( new DND5eButtonPanelButton ( { type, items, color : 3 } ) ) ;
463
474
}
464
475
465
- const barItems = this . actor . items . filter ( ( item ) => mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . reaction . includes ( item . system . activation ?. type ) ) ;
466
- for ( const item of barItems ) {
476
+ const barItems = this . actor . items . filter ( ( item ) => CoreHUD . DND5E . mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . reaction . includes ( item . system . activation ?. type ) ) ;
477
+ for ( const item of barItems ) {
467
478
buttons . push ( new DND5eItemButton ( { item, inActionPanel : true } ) ) ;
468
479
}
469
480
@@ -483,7 +494,7 @@ export function initConfig() {
483
494
get maxActions ( ) {
484
495
return this . actor . inCombat ? 1 : null ;
485
496
}
486
-
497
+
487
498
get currentActions ( ) {
488
499
return this . isActionUsed ? 0 : 1 ;
489
500
}
@@ -502,8 +513,8 @@ export function initConfig() {
502
513
buttons . push ( new DND5eButtonPanelButton ( { type, items, color : 2 } ) ) ;
503
514
}
504
515
505
- const barItems = this . actor . items . filter ( ( item ) => mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . free . includes ( item . system . activation ?. type ) ) ;
506
- for ( const item of barItems ) {
516
+ const barItems = this . actor . items . filter ( ( item ) => CoreHUD . DND5E . mainBarFeatures . includes ( item . system . type ?. value ) && actionTypes . free . includes ( item . system . activation ?. type ) ) ;
517
+ for ( const item of barItems ) {
507
518
buttons . push ( new DND5eItemButton ( { item, inActionPanel : true } ) ) ;
508
519
}
509
520
@@ -523,7 +534,7 @@ export function initConfig() {
523
534
get maxActions ( ) {
524
535
return this . actor . inCombat ? this . actor . system . resources ?. legact ?. max ?? null : null ;
525
536
}
526
-
537
+
527
538
get currentActions ( ) {
528
539
return this . actor . system . resources ?. legact ?. value ?? null ;
529
540
}
@@ -619,7 +630,7 @@ export function initConfig() {
619
630
}
620
631
621
632
get quantity ( ) {
622
- if ( ! this . item ?. system ) return null ;
633
+ if ( ! this . item ?. system ) return null ;
623
634
const showQuantityItemTypes = [ "consumable" ] ;
624
635
const consumeType = this . item . system . consume ?. type ;
625
636
if ( consumeType === "ammo" ) {
@@ -661,11 +672,11 @@ export function initConfig() {
661
672
get icon ( ) {
662
673
switch ( this . type ) {
663
674
case "spell" :
664
- return "modules/enhancedcombathud/icons/spell-book.svg " ;
675
+ return "modules/enhancedcombathud/icons/spell-book.webp " ;
665
676
case "feat" :
666
- return "modules/enhancedcombathud/icons/mighty-force.svg " ;
677
+ return "modules/enhancedcombathud/icons/mighty-force.webp " ;
667
678
case "consumable" :
668
- return "modules/enhancedcombathud/icons/drink-me.svg " ;
679
+ return "modules/enhancedcombathud/icons/drink-me.webp " ;
669
680
}
670
681
}
671
682
@@ -729,9 +740,11 @@ export function initConfig() {
729
740
constructor ( specialItem ) {
730
741
super ( ) ;
731
742
const actorItem = this . actor . items . getName ( specialItem . name ) ;
732
- this . item = actorItem ?? new CONFIG . Item . documentClass ( specialItem , {
733
- parent : this . actor ,
734
- } ) ;
743
+ this . item =
744
+ actorItem ??
745
+ new CONFIG . Item . documentClass ( specialItem , {
746
+ parent : this . actor ,
747
+ } ) ;
735
748
}
736
749
737
750
get label ( ) {
@@ -826,7 +839,7 @@ function registerItems() {
826
839
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.disengage.name" ) ] = {
827
840
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.disengage.name" ) ,
828
841
type : "feat" ,
829
- img : "modules/enhancedcombathud/icons/journey.svg " ,
842
+ img : "modules/enhancedcombathud/icons/journey.webp " ,
830
843
system : {
831
844
description : {
832
845
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.disengage.desc" ) ,
@@ -892,7 +905,7 @@ function registerItems() {
892
905
startTime : null ,
893
906
turns : 1 ,
894
907
} ,
895
- icon : "modules/enhancedcombathud/icons/journey.svg " ,
908
+ icon : "modules/enhancedcombathud/icons/journey.webp " ,
896
909
label : "Disengage" ,
897
910
origin : "Item.wyQkeuZkttllAFB1" ,
898
911
transfer : false ,
@@ -921,7 +934,7 @@ function registerItems() {
921
934
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.dodge.name" ) ] = {
922
935
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.dodge.name" ) ,
923
936
type : "feat" ,
924
- img : "modules/enhancedcombathud/icons/armor-upgrade.svg " ,
937
+ img : "modules/enhancedcombathud/icons/armor-upgrade.webp " ,
925
938
system : {
926
939
description : {
927
940
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.dodge.desc" ) ,
@@ -989,7 +1002,7 @@ function registerItems() {
989
1002
startTime : null ,
990
1003
rounds : 1 ,
991
1004
} ,
992
- icon : "modules/enhancedcombathud/icons/armor-upgrade.svg " ,
1005
+ icon : "modules/enhancedcombathud/icons/armor-upgrade.webp " ,
993
1006
label : "Dodge" ,
994
1007
origin : "Item.pakEYcgLYxtKGv7J" ,
995
1008
transfer : false ,
@@ -1006,7 +1019,6 @@ function registerItems() {
1006
1019
] ,
1007
1020
sort : 0 ,
1008
1021
flags : {
1009
-
1010
1022
"midi-qol" : {
1011
1023
onUseMacroName : "" ,
1012
1024
} ,
@@ -1015,7 +1027,7 @@ function registerItems() {
1015
1027
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.ready.name" ) ] = {
1016
1028
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.ready.name" ) ,
1017
1029
type : "feat" ,
1018
- img : "modules/enhancedcombathud/icons/clockwork.svg " ,
1030
+ img : "modules/enhancedcombathud/icons/clockwork.webp " ,
1019
1031
system : {
1020
1032
description : {
1021
1033
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.ready.desc" ) ,
@@ -1083,7 +1095,7 @@ function registerItems() {
1083
1095
startTime : null ,
1084
1096
turns : 1 ,
1085
1097
} ,
1086
- icon : "modules/enhancedcombathud/icons/clockwork.svg " ,
1098
+ icon : "modules/enhancedcombathud/icons/clockwork.webp " ,
1087
1099
label : "Ready" ,
1088
1100
transfer : false ,
1089
1101
flags : {
@@ -1099,7 +1111,6 @@ function registerItems() {
1099
1111
] ,
1100
1112
sort : 0 ,
1101
1113
flags : {
1102
-
1103
1114
"midi-qol" : {
1104
1115
onUseMacroName : "" ,
1105
1116
} ,
@@ -1108,7 +1119,7 @@ function registerItems() {
1108
1119
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.hide.name" ) ] = {
1109
1120
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.hide.name" ) ,
1110
1121
type : "feat" ,
1111
- img : "modules/enhancedcombathud/icons/cloak-dagger.svg " ,
1122
+ img : "modules/enhancedcombathud/icons/cloak-dagger.webp " ,
1112
1123
system : {
1113
1124
description : {
1114
1125
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.hide.desc" ) ,
@@ -1180,7 +1191,7 @@ function registerItems() {
1180
1191
startTime : null ,
1181
1192
turns : 10 ,
1182
1193
} ,
1183
- icon : "modules/enhancedcombathud/icons/cloak-dagger.svg " ,
1194
+ icon : "modules/enhancedcombathud/icons/cloak-dagger.webp " ,
1184
1195
label : "Hide" ,
1185
1196
transfer : false ,
1186
1197
flags : {
@@ -1204,7 +1215,7 @@ function registerItems() {
1204
1215
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.dash.name" ) ] = {
1205
1216
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.dash.name" ) ,
1206
1217
type : "feat" ,
1207
- img : "modules/enhancedcombathud/icons/walking-boot.svg " ,
1218
+ img : "modules/enhancedcombathud/icons/walking-boot.webp " ,
1208
1219
system : {
1209
1220
description : {
1210
1221
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.dash.desc" ) ,
@@ -1272,7 +1283,7 @@ function registerItems() {
1272
1283
startTime : null ,
1273
1284
rounds : 1 ,
1274
1285
} ,
1275
- icon : "modules/enhancedcombathud/icons/walking-boot.svg " ,
1286
+ icon : "modules/enhancedcombathud/icons/walking-boot.webp " ,
1276
1287
label : "Dash" ,
1277
1288
transfer : false ,
1278
1289
flags : {
@@ -1288,7 +1299,6 @@ function registerItems() {
1288
1299
] ,
1289
1300
sort : 0 ,
1290
1301
flags : {
1291
-
1292
1302
"midi-qol" : {
1293
1303
onUseMacroName : "" ,
1294
1304
} ,
@@ -1297,7 +1307,7 @@ function registerItems() {
1297
1307
ECHItems [ game . i18n . localize ( "enhancedcombathud-dnd5e.items.shove.name" ) ] = {
1298
1308
name : game . i18n . localize ( "enhancedcombathud-dnd5e.items.shove.name" ) ,
1299
1309
type : "feat" ,
1300
- img : "modules/enhancedcombathud/icons/shield-bash.svg " ,
1310
+ img : "modules/enhancedcombathud/icons/shield-bash.webp " ,
1301
1311
system : {
1302
1312
description : {
1303
1313
value : game . i18n . localize ( "enhancedcombathud-dnd5e.items.shove.desc" ) ,
@@ -1359,7 +1369,6 @@ function registerItems() {
1359
1369
effects : [ ] ,
1360
1370
sort : 0 ,
1361
1371
flags : {
1362
-
1363
1372
"midi-qol" : {
1364
1373
onUseMacroName : "" ,
1365
1374
} ,
@@ -1371,4 +1380,4 @@ function registerItems() {
1371
1380
delete ECHItems [ key ] . effects ;
1372
1381
}
1373
1382
}
1374
- }
1383
+ }
0 commit comments