diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3538c32..e347b68 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 2.6.9
+- Fix console error when moving token outside of combat
+
# 2.6.8
- Test compatibility with Foundry v0.6.2
- Start marker if enabled will no longer show up until after a token has moved for the first time on it's turn
diff --git a/dist/module.json b/dist/module.json
index 2b31d11..3d17597 100644
--- a/dist/module.json
+++ b/dist/module.json
@@ -3,7 +3,7 @@
"title": "Turn Marker",
"description": "Displays a (optionally animated) marker on the token who's active turn it is.",
"author": "Brunhine",
- "version": "2.6.8",
+ "version": "2.6.9",
"minimumCoreVersion": "0.5.6",
"compatibleCoreVersion": "0.6.2",
"esmodules": [
@@ -35,5 +35,5 @@
],
"url": "https://github.com/Brunhine/TurnMarker",
"manifest": "https://raw.githubusercontent.com/Brunhine/TurnMarker/master/src/module.json",
- "download": "https://github.com/Brunhine/TurnMarker/releases/download/v2.6.8/turnmarker.zip"
+ "download": "https://github.com/Brunhine/TurnMarker/releases/download/v2.6.9/turnmarker.zip"
}
\ No newline at end of file
diff --git a/dist/scripts/turnmarker.js b/dist/scripts/turnmarker.js
index c9b93fb..e8372db 100644
--- a/dist/scripts/turnmarker.js
+++ b/dist/scripts/turnmarker.js
@@ -22,7 +22,7 @@
/*!***********************************!*\
!*** ./src/scripts/turnmarker.js ***!
\***********************************/
-/*! no exports provided */function(e,t,a){"use strict";a.r(t);var s=a(/*! ./chatter.js */"./src/scripts/chatter.js"),n=a(/*! ./marker.js */"./src/scripts/marker.js"),r=a(/*! ./markeranimation.js */"./src/scripts/markeranimation.js"),i=a(/*! ./settings.js */"./src/scripts/settings.js"),o=a(/*! ./updateWindow.js */"./src/scripts/updateWindow.js"),c=a(/*! ./utils.js */"./src/scripts/utils.js");let m,g,d="";Hooks.on("ready",async()=>{i.Settings.registerSettings();let e=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);if(e&&e.id){g=e.id;let t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);t.zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,t.parent.sortChildren(),!game.paused&&i.Settings.getShouldAnimate()&&(m=r.MarkerAnimation.startAnimation(m,g))}game.user.isGM&&isNewerVersion(game.modules.get("turnmarker").data.version,i.Settings.getVersion())&&Object(o.renderUpdateWindow)(),game.socket.on(c.socketName,async e=>{if(game.user.isGM)switch(e.mode){case c.socketAction.placeStartMarker:await canvas.scene.createEmbeddedEntity("Tile",e.tileData),canvas.scene.setFlag(c.FlagScope,c.Flags.startMarkerPlaced,!0)}})}),Hooks.on("createTile",(e,t)=>{1==t.flags.turnMarker&&(g=t._id,(t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker)).zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,t.parent.sortChildren(),i.Settings.getShouldAnimate()&&(m=r.MarkerAnimation.startAnimation(m,g)))}),Hooks.on("preUpdateToken",async(e,t)=>{t._id!=game.combat.combatant.token._id||canvas.scene.getFlag(c.FlagScope,c.Flags.startMarkerPlaced)||await n.Marker.placeStartMarker(game.combat.combatant.token._id)}),Hooks.on("updateCombat",async(e,t)=>{if(e.combatant&&t&&d!=e.combatant._id&&game.user.isGM&&game.userId==Object(c.firstGM)()&&(d=e.combatant._id,e&&e.combatant)){let t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker),a=await n.Marker.placeTurnMarker(e.combatant.token._id,t&&t.id||void 0);a&&(g=a.markerId,m=a.animator),i.Settings.getTurnMarkerEnabled()&&(n.Marker.deleteStartMarker(),canvas.scene.unsetFlag(c.FlagScope,c.Flags.startMarkerPlaced)),i.Settings.shouldAnnounceTurns()&&!e.combatant.hidden&&s.Chatter.sendTurnMessage(e.combatant)}}),Hooks.on("deleteCombat",async()=>{game.user.isGM&&n.Marker.clearAllMarkers(),r.MarkerAnimation.stopAnimation(m)}),Hooks.on("updateToken",(e,t,a)=>{let s=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);s&&(a.x||a.y||a.width||a.height||a.hidden)&&game&&game.combat&&game.combat.combatant&&game.combat.combatant.tokenId==t._id&&game.user.isGM&&game.combat&&(n.Marker.moveMarkerToToken(t._id,s.id),s.zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,s.parent.sortChildren())}),Hooks.on("updateTile",()=>{if(canvas.scene.data.tokenVision){let e=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);if(e){let t=canvas.tokens.placeables.find(e=>e.id==game.combat.combatant.tokenId);t&&!t.data.hidden&&(e.visible=canvas.sight.testVisibility(t.center,{tolerance:canvas.dimensions.size/4}))}}}),Hooks.on("pauseGame",async e=>{g&&i.Settings.getShouldAnimate()&&(e?r.MarkerAnimation.stopAnimation(m):m=r.MarkerAnimation.startAnimation(m,g))})},"./src/scripts/updateWindow.js":
+/*! no exports provided */function(e,t,a){"use strict";a.r(t);var s=a(/*! ./chatter.js */"./src/scripts/chatter.js"),n=a(/*! ./marker.js */"./src/scripts/marker.js"),r=a(/*! ./markeranimation.js */"./src/scripts/markeranimation.js"),i=a(/*! ./settings.js */"./src/scripts/settings.js"),o=a(/*! ./updateWindow.js */"./src/scripts/updateWindow.js"),m=a(/*! ./utils.js */"./src/scripts/utils.js");let c,g,d="";Hooks.on("ready",async()=>{i.Settings.registerSettings();let e=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);if(e&&e.id){g=e.id;let t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);t.zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,t.parent.sortChildren(),!game.paused&&i.Settings.getShouldAnimate()&&(c=r.MarkerAnimation.startAnimation(c,g))}game.user.isGM&&isNewerVersion(game.modules.get("turnmarker").data.version,i.Settings.getVersion())&&Object(o.renderUpdateWindow)(),game.socket.on(m.socketName,async e=>{if(game.user.isGM)switch(e.mode){case m.socketAction.placeStartMarker:await canvas.scene.createEmbeddedEntity("Tile",e.tileData),canvas.scene.setFlag(m.FlagScope,m.Flags.startMarkerPlaced,!0)}})}),Hooks.on("createTile",(e,t)=>{1==t.flags.turnMarker&&(g=t._id,(t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker)).zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,t.parent.sortChildren(),i.Settings.getShouldAnimate()&&(c=r.MarkerAnimation.startAnimation(c,g)))}),Hooks.on("preUpdateToken",async(e,t)=>{game.combat&&(t._id!=game.combat.combatant.token._id||canvas.scene.getFlag(m.FlagScope,m.Flags.startMarkerPlaced)||await n.Marker.placeStartMarker(game.combat.combatant.token._id))}),Hooks.on("updateCombat",async(e,t)=>{if(e.combatant&&t&&d!=e.combatant._id&&game.user.isGM&&game.userId==Object(m.firstGM)()&&(d=e.combatant._id,e&&e.combatant)){let t=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker),a=await n.Marker.placeTurnMarker(e.combatant.token._id,t&&t.id||void 0);a&&(g=a.markerId,c=a.animator),i.Settings.getTurnMarkerEnabled()&&(n.Marker.deleteStartMarker(),canvas.scene.unsetFlag(m.FlagScope,m.Flags.startMarkerPlaced)),i.Settings.shouldAnnounceTurns()&&!e.combatant.hidden&&s.Chatter.sendTurnMessage(e.combatant)}}),Hooks.on("deleteCombat",async()=>{game.user.isGM&&n.Marker.clearAllMarkers(),r.MarkerAnimation.stopAnimation(c)}),Hooks.on("updateToken",(e,t,a)=>{let s=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);s&&(a.x||a.y||a.width||a.height||a.hidden)&&game&&game.combat&&game.combat.combatant&&game.combat.combatant.tokenId==t._id&&game.user.isGM&&game.combat&&(n.Marker.moveMarkerToToken(t._id,s.id),s.zIndex=Math.max(...canvas.tiles.placeables.map(e=>e.zIndex))+1,s.parent.sortChildren())}),Hooks.on("updateTile",()=>{if(canvas.scene.data.tokenVision){let e=canvas.tiles.placeables.find(e=>1==e.data.flags.turnMarker);if(e){let t=canvas.tokens.placeables.find(e=>e.id==game.combat.combatant.tokenId);t&&!t.data.hidden&&(e.visible=canvas.sight.testVisibility(t.center,{tolerance:canvas.dimensions.size/4}))}}}),Hooks.on("pauseGame",async e=>{g&&i.Settings.getShouldAnimate()&&(e?r.MarkerAnimation.stopAnimation(c):c=r.MarkerAnimation.startAnimation(c,g))})},"./src/scripts/updateWindow.js":
/*!*************************************!*\
!*** ./src/scripts/updateWindow.js ***!
\*************************************/
@@ -30,5 +30,5 @@
/*!******************************!*\
!*** ./src/scripts/utils.js ***!
\******************************/
-/*! exports provided: modName, FlagScope, Flags, socketName, socketAction, findTokenById, firstGM */function(e,t,a){"use strict";a.r(t),a.d(t,"modName",(function(){return s})),a.d(t,"FlagScope",(function(){return n})),a.d(t,"Flags",(function(){return r})),a.d(t,"socketName",(function(){return i})),a.d(t,"socketAction",(function(){return o})),a.d(t,"findTokenById",(function(){return c})),a.d(t,"firstGM",(function(){return m}));const s="turnmarker",n="turnmarker",r={startMarkerPlaced:"startMarkerPlaced"},i="module.turnmarker",o={placeStartMarker:0};function c(e){return canvas.tokens.ownedTokens.find(t=>t.id==e)}function m(){for(let e of game.users.entities)if(e.data.role>=4&&e.active)return e.data._id}}});
+/*! exports provided: modName, FlagScope, Flags, socketName, socketAction, findTokenById, firstGM */function(e,t,a){"use strict";a.r(t),a.d(t,"modName",(function(){return s})),a.d(t,"FlagScope",(function(){return n})),a.d(t,"Flags",(function(){return r})),a.d(t,"socketName",(function(){return i})),a.d(t,"socketAction",(function(){return o})),a.d(t,"findTokenById",(function(){return m})),a.d(t,"firstGM",(function(){return c}));const s="turnmarker",n="turnmarker",r={startMarkerPlaced:"startMarkerPlaced"},i="module.turnmarker",o={placeStartMarker:0};function m(e){return canvas.tokens.ownedTokens.find(t=>t.id==e)}function c(){for(let e of game.users.entities)if(e.data.role>=4&&e.active)return e.data._id}}});
//# sourceMappingURL=turnmarker.js.map
\ No newline at end of file
diff --git a/dist/scripts/turnmarker.js.map b/dist/scripts/turnmarker.js.map
index c0e85e9..51d2f96 100644
--- a/dist/scripts/turnmarker.js.map
+++ b/dist/scripts/turnmarker.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/scripts/chatter.js","webpack:///./src/scripts/marker.js","webpack:///./src/scripts/markeranimation.js","webpack:///./src/scripts/settings.js","webpack:///./src/scripts/settingsForm.js","webpack:///./src/scripts/turnmarker.js","webpack:///./src/scripts/updateWindow.js","webpack:///./src/scripts/utils.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Chatter","combatant","players","forEach","player","push","length","ChatMessage","speaker","actor","content","this","placeImage","join","getIncludeAnnounceImage","img","flags","core","thumb","Marker","tokenId","markerId","moveMarkerToToken","clearAllMarkers","getTurnMarkerEnabled","token","dims","getRatio","getImageDimensions","center","getImageLocation","newTile","Tile","getImagePath","width","w","height","h","x","y","z","rotation","hidden","data","locked","turnMarker","canvas","scene","createEmbeddedEntity","_id","tile","getEmbeddedCollection","startMarker","deleteEmbeddedEntity","getStartMarkerEnabled","getStartMarker","game","user","isGM","setFlag","startMarkerPlaced","socket","emit","placeStartMarker","tileData","updateEmbeddedEntity","tiles","placeables","find","id","animator","stopAnimation","ignoreRatio","ratio","newWidth","newHeight","grid","type","newX","newY","MarkerAnimation","tileId","getEmbeddedEntity","animateRotation","app","ticker","add","remove","dt","delta","getInterval","err","imageTitles","Settings","settings","val","set","trim","getImageByIndex","index","registerMenu","label","icon","restricted","register","default","String","scope","hint","config","Number","Boolean","choices","onChange","updateImagePath","videos","SettingsForm","FormApplication","options","super","mergeObject","defaultOptions","title","template","classes","closeOnSubmit","turnMarkerEnabled","image","getSelectList","getImageIndex","customImage","getCustomImagePath","announce","shouldAnnounceTurns","announceImage","startMarkerEnabled","startMarkerPath","getStartMarkerPath","previewPath","e","console","log","setRatio","setImage","setCustomImagePath","setShouldAnnounceTurns","setIncludeAnnounceImage","setTurnMarkerEnabled","setStartMarkerEnabled","setStartMarkerPath","html","activateListeners","markerSelect","markerImgPreview","updatePreview","on","event","attr","target","markerVideoPreview","disabled","removeClass","addClass","ext","getExtension","warn","includes","toLowerCase","filePath","slice","lastIndexOf","array","selected","lastTurn","Hooks","async","registerSettings","marker","zIndex","Math","max","map","parent","sortChildren","paused","getShouldAnimate","startAnimation","isNewerVersion","version","getVersion","combat","getFlag","update","userId","result","placeTurnMarker","undefined","deleteStartMarker","unsetFlag","sendTurnMessage","updateToken","updateData","tokenVision","tokens","visible","sight","testVisibility","tolerance","dimensions","size","isPaused","renderUpdateWindow","UpdateWindow","Application","resizable","ev","setVersion","currentTarget","checked","oldVersion","render","modName","FlagScope","Flags","socketName","socketAction","findTokenById","ownedTokens","firstGM","users","entities","role","active"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQr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,OAAQ,CAAEkL,UAAWjK,OAAOkK,WAAWC,KAAO,SAMnHnC,MAAMnB,GAAG,YAAaoB,MAAOmC,IACrB7L,GAAY,WAASoK,qBACjByB,EACA,kBAAgB3I,cAAcD,GAE9BA,EAAW,kBAAgBoH,eAAepH,EAAUjD,O;;;;wECvHhE,mHAEO,SAAS8L,IACZ,MAAMpP,EAASyF,KAAKtF,QAAQW,IAAI,cAEhC,GAAK8M,eAAe5N,EAAO4E,KAAKiJ,QAAS,WAASC,cAAlD,CAGA,MAAMuB,UAAqBC,YACvB,4BACI,OAAO7F,YAAYD,MAAME,eAAgB,CACrCE,SAAU,WAAW5J,EAAOsG,iCAC5BiJ,WAAW,EACXpL,MAAO,IACPE,OAAQ,IACRwF,QAAS,CAAC,gBACVF,MAAU3J,EAAO4E,KAAK+E,MAAf,eAIf,UACI,MAAO,CACHkE,QAAS7N,EAAO4E,KAAKiJ,SAI7B,kBAAkBtC,GACd/B,MAAMgC,kBAAkBD,GAExBA,EAAKlF,KAAK,eAAeuF,GAAG,SAAU4D,IAClC,WAASC,WAAWD,EAAGE,cAAcC,QAAU3P,EAAO4E,KAAKiJ,QAAU+B,gBAKjF,IAAIP,GAAeQ,QAAO,M;;;;8aC/BvB,MAAMC,EAAU,aAGVC,EAAY,aACZC,EAAQ,CACjBnK,kBAAmB,qBAIVoK,EAAa,oBACbC,EAAe,CACxBlK,iBAAkB,GAOf,SAASmK,EAAc9M,GAC1B,OAAO0B,OAAO6J,OAAOwB,YAAY/J,KAAKlF,GAAKA,EAAEmF,IAAMjD,GAOhD,SAASgN,IACZ,IAAK,IAAI3K,KAAQD,KAAK6K,MAAMC,SACxB,GAAI7K,EAAKd,KAAK4L,MAAQ,GAAK9K,EAAK+K,OAC5B,OAAO/K,EAAKd,KAAKM","file":"turnmarker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"modules/turnmarker/scripts/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/scripts/turnmarker.js\");\n","import { Settings } from \"./settings.js\";\r\n\r\nexport class Chatter {\r\n\r\n static sendTurnMessage(combatant) {\r\n let players = [];\r\n combatant.players.forEach(player => {\r\n players.push(player.name);\r\n });\r\n if (players.length == 0) players.push(\"GM\");\r\n ChatMessage.create({\r\n speaker: { actor: combatant.actor },\r\n //speaker: { actor: {}, alias: 'Turn Marker' },\r\n content:\r\n `
${this.placeImage(combatant)}\r\n
\r\n
${combatant.name}'s Turn
\r\n
${players.join(' - ')}
\r\n
\r\n
Turn Marker`\r\n });\r\n }\r\n\r\n static placeImage(combatant) {\r\n if (Settings.getIncludeAnnounceImage()) {\r\n let img = combatant.img;\r\n if (combatant.flags.core && combatant.flags.core.thumb) {\r\n img = combatant.flags.core.thumb;\r\n }\r\n return ``;\r\n // return ``;\r\n } else return '';\r\n }\r\n}","import { MarkerAnimation } from './markeranimation.js';\r\nimport { Settings } from './settings.js';\r\nimport { findTokenById, Flags, FlagScope, socketAction, socketName } from './utils.js';\r\n\r\n/**\r\n * Provides functionality for creating, moving, and animating the turn marker\r\n */\r\nexport class Marker {\r\n\r\n /**\r\n * Places a new turn marker under the token specified, and if required, starts the animation\r\n * @param {String} tokenId - The ID of the token where the marker should be placed\r\n * @param {Object} animator - The animator object\r\n * @param {String} markerId - The ID of the tile being used as the turn marker\r\n */\r\n static async placeTurnMarker(tokenId, markerId) {\r\n if (!markerId) {\r\n this.clearAllMarkers();\r\n\r\n if (Settings.getTurnMarkerEnabled()) {\r\n let token = findTokenById(tokenId);\r\n let ratio = Settings.getRatio();\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n\r\n let newTile = new Tile({\r\n img: Settings.getImagePath(),\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n z: 900,\r\n rotation: 0,\r\n hidden: token.data.hidden,\r\n locked: false,\r\n flags: { turnMarker: true }\r\n });\r\n\r\n let tile = await canvas.scene.createEmbeddedEntity('Tile', newTile.data);\r\n\r\n return tile._id;\r\n } else {\r\n return null;\r\n }\r\n } else {\r\n this.moveMarkerToToken(tokenId, markerId);\r\n return markerId;\r\n }\r\n }\r\n\r\n /**\r\n * Deletes any tiles flagged as a 'Start Marker' from the canvas\r\n */\r\n static async deleteStartMarker() {\r\n for (var tile of canvas.scene.getEmbeddedCollection('Tile')) {\r\n if (tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * If enabled in settings, place a \"start\" marker under the token where their turn started.\r\n * @param {String} tokenId - The ID of the token to place the start marker under\r\n */\r\n static async placeStartMarker(tokenId) {\r\n if (Settings.getStartMarkerEnabled()) {\r\n let token = findTokenById(tokenId);\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n let newTile = new Tile({\r\n img: Settings.getStartMarker(),\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n z: 900,\r\n rotation: 0,\r\n hidden: token.data.hidden,\r\n locked: false,\r\n flags: { startMarker: true }\r\n });\r\n\r\n if (game.user.isGM) {\r\n canvas.scene.createEmbeddedEntity('Tile', newTile.data);\r\n canvas.scene.setFlag(FlagScope, Flags.startMarkerPlaced, true);\r\n } else {\r\n game.socket.emit(socketName, {\r\n mode: socketAction.placeStartMarker,\r\n tileData: newTile.data\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Moves the turn marker tile under the specified token\r\n * @param {String} tokenId - The ID of the token that the marker should be placed under\r\n * @param {String} markerId - The ID of the tile currently serving as the turn marker\r\n */\r\n static async moveMarkerToToken(tokenId, markerId) {\r\n let token = findTokenById(tokenId);\r\n let ratio = Settings.getRatio();\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n\r\n await canvas.scene.updateEmbeddedEntity('Tile', {\r\n _id: markerId,\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n hidden: token.data.hidden\r\n });\r\n }\r\n\r\n /**\r\n * Removes any existing turn marker and start marker tiles from the canvas\r\n */\r\n static async clearAllMarkers() {\r\n let tiles = canvas.scene.getEmbeddedCollection('Tile');\r\n\r\n for (var tile of tiles) {\r\n if (tile.flags.turnMarker || tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Updates the tile image when the image path has changed\r\n */\r\n static updateImagePath() {\r\n if (game.user.isGM) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n canvas.scene.updateEmbeddedEntity('Tile', {\r\n _id: tile.id,\r\n img: Settings.getImagePath()\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Completely resets the turn marker - deletes all tiles and stops any animation\r\n * @param {Object} animator - The animator object\r\n */\r\n static reset(animator) {\r\n MarkerAnimation.stopAnimation(animator);\r\n this.clearAllMarkers();\r\n }\r\n\r\n /**\r\n * Gets the proper dimensions of the marker tile taking into account the current grid layout\r\n * @param {object} token - The token that the tile should be placed under\r\n */\r\n static getImageDimensions(token, ignoreRatio = false) {\r\n let ratio = ignoreRatio ? 1 : Settings.getRatio();\r\n let newWidth = 0;\r\n let newHeight = 0;\r\n\r\n switch (canvas.grid.type) {\r\n case 2: case 3: // Hex Rows\r\n newWidth = newHeight = token.h * ratio;\r\n break;\r\n case 4: case 5: // Hex Columns\r\n newWidth = newHeight = token.w * ratio;\r\n break;\r\n default: // Gridless and Square\r\n newWidth = token.w * ratio;\r\n newHeight = token.h * ratio;\r\n break;\r\n }\r\n\r\n return { w: newWidth, h: newHeight };\r\n }\r\n\r\n /**\r\n * Gets the proper location of the marker tile taking into account the current grid layout\r\n * @param {object} token - The token that the tile should be placed under\r\n */\r\n static getImageLocation(token, ignoreRatio = false) {\r\n let ratio = ignoreRatio ? 1 : Settings.getRatio();\r\n let newX = 0;\r\n let newY = 0;\r\n\r\n switch (canvas.grid.type) {\r\n case 2: case 3: // Hex Rows\r\n newX = token.center.x - ((token.h * ratio) / 2);\r\n newY = token.center.y - ((token.h * ratio) / 2);\r\n break;\r\n case 4: case 5: // Hex Columns\r\n newX = token.center.x - ((token.w * ratio) / 2);\r\n newY = token.center.y - ((token.w * ratio) / 2);\r\n break;\r\n default: // Gridless and Square\r\n newX = token.center.x - ((token.w * ratio) / 2);\r\n newY = token.center.y - ((token.h * ratio) / 2);\r\n }\r\n\r\n return { x: newX, y: newY };\r\n }\r\n}","import { Settings } from './settings.js';\r\n\r\nexport class MarkerAnimation {\r\n /**\r\n * Starts the animation loop for the specified tile\r\n * @param {object} animator - The animator object\r\n * @param {String} tileId - The ID of the tile currently serving as the turn marker \r\n */\r\n static startAnimation(animator, tileId) {\r\n let tile = canvas.scene.getEmbeddedEntity('Tile', tileId);\r\n animator = this.animateRotation.bind(tile);\r\n canvas.app.ticker.add(animator);\r\n return animator;\r\n }\r\n\r\n /**\r\n * Stops the animation loop for the specified tile\r\n * @param {object} animator - The animator object\r\n */\r\n static stopAnimation(animator) {\r\n canvas.app.ticker.remove(animator);\r\n }\r\n\r\n /**\r\n * Called on every tick of the animation loop to rotate the image based on the current frame\r\n * @param {number} dt - The delta time\r\n */\r\n static animateRotation(dt) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile && tile.data.img) {\r\n let delta = Settings.getInterval() / 10000;\r\n try {\r\n tile.tile.img.rotation += (delta * dt);\r\n } catch (err) {\r\n // skip lost frames if the tile is being updated by the server\r\n }\r\n }\r\n }\r\n}","import { Marker } from './marker.js';\r\nimport { SettingsForm } from './settingsForm.js';\r\nimport { modName } from './utils.js';\r\n\r\nconst version = 'tm-version';\r\nconst ratio = 'ratio';\r\nconst animation = 'animation';\r\nconst interval = 'interval';\r\nconst announce = 'announce-turn';\r\nconst announceAsActor = 'announce-asActor';\r\nconst announceImage = 'announce-image';\r\nconst image = 'image';\r\nconst customimage = 'customimage';\r\nconst turnMarkerEnabled = 'turnmarker-enabled';\r\nconst startMarkerEnabled = 'startMarker-enabled';\r\nconst startMarkerImage = 'startMarker-custom';\r\nexport const imageTitles = [\r\n 'Runes of Incendium by Rin',\r\n 'Runes of the Cultist by Rin',\r\n 'Runes of Regeneration by Rin',\r\n 'Runes of the Cosmos by Rin',\r\n 'Runes of Earthly Dust by Rin',\r\n 'Runes of Reality by Rin',\r\n 'Runes of the Believer by Rin',\r\n 'Runes of the Mad Mage by Rin',\r\n 'Runes of the Blue Sky by Rin',\r\n 'Runes of the Universe by Rin',\r\n 'Runes of Prosperity by Rin'\r\n];\r\n\r\n/**\r\n * Provides functionality for reading and writing module settings\r\n */\r\nexport class Settings {\r\n\r\n static getVersion() {\r\n return game.settings.get(modName, version);\r\n }\r\n\r\n static setVersion(val) {\r\n game.settings.set(modName, version, val);\r\n }\r\n\r\n /**\r\n * Gets the image ratio\r\n */\r\n static getRatio() {\r\n return game.settings.get(modName, ratio);\r\n }\r\n\r\n /**\r\n * Sets the image ratio\r\n * @param {Number} val - The image ratio\r\n */\r\n static setRatio(val) {\r\n game.settings.set(modName, ratio, val);\r\n }\r\n\r\n /**\r\n * Returns true if the marker should be animated\r\n */\r\n static getShouldAnimate() {\r\n return game.settings.get(modName, animation);\r\n }\r\n\r\n /**\r\n * Gets the animation interval in ms.\r\n */\r\n static getInterval() {\r\n return game.settings.get(modName, interval);\r\n }\r\n\r\n /**\r\n * Returns true if turn changes should be announced in chat\r\n */\r\n static shouldAnnounceTurns() {\r\n return game.settings.get(modName, announce);\r\n }\r\n\r\n /**\r\n * Sets whether or not to announce turn changes\r\n * @param {Boolean} val - Whether or not to announce turn changes\r\n */\r\n static setShouldAnnounceTurns(val) {\r\n game.settings.set(modName, announce, val);\r\n }\r\n\r\n static getIncludeAnnounceImage() {\r\n return game.settings.get(modName, announceImage);\r\n }\r\n\r\n static setIncludeAnnounceImage(val) {\r\n game.settings.set(modName, announceImage, val);\r\n }\r\n\r\n /**\r\n * Gets the index of the currently selected marker image\r\n */\r\n static getImageIndex() {\r\n return game.settings.get(modName, image);\r\n }\r\n\r\n static getStartMarker() {\r\n if (game.settings.get(modName, startMarkerImage).trim() == '') {\r\n return 'modules/turnmarker/assets/start.png';\r\n } else {\r\n return game.settings.get(modName, startMarkerImage);\r\n }\r\n }\r\n\r\n static getTurnMarkerEnabled() {\r\n return game.settings.get(modName, turnMarkerEnabled);\r\n }\r\n\r\n\r\n static setTurnMarkerEnabled(val) {\r\n game.settings.set(modName, turnMarkerEnabled, val);\r\n }\r\n\r\n static getStartMarkerEnabled() {\r\n return game.settings.get(modName, startMarkerEnabled);\r\n }\r\n\r\n static setStartMarkerEnabled(val) {\r\n game.settings.set(modName, startMarkerEnabled, val);\r\n }\r\n\r\n static getStartMarkerPath() {\r\n return game.settings.get(modName, startMarkerImage);\r\n }\r\n\r\n static setStartMarkerPath(val) {\r\n game.settings.set(modName, startMarkerImage, val);\r\n }\r\n\r\n /**\r\n * Gets a path to the currently selected image to be used as the marker\r\n */\r\n static getImagePath() {\r\n if (game.settings.get(modName, customimage).trim() == '') {\r\n return this.getImageByIndex(game.settings.get(modName, image));\r\n } else {\r\n return game.settings.get(modName, customimage);\r\n }\r\n }\r\n\r\n static getImageByIndex(index) {\r\n switch (index) {\r\n case 0: return 'modules/turnmarker/assets/incendium.png';\r\n case 1: return 'modules/turnmarker/assets/cultist.png';\r\n case 2: return 'modules/turnmarker/assets/regeneration.png';\r\n case 3: return 'modules/turnmarker/assets/cosmos.png';\r\n case 4: return 'modules/turnmarker/assets/earthlydust.png';\r\n case 5: return 'modules/turnmarker/assets/reality.png';\r\n case 6: return 'modules/turnmarker/assets/believer.png';\r\n case 7: return 'modules/turnmarker/assets/madmage.png';\r\n case 8: return 'modules/turnmarker/assets/bluesky.png';\r\n case 9: return 'modules/turnmarker/assets/universe.png';\r\n case 10: return 'modules/turnmarker/assets/prosperity.png';\r\n }\r\n }\r\n\r\n static setImage(val) {\r\n game.settings.set(modName, image, val);\r\n }\r\n\r\n static getCustomImagePath() {\r\n return game.settings.get(modName, customimage);\r\n }\r\n\r\n static setCustomImagePath(val) {\r\n game.settings.set(modName, customimage, val);\r\n }\r\n\r\n /**\r\n * Registers all game settings\r\n */\r\n static registerSettings() {\r\n\r\n game.settings.registerMenu(modName, 'tm.settingsMenu', {\r\n name: 'tm.settings.button.name',\r\n label: 'tm.settings.button.label',\r\n icon: 'fas fa-sync-alt',\r\n type: SettingsForm,\r\n restricted: true,\r\n });\r\n\r\n game.settings.register(modName, version, {\r\n name: `${modName} version`,\r\n default: '0.0.0',\r\n type: String,\r\n scope: 'world',\r\n });\r\n\r\n game.settings.register(modName, ratio, {\r\n name: 'tm.settings.ratio.name',\r\n hint: 'tm.settings.ratio.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Number,\r\n default: 1.5,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, animation, {\r\n name: 'tm.settings.animate.name',\r\n hint: 'tm.settings.animate.hint',\r\n scope: 'user',\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n });\r\n\r\n game.settings.register(modName, interval, {\r\n name: 'tm.settings.interval.name',\r\n hint: 'tm.settings.interval.hint',\r\n scope: 'user',\r\n config: true,\r\n type: Number,\r\n default: 100\r\n });\r\n\r\n game.settings.register(modName, image, {\r\n name: 'tm.settings.image.name',\r\n scope: 'world',\r\n config: false,\r\n type: Number,\r\n default: 0,\r\n choices: imageTitles,\r\n restricted: true,\r\n onChange: value => Marker.updateImagePath(value)\r\n });\r\n\r\n game.settings.register(modName, customimage, {\r\n name: 'tm.settings.customImage.name',\r\n hint: 'tm.settings.customImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: String,\r\n default: '',\r\n restricted: true,\r\n onChange: value => Marker.updateImagePath(value)\r\n });\r\n\r\n game.settings.register(modName, announce, {\r\n name: 'tm.settings.announce.name',\r\n hint: 'tm.settings.announce.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, announceImage, {\r\n name: 'tm.settings.announceImage.name',\r\n hint: 'tm.settings.announceImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, announceAsActor, {\r\n name: 'tm.settings.announceAs.name',\r\n hint: 'tm.settings.announceAs.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, turnMarkerEnabled, {\r\n name: 'tm.settings.turnMarkerEnabled.name',\r\n hint: 'tm.settings.turnMarkerEnabled.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, startMarkerEnabled, {\r\n name: 'tm.settings.startEnabled.name',\r\n hint: 'tm.settings.startEnabled.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: false,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, startMarkerImage, {\r\n name: 'tm.settings.startImage.name',\r\n hint: 'tm.settings.startImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: String,\r\n default: '',\r\n restricted: true\r\n });\r\n }\r\n}","import { imageTitles, Settings } from './settings.js';\r\n\r\nconst videos = ['mp4', 'webm', 'ogg'];\r\n\r\nexport class SettingsForm extends FormApplication {\r\n\r\n constructor(object, options = {}) {\r\n super(object, options);\r\n }\r\n\r\n /**\r\n * Default Options for this FormApplication\r\n */\r\n static get defaultOptions() {\r\n return mergeObject(super.defaultOptions, {\r\n id: 'turnmarker-settings-form',\r\n title: 'Turn Marker - Global Settings',\r\n template: './modules/turnmarker/templates/settings.html',\r\n classes: ['sheet', 'tm-settings'],\r\n width: 500,\r\n closeOnSubmit: true\r\n });\r\n }\r\n\r\n getData() {\r\n return {\r\n turnMarkerEnabled: Settings.getTurnMarkerEnabled(),\r\n ratio: Settings.getRatio(),\r\n image: this.getSelectList(imageTitles, Settings.getImageIndex()),\r\n customImage: Settings.getCustomImagePath(),\r\n announce: Settings.shouldAnnounceTurns(),\r\n announceImage: Settings.getIncludeAnnounceImage(),\r\n startMarkerEnabled: Settings.getStartMarkerEnabled(),\r\n startMarkerPath: Settings.getStartMarkerPath(),\r\n previewPath: Settings.getImagePath()\r\n };\r\n }\r\n\r\n /** \r\n * Executes on form submission.\r\n * @param {Object} e - the form submission event\r\n * @param {Object} d - the form data\r\n */\r\n async _updateObject(e, d) {\r\n console.log('Turn Marker | Saving Settings');\r\n Settings.setRatio(d.ratio);\r\n if (d.image) Settings.setImage(d.image);\r\n Settings.setCustomImagePath(d.customImage);\r\n Settings.setShouldAnnounceTurns(d.announce);\r\n Settings.setIncludeAnnounceImage(d.announceImage);\r\n Settings.setTurnMarkerEnabled(d.turnMarkerEnabled);\r\n Settings.setStartMarkerEnabled(d.startMarkerEnabled);\r\n Settings.setStartMarkerPath(d.startMarkerPath);\r\n }\r\n\r\n activateListeners(html) {\r\n super.activateListeners(html);\r\n const markerSelect = html.find('#image');\r\n const customImage = html.find('#customImage');\r\n const markerImgPreview = html.find('#markerImgPreview');\r\n\r\n this.updatePreview(html);\r\n\r\n if (markerSelect.length > 0) {\r\n markerSelect.on('change', event => {\r\n if (customImage[0].value.trim() == '') {\r\n markerImgPreview.attr('src', Settings.getImageByIndex(Number(event.target.value)));\r\n }\r\n });\r\n }\r\n\r\n if (customImage.length > 0) {\r\n customImage.on('change', event => {\r\n this.updatePreview(html);\r\n });\r\n }\r\n }\r\n\r\n updatePreview(html) {\r\n const markerSelect = html.find('#image');\r\n const customImage = html.find('#customImage');\r\n const markerImgPreview = html.find('#markerImgPreview');\r\n const markerVideoPreview = html.find('#markerVideoPreview');\r\n\r\n if (customImage[0].value.trim() == '') {\r\n markerSelect[0].disabled = false;\r\n markerImgPreview.attr('src', Settings.getImageByIndex(Number(markerSelect[0].value)));\r\n markerImgPreview.removeClass('hidden');\r\n markerVideoPreview.addClass('hidden');\r\n } else {\r\n markerSelect[0].disabled = true;\r\n const ext = this.getExtension(customImage[0].value);\r\n console.warn(ext);\r\n if (videos.includes(ext.toLowerCase())) {\r\n markerVideoPreview.attr('src', customImage[0].value);\r\n markerImgPreview.addClass('hidden');\r\n markerVideoPreview.removeClass('hidden');\r\n } else {\r\n markerImgPreview.attr('src', customImage[0].value);\r\n markerImgPreview.removeClass('hidden');\r\n markerVideoPreview.addClass('hidden');\r\n }\r\n }\r\n }\r\n\r\n getExtension(filePath) {\r\n return filePath.slice((filePath.lastIndexOf(\".\") - 1 >>> 0) + 2);\r\n }\r\n\r\n getSelectList(array, selected) {\r\n let options = [];\r\n array.forEach((x, i) => {\r\n options.push({ value: x, selected: i == selected });\r\n });\r\n return options;\r\n }\r\n}","import { Chatter } from './chatter.js';\r\nimport { Marker } from './marker.js';\r\nimport { MarkerAnimation } from './markeranimation.js';\r\nimport { Settings } from './settings.js';\r\nimport { renderUpdateWindow } from './updateWindow.js';\r\nimport { firstGM, Flags, FlagScope, socketAction, socketName } from './utils.js';\r\n\r\nlet animator;\r\nlet markerId;\r\nlet lastTurn = '';\r\n\r\nHooks.on('ready', async () => {\r\n Settings.registerSettings();\r\n let marker = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (marker && marker.id) {\r\n markerId = marker.id;\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n if (!game.paused && Settings.getShouldAnimate()) {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n\r\n if (game.user.isGM) {\r\n if (isNewerVersion(game.modules.get(\"turnmarker\").data.version, Settings.getVersion())) {\r\n renderUpdateWindow();\r\n }\r\n }\r\n\r\n game.socket.on(socketName, async (data) => {\r\n if (game.user.isGM) {\r\n switch (data.mode) {\r\n case socketAction.placeStartMarker:\r\n await canvas.scene.createEmbeddedEntity('Tile', data.tileData);\r\n canvas.scene.setFlag(FlagScope, Flags.startMarkerPlaced, true);\r\n }\r\n }\r\n });\r\n});\r\n\r\nHooks.on('createTile', (scene, tile) => {\r\n if (tile.flags.turnMarker == true) {\r\n markerId = tile._id;\r\n tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n if (Settings.getShouldAnimate()) {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n});\r\n\r\nHooks.on('preUpdateToken', async (scene, token) => {\r\n if (token._id == game.combat.combatant.token._id && !canvas.scene.getFlag(FlagScope, Flags.startMarkerPlaced)) {\r\n await Marker.placeStartMarker(game.combat.combatant.token._id);\r\n }\r\n});\r\n\r\nHooks.on('updateCombat', async (combat, update) => {\r\n if (combat.combatant) {\r\n if (update && lastTurn != combat.combatant._id && game.user.isGM && game.userId == firstGM()) {\r\n lastTurn = combat.combatant._id;\r\n if (combat && combat.combatant) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n let result = await Marker.placeTurnMarker(combat.combatant.token._id, (tile && tile.id) || undefined);\r\n if (result) {\r\n markerId = result.markerId;\r\n animator = result.animator;\r\n }\r\n if (Settings.getTurnMarkerEnabled()) {\r\n Marker.deleteStartMarker();\r\n canvas.scene.unsetFlag(FlagScope, Flags.startMarkerPlaced);\r\n }\r\n if (Settings.shouldAnnounceTurns() && !combat.combatant.hidden) {\r\n Chatter.sendTurnMessage(combat.combatant);\r\n }\r\n }\r\n }\r\n }\r\n});\r\n\r\nHooks.on('deleteCombat', async () => {\r\n if (game.user.isGM) {\r\n Marker.clearAllMarkers();\r\n }\r\n MarkerAnimation.stopAnimation(animator);\r\n});\r\n\r\nHooks.on('updateToken', (scene, updateToken, updateData) => {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n if ((updateData.x || updateData.y || updateData.width || updateData.height || updateData.hidden) &&\r\n (game && game.combat && game.combat.combatant && game.combat.combatant.tokenId == updateToken._id) &&\r\n game.user.isGM && game.combat) {\r\n Marker.moveMarkerToToken(updateToken._id, tile.id);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n }\r\n }\r\n});\r\n\r\nHooks.on('updateTile', () => {\r\n if (canvas.scene.data.tokenVision) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n let combatant = canvas.tokens.placeables.find(x => x.id == game.combat.combatant.tokenId);\r\n if (combatant && !combatant.data.hidden) {\r\n tile.visible = canvas.sight.testVisibility(combatant.center, { tolerance: canvas.dimensions.size / 4 });\r\n }\r\n }\r\n }\r\n});\r\n\r\nHooks.on('pauseGame', async (isPaused) => {\r\n if (markerId && Settings.getShouldAnimate()) {\r\n if (isPaused) {\r\n MarkerAnimation.stopAnimation(animator);\r\n } else {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n});","import { Settings } from './settings.js';\r\n\r\nexport function renderUpdateWindow() {\r\n const module = game.modules.get(\"turnmarker\");\r\n\r\n if (!isNewerVersion(module.data.version, Settings.getVersion()))\r\n return;\r\n\r\n class UpdateWindow extends Application {\r\n static get defaultOptions() {\r\n return mergeObject(super.defaultOptions, {\r\n template: `modules/${module.id}/templates/updateWindow.html`,\r\n resizable: false,\r\n width: 500,\r\n height: 600,\r\n classes: [\"updateWindow\"],\r\n title: `${module.data.title} - Updated`\r\n });\r\n }\r\n\r\n getData() {\r\n return {\r\n version: module.data.version\r\n };\r\n }\r\n\r\n activateListeners(html) {\r\n super.activateListeners(html);\r\n\r\n html.find('.show-again').on('change', ev => {\r\n Settings.setVersion(ev.currentTarget.checked ? module.data.version : oldVersion);\r\n });\r\n }\r\n }\r\n\r\n new UpdateWindow().render(true);\r\n}","\r\n/**\r\n * The name of the module\r\n */\r\nexport const modName = 'turnmarker';\r\n\r\n/*** Flag Info */\r\nexport const FlagScope = 'turnmarker';\r\nexport const Flags = {\r\n startMarkerPlaced: 'startMarkerPlaced'\r\n};\r\n\r\n/** Socket Info */\r\nexport const socketName = 'module.turnmarker';\r\nexport const socketAction = {\r\n placeStartMarker: 0\r\n};\r\n\r\n/**\r\n * Returns a token object from the canvas based on the ID value\r\n * @param {String} tokenId - The ID of the token to look for\r\n */\r\nexport function findTokenById(tokenId) {\r\n return canvas.tokens.ownedTokens.find(t => t.id == tokenId);\r\n}\r\n\r\n/**\r\n * Returns the ID of the first user logged in as GM.\r\n * Use for actions that need to be done by a GM but by only 1 GM\r\n */\r\nexport function firstGM() {\r\n for (let user of game.users.entities) {\r\n if (user.data.role >= 4 && user.active) {\r\n return user.data._id;\r\n }\r\n }\r\n return undefined;\r\n}"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/scripts/chatter.js","webpack:///./src/scripts/marker.js","webpack:///./src/scripts/markeranimation.js","webpack:///./src/scripts/settings.js","webpack:///./src/scripts/settingsForm.js","webpack:///./src/scripts/turnmarker.js","webpack:///./src/scripts/updateWindow.js","webpack:///./src/scripts/utils.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Chatter","combatant","players","forEach","player","push","length","ChatMessage","speaker","actor","content","this","placeImage","join","getIncludeAnnounceImage","img","flags","core","thumb","Marker","tokenId","markerId","moveMarkerToToken","clearAllMarkers","getTurnMarkerEnabled","token","dims","getRatio","getImageDimensions","center","getImageLocation","newTile","Tile","getImagePath","width","w","height","h","x","y","z","rotation","hidden","data","locked","turnMarker","canvas","scene","createEmbeddedEntity","_id","tile","getEmbeddedCollection","startMarker","deleteEmbeddedEntity","getStartMarkerEnabled","getStartMarker","game","user","isGM","setFlag","startMarkerPlaced","socket","emit","placeStartMarker","tileData","updateEmbeddedEntity","tiles","placeables","find","id","animator","stopAnimation","ignoreRatio","ratio","newWidth","newHeight","grid","type","newX","newY","MarkerAnimation","tileId","getEmbeddedEntity","animateRotation","app","ticker","add","remove","dt","delta","getInterval","err","imageTitles","Settings","settings","val","set","trim","getImageByIndex","index","registerMenu","label","icon","restricted","register","default","String","scope","hint","config","Number","Boolean","choices","onChange","updateImagePath","videos","SettingsForm","FormApplication","options","super","mergeObject","defaultOptions","title","template","classes","closeOnSubmit","turnMarkerEnabled","image","getSelectList","getImageIndex","customImage","getCustomImagePath","announce","shouldAnnounceTurns","announceImage","startMarkerEnabled","startMarkerPath","getStartMarkerPath","previewPath","e","console","log","setRatio","setImage","setCustomImagePath","setShouldAnnounceTurns","setIncludeAnnounceImage","setTurnMarkerEnabled","setStartMarkerEnabled","setStartMarkerPath","html","activateListeners","markerSelect","markerImgPreview","updatePreview","on","event","attr","target","markerVideoPreview","disabled","removeClass","addClass","ext","getExtension","warn","includes","toLowerCase","filePath","slice","lastIndexOf","array","selected","lastTurn","Hooks","async","registerSettings","marker","zIndex","Math","max","map","parent","sortChildren","paused","getShouldAnimate","startAnimation","isNewerVersion","version","getVersion","combat","getFlag","update","userId","result","placeTurnMarker","undefined","deleteStartMarker","unsetFlag","sendTurnMessage","updateToken","updateData","tokenVision","tokens","visible","sight","testVisibility","tolerance","dimensions","size","isPaused","renderUpdateWindow","UpdateWindow","Application","resizable","ev","setVersion","currentTarget","checked","oldVersion","render","modName","FlagScope","Flags","socketName","socketAction","findTokenById","ownedTokens","firstGM","users","entities","role","active"],"mappings":"aACE,IAAIA,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kE,QAAS7N,EAAO4E,KAAKiJ,SAI7B,kBAAkBtC,GACd/B,MAAMgC,kBAAkBD,GAExBA,EAAKlF,KAAK,eAAeuF,GAAG,SAAU4D,IAClC,WAASC,WAAWD,EAAGE,cAAcC,QAAU3P,EAAO4E,KAAKiJ,QAAU+B,gBAKjF,IAAIP,GAAeQ,QAAO,M;;;;8aC/BvB,MAAMC,EAAU,aAGVC,EAAY,aACZC,EAAQ,CACjBnK,kBAAmB,qBAIVoK,EAAa,oBACbC,EAAe,CACxBlK,iBAAkB,GAOf,SAASmK,EAAc9M,GAC1B,OAAO0B,OAAO6J,OAAOwB,YAAY/J,KAAKlF,GAAKA,EAAEmF,IAAMjD,GAOhD,SAASgN,IACZ,IAAK,IAAI3K,KAAQD,KAAK6K,MAAMC,SACxB,GAAI7K,EAAKd,KAAK4L,MAAQ,GAAK9K,EAAK+K,OAC5B,OAAO/K,EAAKd,KAAKM","file":"turnmarker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"modules/turnmarker/scripts/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/scripts/turnmarker.js\");\n","import { Settings } from \"./settings.js\";\r\n\r\nexport class Chatter {\r\n\r\n static sendTurnMessage(combatant) {\r\n let players = [];\r\n combatant.players.forEach(player => {\r\n players.push(player.name);\r\n });\r\n if (players.length == 0) players.push(\"GM\");\r\n ChatMessage.create({\r\n speaker: { actor: combatant.actor },\r\n //speaker: { actor: {}, alias: 'Turn Marker' },\r\n content:\r\n `${this.placeImage(combatant)}\r\n
\r\n
${combatant.name}'s Turn
\r\n
${players.join(' - ')}
\r\n
\r\n
Turn Marker`\r\n });\r\n }\r\n\r\n static placeImage(combatant) {\r\n if (Settings.getIncludeAnnounceImage()) {\r\n let img = combatant.img;\r\n if (combatant.flags.core && combatant.flags.core.thumb) {\r\n img = combatant.flags.core.thumb;\r\n }\r\n return ``;\r\n // return ``;\r\n } else return '';\r\n }\r\n}","import { MarkerAnimation } from './markeranimation.js';\r\nimport { Settings } from './settings.js';\r\nimport { findTokenById, Flags, FlagScope, socketAction, socketName } from './utils.js';\r\n\r\n/**\r\n * Provides functionality for creating, moving, and animating the turn marker\r\n */\r\nexport class Marker {\r\n\r\n /**\r\n * Places a new turn marker under the token specified, and if required, starts the animation\r\n * @param {String} tokenId - The ID of the token where the marker should be placed\r\n * @param {Object} animator - The animator object\r\n * @param {String} markerId - The ID of the tile being used as the turn marker\r\n */\r\n static async placeTurnMarker(tokenId, markerId) {\r\n if (!markerId) {\r\n this.clearAllMarkers();\r\n\r\n if (Settings.getTurnMarkerEnabled()) {\r\n let token = findTokenById(tokenId);\r\n let ratio = Settings.getRatio();\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n\r\n let newTile = new Tile({\r\n img: Settings.getImagePath(),\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n z: 900,\r\n rotation: 0,\r\n hidden: token.data.hidden,\r\n locked: false,\r\n flags: { turnMarker: true }\r\n });\r\n\r\n let tile = await canvas.scene.createEmbeddedEntity('Tile', newTile.data);\r\n\r\n return tile._id;\r\n } else {\r\n return null;\r\n }\r\n } else {\r\n this.moveMarkerToToken(tokenId, markerId);\r\n return markerId;\r\n }\r\n }\r\n\r\n /**\r\n * Deletes any tiles flagged as a 'Start Marker' from the canvas\r\n */\r\n static async deleteStartMarker() {\r\n for (var tile of canvas.scene.getEmbeddedCollection('Tile')) {\r\n if (tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * If enabled in settings, place a \"start\" marker under the token where their turn started.\r\n * @param {String} tokenId - The ID of the token to place the start marker under\r\n */\r\n static async placeStartMarker(tokenId) {\r\n if (Settings.getStartMarkerEnabled()) {\r\n let token = findTokenById(tokenId);\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n let newTile = new Tile({\r\n img: Settings.getStartMarker(),\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n z: 900,\r\n rotation: 0,\r\n hidden: token.data.hidden,\r\n locked: false,\r\n flags: { startMarker: true }\r\n });\r\n\r\n if (game.user.isGM) {\r\n canvas.scene.createEmbeddedEntity('Tile', newTile.data);\r\n canvas.scene.setFlag(FlagScope, Flags.startMarkerPlaced, true);\r\n } else {\r\n game.socket.emit(socketName, {\r\n mode: socketAction.placeStartMarker,\r\n tileData: newTile.data\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Moves the turn marker tile under the specified token\r\n * @param {String} tokenId - The ID of the token that the marker should be placed under\r\n * @param {String} markerId - The ID of the tile currently serving as the turn marker\r\n */\r\n static async moveMarkerToToken(tokenId, markerId) {\r\n let token = findTokenById(tokenId);\r\n let ratio = Settings.getRatio();\r\n let dims = this.getImageDimensions(token);\r\n let center = this.getImageLocation(token);\r\n\r\n await canvas.scene.updateEmbeddedEntity('Tile', {\r\n _id: markerId,\r\n width: dims.w,\r\n height: dims.h,\r\n x: center.x,\r\n y: center.y,\r\n hidden: token.data.hidden\r\n });\r\n }\r\n\r\n /**\r\n * Removes any existing turn marker and start marker tiles from the canvas\r\n */\r\n static async clearAllMarkers() {\r\n let tiles = canvas.scene.getEmbeddedCollection('Tile');\r\n\r\n for (var tile of tiles) {\r\n if (tile.flags.turnMarker || tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Updates the tile image when the image path has changed\r\n */\r\n static updateImagePath() {\r\n if (game.user.isGM) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n canvas.scene.updateEmbeddedEntity('Tile', {\r\n _id: tile.id,\r\n img: Settings.getImagePath()\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Completely resets the turn marker - deletes all tiles and stops any animation\r\n * @param {Object} animator - The animator object\r\n */\r\n static reset(animator) {\r\n MarkerAnimation.stopAnimation(animator);\r\n this.clearAllMarkers();\r\n }\r\n\r\n /**\r\n * Gets the proper dimensions of the marker tile taking into account the current grid layout\r\n * @param {object} token - The token that the tile should be placed under\r\n */\r\n static getImageDimensions(token, ignoreRatio = false) {\r\n let ratio = ignoreRatio ? 1 : Settings.getRatio();\r\n let newWidth = 0;\r\n let newHeight = 0;\r\n\r\n switch (canvas.grid.type) {\r\n case 2: case 3: // Hex Rows\r\n newWidth = newHeight = token.h * ratio;\r\n break;\r\n case 4: case 5: // Hex Columns\r\n newWidth = newHeight = token.w * ratio;\r\n break;\r\n default: // Gridless and Square\r\n newWidth = token.w * ratio;\r\n newHeight = token.h * ratio;\r\n break;\r\n }\r\n\r\n return { w: newWidth, h: newHeight };\r\n }\r\n\r\n /**\r\n * Gets the proper location of the marker tile taking into account the current grid layout\r\n * @param {object} token - The token that the tile should be placed under\r\n */\r\n static getImageLocation(token, ignoreRatio = false) {\r\n let ratio = ignoreRatio ? 1 : Settings.getRatio();\r\n let newX = 0;\r\n let newY = 0;\r\n\r\n switch (canvas.grid.type) {\r\n case 2: case 3: // Hex Rows\r\n newX = token.center.x - ((token.h * ratio) / 2);\r\n newY = token.center.y - ((token.h * ratio) / 2);\r\n break;\r\n case 4: case 5: // Hex Columns\r\n newX = token.center.x - ((token.w * ratio) / 2);\r\n newY = token.center.y - ((token.w * ratio) / 2);\r\n break;\r\n default: // Gridless and Square\r\n newX = token.center.x - ((token.w * ratio) / 2);\r\n newY = token.center.y - ((token.h * ratio) / 2);\r\n }\r\n\r\n return { x: newX, y: newY };\r\n }\r\n}","import { Settings } from './settings.js';\r\n\r\nexport class MarkerAnimation {\r\n /**\r\n * Starts the animation loop for the specified tile\r\n * @param {object} animator - The animator object\r\n * @param {String} tileId - The ID of the tile currently serving as the turn marker \r\n */\r\n static startAnimation(animator, tileId) {\r\n let tile = canvas.scene.getEmbeddedEntity('Tile', tileId);\r\n animator = this.animateRotation.bind(tile);\r\n canvas.app.ticker.add(animator);\r\n return animator;\r\n }\r\n\r\n /**\r\n * Stops the animation loop for the specified tile\r\n * @param {object} animator - The animator object\r\n */\r\n static stopAnimation(animator) {\r\n canvas.app.ticker.remove(animator);\r\n }\r\n\r\n /**\r\n * Called on every tick of the animation loop to rotate the image based on the current frame\r\n * @param {number} dt - The delta time\r\n */\r\n static animateRotation(dt) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile && tile.data.img) {\r\n let delta = Settings.getInterval() / 10000;\r\n try {\r\n tile.tile.img.rotation += (delta * dt);\r\n } catch (err) {\r\n // skip lost frames if the tile is being updated by the server\r\n }\r\n }\r\n }\r\n}","import { Marker } from './marker.js';\r\nimport { SettingsForm } from './settingsForm.js';\r\nimport { modName } from './utils.js';\r\n\r\nconst version = 'tm-version';\r\nconst ratio = 'ratio';\r\nconst animation = 'animation';\r\nconst interval = 'interval';\r\nconst announce = 'announce-turn';\r\nconst announceAsActor = 'announce-asActor';\r\nconst announceImage = 'announce-image';\r\nconst image = 'image';\r\nconst customimage = 'customimage';\r\nconst turnMarkerEnabled = 'turnmarker-enabled';\r\nconst startMarkerEnabled = 'startMarker-enabled';\r\nconst startMarkerImage = 'startMarker-custom';\r\nexport const imageTitles = [\r\n 'Runes of Incendium by Rin',\r\n 'Runes of the Cultist by Rin',\r\n 'Runes of Regeneration by Rin',\r\n 'Runes of the Cosmos by Rin',\r\n 'Runes of Earthly Dust by Rin',\r\n 'Runes of Reality by Rin',\r\n 'Runes of the Believer by Rin',\r\n 'Runes of the Mad Mage by Rin',\r\n 'Runes of the Blue Sky by Rin',\r\n 'Runes of the Universe by Rin',\r\n 'Runes of Prosperity by Rin'\r\n];\r\n\r\n/**\r\n * Provides functionality for reading and writing module settings\r\n */\r\nexport class Settings {\r\n\r\n static getVersion() {\r\n return game.settings.get(modName, version);\r\n }\r\n\r\n static setVersion(val) {\r\n game.settings.set(modName, version, val);\r\n }\r\n\r\n /**\r\n * Gets the image ratio\r\n */\r\n static getRatio() {\r\n return game.settings.get(modName, ratio);\r\n }\r\n\r\n /**\r\n * Sets the image ratio\r\n * @param {Number} val - The image ratio\r\n */\r\n static setRatio(val) {\r\n game.settings.set(modName, ratio, val);\r\n }\r\n\r\n /**\r\n * Returns true if the marker should be animated\r\n */\r\n static getShouldAnimate() {\r\n return game.settings.get(modName, animation);\r\n }\r\n\r\n /**\r\n * Gets the animation interval in ms.\r\n */\r\n static getInterval() {\r\n return game.settings.get(modName, interval);\r\n }\r\n\r\n /**\r\n * Returns true if turn changes should be announced in chat\r\n */\r\n static shouldAnnounceTurns() {\r\n return game.settings.get(modName, announce);\r\n }\r\n\r\n /**\r\n * Sets whether or not to announce turn changes\r\n * @param {Boolean} val - Whether or not to announce turn changes\r\n */\r\n static setShouldAnnounceTurns(val) {\r\n game.settings.set(modName, announce, val);\r\n }\r\n\r\n static getIncludeAnnounceImage() {\r\n return game.settings.get(modName, announceImage);\r\n }\r\n\r\n static setIncludeAnnounceImage(val) {\r\n game.settings.set(modName, announceImage, val);\r\n }\r\n\r\n /**\r\n * Gets the index of the currently selected marker image\r\n */\r\n static getImageIndex() {\r\n return game.settings.get(modName, image);\r\n }\r\n\r\n static getStartMarker() {\r\n if (game.settings.get(modName, startMarkerImage).trim() == '') {\r\n return 'modules/turnmarker/assets/start.png';\r\n } else {\r\n return game.settings.get(modName, startMarkerImage);\r\n }\r\n }\r\n\r\n static getTurnMarkerEnabled() {\r\n return game.settings.get(modName, turnMarkerEnabled);\r\n }\r\n\r\n\r\n static setTurnMarkerEnabled(val) {\r\n game.settings.set(modName, turnMarkerEnabled, val);\r\n }\r\n\r\n static getStartMarkerEnabled() {\r\n return game.settings.get(modName, startMarkerEnabled);\r\n }\r\n\r\n static setStartMarkerEnabled(val) {\r\n game.settings.set(modName, startMarkerEnabled, val);\r\n }\r\n\r\n static getStartMarkerPath() {\r\n return game.settings.get(modName, startMarkerImage);\r\n }\r\n\r\n static setStartMarkerPath(val) {\r\n game.settings.set(modName, startMarkerImage, val);\r\n }\r\n\r\n /**\r\n * Gets a path to the currently selected image to be used as the marker\r\n */\r\n static getImagePath() {\r\n if (game.settings.get(modName, customimage).trim() == '') {\r\n return this.getImageByIndex(game.settings.get(modName, image));\r\n } else {\r\n return game.settings.get(modName, customimage);\r\n }\r\n }\r\n\r\n static getImageByIndex(index) {\r\n switch (index) {\r\n case 0: return 'modules/turnmarker/assets/incendium.png';\r\n case 1: return 'modules/turnmarker/assets/cultist.png';\r\n case 2: return 'modules/turnmarker/assets/regeneration.png';\r\n case 3: return 'modules/turnmarker/assets/cosmos.png';\r\n case 4: return 'modules/turnmarker/assets/earthlydust.png';\r\n case 5: return 'modules/turnmarker/assets/reality.png';\r\n case 6: return 'modules/turnmarker/assets/believer.png';\r\n case 7: return 'modules/turnmarker/assets/madmage.png';\r\n case 8: return 'modules/turnmarker/assets/bluesky.png';\r\n case 9: return 'modules/turnmarker/assets/universe.png';\r\n case 10: return 'modules/turnmarker/assets/prosperity.png';\r\n }\r\n }\r\n\r\n static setImage(val) {\r\n game.settings.set(modName, image, val);\r\n }\r\n\r\n static getCustomImagePath() {\r\n return game.settings.get(modName, customimage);\r\n }\r\n\r\n static setCustomImagePath(val) {\r\n game.settings.set(modName, customimage, val);\r\n }\r\n\r\n /**\r\n * Registers all game settings\r\n */\r\n static registerSettings() {\r\n\r\n game.settings.registerMenu(modName, 'tm.settingsMenu', {\r\n name: 'tm.settings.button.name',\r\n label: 'tm.settings.button.label',\r\n icon: 'fas fa-sync-alt',\r\n type: SettingsForm,\r\n restricted: true,\r\n });\r\n\r\n game.settings.register(modName, version, {\r\n name: `${modName} version`,\r\n default: '0.0.0',\r\n type: String,\r\n scope: 'world',\r\n });\r\n\r\n game.settings.register(modName, ratio, {\r\n name: 'tm.settings.ratio.name',\r\n hint: 'tm.settings.ratio.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Number,\r\n default: 1.5,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, animation, {\r\n name: 'tm.settings.animate.name',\r\n hint: 'tm.settings.animate.hint',\r\n scope: 'user',\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n });\r\n\r\n game.settings.register(modName, interval, {\r\n name: 'tm.settings.interval.name',\r\n hint: 'tm.settings.interval.hint',\r\n scope: 'user',\r\n config: true,\r\n type: Number,\r\n default: 100\r\n });\r\n\r\n game.settings.register(modName, image, {\r\n name: 'tm.settings.image.name',\r\n scope: 'world',\r\n config: false,\r\n type: Number,\r\n default: 0,\r\n choices: imageTitles,\r\n restricted: true,\r\n onChange: value => Marker.updateImagePath(value)\r\n });\r\n\r\n game.settings.register(modName, customimage, {\r\n name: 'tm.settings.customImage.name',\r\n hint: 'tm.settings.customImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: String,\r\n default: '',\r\n restricted: true,\r\n onChange: value => Marker.updateImagePath(value)\r\n });\r\n\r\n game.settings.register(modName, announce, {\r\n name: 'tm.settings.announce.name',\r\n hint: 'tm.settings.announce.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, announceImage, {\r\n name: 'tm.settings.announceImage.name',\r\n hint: 'tm.settings.announceImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, announceAsActor, {\r\n name: 'tm.settings.announceAs.name',\r\n hint: 'tm.settings.announceAs.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true\r\n });\r\n\r\n game.settings.register(modName, turnMarkerEnabled, {\r\n name: 'tm.settings.turnMarkerEnabled.name',\r\n hint: 'tm.settings.turnMarkerEnabled.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: true,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, startMarkerEnabled, {\r\n name: 'tm.settings.startEnabled.name',\r\n hint: 'tm.settings.startEnabled.hint',\r\n scope: 'world',\r\n config: false,\r\n type: Boolean,\r\n default: false,\r\n restricted: true\r\n });\r\n\r\n game.settings.register(modName, startMarkerImage, {\r\n name: 'tm.settings.startImage.name',\r\n hint: 'tm.settings.startImage.hint',\r\n scope: 'world',\r\n config: false,\r\n type: String,\r\n default: '',\r\n restricted: true\r\n });\r\n }\r\n}","import { imageTitles, Settings } from './settings.js';\r\n\r\nconst videos = ['mp4', 'webm', 'ogg'];\r\n\r\nexport class SettingsForm extends FormApplication {\r\n\r\n constructor(object, options = {}) {\r\n super(object, options);\r\n }\r\n\r\n /**\r\n * Default Options for this FormApplication\r\n */\r\n static get defaultOptions() {\r\n return mergeObject(super.defaultOptions, {\r\n id: 'turnmarker-settings-form',\r\n title: 'Turn Marker - Global Settings',\r\n template: './modules/turnmarker/templates/settings.html',\r\n classes: ['sheet', 'tm-settings'],\r\n width: 500,\r\n closeOnSubmit: true\r\n });\r\n }\r\n\r\n getData() {\r\n return {\r\n turnMarkerEnabled: Settings.getTurnMarkerEnabled(),\r\n ratio: Settings.getRatio(),\r\n image: this.getSelectList(imageTitles, Settings.getImageIndex()),\r\n customImage: Settings.getCustomImagePath(),\r\n announce: Settings.shouldAnnounceTurns(),\r\n announceImage: Settings.getIncludeAnnounceImage(),\r\n startMarkerEnabled: Settings.getStartMarkerEnabled(),\r\n startMarkerPath: Settings.getStartMarkerPath(),\r\n previewPath: Settings.getImagePath()\r\n };\r\n }\r\n\r\n /** \r\n * Executes on form submission.\r\n * @param {Object} e - the form submission event\r\n * @param {Object} d - the form data\r\n */\r\n async _updateObject(e, d) {\r\n console.log('Turn Marker | Saving Settings');\r\n Settings.setRatio(d.ratio);\r\n if (d.image) Settings.setImage(d.image);\r\n Settings.setCustomImagePath(d.customImage);\r\n Settings.setShouldAnnounceTurns(d.announce);\r\n Settings.setIncludeAnnounceImage(d.announceImage);\r\n Settings.setTurnMarkerEnabled(d.turnMarkerEnabled);\r\n Settings.setStartMarkerEnabled(d.startMarkerEnabled);\r\n Settings.setStartMarkerPath(d.startMarkerPath);\r\n }\r\n\r\n activateListeners(html) {\r\n super.activateListeners(html);\r\n const markerSelect = html.find('#image');\r\n const customImage = html.find('#customImage');\r\n const markerImgPreview = html.find('#markerImgPreview');\r\n\r\n this.updatePreview(html);\r\n\r\n if (markerSelect.length > 0) {\r\n markerSelect.on('change', event => {\r\n if (customImage[0].value.trim() == '') {\r\n markerImgPreview.attr('src', Settings.getImageByIndex(Number(event.target.value)));\r\n }\r\n });\r\n }\r\n\r\n if (customImage.length > 0) {\r\n customImage.on('change', event => {\r\n this.updatePreview(html);\r\n });\r\n }\r\n }\r\n\r\n updatePreview(html) {\r\n const markerSelect = html.find('#image');\r\n const customImage = html.find('#customImage');\r\n const markerImgPreview = html.find('#markerImgPreview');\r\n const markerVideoPreview = html.find('#markerVideoPreview');\r\n\r\n if (customImage[0].value.trim() == '') {\r\n markerSelect[0].disabled = false;\r\n markerImgPreview.attr('src', Settings.getImageByIndex(Number(markerSelect[0].value)));\r\n markerImgPreview.removeClass('hidden');\r\n markerVideoPreview.addClass('hidden');\r\n } else {\r\n markerSelect[0].disabled = true;\r\n const ext = this.getExtension(customImage[0].value);\r\n console.warn(ext);\r\n if (videos.includes(ext.toLowerCase())) {\r\n markerVideoPreview.attr('src', customImage[0].value);\r\n markerImgPreview.addClass('hidden');\r\n markerVideoPreview.removeClass('hidden');\r\n } else {\r\n markerImgPreview.attr('src', customImage[0].value);\r\n markerImgPreview.removeClass('hidden');\r\n markerVideoPreview.addClass('hidden');\r\n }\r\n }\r\n }\r\n\r\n getExtension(filePath) {\r\n return filePath.slice((filePath.lastIndexOf(\".\") - 1 >>> 0) + 2);\r\n }\r\n\r\n getSelectList(array, selected) {\r\n let options = [];\r\n array.forEach((x, i) => {\r\n options.push({ value: x, selected: i == selected });\r\n });\r\n return options;\r\n }\r\n}","import { Chatter } from './chatter.js';\r\nimport { Marker } from './marker.js';\r\nimport { MarkerAnimation } from './markeranimation.js';\r\nimport { Settings } from './settings.js';\r\nimport { renderUpdateWindow } from './updateWindow.js';\r\nimport { firstGM, Flags, FlagScope, socketAction, socketName } from './utils.js';\r\n\r\nlet animator;\r\nlet markerId;\r\nlet lastTurn = '';\r\n\r\nHooks.on('ready', async () => {\r\n Settings.registerSettings();\r\n let marker = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (marker && marker.id) {\r\n markerId = marker.id;\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n if (!game.paused && Settings.getShouldAnimate()) {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n\r\n if (game.user.isGM) {\r\n if (isNewerVersion(game.modules.get(\"turnmarker\").data.version, Settings.getVersion())) {\r\n renderUpdateWindow();\r\n }\r\n }\r\n\r\n game.socket.on(socketName, async (data) => {\r\n if (game.user.isGM) {\r\n switch (data.mode) {\r\n case socketAction.placeStartMarker:\r\n await canvas.scene.createEmbeddedEntity('Tile', data.tileData);\r\n canvas.scene.setFlag(FlagScope, Flags.startMarkerPlaced, true);\r\n }\r\n }\r\n });\r\n});\r\n\r\nHooks.on('createTile', (scene, tile) => {\r\n if (tile.flags.turnMarker == true) {\r\n markerId = tile._id;\r\n tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n if (Settings.getShouldAnimate()) {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n});\r\n\r\nHooks.on('preUpdateToken', async (scene, token) => {\r\n if (game.combat) {\r\n if (token._id == game.combat.combatant.token._id && !canvas.scene.getFlag(FlagScope, Flags.startMarkerPlaced)) {\r\n await Marker.placeStartMarker(game.combat.combatant.token._id);\r\n }\r\n }\r\n});\r\n\r\nHooks.on('updateCombat', async (combat, update) => {\r\n if (combat.combatant) {\r\n if (update && lastTurn != combat.combatant._id && game.user.isGM && game.userId == firstGM()) {\r\n lastTurn = combat.combatant._id;\r\n if (combat && combat.combatant) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n let result = await Marker.placeTurnMarker(combat.combatant.token._id, (tile && tile.id) || undefined);\r\n if (result) {\r\n markerId = result.markerId;\r\n animator = result.animator;\r\n }\r\n if (Settings.getTurnMarkerEnabled()) {\r\n Marker.deleteStartMarker();\r\n canvas.scene.unsetFlag(FlagScope, Flags.startMarkerPlaced);\r\n }\r\n if (Settings.shouldAnnounceTurns() && !combat.combatant.hidden) {\r\n Chatter.sendTurnMessage(combat.combatant);\r\n }\r\n }\r\n }\r\n }\r\n});\r\n\r\nHooks.on('deleteCombat', async () => {\r\n if (game.user.isGM) {\r\n Marker.clearAllMarkers();\r\n }\r\n MarkerAnimation.stopAnimation(animator);\r\n});\r\n\r\nHooks.on('updateToken', (scene, updateToken, updateData) => {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n if ((updateData.x || updateData.y || updateData.width || updateData.height || updateData.hidden) &&\r\n (game && game.combat && game.combat.combatant && game.combat.combatant.tokenId == updateToken._id) &&\r\n game.user.isGM && game.combat) {\r\n Marker.moveMarkerToToken(updateToken._id, tile.id);\r\n tile.zIndex = Math.max(...canvas.tiles.placeables.map(o => o.zIndex)) + 1;\r\n tile.parent.sortChildren();\r\n }\r\n }\r\n});\r\n\r\nHooks.on('updateTile', () => {\r\n if (canvas.scene.data.tokenVision) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n let combatant = canvas.tokens.placeables.find(x => x.id == game.combat.combatant.tokenId);\r\n if (combatant && !combatant.data.hidden) {\r\n tile.visible = canvas.sight.testVisibility(combatant.center, { tolerance: canvas.dimensions.size / 4 });\r\n }\r\n }\r\n }\r\n});\r\n\r\nHooks.on('pauseGame', async (isPaused) => {\r\n if (markerId && Settings.getShouldAnimate()) {\r\n if (isPaused) {\r\n MarkerAnimation.stopAnimation(animator);\r\n } else {\r\n animator = MarkerAnimation.startAnimation(animator, markerId);\r\n }\r\n }\r\n});","import { Settings } from './settings.js';\r\n\r\nexport function renderUpdateWindow() {\r\n const module = game.modules.get(\"turnmarker\");\r\n\r\n if (!isNewerVersion(module.data.version, Settings.getVersion()))\r\n return;\r\n\r\n class UpdateWindow extends Application {\r\n static get defaultOptions() {\r\n return mergeObject(super.defaultOptions, {\r\n template: `modules/${module.id}/templates/updateWindow.html`,\r\n resizable: false,\r\n width: 500,\r\n height: 600,\r\n classes: [\"updateWindow\"],\r\n title: `${module.data.title} - Updated`\r\n });\r\n }\r\n\r\n getData() {\r\n return {\r\n version: module.data.version\r\n };\r\n }\r\n\r\n activateListeners(html) {\r\n super.activateListeners(html);\r\n\r\n html.find('.show-again').on('change', ev => {\r\n Settings.setVersion(ev.currentTarget.checked ? module.data.version : oldVersion);\r\n });\r\n }\r\n }\r\n\r\n new UpdateWindow().render(true);\r\n}","\r\n/**\r\n * The name of the module\r\n */\r\nexport const modName = 'turnmarker';\r\n\r\n/*** Flag Info */\r\nexport const FlagScope = 'turnmarker';\r\nexport const Flags = {\r\n startMarkerPlaced: 'startMarkerPlaced'\r\n};\r\n\r\n/** Socket Info */\r\nexport const socketName = 'module.turnmarker';\r\nexport const socketAction = {\r\n placeStartMarker: 0\r\n};\r\n\r\n/**\r\n * Returns a token object from the canvas based on the ID value\r\n * @param {String} tokenId - The ID of the token to look for\r\n */\r\nexport function findTokenById(tokenId) {\r\n return canvas.tokens.ownedTokens.find(t => t.id == tokenId);\r\n}\r\n\r\n/**\r\n * Returns the ID of the first user logged in as GM.\r\n * Use for actions that need to be done by a GM but by only 1 GM\r\n */\r\nexport function firstGM() {\r\n for (let user of game.users.entities) {\r\n if (user.data.role >= 4 && user.active) {\r\n return user.data._id;\r\n }\r\n }\r\n return undefined;\r\n}"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/templates/updateWindow.html b/dist/templates/updateWindow.html
index 9fe8116..455f6b4 100644
--- a/dist/templates/updateWindow.html
+++ b/dist/templates/updateWindow.html
@@ -21,15 +21,19 @@ Want to support development?
href="https://github.com/brunhine/turnmarker#support-development">check here for more info.
Important Changes
-Below are just of the changes to the module that should be called out. The full changelog is also available
+
Below are just some of the changes to the module that should be called out. The full changelog is also available
here.
+v2.6.9
+
+ - Fixed a console error when moving a token outside of combat
+
+
v2.6.8
- Test compatibility with Foundry v0.6.2
- Start marker if enabled will no longer show up until after a token has moved for the first time on it's turn
- Video files (webm, ogg, & mp4) should now properly display in the marker previewer in settings
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/package.json b/package.json
index a56f012..0456afd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "turnmarker",
- "version": "2.6.8",
+ "version": "2.6.9",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
diff --git a/src/module.json b/src/module.json
index 2b31d11..3d17597 100644
--- a/src/module.json
+++ b/src/module.json
@@ -3,7 +3,7 @@
"title": "Turn Marker",
"description": "Displays a (optionally animated) marker on the token who's active turn it is.",
"author": "Brunhine",
- "version": "2.6.8",
+ "version": "2.6.9",
"minimumCoreVersion": "0.5.6",
"compatibleCoreVersion": "0.6.2",
"esmodules": [
@@ -35,5 +35,5 @@
],
"url": "https://github.com/Brunhine/TurnMarker",
"manifest": "https://raw.githubusercontent.com/Brunhine/TurnMarker/master/src/module.json",
- "download": "https://github.com/Brunhine/TurnMarker/releases/download/v2.6.8/turnmarker.zip"
+ "download": "https://github.com/Brunhine/TurnMarker/releases/download/v2.6.9/turnmarker.zip"
}
\ No newline at end of file
diff --git a/src/scripts/turnmarker.js b/src/scripts/turnmarker.js
index 2614f7f..a885fb2 100644
--- a/src/scripts/turnmarker.js
+++ b/src/scripts/turnmarker.js
@@ -52,8 +52,10 @@ Hooks.on('createTile', (scene, tile) => {
});
Hooks.on('preUpdateToken', async (scene, token) => {
- if (token._id == game.combat.combatant.token._id && !canvas.scene.getFlag(FlagScope, Flags.startMarkerPlaced)) {
- await Marker.placeStartMarker(game.combat.combatant.token._id);
+ if (game.combat) {
+ if (token._id == game.combat.combatant.token._id && !canvas.scene.getFlag(FlagScope, Flags.startMarkerPlaced)) {
+ await Marker.placeStartMarker(game.combat.combatant.token._id);
+ }
}
});
diff --git a/src/templates/updateWindow.html b/src/templates/updateWindow.html
index 9fe8116..455f6b4 100644
--- a/src/templates/updateWindow.html
+++ b/src/templates/updateWindow.html
@@ -21,15 +21,19 @@ Want to support development?
href="https://github.com/brunhine/turnmarker#support-development">check here for more info.
Important Changes
-Below are just of the changes to the module that should be called out. The full changelog is also available
+
Below are just some of the changes to the module that should be called out. The full changelog is also available
here.
+v2.6.9
+
+ - Fixed a console error when moving a token outside of combat
+
+
v2.6.8
- Test compatibility with Foundry v0.6.2
- Start marker if enabled will no longer show up until after a token has moved for the first time on it's turn
- Video files (webm, ogg, & mp4) should now properly display in the marker previewer in settings
-
-
\ No newline at end of file
+
\ No newline at end of file