@@ -8,7 +8,7 @@ import { FUItemSheet } from './sheets/item-sheet.mjs';
88import { preloadHandlebarsTemplates } from './helpers/templates.mjs' ;
99import { FU , SYSTEM } from './helpers/config.mjs' ;
1010import { registerSystemSettings , SETTINGS } from './settings.js' ;
11- import { addRollContextMenuEntries , createCheckMessage , promptCheck , rollCheck } from './helpers/checks.mjs' ;
11+ import { addRollContextMenuEntries , createCheckMessage , promptCheck , promptOpenCheck , rollCheck } from './helpers/checks.mjs' ;
1212import { FUCombatTracker } from './ui/combat-tracker.mjs' ;
1313import { FUCombat } from './ui/combat.mjs' ;
1414import { FUCombatant } from './ui/combatant.mjs' ;
@@ -188,18 +188,22 @@ Hooks.once('init', async () => {
188188 Actors . unregisterSheet ( 'core' , ActorSheet ) ;
189189 Actors . registerSheet ( 'projectfu' , FUStandardActorSheet , {
190190 makeDefault : true ,
191+ label : 'Standard Actor Sheet' ,
191192 } ) ;
192193 Items . unregisterSheet ( 'core' , ItemSheet ) ;
193194 Items . registerSheet ( 'projectfu' , FUItemSheet , {
194195 makeDefault : true ,
196+ label : 'Standard Item Sheet' ,
195197 } ) ;
196198 Items . registerSheet ( SYSTEM , FUClassFeatureSheet , {
197199 types : [ 'classFeature' ] ,
198200 makeDefault : true ,
201+ label : 'Class Feature Sheet' ,
199202 } ) ;
200203 Items . registerSheet ( SYSTEM , FUOptionalFeatureSheet , {
201204 types : [ 'optionalFeature' ] ,
202205 makeDefault : true ,
206+ label : 'Optional Feature Sheet' ,
203207 } ) ;
204208
205209 Hooks . on ( 'getChatLogEntryContext' , addRollContextMenuEntries ) ;
@@ -460,20 +464,33 @@ Hooks.once('ready', async function () {
460464 rollEquipment ( actor , slot , isShift ) ;
461465 } ) ;
462466
463- Hooks . on ( 'promptCheckCalled' , ( actor ) => {
467+ function handleNoActor ( actor ) {
464468 if ( ! actor ) {
465- return ui . notification . error ( 'No character for this user' ) ;
469+ ui . notification . error ( 'No character for this user' ) ;
470+ return true ;
466471 }
467- // Call promptCheck function
472+ return false ;
473+ }
474+
475+ Hooks . on ( 'promptOpenCheckCalled' , ( actor ) => {
476+ if ( handleNoActor ( actor ) ) return ;
477+ promptOpenCheck ( actor ) ;
478+ } ) ;
479+
480+ Hooks . on ( 'promptAttributeCheckCalled' , ( actor ) => {
481+ if ( handleNoActor ( actor ) ) return ;
468482 promptCheck ( actor ) ;
469483 } ) ;
470484
471485 Hooks . on ( 'promptGroupCheckCalled' , ( actor ) => {
472- if ( ! actor ) {
473- return ui . notification . error ( 'No character for this user' ) ;
474- }
486+ if ( handleNoActor ( actor ) ) return ;
487+ let isShift = false ;
488+ GroupCheck . promptCheck ( actor , isShift ) ;
489+ } ) ;
490+
491+ Hooks . on ( 'promptInitiativeCheckCalled' , ( actor ) => {
492+ if ( handleNoActor ( actor ) ) return ;
475493 let isShift = true ;
476- // Call Group Check promptCheck function
477494 GroupCheck . promptCheck ( actor , isShift ) ;
478495 } ) ;
479496
@@ -568,20 +585,6 @@ Hooks.once('ready', async function () {
568585
569586Hooks . once ( 'socketlib.ready' , onSocketLibReady ) ;
570587
571- Hooks . once ( 'mmo-hud.ready' , ( ) => {
572- // Do this
573- } ) ;
574-
575- Hooks . once ( 'ready' , ( ) => {
576- const isPixelated = game . settings . get ( 'projectfu' , 'optionImagePixelated' ) ;
577- const applyPixelatedStyle = ( ) => {
578- // Apply the style to specific selectors
579- $ ( 'img' ) . css ( 'image-rendering' , isPixelated ? 'pixelated' : '' ) ;
580- } ;
581- // Apply the style initially
582- applyPixelatedStyle ( ) ;
583- } ) ;
584-
585588/* -------------------------------------------- */
586589/* Other Hooks */
587590/* -------------------------------------------- */
0 commit comments