@@ -398,8 +398,22 @@ Hooks.once("setupTileActions", (pMATT) => {
398398 options : { show : [ 'token' , 'tile' , 'within' , 'players' , 'previous' , 'tagger' ] } ,
399399 required : true ,
400400 restrict : ( entity ) => { return ( ( entity instanceof Token ) || ( entity instanceof Wall ) || ( entity instanceof Tile ) ) ; }
401+ } ,
402+ {
403+ id : "ConfirmDialogBehaviour" ,
404+ name : Translate ( cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".name" ) ,
405+ list : "ConfirmDialogBehaviour" ,
406+ type : "list" ,
407+ defvalue : "world"
401408 }
402409 ] ,
410+ values : {
411+ "ConfirmDialogBehaviour" : {
412+ "world" : Translate ( cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "world" ) ,
413+ "force" : Translate ( cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "force" ) ,
414+ "skip" : Translate ( cMATT + ".actions." + "spot-object" + ".settings." + "ConfirmDialogBehaviour" + ".options." + "skip" )
415+ }
416+ } ,
403417 group : cModuleName ,
404418 fn : async ( args = { } ) => {
405419 const { action } = args ;
@@ -408,15 +422,18 @@ Hooks.once("setupTileActions", (pMATT) => {
408422
409423 let vSpotted = await pMATT . getEntities ( args , "tokens" , action . data ?. targets ) ;
410424
425+ let vConfirmDialogBehaviour = action . data ?. ConfirmDialogBehaviour ;
426+
411427 let vTokenSpotted = { } ;
412428
413429 for ( let i = 0 ; i < vSpotted . length ; i ++ ) {
414430 vTokenSpotted [ vSpotted [ i ] . id ] = true ; //technically only tokens and tiles are required, but oh well
415431 }
416-
417432 let vInfos = { TokenSpotted : vTokenSpotted ,
418433 sendingPlayer : args . userid ,
419- forceConfirmDialog : true } ;
434+ forceConfirmDialog : vConfirmDialogBehaviour == "force" ,
435+ skipConfirmDialog : vConfirmDialogBehaviour == "skip" ,
436+ sendingPlayer : game . user . id } ;
420437
421438 SpottingManager . RequestSpotObjects ( vSpotted , vSpotters , vInfos ) ;
422439 } ,
0 commit comments