Kekilla0 / Item-Macro

Store macros in your items, execute them from your character sheet or from your favorite automation module!
MIT License
19 stars 21 forks source link

SWADE support update #34

Open EternalRider opened 2 years ago

EternalRider commented 2 years ago

change the way to swade system , and provide args.

swade.js:

export function register_helper()
{
  logger.info(`Registering SWADE Helpers`);

  Hooks.on("swadeAction", async (SwadeTokenOrActor, SwadeItem, SwadeAction, SwadeRoll, SwadeUserId) => {
    //console.log([SwadeTokenOrActor, SwadeItem, SwadeAction, SwadeRoll, SwadeUserId]);  

    if( item.hasMacro() && settings.value("defaultmacro") ) {
        //console.log([SwadeTokenOrActor, SwadeItem, SwadeAction, SwadeRoll, SwadeUserId]);
        return SwadeItem.executeMacro(SwadeTokenOrActor, SwadeItem, SwadeAction, SwadeRoll, SwadeUserId);
      }
    });
}