diff --git a/CHANGELOG.md b/CHANGELOG.md index a42f984..766eb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# v0.10.0 +
\n\t\t\t\t\t${t}\n\t\t\t\t\t${a>=0?"+"+a:a}\n\t\t\t\t
\n\t\t\t\n\t\t\t\t\t${t}\n\t\t\t\t\t${a>=0?"+"+a:a}\n\t\t\t\t
\n\t\t\t${game.i18n.localize("MESS.reloadReminder.text")}
`,buttons:{yes:{icon:'',label:game.i18n.localize("MESS.reloadReminder.yes"),callback:()=>location.reload()},no:{icon:'',label:game.i18n.localize("MESS.reloadReminder.no")}}}).render(!0)}}}}); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/scripts/index.js.map b/dist/scripts/index.js.map index 89d1fbe..7932126 100644 --- a/dist/scripts/index.js.map +++ b/dist/scripts/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/scripts/actor-item-sort-btn.js","webpack:///./src/scripts/add-scrolling.js","webpack:///./src/scripts/change-placeables.js","webpack:///./src/scripts/chat-popup/index.js","webpack:///./src/scripts/draggable-lists/draggable-list.js","webpack:///./src/scripts/draggable-lists/index.js","webpack:///./src/scripts/index.js","webpack:///./src/scripts/modify-templates.js","webpack:///./src/scripts/prepared-spell-tracker.js","webpack:///./src/scripts/rolls/apply-dmg.js","webpack:///./src/scripts/rolls/controls.js","webpack:///./src/scripts/rolls/dice.js","webpack:///./src/scripts/rolls/index.js","webpack:///./src/scripts/rolls/modify-rolling.js","webpack:///./src/scripts/settings.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","async","addAlphabeticalSorter","app","html","actor","_id","querySelectorAll","forEach","el","closest","dataset","tab","btn","innerHTML","classList","add","title","style","flex","margin","addEventListener","ev","lists","actorId","fromUuid","concatList","map","items","spells","flat","sort","a","b","siblings","sortUpdates","SortingHelpers","performIntegerSort","duplicate","sortBefore","updateData","u","update","updateEmbeddedEntity","sortItemListAlphabetically","prepend","itemSortBtn","Hooks","on","addScolling","preventDefault","stopPropagation","deltaY","currentTarget","Number","Math","max","$","change","onDragLeftMove","clones","destination","origin","originalEvent","canvas","_onDragCanvasPan","dx","x","dy","y","snap","previous","momentumThreshold","lambda","prev","prevMomentum","momentum","prevV","v","shiftKey","dest","_original","grid","getSnappedPosition","this","layer","options","gridPrecision","refresh","changePlaceables","PlaceableObject","_onDragLeftMove","initChatPopUp","getElementById","contains","log","DraggableList","container","selector","mergeObject","defaultOptions","_init","offset","time","onDragStart","onDragEnd","onDrop","_items","Array","from","childNodes","filter","matches","rect","getBoundingClientRect","insideChild","clientY","height","clientX","width","_resetOffsets","_over","writable","idx","_initItem","position","_onDragEnterItem","_onDragLeaveItem","srcElement","opacity","TweenLite","_dragged","to","resetList","top","offsetList","initDraggableLists","oldFun","SidebarDirectory","activateListeners","game","settings","CONFIG","debug","mess","sheet","render","user","isGM","moduleVersion","version","register","default","String","scope","oldVersion","isNewerVersion","init","changeTemplates","newFun","MeasuredTemplate","toString","replace","querySelector","Function","getTargets","isTokenInside","ret","dndTemplateSettings","system","id","importedJS","import","AbilityTemplate","itemHook","_originalFromItem","fromItem","item","template","path","getFlag","hasDamage","damage","parts","loadTexture","then","tex","texture","activatePreviewListeners","token","scene","templatePos","startX","startY","currGrid","shape","tokens","getEmbeddedCollection","targets","updateTokenTargets","div","innerText","i18n","localize","formField","inp","dtype","insertAdjacentHTML","button","_activateFilePicker","after","addPreparedSpellTracker","isNPC","tracker","border","preparedSpells","sep","val","isNaN","setFlag","constructor","alignSelf","parentNode","insertBefore","modifyApplyDmg","setProperty","canApply","li","controlled","find","condition","chatLogHook","advSelector","userId","templateData","advantage","normal","disadvantage","renderTemplate","arr","currIdx","findIndex","remove","newSelected","set","toggle","controls","hit","dmg","getD20Modifier","getAdvantageSettings","rollD20","adv","nd","mods","halflingLucky","elvenAccuracy","diceFormula","reliableTalent","unshift","d20Mod","Roll","join","roll","d20","total","tooltip","getTooltip","crit","fumble","chatData","CONST","CHAT_MESSAGE_TYPES","OTHER","content","speaker","alias","rollMode","includes","ChatMessage","getWhisperIDs","getToHitData","hasAttack","actorData","itemData","flags","dnd5e","rollData","getRollData","proficient","weaponCriticalThreshold","critical","parseInt","abilityMod","actorBonus","bonuses","actionType","attackBonus","attack","filterJoin","totalModifier","_safeEval","formula","_formula","situationalModifier","terms","rollToHit","disabled","card","messageId","messages","owner","isAuthor","ui","notifications","Item","entityClass","_getChatCardActor","getOwnedItem","itemId","span","rgx","RegExp","Die","die","match","replaceChild","getDmgData","spellLevel","level","versatile","splice","itm","bnsDmgParts","itmData","lbl","DND5E","damageTypes","scaling","newDmgPart","lvl","details","_scaleCantripDamage","_scaleSpellDamage","part","_evalParentheticalTerms","rollDmg","rolling","toggleItemBonusDamage","itemName","getSpeaker","actors","warn","newState","preCreateChatMessageHook","renderAttack","getFlavor","chatFlavor","rollTables","matchAll","collection","tables","tableData","table","entities","result","results","text","areaSkill","keys","areaTargetTypes","getProperty","size","img","attackData","toHit","dmgs","sceneId","autoroll","allowed","_handleResourceConsumption","isCard","isAttack","attackTemplateData","flavor","autoRoll","toHitBtn","btns","actorSheetHook","abilityMods","off","abilityId","ability","label","abilities","mod","feats","remarkableAthlete","characterFlags","ceil","attributes","prof","jackOfAllTrades","floor","checkBonus","format","abl","saveBonus","skills","skillId","skill","skl","bonus","chatListeners","onChatCardAction","_onChatCardToggleContent","onMouseEnterTarget","onMouseLeaveTarget","onDblClickTarget","action","placeTemplate","_onChatCardAction","getTargetToken","_onHoverIn","visible","_onHoverOut","pos","center","animatePan","tokenId","targetId","placeables","checked","MessSettings","FormApplication","isDnD","hint","config","Boolean","registerMenu","icon","restricted","loadTemplates","super","classes","tabs","navSelector","contentSelector","initial","submitOnClose","_getHeaderButtons","getData","dmgTypes","templateTypes","types","getSettingsData","formData","expandObject","entries","Dialog","buttons","yes","callback","location","reload","no"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,GAOF,IAAIW,EAAmB,GAKnBL,EAAkB,CACrB,MAAS,GAWV,SAASM,EAAoBjB,GAG5B,GAAGgB,EAAiBhB,GACnB,OAAOgB,EAAiBhB,GAAUkB,QAGnC,IAAIC,EAASH,EAAiBhB,GAAY,CACzCI,EAAGJ,EACHoB,GAAG,EACHF,QAAS,IAUV,OANAL,EAAQb,GAAUU,KAAKS,EAAOD,QAASC,EAAQA,EAAOD,QAASD,GAG/DE,EAAOC,GAAI,EAGJD,EAAOD,QAKfD,EAAoBI,EAAI,SAAuBpB,GAC9C,IAAIqB,EAAW,GAKXC,EAAqBZ,EAAgBV,GACzC,GAA0B,IAAvBsB,EAGF,GAAGA,EACFD,EAASV,KAAKW,EAAmB,QAC3B,CAEN,IAAIC,EAAU,IAAI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,OAAQ,kBACnDlE,EAAK,gBAAkBoO,KAAKC,SAASnK,IAAI,OAAQ,gBAEjDlE,EAAK,mBAAqBoO,KAAKC,SAASnK,IAAI,OAAQ,mBAEpDlE,EAAK,0BAA4BoO,KAAKC,SAASnK,IAAI,OAAQ,0BAC3DlE,EAAK,iBAAmBoO,KAAKC,SAASnK,IAAI,OAAQ,kBAE5ClE,EAGR,UACC,MAAM2gB,EAA2B,UAAnBvS,KAAK6B,OAAOC,GAC1B,IAAIlQ,EAAOmhB,MAAMQ,UAOjB,OANIhB,IACH3gB,EAAK4hB,SAAWtT,OAAOkM,MAAMC,YAC7Bza,EAAK6hB,cAAgBvT,OAAOkB,iBAAiBsS,OAE9C9hB,EAAK2gB,MAAQA,EACb3gB,EAAKqO,SAAWzD,KAAKmX,kBACd/hB,EAGR,kBAAkB4F,GACjBub,MAAMhT,kBAAkBvI,GAGzB,cAAckB,EAAIkb,GACjB,MAAMhiB,EAAOiiB,aAAaD,GAC1B,IAAK,IAAKpd,EAAKN,KAAU9D,OAAO0hB,QAAQliB,GACvCoO,KAAKC,SAASuG,IAAI,OAAQhQ,EAAKN,GAEhC,IAAI6d,OAAO,CACVzL,QAAS,MAAMtI,KAAK8D,KAAKC,SAAS,kCAClCiQ,QAAS,CACRC,IAAK,CACJrB,KAAM,+BACN/C,MAAO7P,KAAK8D,KAAKC,SAAS,2BAC1BmQ,SAAU,IAAMC,SAASC,UAE1BC,GAAI,CACHzB,KAAM,+BACN/C,MAAO7P,KAAK8D,KAAKC,SAAS,8BAG1BzD,QAAO","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"bundles/\" + ({\"welcome-screen\":\"welcome-screen\"}[chunkId]||chunkId) + \".\" + {\"welcome-screen\":\"89ea\"}[chunkId] + \".js\"\n \t}\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 \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\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/mess/scripts/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/scripts/index.js\");\n","async function sortItemListAlphabetically(lists, actorId) {\n\tconst actor = await fromUuid(`Actor.${actorId}`);\n\tlet concatList = lists.map(e => e.items || e.spells).flat();\n\tconcatList.sort(function (a, b) {\n\t\tif (a.name < b.name) return -1;\n\t\tif (a.name > b.name) return 1;\n\t\treturn 0;\n\t});\n\tlet siblings = [concatList.shift()];\n\tlet sortUpdates = [];\n\tfor (; concatList.length > 0; siblings.push(concatList.shift())) {\n\t\tsortUpdates = (SortingHelpers.performIntegerSort(concatList[0], {\n\t\t\ttarget: siblings[siblings.length-1], \n\t\t\tsiblings: duplicate(siblings),\n\t\t\tsortBefore: false}));\t\t\n\t}\n\tconst updateData = sortUpdates.map(u => {\n\t\tlet update = u.update;\n\t\tupdate._id = u.target._id;\n\t\treturn update;\n\t})\n\tactor.updateEmbeddedEntity('OwnedItem', updateData);\n}\n\nasync function addAlphabeticalSorter(app, html, data) {\n\tif (!data.actor._id) return;\n\tconst header = html.querySelectorAll('.filter-list');\n\n\theader.forEach(el => {\n\t\tconst type = el.closest('.tab').dataset.tab;\n\t\tconst btn = document.createElement('a');\n\t\tbtn.innerHTML = '';\n\t\tbtn.classList.add('mess-sort-btn');\n\t\tbtn.title = `Sort ${type} alphabetically.`;\n\t\tbtn.style.flex = 0;\n\t\tbtn.style.margin = \"0 5px 0 0\";\n\t\tbtn.addEventListener('click',\t(ev) => sortItemListAlphabetically(data[type], data.actor._id))\n\t\tel.prepend(btn);\n\t});\n}\n\nexport default async function itemSortBtn() {\n\tHooks.on('renderActorSheet', (app, html, data) => {\n\t\taddAlphabeticalSorter(app, html[0], data);\n\t});\n}","export default async function addScolling() {\n\tHooks.on('renderActorSheet', async function (app, html, data) {\n\t\thtml[0].querySelectorAll('input[data-dtype=\"Number\"], .item-uses input').forEach(el => {\n\t\t\tel.addEventListener('wheel', ev => {\n\t\t\t\tev.preventDefault();\n\t\t\t\tev.stopPropagation();\n\t\t\t\tif (ev.deltaY < 0)\n\t\t\t\t\tev.currentTarget.value = Number(ev.currentTarget.value) + 1;\n\t\t\t\tif (ev.deltaY > 0)\n\t\t\t\t\tev.currentTarget.value = Math.max(Number(ev.currentTarget.value) - 1, 0);\n\n\t\t\t\t$(ev.currentTarget).change()\n\t\t\t});\n\t\t})\n\t});\n}","function onDragLeftMove(event) {\n\tconst {clones, destination, origin, originalEvent} = event.data;\n\n\t// Pan the canvas if the drag event approaches the edge\n\tcanvas._onDragCanvasPan(originalEvent);\n\n\t// Determine dragged distance\n\tconst dx = destination.x - origin.x;\n\tconst dy = destination.y - origin.y;\n\n\tlet snap = false;\n\tif (event.data.previous) {\n\t\t// Interesting would be here how this all behaves for different monitor sizes/performances and when Atro possibly introduces more adaptive rates for mosue movement. \n\t\t// Why? Because currently i just set the timedifferences between function calls to 1. So for 60Hz it behaves same as 30Hz although for 30Hz the distance travelled could be bigger.\n\t\t// All this because i don't want divisions in here for the moment....\n\t\tconst momentumThreshold = 30;\n\t\t// smaller lambda means less \"memory\" => current momentum does have more impact\n\t\t// => more jumping around between snapping and not\n\t\t// but higher means more waiting/slow movement time for it to snap\n\t\tconst lambda = 0.8;\n\t\tconst prev = event.data.previous;\n\t\tconst prevMomentum = event.data.momentum || 0;\n\t\tconst prevV = event.data.v || {x: 0, y: 0};\n\t\tconst v = {\n\t\t\tx: destination.x - prev.x,\n\t\t\ty: destination.y - prev.y\n\t\t}\n\t\tconst momentum = {\n\t\t\tx: v.x - prevV.x,\n\t\t\ty: v.y - prevV.y\n\t\t};\n\n\t\tevent.data.momentum = (momentum.x * momentum.x + momentum.y * momentum.y) + prevMomentum * lambda;\n\t\tsnap = !event.shiftKey && event.data.momentum < momentumThreshold;\n\t}\n\n\tevent.data.previous = destination;\n\n\t// Update the position of each clone\n\tfor ( let c of clones || [] ) {\n\t\tlet dest = {x: c._original.data.x + dx, y: c._original.data.y + dy};\n\t\tif ( snap ) {\n\t\t\tdest = canvas.grid.getSnappedPosition(dest.x, dest.y, this.layer.options.gridPrecision);\n\t\t}\n\t\tc.data.x = dest.x;\n\t\tc.data.y = dest.y;\n\t\tc.refresh();\n\t}\n}\n\nexport function changePlaceables() {\n\tPlaceableObject.prototype._onDragLeftMove = onDragLeftMove;\n\t// Change got bigger than expected, so.. complete swap it is\n}","export function initChatPopUp() {\n\tHooks.on('renderChatMessage', (app, html, options) => {\n\t\tif (document.getElementById('chat').classList.contains('active')) return;\n\n\n\t\tconsole.log('rendering chat message');\n\t\tconsole.log(app, html, options);\n\t\tconsole.log(document.getElementById('chat').classList.contains('active'))\n\t});\n\n\tconst hud = document.getElementById('hud');\n\n\tlet popupDiv = hud.appendChild(document.createElement('div'));\n\tpopupDiv.classList.add('mess-chat-popup')\n}","export class DraggableList {\n\tconstructor(container, selector, options = {}) {\n\t\tthis.container = container;\n\t\tthis.selector = selector;\n\t\tthis.options = mergeObject(this.defaultOptions, options);\n\n\t\tthis._init();\n\t}\n\t\n\tget defaultOptions() {\n\t\treturn {\n\t\t\toffset: 21, // in px\n\t\t\ttime: 0.1, // in seconds\n\t\t\t// folowing are not used\n\t\t\tonDragStart: null,\n\t\t\tonDragEnd: null,\n\t\t\tonDrop: null,\n\t\t\t\n\t\t}\n\t}\n\n\tasync _init() {\n\t\tthis._items = Array.from(this.container.childNodes).filter(e => e.matches && e.matches(this.selector));\n\t\tthis.container.addEventListener('dragleave', ev => {\n\t\t\tconst rect = this.container.getBoundingClientRect();\n\t\t\tconst boundary = 5;\n\t\t\t// Reset offsets, when first target was inside a child container.\n\t\t\tconst insideChild = ev.insideChild;\n\t\t\tif (!insideChild \n\t\t\t\t\t&& ev.clientY < rect.y + rect.height - boundary\n\t\t\t\t\t&& ev.clientY > rect.y + boundary\n\t\t\t\t\t&& ev.clientX > rect.x + boundary \n\t\t\t\t\t&& ev.clientX < rect.x - boundary + rect.width) {\n\t\t\t\t\t\tev.insideChild = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\tthis._resetOffsets();\n\t\t});\n\n /** Possibly modifying the drop target.\n\t * Why?\n\t * Due to the method used, the target gets moved out of the way and it will automatically drop onto the container element.\n\t * Most drop functions in fvtt just append to the end though, when dropping onto the container.\n\t * => We search for the first offset element and define that one as target. Since default for sorting is \"insertBefore\", and most implementations i've found build upon FVTT default/dnd5e systems default, this is a rather save implementation to find the real target.\n\t */\n\t\tthis.container.addEventListener('drop', ev => {\n\t\t\tconst insideChild = ev.insideChild;\n\t\t\tif (this._over && !insideChild) {\n\t\t\t\tObject.defineProperty(ev, 'target', {writable: false, value: this._over})\n\t\t\t\t// Make sure that outer directories are not overwriting this stuff!\n\t\t\t\tev.insideChild = true;\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis._items.forEach((e, idx) => this._initItem(e, idx))\n\t}\n\n\tasync _initItem(el, idx) {\n\t\tel.style.position = \"relative\";\n\t\tel.addEventListener('dragenter', ev => this._onDragEnterItem(ev, idx));\n\t\tel.addEventListener('dragleave', ev => this._onDragLeaveItem(ev, idx));\n\t\tel.addEventListener('dragend', ev => {\n\t\t\t// safety net if for some reasons the rerender is to slow or fails...\n\t\t\tconst srcElement = ev.currentTarget;\n\t\t\tsrcElement.style.opacity = null;\n\t\t\tsrcElement.style.height = null;\n\t\t\tTweenLite.from(srcElement, this.options.time, {opacity:0, height:0});\n\t\t\tthis._resetOffsets();\n\t\t});\n\t\tel.addEventListener('dragstart', ev => {\n\t\t\tthis._dragged = ev.currentTarget;\n\t\t\tTweenLite.to(ev.currentTarget, this.options.time, {opacity: 0, height: 0});\n\t\t})\n\t}\n\n\t_onDragEnterItem(ev, idx) {\n\t\tev.stopPropagation();\n\t\t// save the current target\n\t\tthis._over = this._items[idx];\n\n\t\tconst time = this.options.time;\n\t\tconst offset = this.options.offset;\n\t\tconst resetList = this._items.slice(0, idx);\n\t\tTweenLite.to(resetList, time, {top: 0});\n\t\tconst offsetList = this._items.slice(idx);\n\t\tTweenLite.to(offsetList, time, {top: offset});\n\n\t\treturn false;\n\t}\n\n\n\t_onDragLeaveItem(ev, idx) {\n\t\t// Empty for now?\n\t}\n\n\t_resetOffsets(time = this.options.time) {\n\t\tTweenLite.to(this._items, time, {top: 0});\n\t}\n}\n","import {DraggableList} from './draggable-list';\n\nexport function initDraggableLists() {\n // make sure my listeners to get bound _before_ the class owns get bound to the elements\n // Only needed for the \"root\" directory though.. :/\n const oldFun = SidebarDirectory.prototype.activateListeners;\n SidebarDirectory.prototype.activateListeners = function(html) {\n const list = html[0].querySelectorAll('.directory-list, .subdirectory');\n list.forEach(e => new DraggableList(e, '.entity'));\n oldFun.call(this, html);\n }\n\n // this does work, since on default most sheets have their drop function bound to the form, not the item list!\n Hooks.on('renderActorSheet', (app, html, options) => {\n const list = html[0].querySelectorAll('.item-list');\n list.forEach(e => new DraggableList(e, '.item'));\n });\n}","import { rolling } from './rolls';\nimport { MessSettings } from './settings.js';\nimport {dndTemplateSettings, changeTemplates } from './modify-templates.js';\nimport { changePlaceables } from './change-placeables.js';\nimport itemSortBtn from './actor-item-sort-btn.js';\nimport preparedSpellTracker from './prepared-spell-tracker.js';\nimport addScrolling from './add-scrolling.js';\n\nimport {initDraggableLists} from './draggable-lists';\nimport {initChatPopUp} from './chat-popup';\n\nHooks.on('ready', async function() {\n\tif (game.settings.get('mess', 'actor-item-sort'))\n\t\titemSortBtn();\n\tif (game.settings.get('mess', 'prepared-spell-tracker'))\n\t\tpreparedSpellTracker();\n\tif (game.settings.get('mess', 'add-scrolling'))\n\t\taddScrolling();\n\t\n\tif (CONFIG.debug.mess) {\n\t\tconst actor = (await fromUuid('Actor.xV3LUAg05Pz5MFTS'));\n\t\tactor.sheet.render(true);\n\t}\n\n\t// initChatPopUp();\n\n\tif (!game.user.isGM)\n\treturn;\n\t// Edit next line to match module.\n\tconst module = game.modules.get(\"mess\");\n\tconst title = module.data.title;\n\tconst moduleVersion = module.data.version;\n\tgame.settings.register(title, 'version', {\n\t\tname: `${title} Version`,\n\t\tdefault: \"0.0.0\",\n\t\ttype: String,\n\t\tscope: 'world',\n\t});\n\tconst oldVersion = game.settings.get(title, \"version\");\n\n\tif (!isNewerVersion(moduleVersion, oldVersion))\n\t\treturn;\n\n\t(await import(\n\t\t\t\t\t\t\t\t/* webpackChunkName: \"welcome-screen\" */\n\t\t\t\t\t\t\t\t'./welcome-screen.js'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t).default();\n});\n\nHooks.on('init', function() {\n\tgame.mess = {};\n\tCONFIG.debug.mess = false;\n\tMessSettings.init();\n\n\trolling();\n\n\tdndTemplateSettings();\n\tchangeTemplates();\n\tif (game.settings.get('mess', 'change-placeables'))\n\t\tchangePlaceables();\n\tif (game.settings.get('mess', 'better-draggable-lists'))\n\t\tinitDraggableLists();\n});\n","export function changeTemplates() {\n\n // #MonkeyPatchingFTW\n // better than stealing the code, replacing one line and then release it under a/the wrong license..\n // Disadvantage: could need more fixing on updates. At least i didn#t make it line based like Kakaroto.. :P\n \n\tlet newFun = MeasuredTemplate.prototype.refresh.toString();\n\n\tif (game.settings.get('mess', 'modify-templates')) {\n\t\tnewFun = newFun.replace(/this\\.template\\.beginTextureFill\\(\\{[\\s\\S]*\\}\\)\\;/, `\n\t\t\t{\n\t\t\t\tlet mat = PIXI.Matrix.IDENTITY;\n\t\t\t\t// rectangle\n\t\t\t\tif (this.shape.width && this.shape.height)\n\t\t\t\t\tmat.scale(this.shape.width / this.texture.width, this.shape.height / this.texture.height);\n\t\t\t\telse if (this.shape.radius) {\n\t\t\t\t\tmat.scale(this.shape.radius * 2 / this.texture.height, this.shape.radius * 2 / this.texture.width)\n\t\t\t\t\t// Circle center is texture start...\n\t\t\t\t\tmat.translate(-this.shape.radius, -this.shape.radius);\n\t\t\t\t} else if (this.data.t === \"ray\") {\n\t\t\t\t\tconst d = canvas.dimensions,\n\t\t\t\t\t\t\t\theight = this.data.width * d.size / d.distance,\n\t\t\t\t\t\t\t\twidth = this.data.distance * d.size / d.distance;\n\t\t\t\t\tmat.scale(width / this.texture.width, height / this.texture.height);\n\t\t\t\t\tmat.translate(0, -height * 0.5);\n\n\t\t\t\t\tmat.rotate(toRadians(this.data.direction));\n\t\t\t\t} else {// cone\n\t\t\t\t\tconst d = canvas.dimensions;\n\t\t\t\n\t\t\t\t\t// Extract and prepare data\n\t\t\t\t\tlet {direction, distance, angle} = this.data;\n\t\t\t\t\tdistance *= (d.size / d.distance);\n\t\t\t\t\tdirection = toRadians(direction);\n\t\t\t\t\tconst width = this.data.distance * d.size / d.distance;\n\n\t\t\t\t\tconst angles = [(angle/-2), (angle/2)];\n\t\t\t\t\tdistance = distance / Math.cos(toRadians(angle/2));\n\t\t\t\n\t\t\t\t\t// Get the cone shape as a polygon\n\t\t\t\t\tconst rays = angles.map(a => Ray.fromAngle(0, 0, direction + toRadians(a), distance+1));\n\t\t\t\t\tconst height = Math.sqrt((rays[0].B.x - rays[1].B.x) * (rays[0].B.x - rays[1].B.x)\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ (rays[0].B.y - rays[1].B.y) * (rays[0].B.y - rays[1].B.y));\n\t\t\t\t\tmat.scale(width / this.texture.width, height / this.texture.height);\n\t\t\t\t\tmat.translate(0, -height/2)\n\t\t\t\t\tmat.rotate(toRadians(this.data.direction));\n\t\t\t\t}\n\t\t\t\tthis.template.beginTextureFill({\n\t\t\t\t\ttexture: this.texture,\n\t\t\t\t\tmatrix: mat,\n\t\t\t\t\talpha: 0.8\n\t\t\t\t});\n\t\t\t\t// move into draw or so\n\t\t\t\tconst source = getProperty(this.texture, \"baseTexture.resource.source\")\n\t\t\t\tif ( source && (source.tagName === \"VIDEO\") ) {\n\t\t\t\t\tsource.loop = true;\n\t\t\t\t\tsource.muted = true;\n\t\t\t\t\tgame.video.play(source);\n\t\t\t\t}\n\t\t}`);\n\n\t\tHooks.on('renderMeasuredTemplateConfig', (app, html, data) => {\n\t\t\thtml[0].querySelector('.file-picker').dataset.type = 'imagevideo'\n\t\t});\n\t}\n\t\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\tnewFun = newFun.replace(/this\\.\\_borderThickness/, \"this.texture && !this._hover ? 0 : this._borderThickness\");\n\t\tnewFun = newFun.replace(/return\\sthis\\;/, `\n\t\t\tconst grid = canvas.grid;\n\t\t\t// only show grid highlights on hover\n\t\t\tif (this.texture) {\n\t\t\t\tconst hl = grid.getHighlightLayer(\\`Template.\\$\\{this.id\\}\\`);\n\t\t\t\tif (hl)\n\t\t\t\t\thl.renderable = this._hover;\n\t\t\t}\n\t\t\treturn this;`);\n\t}\n\n\tMeasuredTemplate.prototype.refresh = Function(`\"use strict\"; return ( function ${newFun} )`)();\n\n\t\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\tMeasuredTemplate.prototype.getTargets = getTargets;\n\t\tMeasuredTemplate.prototype.isTokenInside = isTokenInside;\n\n\t\tconst oldFun = MeasuredTemplate.prototype._onDragLeftMove;\n\t\tMeasuredTemplate.prototype._onDragLeftMove = function(ev) {\n\t\t\tconst ret = oldFun.bind(this)(ev);\n\n\t\t\tfor (let c of ev.data.clones)\n\t\t\t\tthis.getTargets(c);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n\nexport async function dndTemplateSettings() {\n if (game.system.id !== 'dnd5e') return;\n\n\tconst importedJS = (await import(/* webpackIgnore: true */ '/systems/dnd5e/module/pixi/ability-template.js'))\n\tconst AbilityTemplate = importedJS.default || importedJS.AbilityTemplate;\n\n\t// Auto texture creation from item\n\tif (game.settings.get('mess', 'modify-templates')) {\n\t\tHooks.on('renderItemSheet', itemHook);\n\t\t\n\t\t\n\t\tconst _originalFromItem = AbilityTemplate.fromItem;\n\t\tAbilityTemplate.fromItem = function(item) {\n\t\t\tconst template = _originalFromItem.bind(this)(item);\n\t\t\t\n\t\t\t// generate a texture based on the items dmg type, ...\n\t\t\t// Add settings to define custom templates for stuff.\n\t\t\tlet path = item.getFlag('mess', 'templateTexture');\n\t\t\tif (!path && item.hasDamage) {\n\t\t\t\tconst settings = game.settings.get('mess', 'templateTexture') || {};\n\t\t\t\tpath = settings[item.data.data.damage.parts[0][1]] || {};\n\t\t\t\tpath = path[template.data.t];\n\t\t\t}\n\t\t\tif (path)\n\t\t\t\tloadTexture(path).then(tex => {\n\t\t\t\t\ttemplate.texture = tex;\n\t\t\t\t\ttemplate.data.texture = path;\n\t\t\t\t\ttemplate.refresh();\n\t\t\t\t})\n\t\t\ttemplate.item = item;\n\t\t\treturn template;\n\t\t}\n\t}\n\n\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\t// rather ugly, maybe find a better way at some point :shrug:\n\t\tconst origPrevListeners = AbilityTemplate.prototype.activatePreviewListeners.toString();\n\t\tconst newFun = origPrevListeners.replace(/this\\.refresh\\(\\)\\;/, \n\t\t\t\t\t// get targets\n\t\t\t\t\t\t`this.refresh();\n\t\t\t\t\t\tthis.getTargets(this);\n\t\t\t\t\t`);\n\n\t\tAbilityTemplate.prototype.getTargets = getTargets;\n\t\tAbilityTemplate.prototype.isTokenInside = isTokenInside;\n\n\t\tAbilityTemplate.prototype.activatePreviewListeners = Function(`\"use strict\"; return ( function ${newFun} )`)();\n\t}\n}\n\n\nfunction isTokenInside(token) {\n\tconst grid = canvas.scene.data.grid,\n\t\t\t\ttemplatePos = {x: this.data.x, y: this.data.y};\n\t// Check for center of each square the token uses.\n\t// e.g. for large tokens all 4 squares\n\tconst startX = token.width >= 1 ? 0.5 : token.width / 2;\n\tconst startY = token.height >= 1 ? 0.5 : token.height / 2;\n\tfor (let x = startX; x < token.width; x++) {\n\t\tfor (let y = startY; y < token.height; y++) {\n\t\t\tconst currGrid = {\n\t\t\t\tx: token.x + x * grid - templatePos.x,\n\t\t\t\ty: token.y + y * grid - templatePos.y\n\t\t\t};\n\t\t\tconst contains = this.shape.contains(currGrid.x, currGrid.y);\n\t\t\tif (contains) return true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction getTargets(template) {\n\tconst tokens = canvas.scene.getEmbeddedCollection('Token');\n\tlet targets = [];\n\t\n\tfor (const token of tokens)\n\t\tif (template.isTokenInside(token)) { targets.push(token._id); }\n\tgame.user.updateTokenTargets(targets);\n}\n\nasync function itemHook(app, html) {\n\tconst div = document.createElement('div');\n\tdiv.classList.add('form-group');\n\tdiv.appendChild(document.createElement('label')).innerText = game.i18n.localize('MESS.itemSheet.templateTexture');\n\tconst formField = div.appendChild(document.createElement('div'));\n\tformField.classList.add('form-fields');\n\tconst inp = formField.appendChild(document.createElement('input'));\n\tinp.dataset.dtype = 'String';\n\tinp.type = 'text';\n\tinp.name = 'flags.mess.templateTexture';\n\tinp.value = app.object.getFlag('mess', 'templateTexture') || \"\";\n\n\tformField.insertAdjacentHTML('beforeend', `\n\t\t\n\t`);\n\tconst button = formField.querySelector('button');\n\tbutton.style.flex = '0';\n app._activateFilePicker(button);\n\tconst target = html[0].querySelector('[name=\"data.target.units\"]');\n if (target)\n\t\ttarget.closest('.form-group').after(div);\n}","export default async function addPreparedSpellTracker() {\n\tHooks.on('renderActorSheet', async function (app, html, data) {\n\t\tconst actor = await fromUuid(`Actor.${data.actor._id}`);\n\t\tif (actor.isNPC) return;\n\t\t\n\t\tconst spellDc = html[0].querySelector('.spell-dc');\n\t\tif (!spellDc) return;\n\t\tlet tracker = document.createElement('div');\n\t\ttracker.classList.add('spell-detail');\n\t\ttracker.classList.add('spell-slots');\n\t\ttracker.style.flex = '1';\n\t\ttracker.style.border = 'none';\n\t\tconst spanPrep = tracker.appendChild(document.createElement('span'));\n\t\tspanPrep.innerText = `${game.i18n.localize('MESS.actorSheet.preparedSpellTracker')}: ${data.preparedSpells}`;\n\n\t\tconst sep = tracker.appendChild(document.createElement('span'));\n\t\tsep.innerText = ' / ';\n\t\tsep.classList.add('sep');\n\n\t\tconst max = tracker.appendChild(document.createElement('input'));\n\t\tmax.type = 'text';\n\t\tmax.value = actor.getFlag('mess', 'maxPreparedSpells') || 0;\n\t\tmax.addEventListener('change', async function(ev) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropagation();\n\t\t\tconst val = Number(ev.currentTarget.value);\n\t\t\tif (isNaN(val)) {\n\t\t\t\tev.currentTarget.value = actor.getFlag('mess', 'maxPreparedSpells') || 0;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tactor.setFlag('mess', 'maxPreparedSpells', val);\n\t\t\treturn false;\n\t\t});\n\t\t\n\t\tif (app.constructor.name === 'Tidy5eSheet') {\n\t\t\tconst el = html[0].querySelector('.spellcasting-ability');\n\t\t\tel.appendChild(tracker, el);\n\t\t} else {\n\t\t\tconst el = html[0].querySelector('.spellbook .inventory-list');\n\t\t\ttracker.style.flex = '0';\n\t\t\ttracker.style.alignSelf = 'flex-start';\n\t\t\ttracker.style.margin = '0 8px';\n\t\t\tel.parentNode.insertBefore(tracker, el);\n\t\t}\n\t});\n}","export default function modifyApplyDmg() {\n\tHooks.on('getChatLogEntryContext', function (html, options) {\n\t\tsetProperty(game, 'mess.chatLogEntryContextOptions', options);\n\t\t\n\t\t// Modify existing applies to only work on default rolls and not mess-rolls\n\t\tconst canApply = li => canvas.tokens.controlled.length \n\t\t\t\t\t\t\t\t\t\t\t\t&& li.find(\".dice-roll .dice-result\").length;\n\t\tfor (let i = 1; i < options.length; i++) \n\t\t\toptions[i].condition = canApply;\n\t});\n}","export default function() {\n\n\tHooks.on('renderChatLog', chatLogHook);\n\n\tregisterSettings();\n};\n\nfunction registerSettings() {\n\tgame.settings.register('mess', `${game.userId}.adv-selector`, {\n\t\tname: 'Mess - Advantage Selector',\n\t\tdefault: 'normal',\n\t\ttype: String,\n\t\tscope: 'user'\n\t});\n\tgame.settings.register('mess', `${game.userId}.autoroll-selector`, {\n\t\tname: 'Mess - Autoroll Selector',\n\t\tdefault: {hit: false, dmg: false},\n\t\ttype: Object,\n\t\tscope: 'user'\n\t});\n}\n\nasync function chatLogHook(app, html, data) {\n\thtml[0].classList.add('mess');\n\tconst div = document.createElement('div');\n\tdiv.classList.add('mess-roll-control');\n\n\tconst advSelector = game.settings.get('mess', `${game.userId}.adv-selector`);\n\tconst autoRollSelector = game.settings.get('mess', `${game.userId}.autoroll-selector`);\n\tconst templateData = {\n\t\tadvantage: advSelector === 'advantage',\n\t\tnormal: advSelector === 'normal',\n\t\tdisadvantage: advSelector === 'disadvantage',\n\t\t...autoRollSelector\n\t}\n\n\tdiv.insertAdjacentHTML('afterbegin', await renderTemplate('modules/mess/templates/roll-control.html', templateData));\n\n\tdiv.querySelectorAll('.mess-adv-selector a').forEach(e => {\n\t\te.addEventListener('click', async function(ev) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropagation();\n\t\t\tconst arr = Array.from(ev.currentTarget.parentNode.querySelectorAll('a'));\n\t\t\tconst currIdx = arr.findIndex(e => e.classList.contains('mess-selected'));\n\t\t\tarr[currIdx].classList.remove('mess-selected');\n\t\t\tconst newSelected = arr[(currIdx + 1) % arr.length];\n\t\t\tnewSelected.classList.add('mess-selected');\n\t\t\tgame.settings.set('mess', `${game.userId}.adv-selector`, newSelected.name);\n\t\t});\n\t\t// Toggle in the opposite direction with right click\n\t\te.addEventListener('contextmenu', async function(ev) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropagation();\n\t\t\tconst arr = Array.from(ev.currentTarget.parentNode.querySelectorAll('a'));\n\t\t\tconst currIdx = arr.findIndex(e => e.classList.contains('mess-selected'));\n\t\t\tarr[currIdx].classList.remove('mess-selected');\n\t\t\tconst newSelected = arr[(currIdx + arr.length - 1) % arr.length]; // add length cause javascripts modulo is strange\n\t\t\tnewSelected.classList.add('mess-selected');\n\t\t\tgame.settings.set('mess', `${game.userId}.adv-selector`, newSelected.name);\n\t\t})\n\t});\n\tdiv.querySelectorAll('.mess-autoroll-selector a') .forEach(e => {\n\t\te.addEventListener('click', async function(ev) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropagation();\n\n\t\t\t\n\t\t\tev.currentTarget.classList.toggle('mess-selected');\n\t\t\tlet data = game.settings.get('mess', `${game.userId}.autoroll-selector`);\n\t\t\tdata[ev.currentTarget.name] = ev.currentTarget.classList.contains('mess-selected');\n\t\t\tgame.settings.set('mess', `${game.userId}.autoroll-selector`, data);\n\t\t})\n\t});\n\n\tconst controls = document.getElementById('chat-controls');\n\tcontrols.insertBefore(div, controls.childNodes[0]);\n}","/**\n * All the functions provided here are heavily based on Foundrys DnD5e system, authored by Atropos.\n * Original repository: https://gitlab.com/foundrynet/dnd5e\n * Original Author: Atropos\n * License: GNU GPLv3\n */\n\nfunction getD20Modifier() {\n\treturn document.getElementById('mess-roll-mod').value;\n}\n\nfunction getAdvantageSettings() {\n\treturn game.settings.get('mess', `${game.userId}.adv-selector`);\n}\n\nexport async function rollD20(data) {\n\tlet adv = getAdvantageSettings();\n\t// Determine the d20 roll and modifiers\n\tlet nd = 1;\n\tlet mods = data.halflingLucky ? \"r=1\" : \"\";\n\n\t// Handle advantage\n\tif ( adv === \"advantage\" ) {\n\t\tnd = data.elvenAccuracy ? 3 : 2;\n\t\tmods += \"kh\";\n\t\tdata.title += ` (${game.i18n.localize(\"DND5E.Advantage\")})`;\n\t}\n\n\t// Handle disadvantage\n\telse if ( adv === \"disadvantage\" ) {\n\t\tnd = 2;\n\t\tmods += \"kl\";\n\t\tdata.title += ` (${game.i18n.localize(\"DND5E.Disadvantage\")})`;\n\t}\n\n\t// Include the d20 roll\n\tlet diceFormula = `${nd}d20${mods}`;\n\tif (data.reliableTalent) diceFormula = `{${nd}d20${mods},10}kh`;\n\tdata.parts.unshift(diceFormula);\n\n\tconst d20Mod = getD20Modifier();\n\tif (d20Mod)\n\t\tdata.parts.push(d20Mod);\n\t\n\tlet r = new Roll(data.parts.join('+'), data);\n\tr.roll();\n\tconst d20 = r.parts[0].total;\n\tlet templateData = {...data, \n\t\ttooltip: await r.getTooltip(),\n\t\troll: r,\n\t\tcrit: d20 >= 20,\n\t\tfumble: d20 <= 1\n\t}\n\n\tconst template = await renderTemplate('modules/mess/templates/roll-card.html', templateData);\n\n\tlet chatData = {\n\t\tuser: game.user._id,\n\t\ttype: CONST.CHAT_MESSAGE_TYPES.OTHER,\n\t\tcontent: template,\n\t\tspeaker: {\n\t\t\tactor: this,\n\t\t\talias: this.name\n\t\t}\n\t};\n\tlet rollMode = game.settings.get(\"core\", \"rollMode\");\n\tif ( [\"gmroll\", \"blindroll\"].includes(rollMode) ) chatData[\"whisper\"] = ChatMessage.getWhisperIDs(\"GM\");\n\tif ( rollMode === \"blindroll\" ) chatData[\"blind\"] = true;\n\n\tChatMessage.create(chatData);\n}\n\n/**\n * Extracts the data needed for an attack roll.\n * @param {ActorEntity} actor\n * @param {ItemEntity} item \n */\nexport async function getToHitData({actor, item}) {\n\tif (!item.hasAttack) return null;\n\tconst actorData = actor.data.data;\n\tconst itemData = item.data.data;\n\tconst flags = actor.data.flags.dnd5e || {};\n\t\n\tlet rollData = item.getRollData();\n\n\t// Define Roll bonuses\n\tconst parts = [`@mod`];\n\tif ( (item.data.type !== \"weapon\") || itemData.proficient ) {\n\t\tparts.push(\"@prof\");\n\t}\n\trollData.parts = parts;\n\n\t// Expanded weapon critical threshold\n\tif (( item.data.type === \"weapon\" ) && flags.weaponCriticalThreshold) {\n\t\trollData.critical = parseInt(flags.weaponCriticalThreshold);\n\t}\n\n\t// Elven Accuracy\n\tif ( [\"weapon\", \"spell\"].includes(item.data.type) ) {\n\t\tif (flags.elvenAccuracy && [\"dex\", \"int\", \"wis\", \"cha\"].includes(item.abilityMod)) {\n\t\t\trollData.elvenAccuracy = true;\n\t\t}\n\t}\n\n\t// Apply Halfling Lucky\n\tif ( flags.halflingLucky ) rollData.halflingLucky = true;\n\n\t// Attack Bonus\n\tconst actorBonus = actorData.bonuses[itemData.actionType] || {};\n\tif ( itemData.attackBonus || actorBonus.attack ) {\n\t\t// parts.push(\"@atk\");\n\t\trollData[\"atk\"] = [itemData.attackBonus, actorBonus.attack].filterJoin(\" + \");\n\t\tif (!isNaN(Number(rollData[\"atk\"]))) {\n\t\t\tparts.push(\"@atk\");\n\t\t}\n\t}\n\n\tlet roll = new Roll(rollData.parts.join('+'), rollData);\n\trollData.totalModifier = roll._safeEval(roll.formula);\n\trollData.totalModifier = rollData.totalModifier >= 0 ? '+' + rollData.totalModifier : rollData.totalModifier;\n\tif (rollData[\"atk\"] && !roll._formula.includes('@atk')) {\n\t\trollData.parts.push(\"@atk\");\n\t\troll = new Roll(rollData.parts.join('+'), rollData);\n\t\trollData.totalModifier += `+${rollData[\"atk\"]}`;\n\t}\n\n\tconst situationalModifier = getD20Modifier();\n\tif (situationalModifier) {\n\t\trollData.parts.push(situationalModifier);\n\t\troll = new Roll(rollData.parts.join('+'), rollData);\n\t\trollData.totalModifier += `+${situationalModifier}`;\n\t}\n\trollData.formula = roll.formula;\n\trollData.terms = roll._formula;\n\treturn rollData;\n}\n\n/**\n * Rolls the to hit roll and updates the html target. Also updates the message if found.\n * @param {Click Event} ev event targetting the button which initiated a real or virtual click event\n */\nexport async function rollToHit(ev) {\n\t// Extract card data\n\tconst button = ev.currentTarget;\n\tbutton.disabled = true;\n\tconst card = button.closest(\".chat-card\");\n\tconst messageId = card.closest(\".message\").dataset.messageId;\n\t// Check if user owns chat message, else return\n\tif (messageId) {\n\t\tconst message = game.messages.get(messageId);\n\t\tif (!(message.owner || message.isAuthor)) {\n\t\t\tui.notifications.error('You do not own the permissions to make that roll!');\n\t\t\treturn;\n\t\t}\n\t}\n\t// Get the Actor from a synthetic Token\n\tconst actor = CONFIG.Item.entityClass._getChatCardActor(card);\n\tif (!actor.owner) return false;\n\n\t// Get the Item\n\tconst item = actor.getOwnedItem(card.dataset.itemId);\n\tif ( !item ) {\n\t\treturn ui.notifications.error(`The requested item ${card.dataset.itemId} no longer exists on Actor ${actor.name}`)\n\t}\n\n\tlet rollData = await getToHitData({actor, item});\n\tlet adv = getAdvantageSettings();\n\t// Determine the d20 roll and modifiers\n\tlet nd = 1;\n\tlet mods = rollData.halflingLucky ? \"r=1\" : \"\";\n\n\t// Handle advantage\n\tif ( adv === \"advantage\" ) {\n\t\tnd = rollData.elvenAccuracy ? 3 : 2;\n\t\tmods += \"kh\";\n\t}\n\n\t// Handle disadvantage\n\telse if ( adv === \"disadvantage\" ) {\n\t\tnd = 2;\n\t\tmods += \"kl\";\n\t}\n\n\t// Include the d20 roll\n\trollData.parts.unshift(`${nd}d20${mods}`);\n\t\n\tlet r = new Roll(rollData.parts.join('+'), rollData);\n\tr.roll();\n\tlet div = document.createElement('div');\n\tdiv.title = `${rollData.parts[0]}+${rollData.terms} = ${r.formula} = ${r.total}. Click to see rolls.`;\n\tdiv.classList.add('dice-roll');\n\tdiv.classList.add('mess-dice-result');\n\tconst span = div.appendChild(document.createElement('span'));\n\tspan.innerText = r.total;\n\tdiv.insertAdjacentHTML('beforeend', await r.getTooltip());\n\tconst tooltip = div.childNodes[1];\n\ttooltip.classList.add('hidden');\n\tconst crit = rollData.critical || 20;\n\tconst fumble = rollData.fumble || 1;\n\n\tconst d20 = r.parts[0].total;\n\tif (d20 >= crit) {\n\t\tspan.classList.add('crit');\n\t\tcard.querySelector('.mess-chat-dmg .mess-chat-roll-type').innerHTML += ' - Crit!'\n\t\tcard.querySelectorAll('.mess-button-dmg').forEach((e, idx) => {\n\t\t\tconst rgx = new RegExp(Die.rgx.die, \"g\");\n\t\t\tconst formula = e.dataset.formula.replace(rgx, (match, nd, d, mods) => {\n\t\t\t\tif (game.settings.get('mess', 'max-critical'))\n\t\t\t\t\t\tmods = \" + \" + nd * d + (mods || \"\");\n\t\t\t\telse {\n\t\t\t\t\t\tnd = nd * 2;\n\t\t\t\t\t\tmods = mods || \"\";\n\t\t\t\t}\n\t\t\t\treturn nd + \"d\" + d + mods;\n\t\t\t});\n\t\t\te.innerHTML = ` ${formula}`;\n\t\t\te.dataset.formula = formula;\n\t\t});\n\t}\n\tif (d20 <= fumble)\n\t\tspan.classList.add('fumble');\n\n\tev.currentTarget.parentNode.replaceChild(div, ev.currentTarget);\n\tif (messageId) {\n\t\tconst message = game.messages.get(messageId);\n\t\tmessage.update({content: card.parentNode.innerHTML});\n\t}\n}\n\nexport async function getDmgData({actor, item, spellLevel = null}) {\n\tif (!item.hasDamage) return null;\n\tconst actorData = actor.data.data;\n\tconst itemData = item.data.data;\n\tlet rollData = item.getRollData();\n\t\n\tif ( spellLevel ) rollData.item.level = spellLevel;\n\n\trollData.parts = duplicate(itemData.damage.parts);\n\tif (itemData.damage.versatile) \n\t\trollData.parts.splice(1, 0, [itemData.damage.versatile, \"versatile\"]);\n\n\t// Only apply for items that are not bonus dmg themself\n\tif (!item.getFlag('mess', 'isBonusDamage'))\n\t\tfor (let itm of actor.items){\n\t\t\t// skip self\n\t\t\tif (itm.id === item.id) continue;\n\n\t\t\tlet bnsDmgParts = [];\n\t\t\tif (itm.getFlag('mess', 'isBonusDamage')){\n\t\t\t\tif (itm.hasDamage){\n\t\t\t\t\tconst itmData = itm.data.data;\n\t\t\t\t\tbnsDmgParts.push(itmData.damage.parts[0][0]);\n\t\t\t\t\tvar lbl = itm.name;\n\t\t\t\t\tif (itmData.damage.parts[0][1].length > 0) lbl += ` - ${game.i18n.localize('DND5E.Damage' + CONFIG.DND5E.damageTypes[itmData.damage.parts[0][1]])}`;\n\t\t\t\t\tbnsDmgParts.push(lbl);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (bnsDmgParts.length > 0) rollData.parts.push(bnsDmgParts);\n\t\t}\n\t\n\tif (item.data.type === 'spell') {\n\t\tif (itemData.scaling.mode === 'cantrip') {\n\t\t\tlet newDmgPart = [rollData.parts[0][0]];\n\t\t\tconst lvl = actor.data.type === 'character' ? actorData.details.level : actorData.details.spellLevel;\n\t\t\titem._scaleCantripDamage(newDmgPart, lvl, itemData.scaling.formula);\n\t\t\trollData.parts[0][0] = newDmgPart[0];\n\t\t} else if (spellLevel && (itemData.scaling.mode === 'level') && itemData.scaling.formula ) {\n\t\t\tlet newDmgPart = [];\n\t\t\titem._scaleSpellDamage(newDmgPart, itemData.level, spellLevel, itemData.scaling.formula)\n\t\t\tif (newDmgPart.length > 0) {\n\t\t\t\tnewDmgPart.push('upcast dice');\n\t\t\t\trollData.parts.push(newDmgPart);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tconst actorBonus = actorData.bonuses[itemData.actionType] || {};\n\tif (actorBonus.damage && parseInt(actorBonus.damage ) !== 0) {\n\t\trollData.parts[0][0] += \"+@dmg\";\n\t\trollData[\"dmg\"] = actorBonus.damage;\n\t}\n\n\tfor (let part of rollData.parts) {\n\t\tlet roll = new Roll(part[0], rollData);\n\t\tconst dmgType = CONFIG.DND5E.damageTypes[part[1]];\n\t\tif (dmgType)\n\t\t\tpart[1] = game.i18n.localize('DND5E.Damage' + CONFIG.DND5E.damageTypes[part[1]]);\n\t\telse if (part[1] === 'versatile')\n\t\t\tpart[1] = game.i18n.localize('DND5E.Versatile');\n\n\t\t//evalute damage formula's for example \"ceil(@classes.rogue.levels/2))d6\" -> \"4d6\"\n\t\tlet terms = roll._evalParentheticalTerms(roll.formula).map(t => {\n\t\t\tif ( t instanceof Roll ) {\n\t\t\t\tt.roll();\n\t\t\t\treturn t.total;\n\t\t\t}\n\t\t\treturn t;\n\t\t});\n\t\tpart.push(terms.join(''));\n\t}\n\n\treturn rollData;\n}\n\n/**\n * Rolls the dmg dice listed. If the event points towards an existing message the message will get updated\n * @param {Event} ev \n */\nexport async function rollDmg(ev) {\n\t// Extract card data\n\tconst button = ev.currentTarget;\n\tbutton.disabled = true;\n\tconst card = button.closest(\".chat-card\");\n\tconst messageId = card.closest(\".message\").dataset.messageId;\n\n\t// Check if user owns chat message, else return\n\tif (messageId) {\n\t\tconst message = game.messages.get(messageId);\n\t\tif (!(message.owner || message.isAuthor)) {\n\t\t\tui.notifications.error('You do not own the permissions to make that roll!');\n\t\t\treturn;\n\t\t}\n\t}\n\tconst formula = button.dataset.formula;\n\n\tlet r = new Roll(formula);\n\tr.roll();\n\tlet div = document.createElement('div');\n\tdiv.title = `${button.dataset.terms} = ${r.formula} = ${r.total}. Click to see rolls.`;\n\tdiv.classList.add('dice-roll');\n\tdiv.classList.add('mess-dice-result');\n\tconst span = div.appendChild(document.createElement('span'));\n\tspan.innerText = r.total;\n\tdiv.insertAdjacentHTML('beforeend', await r.getTooltip());\n\tconst tooltip = div.childNodes[1];\n\ttooltip.classList.add('hidden');\n\n\tev.currentTarget.parentNode.replaceChild(div, ev.currentTarget);\n\n\tif (messageId) {\n\t\tconst message = game.messages.get(messageId);\n\t\tmessage.update({content: card.parentNode.innerHTML});\n\t}\n}","import rollConrolls from './controls.js';\nimport applyDmg from './apply-dmg.js';\nimport modifyRolling from './modify-rolling.js';\n\nexport function rolling() {\n\t// Don't do this stuff if the settings are disabled.\n\tif (!game.settings.get('mess', 'modify-rolling'))\n\t\treturn;\n\trollConrolls();\n\tapplyDmg();\n\tmodifyRolling()\n}","import {rollD20, getToHitData, rollToHit, getDmgData, rollDmg} from './dice.js';\n\n\nexport default function() {\n\tsetupHooks();\n\tgame.mess.toggleItemBonusDamage = toggleItemBonusDamage;\n}\n\n/**\n * Heavily based on: https://gitlab.com/foundrynet/dnd5e/-/blob/master/module/macros.js#L42\n * original author: Atropos\n * source repository: https://gitlab.com/foundrynet/dnd5e\n * license: GPLv3\n * @param {*} itemName \n */\nfunction toggleItemBonusDamage(itemName) {\n\tconst speaker = ChatMessage.getSpeaker();\n let actor;\n\tif ( speaker.token ) \n\t\tactor = game.actors.tokens[speaker.token];\n\tif ( !actor ) \n\t\tactor = game.actors.get(speaker.actor);\n // Get matching items\n const items = actor ? actor.items.filter(i => i.name === itemName) : [];\n if ( items.length > 1 ) {\n ui.notifications.warn(`Your controlled Actor ${actor.name} has more than one Item with name ${itemName}. The first matched item will be chosen.`);\n } else if ( items.length === 0 ) {\n return ui.notifications.warn(`Your controlled Actor does not have an item named ${itemName}`);\n }\n const item = items[0];\n\n\tconst newState = !item.getFlag('mess', 'isBonusDamage');\n\t// toggle bonus dmg\n\titem.setFlag('mess', 'isBonusDamage', newState);\n\treturn newState;\n}\n\n/**\n * Initializes all the hoohks!\n */\nfunction setupHooks() {\n\tCONFIG.Item.entityClass.chatListeners = chatListeners.bind(CONFIG.Item.entityClass);\n\n\tHooks.on('preCreateChatMessage', preCreateChatMessageHook);\n\tHooks.on('renderActorSheet', actorSheetHook);\n\n\t// Bind my own chatListeners to the item class and execute them.\n\t// Hooks.on('ready', chatListeners.bind(CONFIG.Item.entityClass));\n\n\tHooks.on('renderItemSheet', (app, html, data) => {\n\t\tlet div = document.createElement('div');\n\t\tdiv.classList.add('form-group');\n\t\tdiv.appendChild(document.createElement('label')).innerText = game.i18n.localize('MESS.itemSheet.bonusDmg');\n\t\tlet formField = div.appendChild(document.createElement('div'));\n\t\tformField.classList.add('form-fields');\n\t\tlet inp = formField.appendChild(document.createElement('input'));\n\t\tinp.type = 'checkbox';\n\t\tinp.name = 'flags.mess.isBonusDamage';\n\t\tinp.checked = app.object.getFlag('mess', 'isBonusDamage');\n\n\t\tconst target = html[0].querySelector('[name=\"data.formula\"]');\n\t\tif (target)\n\t\t\ttarget.closest('.form-group').after(div);\n\t})\n}\n\n/**\n * Makes sure one attack is rolled for every chat card that has a dmg or attack button.\n * @param {Object} data chat message data\n */\nasync function preCreateChatMessageHook(data) {\n\tconst div = document.createElement('div');\n\tdiv.insertAdjacentHTML('afterbegin', data.content);\n\tlet btn = div.querySelector('button[data-action=\"attack\"]');\n\tif (!btn)\n\t\tbtn = div.querySelector('button[data-action=\"damage\"]');\n\t\n\tif (btn)\n\t\trenderAttack({currentTarget: btn});\n}\n\n\n// TODO: for compendium rolltables\nfunction getFlavor(chatFlavor, target) {\n\tconst rollTableRegExp = /@RollTable\\[([^\\]])+\\](?:\\{([^\\}]+)\\})?/g;\n\tlet rollTables = Array.from(chatFlavor.matchAll(rollTableRegExp));\n\tif (rollTables) {\n\t\tconst collection = game.tables;\n\t\tfor (let tableData of rollTables) {\n\t\t\tlet table;\n\t\t\tconst id = tableData[0].match(/\\[[a-zA-Z0-9]{16}\\]/);\n\t\t\tif (id) {\n\t\t\t\ttable = collection.get(id[0].slice(1, -1));\n\t\t\t} else {\n\t\t\t\tconst name = tableData[0].match(/\\[([^\\]])+\\]/)[0].slice(1, -1);\n\t\t\t\ttable = collection.entities.find(e => e.data.name === name);\n\t\t\t}\n\t\t\tlet result = table.roll();\n\t\t\tchatFlavor = chatFlavor.replace(tableData[0], result.results.map(e => e.text).join(\",\"));\n\t\t}\n\t}\n\treturn chatFlavor.replace(/\\[target\\.name\\]/g, target.data.name)\n}\n\n\n/**\n * Renders an attack chat card\n * @param {Click Event} ev pointing towards the card that is supposed to initiate the event.\n */\nasync function renderAttack(ev) {\n\tif (ev.type === 'click') {\n\t\tev.preventDefault();\n\t\tev.stopPropagation();\n\t}\n\n\t// Extract card data\n\tconst button = ev.currentTarget;\n\tbutton.disabled = true;\n\tconst card = button.closest(\".chat-card\");\n\n\t// Get the Actor from a synthetic Token\n\tconst actor = CONFIG.Item.entityClass._getChatCardActor(card);\n\n\tif ( !actor || !actor.owner) return;\n\n\t// Get the Item\n\tconst item = actor.getOwnedItem(card.dataset.itemId);\n\tif ( !item ) {\n\t\treturn ui.notifications.error(`The requested item ${card.dataset.itemId} no longer exists on Actor ${actor.name}`)\n\t}\n\n\tlet targets = game.user.targets;\n\t// Don't roll for all targets if its an AoE, due to only rolling e.g. dmg once for all targets\n\t// TODO: Maybe add target list or chat cards for making saving throws\n\t// or not, since it would just spam the chatlog.. hmm\n\tconst areaSkill = Object.keys(CONFIG.DND5E.areaTargetTypes).includes(getProperty(item, 'data.data.target.type'));\n\tif (!targets.size || areaSkill)\n\t\ttargets = [{data: {\n\t\t\t\tname: \"someone\",\n\t\t\t\timg: \"\"\n\t\t\t}\n\t\t}];\n\tconst spellLevel = parseInt(card.dataset.spellLevel) || null;\n\n\tconst template = 'modules/mess/templates/attack-card.html';\n\n\tconst attackData = {\n\t\tactor, item,\n\t\ttoHit: await getToHitData({actor, item}),\n\t\tdmgs: await getDmgData({actor, item, spellLevel}),\n\t\tsceneId: canvas.scene.id,\n\t\tuser: game.user.id\n\t}\n\n\tconst autoroll = game.settings.get('mess', `${game.userId}.autoroll-selector`);\n\n\tlet rollMode = game.settings.get(\"core\", \"rollMode\");\n\tfor (const target of targets) {\n\t\tconst allowed = await item._handleResourceConsumption({isCard: false, isAttack: true});\n\t\tconst attackTemplateData = {\n\t\t\t\t\t\t\t\t\t...attackData, \n\t\t\t\t\t\t\t\t\ttarget: target.data,\n\t\t\t\t\t\t\t\t\tflavor: getFlavor(item.data.data.chatFlavor, target),\n\t\t\t\t\t\t\t\t\tallowed\n\t\t\t\t\t\t\t\t};\n\t\tlet html = await renderTemplate(template, attackTemplateData);\n\n\t\t\n\n\t\tif (autoroll.hit || autoroll.dmg) \n\t\t\thtml = await autoRoll(autoroll, html);\n\n\n\t\tlet chatData = {\n user: game.user._id,\n type: CONST.CHAT_MESSAGE_TYPES.OTHER,\n content: html,\n speaker: {\n actor: item.actor._id,\n token: item.actor.token,\n alias: item.actor.name\n\t\t\t}\n\t\t};\n\t\tif ( [\"gmroll\", \"blindroll\"].includes(rollMode) ) chatData[\"whisper\"] = ChatMessage.getWhisperIDs(\"GM\");\n\t\tif ( rollMode === \"blindroll\" ) chatData[\"blind\"] = true;\n\t\n\t\tChatMessage.create(chatData);\n\t}\n\n\tbutton.disabled = false;\n}\n\n/**\n * Autorolls hit or dmg, depending on which flag is set and replaces the template string.\n * @param {Object} autoroll Defining whether to autoroll hit or dmg\n * @param {String} template Defining the html template where the roll should happen.\n */\nasync function autoRoll(autoroll, template) {\n\tlet card = document.createElement('div');\n\tcard.classList.add('message');\n\tcard.insertAdjacentHTML('afterbegin', template);\n\tif (autoroll.hit) {\n\t\tlet toHitBtn = card.querySelector('.mess-button-to-hit');\n\t\tif (toHitBtn)\n\t\t\tawait rollToHit({currentTarget: toHitBtn});\n\t}\n\n\tif (autoroll.dmg) {\n\t\tconst btns = Array.from(card.querySelectorAll('.mess-button-dmg'));\n\t\tfor (const btn of btns)\n\t\t\tawait rollDmg({currentTarget: btn});\n\t}\n\treturn card.innerHTML;\n}\n\n/**\n * Hook onto the Actor Sheet rendering, modifying the listeners for the roll ability and roll skill check events\n * @param {*} app \n * @param {*} html \n * @param {*} data \n */\nasync function actorSheetHook(app, html, data) {\n\t// TODO: Redo this with proper methods... this currently ignores the cool new modifier field\n\t// maybe just ignore replace the abilitysave etc functions\n\tconst abilityMods = html[0].querySelectorAll('.ability-mod, .ability-name');\n\t$(abilityMods).off(); // find smth better here!\n\tabilityMods.forEach(e => e.addEventListener('click', function(ev) {\n\t\tev.stopPropagation();\n\t\tev.preventDefault();\n\n\t\tconst abilityId = ev.currentTarget.closest('.ability').dataset.ability;\n\t\tconst label = CONFIG.DND5E.abilities[abilityId];\n const abl = app.object.data.data.abilities[abilityId];\n const parts = [\"@mod\"];\n const data = {mod: abl.mod};\n const feats = app.object.data.flags.dnd5e || {};\n\n\t\t// Add feat-related proficiency bonuses\n\t\tconst actorData = getProperty(app.object, \"data.data\")\n if ( feats.remarkableAthlete && DND5E.characterFlags.remarkableAthlete.abilities.includes(abilityId) ) {\n parts.push(\"@remarkable-athlete\");\n data[\"remarkable-athlete\"] = Math.ceil(0.5 * actorData.attributes.prof);\n }\n else if ( feats.jackOfAllTrades ) {\n parts.push(\"@jack-of-all-trades\");\n data[\"jack-of-all-trades\"] = Math.floor(0.5 * actorData.attributes.prof);\n }\n\n // Add global actor bonus\n let actorBonus = getProperty(app.object.data.data.bonuses, \"abilities.check\");\n if ( !!actorBonus ) {\n parts.push(\"@checkBonus\");\n data.checkBonus = actorBonus;\n\t\t}\n\t\t\n\t\tdata.parts = parts;\n\n\t\tdata.title = game.i18n.format(\"DND5E.AbilityPromptTitle\", {ability: label});\n\n\t\trollD20.bind(app.object)(data);\n\t\treturn true;\n\t}));\n\tconst saveMods = html[0].querySelectorAll('.ability-save');\n\tsaveMods.forEach(e => e.addEventListener('click', function(ev) {\n\t\tev.stopPropagation();\n\t\tev.preventDefault();\n\t\tconst abilityId = ev.currentTarget.closest('.ability').dataset.ability;\n\t\tconst label = CONFIG.DND5E.abilities[abilityId];\n const abl = app.object.data.data.abilities[abilityId];\n const parts = [\"@mod\"];\n const data = {mod: abl.mod};\n\n // Include proficiency bonus\n if ( abl.prof > 0 ) {\n parts.push(\"@prof\");\n data.prof = abl.prof;\n }\n\n // Include a global actor ability save bonus\n const actorBonus = getProperty(app.object.data.data.bonuses, \"abilities.save\");\n if ( !!actorBonus ) {\n parts.push(\"@saveBonus\");\n data.saveBonus = actorBonus;\n }\n\t\tdata.title = game.i18n.format(\"DND5E.SavePromptTitle\", {ability: label});\n\t\tdata.parts = parts;\n\t\trollD20.bind(app.object)(data);\n\t}));\n\n\tconst skills = html[0].querySelectorAll('.skill-name');\n\t$(skills).off();\n\tskills.forEach(e => e.addEventListener('click', function(ev) {\n\t\tev.stopPropagation();\n\t\tev.preventDefault();\n\t\tconst skillId = ev.currentTarget.closest('.skill').dataset.skill;\n\t\tconst skl = app.object.data.data.skills[skillId];\n\n // Compose roll parts and data\n const parts = [\"@mod\"];\n const data = {mod: skl.mod + skl.prof};\n if ( skl.bonus ) {\n data[\"skillBonus\"] = skl.bonus;\n parts.push(\"@skillBonus\");\n }\n\n // Reliable Talent applies to any skill check we have full or better proficiency in\n\t\tdata.reliableTalent = (skl.value >= 1 && app.object.getFlag(\"dnd5e\", \"reliableTalent\"));\n\t\tdata.parts = parts;\n\t\tdata.title = game.i18n.format(\"DND5E.SkillPromptTitle\", {skill: CONFIG.DND5E.skills[skillId]});\n\n\t\trollD20.bind(app.object)(data);\n\t\treturn false;\n\t}))\n}\n\n/**\n * My own chat listeners\n */\nfunction chatListeners(html) {\n\tif (!html)\n\t\thtml = $(document.getElementById('chat-log'));\n\thtml.on('click', '.card-buttons button', onChatCardAction.bind(this));\n\thtml.on('click', '.item-name', this._onChatCardToggleContent.bind(this));\n\t\n\t// lets just use this for even more listeners\n\thtml.on('mouseenter', '.mess-chat-target', onMouseEnterTarget);\n\thtml.on('mouseleave', '.mess-chat-target', onMouseLeaveTarget);\n\thtml.on('dblclick', '.mess-chat-target', onDblClickTarget);\n\n\thtml.on('click', '.mess-button-to-hit', rollToHit);\n\thtml.on('click', '.mess-button-dmg', rollDmg);\n}\n\n// Only overwrite stuff for attack buttons\nasync function onChatCardAction (ev) {\n\tev.preventDefault(); ev.stopPropagation();\n\tif (ev.currentTarget.dataset.action === 'attack')\n\t\treturn renderAttack(ev);\n\tif (ev.currentTarget.dataset.action === 'damage')\n\t\treturn renderAttack(ev);\n\tif (ev.currentTarget.dataset.placeTemplate)\n\t\treturn renderTemplate(ev);\n\n\treturn this._onChatCardAction(ev);\t\t\n}\n\n/*****************************************************\n * Mouse Listeners for the target img for chat cards *\n *****************************************************/\n\nasync function onMouseEnterTarget(ev) {\n\tev.preventDefault();\n\tev.stopPropagation();\n\tconst token = await getTargetToken(ev);\n\tif (!token) return false;\n\n\ttoken._onHoverIn();\n}\n\nasync function onMouseLeaveTarget(ev) {\n\tev.preventDefault();\n\tev.stopPropagation();\n\tconst token = await getTargetToken(ev);\n\tif (!token || !token.visible) return false;\n\t\n\ttoken._onHoverOut();\n}\n\nasync function onDblClickTarget(ev) {\n\tev.preventDefault();\n\tev.stopPropagation();\n\tconst token = await getTargetToken(ev);\n\tif (!token || !token.visible) return false;\n\t\n\tconst pos = token.center;\n\tcanvas.animatePan({x: pos.x, y: pos.y});\n}\n\nasync function getTargetToken(ev) {\n\tconst card = ev.currentTarget.closest('.mess-attack-card');\n\tconst sceneId = card.dataset.sceneId;\n\tif (sceneId !== canvas.scene.id) return false;\n\tconst tokenId = card.dataset.targetId;\n\tif (!tokenId) return false;\n\n\tconst token = canvas.tokens.placeables.find(e => e.id === tokenId);\n\tif (!token) return false;\n\treturn token;\n}","export class MessSettings extends FormApplication {\n\tstatic init() {\n\t\tconst isDnD = game.system.id === 'dnd5e';\n\t\t\n\t\tgame.settings.register('mess', 'actor-item-sort', {\n\t\t\tname: \"Activate item sort button.\",\n\t\t\thint: \"Adds a button to actor sheets for sorting all items of that category alphabetically.\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: isDnD,\n\t\t\ttype: Boolean\n\t\t})\n\t\n\t\tgame.settings.register('mess', 'better-draggable', {\n\t\t\tname: \"Activate better drag'n'drop workflow.\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,// Change if implemented\n\t\t\tdefault: isDnD,\n\t\t\ttype: Boolean\n\t\t})\n\n\t\tgame.settings.register('mess', 'better-draggable-lists', {\n\t\t\tname: \"Activate better drag'n'drop workflow for lists.\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: true,\n\t\t\ttype: Boolean\n\t\t})\n\t\n\t\tgame.settings.register('mess', 'prepared-spell-tracker', {\n\t\t\tname: \"Activate prepared spell tracker\",\n\t\t\thint: \"Adds a tracker to the spellbook tab, providing a way to track the allowed maximum of prepared spells.\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: isDnD,\n\t\t\ttype: Boolean\n\t\t})\n\t\n\t\tgame.settings.register('mess', 'add-scrolling', {\n\t\t\tname: \"Activating numerical field scrolling.\",\n\t\t\thint: \"Lets you in-/decrease numerical fields in the Actor sheet using the mouse wheel when focused.\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: isDnD,\n\t\t\ttype: Boolean\n\t\t});\n\t\n\t\tgame.settings.register('mess', 'modify-rolling', {\n\t\t\tname: \"Alternative Rolling.\",\n\t\t\thint: \"Changes the way rolling is displayed and executed for DnD5e. Reload for all connected clients is required for this to take effect if changed!\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: isDnD,\n\t\t\ttype: Boolean\n\t\t});\n\t\n\t\tgame.settings.register('mess', 'modify-templates', {\n\t\t\tname: \"Activate modified templates.\",\n\t\t\thint: \"Makes templates texture fill scaling instead of tiling and does allow the usage of videos as texture. Reload for all connected clients is required for this to take effect if changed!\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: true,\n\t\t\ttype: Boolean\n\t\t});\n\t\t\n\t\tgame.settings.register('mess', 'change-placeables', {\n\t\t\tname: \"Activate placeables changes.\",\n\t\t\thint: \"Changes some behaviours of placeables, like preview snapping to grid. Reload for all connected clients is required for this to take effect if changed!\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: true,\n\t\t\ttype: Boolean\n\t\t});\t\n\t\tgame.settings.registerMenu('mess', 'templateTexture', {\n\t\t\tname: game.i18n.localize('MESS.FVTTSettings.description'),\n\t\t\tlabel: game.i18n.localize('MESS.FVTTSettings.button'),\n\t\t\ticon: \"fas fa-mug-hot\",\n\t\t\ttype: MessSettings,\n\t\t\trestricted: true\n\t\t});\n\n\t\tgame.settings.register('mess', 'templateTexture', {\n\t\t\tname: \"Activate placeables changes.\",\n\t\t\thint: \"Changes some behaviours of placeables, like preview snapping to grid. Reload for all connected clients is required for this to take effect if changed!\",\n\t\t\tscope: \"world\",\n\t\t\tdefault: true,\n\t\t\ttype: Object\n\t\t});\t\n\n\t\tgame.settings.register('mess', 'max-critical', {\n\t\t\tname: \"Activate maximum critical rolls.\",\n\t\t\thint: \"Changes behaviour of critical damage rolls to maximize the damage of the extra dice for criticals!\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: false,\n\t\t\ttype: Boolean\n\t\t});\n\n\n\t\tgame.settings.register('mess', 'templateTexture', {\n\t\t\tname: \"Activate placeables changes.\",\n\t\t\thint: \"Changes some behaviours of placeables, like preview snapping to grid. Reload for all connected clients is required for this to take effect if changed!\",\n\t\t\tscope: \"world\",\n\t\t\tconfig: false,\n\t\t\tdefault: true,\n\t\t\ttype: Object\n\t\t});\t\n\n\t\tgame.settings.register('mess', 'templateAutoTargeting', {\n\t\t\tscope: \"world\",\n\t\t\tdefault: true,\n\t\t\ttype: Boolean\n\t\t})\n\n\t\tgame.settings.register('mess', 'templateDrawBordersOnlyOnHighlight', {\n\t\t\tscope: \"world\",\n\t\t\tdefault: true,\n\t\t\ttype: Boolean\n\t\t})\n\n\t\tthis.loadTemplates();\n\t}\n\tstatic loadTemplates() {\n\t\tloadTemplates([\n\t\t\t'modules/mess/templates/settings/templates.html',\n\t\t\t'modules/mess/templates/settings/dnd5e.html',\n\t\t\t'modules/mess/templates/settings/misc.html'\n\t\t]);\n\t}\n\n\tstatic get defaultOptions() {\n\t\treturn {\n\t\t\t...super.defaultOptions,\n\t\t\ttemplate: \"modules/mess/templates/settings/settings.html\",\n\t\t\theight: \"auto\",\n\t\t\ttitle: \"Mess - Moerills enhancing super-suit(e) - Settings Menu\",\n\t\t\twidth: 600,\n\t\t\tclasses: [\"mess\", \"settings\"],\n\t\t\ttabs: [ \n\t\t\t\t{\n\t\t\t\t\tnavSelector: '.tabs',\n\t\t\t\t\tcontentSelector: 'form',\n\t\t\t\t\tinitial: 'name'\n\t\t\t\t} \n\t\t\t],\n\t\t\tsubmitOnClose: true\n\t\t}\n\t}\n\n\tconstructor(object = {}, options) {\n\t\tsuper(object, options);\n\t\tthis.object = game.settings.get('mess', 'templateTexture');\n\t}\n\n\t_getHeaderButtons() {\n\t\tlet btns = super._getHeaderButtons();\n\t\tbtns[0].label = \"Save & Close\";\n\t\treturn btns;\n\t}\n\n\tgetSettingsData() {\n\t\tconst isDnD = game.system.id === 'dnd5e';\n\t\tlet data = {\n\t\t\t'modify-templates': game.settings.get('mess', 'modify-templates'),\n\t\t\t'change-placeables': game.settings.get('mess', 'change-placeables'),\n\t\t\t'templateTexture': game.settings.get('mess', 'templateTexture'),\n\t\t\t'templateAutoTargeting': game.settings.get('mess', 'templateAutoTargeting'),\n\t\t\t'templateDrawBordersOnlyOnHighlight': game.settings.get('mess', 'templateDrawBordersOnlyOnHighlight'),\n\t\t\t'better-draggable-lists': game.settings.get('mess', 'better-draggable-lists')\n\t\t};\n\t\tif (isDnD) {\n\t\t\tdata['templateTexture'] = game.settings.get('mess', 'templateTexture');\n\t\t\tdata['modify-rolling'] = game.settings.get('mess', 'modify-rolling');\n\t\t\tdata['max-critical'] = game.settings.get('mess', 'max-critical');\n\n\t\t\tdata['actor-item-sort'] = game.settings.get('mess', 'actor-item-sort');\n\t\t\t// data['better-draggable'] = game.settings.get('mess', 'better-draggable');\n\t\t\tdata['prepared-spell-tracker'] = game.settings.get('mess', 'prepared-spell-tracker');\n\t\t\tdata['add-scrolling'] = game.settings.get('mess', 'add-scrolling');\n\t\t}\n\t\treturn data;\n\t}\n\n\tgetData() {\n\t\tconst isDnD = game.system.id === 'dnd5e';\n\t\tlet data = super.getData();\n\t\tif (isDnD) {\n\t\t\tdata.dmgTypes = CONFIG.DND5E.damageTypes;\n\t\t\tdata.templateTypes = CONFIG.MeasuredTemplate.types;\n\t\t}\n\t\tdata.isDnD = isDnD;\n\t\tdata.settings = this.getSettingsData();\n\t\treturn data;\n\t}\n\n\tactivateListeners(html) {\n\t\tsuper.activateListeners(html);\n\t}\n\n\t_updateObject(ev, formData) {\n\t\tconst data = expandObject(formData);\n\t\tfor (let [key, value] of Object.entries(data)) {\n\t\t\tgame.settings.set('mess', key, value);\n\t\t}\n\t\tnew Dialog({\n\t\t\tcontent: `${game.i18n.localize(\"MESS.reloadReminder.text\")}
`,\n\t\t\tbuttons: {\n\t\t\t\tyes: {\n\t\t\t\t\ticon: '',\n\t\t\t\t\tlabel: game.i18n.localize(\"MESS.reloadReminder.yes\"),\n\t\t\t\t\tcallback: () => location.reload()\n\t\t\t\t},\n\t\t\t\tno: {\n\t\t\t\t\ticon: '',\n\t\t\t\t\tlabel: game.i18n.localize(\"MESS.reloadReminder.no\")\n\t\t\t\t}\n\t\t\t}\n\t\t}).render(true);\n\t\t// game.settings.set('mess', 'templateTexture', mergeObject({}, formData))\n\t}\n}"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/scripts/actor-item-sort-btn.js","webpack:///./src/scripts/add-scrolling.js","webpack:///./src/scripts/change-placeables.js","webpack:///./src/scripts/chat-popup/index.js","webpack:///./src/scripts/draggable-lists/draggable-list.js","webpack:///./src/scripts/draggable-lists/index.js","webpack:///./src/scripts/index.js","webpack:///./src/scripts/modify-templates.js","webpack:///./src/scripts/prepared-spell-tracker.js","webpack:///./src/scripts/rolls/apply-dmg.js","webpack:///./src/scripts/rolls/controls.js","webpack:///./src/scripts/rolls/dice.js","webpack:///./src/scripts/rolls/index.js","webpack:///./src/scripts/rolls/modify-rolling.js","webpack:///./src/scripts/rolls/util.js","webpack:///./src/scripts/settings.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","async","addAlphabeticalSorter","app","html","actor","_id","querySelectorAll","forEach","el","closest","dataset","tab","btn","innerHTML","classList","add","title","style","flex","margin","addEventListener","ev","lists","actorId","fromUuid","concatList","map","items","spells","flat","sort","a","b","siblings","sortUpdates","SortingHelpers","performIntegerSort","duplicate","sortBefore","updateData","u","update","updateEmbeddedEntity","sortItemListAlphabetically","prepend","itemSortBtn","Hooks","on","addScolling","preventDefault","stopPropagation","deltaY","currentTarget","Number","Math","max","$","change","onDragLeftMove","clones","destination","origin","originalEvent","canvas","_onDragCanvasPan","dx","x","dy","y","snap","previous","momentumThreshold","lambda","prev","prevMomentum","momentum","prevV","v","shiftKey","dest","_original","grid","getSnappedPosition","this","layer","options","gridPrecision","refresh","changePlaceables","PlaceableObject","_onDragLeftMove","initChatPopUp","getElementById","contains","log","DraggableList","container","selector","mergeObject","defaultOptions","_init","offset","time","dir","onDragStart","onDragEnd","onDrop","_items","Array","from","rect","getBoundingClientRect","insideChild","clientY","height","clientX","width","_resetOffsets","idx","_initItem","position","_onDragEnterItem","_onDragLeaveItem","matches","headerRect","top","bottom","TweenLite","to","paddingTop","_over","item","timeEnd","initDraggableLists","oldFun","SidebarDirectory","activateListeners","list","querySelector","SceneDirectory","_onLazyLoadImage","entries","observer","isIntersecting","li","backgroundImage","children","img","unobserve","game","settings","CONFIG","debug","mess","sheet","render","user","isGM","moduleVersion","version","register","default","String","scope","oldVersion","isNewerVersion","init","changeTemplates","newFun","MeasuredTemplate","toString","replace","Function","getTargets","isTokenInside","ret","dndTemplateSettings","system","id","importedJS","import","AbilityTemplate","itemHook","_originalFromItem","fromItem","template","path","getFlag","hasDamage","damage","parts","loadTexture","then","tex","texture","activatePreviewListeners","token","scene","templatePos","startX","startY","currGrid","shape","tokens","getEmbeddedCollection","targets","updateTokenTargets","div","innerText","i18n","localize","formField","inp","dtype","insertAdjacentHTML","button","_activateFilePicker","after","addPreparedSpellTracker","isNPC","tracker","border","preparedSpells","sep","val","isNaN","setFlag","constructor","alignSelf","parentNode","insertBefore","getAllDmg","reduce","getAllVersatile","resultArray","splice","modifyApplyDmg","canApply","canApplyNonVersatile","canApplyVersatile","hasTarget","targetId","hasNoTarget","contextOptionsDmg","condition","icon","callback","applyDamage","content","floor","contextOptionsRoll","ContextMenu","MessContextMenu","find","setProperty","controlled","args","super","_menuItems","menuItems","filteredItems","filter","ol","frag","createDocumentFragment","join","close","_setPosition","_animateOpen","removeClass","sign","amount","card","sceneId","scenes","ui","notifications","Token","getEmbeddedEntity","owner","chatLogHook","advSelector","userId","templateData","advantage","normal","disadvantage","renderTemplate","arr","currIdx","findIndex","remove","newSelected","set","toggle","controls","childNodes","hit","dmg","getD20Modifier","getAdvantageSettings","rollD20","adv","nd","mods","halflingLucky","elvenAccuracy","diceFormula","reliableTalent","unshift","d20Mod","Roll","roll","d20","total","tooltip","getTooltip","crit","fumble","chatData","CONST","CHAT_MESSAGE_TYPES","OTHER","speaker","alias","rollMode","includes","ChatMessage","getWhisperIDs","getToHitData","hasAttack","actorData","itemData","flags","dnd5e","rollData","getRollData","proficient","weaponCriticalThreshold","critical","parseInt","abilityMod","actorBonus","bonuses","actionType","attackBonus","attack","filterJoin","totalModifier","_safeEval","formula","_formula","situationalModifier","terms","rollToHit","disabled","messageId","messages","isAuthor","Item","entityClass","_getChatCardActor","getOwnedItem","itemId","span","customTooltip","split","dataTerms","term","num","rgx","RegExp","Die","die","match","replaceChild","getDmgData","spellLevel","level","versatile","itm","bnsDmgParts","itmData","lbl","DND5E","damageTypes","scaling","newDmgPart","lvl","details","_scaleCantripDamage","_scaleSpellDamage","part","_evalParentheticalTerms","rollDmg","contextMenu","nextElementSibling","rolling","toggleItemBonusDamage","itemName","getSpeaker","actors","warn","newState","preCreateChatMessageHook","renderAttack","getFlavor","chatFlavor","rollTables","matchAll","collection","tables","tableData","table","entities","result","results","text","areaSkill","keys","areaTargetTypes","getProperty","size","attackData","toHit","dmgs","autoroll","allowed","_handleResourceConsumption","isCard","isAttack","targetActor","targetData","ac","label","attributes","traits","di","toUpperCase","substring","custom","dr","dv","attackTemplateData","flavor","autoRoll","whisper","getWhisperRecipients","toHitBtn","btns","actorSheetHook","abilityMods","off","abilityId","ability","abilities","mod","feats","remarkableAthlete","characterFlags","ceil","prof","jackOfAllTrades","checkBonus","format","saveMods","abl","saveBonus","skills","skillId","skill","skl","bonus","chatListeners","onChatCardAction","_onChatCardToggleContent","onMouseEnterTarget","onMouseLeaveTarget","onDblClickTarget","onToggleShowPlayers","action","placeTemplate","_onChatCardAction","getTargetToken","_onHoverIn","visible","_onHoverOut","pos","center","animatePan","tokenId","placeables","checked","oldGetTooltip","MessSettings","FormApplication","isDnD","hint","config","Boolean","registerMenu","restricted","loadTemplates","classes","tabs","navSelector","contentSelector","initial","submitOnClose","_getHeaderButtons","getData","dmgTypes","templateTypes","types","getSettingsData","formData","expandObject","Dialog","buttons","yes","location","reload","no"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,GAOF,IAAIW,EAAmB,GAKnBL,EAAkB,CACrB,MAAS,GAWV,SAASM,EAAoBjB,GAG5B,GAAGgB,EAAiBhB,GACnB,OAAOgB,EAAiBhB,GAAUkB,QAGnC,IAAIC,EAASH,EAAiBhB,GAAY,CACzCI,EAAGJ,EACHoB,GAAG,EACHF,QAAS,IAUV,OANAL,EAAQb,GAAUU,KAAKS,EAAOD,QAASC,EAAQA,EAAOD,QAASD,GAG/DE,EAAOC,GAAI,EAGJD,EAAOD,QAKfD,EAAoBI,EAAI,SAAuBpB,GAC9C,IAAIqB,EAAW,GAKXC,EAAqBZ,EAAgBV,GACzC,GAA0B,IAAvBsB,EAGF,GAAGA,EACFD,EAASV,KAAKW,EAAmB,QAC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B,iBAAiBwV,OAE9C1lB,EAAKykB,MAAQA,EACbzkB,EAAK+O,SAAWnE,KAAK+a,kBACd3lB,EAGR,kBAAkB4F,GACjB8P,MAAMzH,kBAAkBrI,GAGzB,cAAckB,EAAI8e,GACjB,MAAM5lB,EAAO6lB,aAAaD,GAC1B,IAAK,IAAKhhB,EAAKN,KAAU9D,OAAO8N,QAAQtO,GACvC8O,KAAKC,SAAS+I,IAAI,OAAQlT,EAAKN,GAEhC,IAAIwhB,OAAO,CACV7Q,QAAS,MAAMnG,KAAK4D,KAAKC,SAAS,kCAClCoT,QAAS,CACRC,IAAK,CACJlR,KAAM,+BACN6L,MAAO7R,KAAK4D,KAAKC,SAAS,2BAC1BoC,SAAU,IAAMkR,SAASC,UAE1BC,GAAI,CACHrR,KAAM,+BACN6L,MAAO7R,KAAK4D,KAAKC,SAAS,8BAG1BvD,QAAO","file":"index.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"bundles/\" + ({\"welcome-screen\":\"welcome-screen\"}[chunkId]||chunkId) + \".\" + {\"welcome-screen\":\"89ea\"}[chunkId] + \".js\"\n \t}\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 \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\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/mess/scripts/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/scripts/index.js\");\n","async function sortItemListAlphabetically(lists, actorId) {\n\tconst actor = await fromUuid(`Actor.${actorId}`);\n\tlet concatList = lists.map(e => e.items || e.spells).flat();\n\tconcatList.sort(function (a, b) {\n\t\tif (a.name < b.name) return -1;\n\t\tif (a.name > b.name) return 1;\n\t\treturn 0;\n\t});\n\tlet siblings = [concatList.shift()];\n\tlet sortUpdates = [];\n\tfor (; concatList.length > 0; siblings.push(concatList.shift())) {\n\t\tsortUpdates = (SortingHelpers.performIntegerSort(concatList[0], {\n\t\t\ttarget: siblings[siblings.length-1], \n\t\t\tsiblings: duplicate(siblings),\n\t\t\tsortBefore: false}));\t\t\n\t}\n\tconst updateData = sortUpdates.map(u => {\n\t\tlet update = u.update;\n\t\tupdate._id = u.target._id;\n\t\treturn update;\n\t})\n\tactor.updateEmbeddedEntity('OwnedItem', updateData);\n}\n\nasync function addAlphabeticalSorter(app, html, data) {\n\tif (!data.actor._id) return;\n\tconst header = html.querySelectorAll('.filter-list');\n\n\theader.forEach(el => {\n\t\tconst type = el.closest('.tab').dataset.tab;\n\t\tconst btn = document.createElement('a');\n\t\tbtn.innerHTML = '';\n\t\tbtn.classList.add('mess-sort-btn');\n\t\tbtn.title = `Sort ${type} alphabetically.`;\n\t\tbtn.style.flex = 0;\n\t\tbtn.style.margin = \"0 5px 0 0\";\n\t\tbtn.addEventListener('click',\t(ev) => sortItemListAlphabetically(data[type], data.actor._id))\n\t\tel.prepend(btn);\n\t});\n}\n\nexport default async function itemSortBtn() {\n\tHooks.on('renderActorSheet', (app, html, data) => {\n\t\taddAlphabeticalSorter(app, html[0], data);\n\t});\n}","export default async function addScolling() {\n\tHooks.on('renderActorSheet', async function (app, html, data) {\n\t\thtml[0].querySelectorAll('input[data-dtype=\"Number\"], .item-uses input').forEach(el => {\n\t\t\tel.addEventListener('wheel', ev => {\n\t\t\t\tev.preventDefault();\n\t\t\t\tev.stopPropagation();\n\t\t\t\tif (ev.deltaY < 0)\n\t\t\t\t\tev.currentTarget.value = Number(ev.currentTarget.value) + 1;\n\t\t\t\tif (ev.deltaY > 0)\n\t\t\t\t\tev.currentTarget.value = Math.max(Number(ev.currentTarget.value) - 1, 0);\n\n\t\t\t\t$(ev.currentTarget).change()\n\t\t\t});\n\t\t})\n\t});\n}","function onDragLeftMove(event) {\n\tconst {clones, destination, origin, originalEvent} = event.data;\n\n\t// Pan the canvas if the drag event approaches the edge\n\tcanvas._onDragCanvasPan(originalEvent);\n\n\t// Determine dragged distance\n\tconst dx = destination.x - origin.x;\n\tconst dy = destination.y - origin.y;\n\n\tlet snap = false;\n\tif (event.data.previous) {\n\t\t// Interesting would be here how this all behaves for different monitor sizes/performances and when Atro possibly introduces more adaptive rates for mosue movement. \n\t\t// Why? Because currently i just set the timedifferences between function calls to 1. So for 60Hz it behaves same as 30Hz although for 30Hz the distance travelled could be bigger.\n\t\t// All this because i don't want divisions in here for the moment....\n\t\tconst momentumThreshold = 30;\n\t\t// smaller lambda means less \"memory\" => current momentum does have more impact\n\t\t// => more jumping around between snapping and not\n\t\t// but higher means more waiting/slow movement time for it to snap\n\t\tconst lambda = 0.8;\n\t\tconst prev = event.data.previous;\n\t\tconst prevMomentum = event.data.momentum || 0;\n\t\tconst prevV = event.data.v || {x: 0, y: 0};\n\t\tconst v = {\n\t\t\tx: destination.x - prev.x,\n\t\t\ty: destination.y - prev.y\n\t\t}\n\t\tconst momentum = {\n\t\t\tx: v.x - prevV.x,\n\t\t\ty: v.y - prevV.y\n\t\t};\n\n\t\tevent.data.momentum = (momentum.x * momentum.x + momentum.y * momentum.y) + prevMomentum * lambda;\n\t\tsnap = !event.shiftKey && event.data.momentum < momentumThreshold;\n\t}\n\n\tevent.data.previous = destination;\n\n\t// Update the position of each clone\n\tfor ( let c of clones || [] ) {\n\t\tlet dest = {x: c._original.data.x + dx, y: c._original.data.y + dy};\n\t\tif ( snap ) {\n\t\t\tdest = canvas.grid.getSnappedPosition(dest.x, dest.y, this.layer.options.gridPrecision);\n\t\t}\n\t\tc.data.x = dest.x;\n\t\tc.data.y = dest.y;\n\t\tc.refresh();\n\t}\n}\n\nexport function changePlaceables() {\n\tPlaceableObject.prototype._onDragLeftMove = onDragLeftMove;\n\t// Change got bigger than expected, so.. complete swap it is\n}","export function initChatPopUp() {\n\tHooks.on('renderChatMessage', (app, html, options) => {\n\t\tif (document.getElementById('chat').classList.contains('active')) return;\n\n\n\t\tconsole.log('rendering chat message');\n\t\tconsole.log(app, html, options);\n\t\tconsole.log(document.getElementById('chat').classList.contains('active'))\n\t});\n\n\tconst hud = document.getElementById('hud');\n\n\tlet popupDiv = hud.appendChild(document.createElement('div'));\n\tpopupDiv.classList.add('mess-chat-popup')\n}","export class DraggableList {\n\tconstructor(container, selector, options = {}) {\n\t\tthis.container = container;\n\t\tthis.selector = selector;\n\t\tthis.options = mergeObject(this.defaultOptions, options);\n\n\t\tthis._init();\n\t}\n\t\n\tget defaultOptions() {\n\t\treturn {\n\t\t\toffset: 21, // in px\n\t\t\ttime: 0.2, // in seconds\n\t\t\tdir: null, // this selector will not get offset when hovered over\n\t\t\t// folowing are not used\n\t\t\tonDragStart: null,\n\t\t\tonDragEnd: null,\n\t\t\tonDrop: null,\n\t\t\t\n\t\t}\n\t}\n\n\tasync _init() {\n\t\t// this._items = Array.from(this.container.childNodes).filter(e => e.matches && e.matches(this.selector));\n\t\tthis._items = Array.from(this.container.querySelectorAll(this.selector));\n\t\tthis.container.addEventListener('dragleave', ev => {\n\t\t\tconst rect = this.container.getBoundingClientRect();\n\t\t\tconst boundary = 5;\n\t\t\t// Reset offsets, when first target was inside a child container.\n\t\t\tconst insideChild = ev.insideChild;\n\t\t\tif (!insideChild \n\t\t\t\t\t&& ev.clientY < rect.y + rect.height - boundary\n\t\t\t\t\t&& ev.clientY > rect.y + boundary\n\t\t\t\t\t&& ev.clientX > rect.x + boundary \n\t\t\t\t\t&& ev.clientX < rect.x - boundary + rect.width) {\n\t\t\t\t\t\tev.insideChild = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\tthis._resetOffsets();\n\t\t});\n\n /** Possibly modifying the drop target.\n\t * Why?\n\t * Due to the method used, the target gets moved out of the way and it will automatically drop onto the container element.\n\t * Most drop functions in fvtt just append to the end though, when dropping onto the container.\n\t * => We search for the first offset element and define that one as target. Since default for sorting is \"insertBefore\", and most implementations i've found build upon FVTT default/dnd5e systems default, this is a rather save implementation to find the real target.\n\t */\n\t\tthis.container.addEventListener('drop', ev => {\n\t\t\t// const insideChild = ev.insideChild;\n\t\t\t// if (this._over) {\n\t\t\t// \tObject.defineProperty(ev, 'target', {writable: false, value: this._over})\n\t\t\t// \t// Make sure that outer directories are not overwriting this stuff!\n\t\t\t// \t// ev.insideChild = true;\n\t\t\t// }\n\t\t});\n\t\tthis._items.forEach((e, idx) => this._initItem(e, idx))\n\t}\n\n\tasync _initItem(el, idx) {\n\t\tel.style.position = \"relative\";\n\t\tel.addEventListener('dragenter', ev => this._onDragEnterItem(ev, idx));\n\t\tel.addEventListener('dragleave', ev => this._onDragLeaveItem(ev, idx));\n\t\tel.addEventListener('dragend', ev => {\n\t\t\t// safety net if for some reasons the rerender is to slow or fails...\n\t\t\t// const srcElement = ev.currentTarget;\n\t\t\t// srcElement.style.opacity = null;\n\t\t\t// srcElement.style.height = null;\n\t\t\t// TweenLite.from(srcElement, this.options.time, {opacity:0, height:0});\n\t\t\tthis._resetOffsets();\n\t\t});\n\t\t// el.addEventListener('dragstart', ev => {\n\t\t// \tthis._dragged = ev.currentTarget;\n\t\t// \t// if (ev.currentTarget.matches(this.dir))\n\t\t// \t// \tthis._draggingDir = true;\n\t\t// \t// else \n\t\t// \t// \tthis._draggingDir = false;\n\t\t// \t// TweenLite.to(ev.currentTarget, this.options.time, {opacity: 0, height: 0});\n\t\t// })\n\t}\n\n\t_onDragEnterItem(ev, idx) {\n\t\tconsole.time('dragEnter')\n\t\tev.stopPropagation();\n\n\t\t// // save the current target\n\t\tconst time = this.options.time;\n\t\tconst offset = this.options.offset;\n\t\tthis._resetOffsets();\n\t\tlet target = ev.currentTarget;\n\t\tconsole.log(ev.currentTarget)\n\t\t// if inside a container, just make sure that its not jumping around. (Sometimes its ignoring the real target...)\n\t\tif (target.matches(this.options.dir)) {\n\t\t\tconst items = Array.from(target.querySelectorAll(this.selector));\n\t\t\tconst headerRect = target.getBoundingClientRect();\n\t\t\tif (ev.clientY > headerRect.top && ev.clientY < headerRect.bottom) {\n\t\t\t\tTweenLite.to(items, time, {paddingTop: 0});\n\t\t\t\tthis._over = target;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (let item of items) {\n\t\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\t\tif (rect.bottom > ev.clientY) {\n\t\t\t\t\ttarget = item;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._over = target;\n\t\tconsole.log(target, offset);\n\t\tTweenLite.to(target, time, {paddingTop: offset});\n\t\t// let resetList = [];\n\t\t// let offsetList = [];\n\t\t// let prev = item.previousElementSibling;\n\t\t// while (prev) {\n\t\t// \t// TweenLite.to(prev, time, {top: 0})\n\t\t// \tresetList.push(prev);\n\t\t// \tprev = prev.previousElementSibling;\n\t\t// }\n\t\t// let next = item;\n\t\t// while (next) {\n\t\t// \tif (!this._draggingDir && next.matches(this.options.dir)) {\n\t\t// \t\t// TweenLite.to(next, time, {top: 0});\n\t\t// \t\tresetList.push(next);\n\t\t// \t} else\n\t\t// \t\toffsetList.push(next);\n\t\t// \t\t// TweenLite.to(next, time, {top: offset});\n\t\t// \tnext = next.nextElementSibling;\n\t\t// }\n\n\t\t// // // if (ev.currentTarget.matches(this.options.dir)) {\n\t\t\t\n\t\t// // // \tidx = idx + 1;\n\t\t// // // }\n\t\t// // // for (let i = idx; i < this._items.length; i++) {\n\t\t// // // \tconst rect = this._items[i].getBoundingClientRect();\n\t\t// // // }\n\t\t// // const resetList = this._items.slice(0, idx);\n\t\t// TweenLite.to(resetList, time, {top: 0});\n\t\t// // const offsetList = this._items.slice(idx);\n\t\t// TweenLite.to(offsetList, time, {top: offset});\n\n\t\tconsole.timeEnd('dragEnter')\n\t\treturn false;\n\t}\n\n\n\t_onDragLeaveItem(ev, idx) {\n\t\t// console.time('dragLeave')\n\t\tev.stopPropagation();\n\t\treturn false;\n\t\t// // Empty for now?\n\n\t\t// TweenLite.to(ev.currentTarget, 0.3, {transform: \"scale(1, 1)\"});\n\t\t// console.timeEnd('dragLeave')\n\t}\n\n\t// We now work with padding, cause.. reasons..\n\t_resetOffsets(time = this.options.time) {\n\t\t// TweenLite.to(this._items, time, {top: 0});\n\t\tTweenLite.to(this._items, time, {paddingTop: 0});\n\t}\n}\n","import {DraggableList} from './draggable-list';\n\nexport function initDraggableLists() {\n // make sure my listeners to get bound _before_ the class owns get bound to the elements\n // Only needed for the \"root\" directory though.. :/\n const oldFun = SidebarDirectory.prototype.activateListeners;\n SidebarDirectory.prototype.activateListeners = function(html) {\n // const list = html[0].querySelectorAll('.directory-list, .directory-item');\n // list.forEach(e => new DraggableList(e, '.entity'));\n const list = html[0].querySelector('.directory-list');\n new DraggableList(list, '.entity, .folder', {dir: '.folder'});\n oldFun.call(this, html);\n }\n\n // this does work, since on default most sheets have their drop function bound to the form, not the item list!\n Hooks.on('renderActorSheet', (app, html, options) => {\n const list = html[0].querySelectorAll('.item-list');\n list.forEach(e => new DraggableList(e, '.item'));\n });\n\n SceneDirectory.prototype._onLazyLoadImage = function(entries, observer) {\n for ( let e of entries ) {\n if ( !e.isIntersecting ) continue;\n const li = e.target;\n\n // Background Image\n if ( li.dataset.backgroundImage ) {\n li.children[0].style[\"background-image\"] = `url(\"${li.dataset.backgroundImage}\")`;\n delete li.dataset.backgroundImage;\n }\n\n // Avatar image\n const img = li.querySelector(\"img\");\n if ( img && img.dataset.src ) {\n img.src = img.dataset.src;\n delete img.dataset.src;\n }\n\n // No longer observe the target\n observer.unobserve(e.target);\n }\n }\n}","import { rolling } from './rolls';\nimport { MessSettings } from './settings.js';\nimport {dndTemplateSettings, changeTemplates } from './modify-templates.js';\nimport { changePlaceables } from './change-placeables.js';\nimport itemSortBtn from './actor-item-sort-btn.js';\nimport preparedSpellTracker from './prepared-spell-tracker.js';\nimport addScrolling from './add-scrolling.js';\n\nimport {initDraggableLists} from './draggable-lists';\nimport {initChatPopUp} from './chat-popup';\n\nHooks.on('ready', async function() {\n\tif (game.settings.get('mess', 'actor-item-sort'))\n\t\titemSortBtn();\n\tif (game.settings.get('mess', 'prepared-spell-tracker'))\n\t\tpreparedSpellTracker();\n\tif (game.settings.get('mess', 'add-scrolling'))\n\t\taddScrolling();\n\t\n\tif (CONFIG.debug.mess) {\n\t\tconst actor = (await fromUuid('Actor.xV3LUAg05Pz5MFTS'));\n\t\tactor.sheet.render(true);\n\t}\n\n\t// initChatPopUp();\n\n\tif (!game.user.isGM)\n\treturn;\n\t// Edit next line to match module.\n\tconst module = game.modules.get(\"mess\");\n\tconst title = module.data.title;\n\tconst moduleVersion = module.data.version;\n\tgame.settings.register(title, 'version', {\n\t\tname: `${title} Version`,\n\t\tdefault: \"0.0.0\",\n\t\ttype: String,\n\t\tscope: 'world',\n\t});\n\tconst oldVersion = game.settings.get(title, \"version\");\n\n\tif (!isNewerVersion(moduleVersion, oldVersion))\n\t\treturn;\n\n\t(await import(\n\t\t\t\t\t\t\t\t/* webpackChunkName: \"welcome-screen\" */\n\t\t\t\t\t\t\t\t'./welcome-screen.js'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t).default();\n});\n\nHooks.on('init', function() {\n\tgame.mess = {};\n\tCONFIG.debug.mess = false;\n\tMessSettings.init();\n\n\trolling();\n\n\tdndTemplateSettings();\n\tchangeTemplates();\n\tif (game.settings.get('mess', 'change-placeables'))\n\t\tchangePlaceables();\n\tif (game.settings.get('mess', 'better-draggable-lists'))\n\t\tinitDraggableLists();\n});\n","export function changeTemplates() {\n\n // #MonkeyPatchingFTW\n // better than stealing the code, replacing one line and then release it under a/the wrong license..\n // Disadvantage: could need more fixing on updates. At least i didn#t make it line based like Kakaroto.. :P\n \n\tlet newFun = MeasuredTemplate.prototype.refresh.toString();\n\n\tif (game.settings.get('mess', 'modify-templates')) {\n\t\tnewFun = newFun.replace(/this\\.template\\.beginTextureFill\\(\\{[\\s\\S]*\\}\\)\\;/, `\n\t\t\t{\n\t\t\t\tlet mat = PIXI.Matrix.IDENTITY;\n\t\t\t\t// rectangle\n\t\t\t\tif (this.shape.width && this.shape.height)\n\t\t\t\t\tmat.scale(this.shape.width / this.texture.width, this.shape.height / this.texture.height);\n\t\t\t\telse if (this.shape.radius) {\n\t\t\t\t\tmat.scale(this.shape.radius * 2 / this.texture.height, this.shape.radius * 2 / this.texture.width)\n\t\t\t\t\t// Circle center is texture start...\n\t\t\t\t\tmat.translate(-this.shape.radius, -this.shape.radius);\n\t\t\t\t} else if (this.data.t === \"ray\") {\n\t\t\t\t\tconst d = canvas.dimensions,\n\t\t\t\t\t\t\t\theight = this.data.width * d.size / d.distance,\n\t\t\t\t\t\t\t\twidth = this.data.distance * d.size / d.distance;\n\t\t\t\t\tmat.scale(width / this.texture.width, height / this.texture.height);\n\t\t\t\t\tmat.translate(0, -height * 0.5);\n\n\t\t\t\t\tmat.rotate(toRadians(this.data.direction));\n\t\t\t\t} else {// cone\n\t\t\t\t\tconst d = canvas.dimensions;\n\t\t\t\n\t\t\t\t\t// Extract and prepare data\n\t\t\t\t\tlet {direction, distance, angle} = this.data;\n\t\t\t\t\tdistance *= (d.size / d.distance);\n\t\t\t\t\tdirection = toRadians(direction);\n\t\t\t\t\tconst width = this.data.distance * d.size / d.distance;\n\n\t\t\t\t\tconst angles = [(angle/-2), (angle/2)];\n\t\t\t\t\tdistance = distance / Math.cos(toRadians(angle/2));\n\t\t\t\n\t\t\t\t\t// Get the cone shape as a polygon\n\t\t\t\t\tconst rays = angles.map(a => Ray.fromAngle(0, 0, direction + toRadians(a), distance+1));\n\t\t\t\t\tconst height = Math.sqrt((rays[0].B.x - rays[1].B.x) * (rays[0].B.x - rays[1].B.x)\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ (rays[0].B.y - rays[1].B.y) * (rays[0].B.y - rays[1].B.y));\n\t\t\t\t\tmat.scale(width / this.texture.width, height / this.texture.height);\n\t\t\t\t\tmat.translate(0, -height/2)\n\t\t\t\t\tmat.rotate(toRadians(this.data.direction));\n\t\t\t\t}\n\t\t\t\tthis.template.beginTextureFill({\n\t\t\t\t\ttexture: this.texture,\n\t\t\t\t\tmatrix: mat,\n\t\t\t\t\talpha: 0.8\n\t\t\t\t});\n\t\t\t\t// move into draw or so\n\t\t\t\tconst source = getProperty(this.texture, \"baseTexture.resource.source\")\n\t\t\t\tif ( source && (source.tagName === \"VIDEO\") ) {\n\t\t\t\t\tsource.loop = true;\n\t\t\t\t\tsource.muted = true;\n\t\t\t\t\tgame.video.play(source);\n\t\t\t\t}\n\t\t}`);\n\n\t\tHooks.on('renderMeasuredTemplateConfig', (app, html, data) => {\n\t\t\thtml[0].querySelector('.file-picker').dataset.type = 'imagevideo'\n\t\t});\n\t}\n\t\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\tnewFun = newFun.replace(/this\\.\\_borderThickness/, \"this.texture && !this._hover ? 0 : this._borderThickness\");\n\t\tnewFun = newFun.replace(/return\\sthis\\;/, `\n\t\t\tconst grid = canvas.grid;\n\t\t\t// only show grid highlights on hover\n\t\t\tif (this.texture) {\n\t\t\t\tconst hl = grid.getHighlightLayer(\\`Template.\\$\\{this.id\\}\\`);\n\t\t\t\tif (hl)\n\t\t\t\t\thl.renderable = this._hover;\n\t\t\t}\n\t\t\treturn this;`);\n\t}\n\n\tMeasuredTemplate.prototype.refresh = Function(`\"use strict\"; return ( function ${newFun} )`)();\n\n\t\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\tMeasuredTemplate.prototype.getTargets = getTargets;\n\t\tMeasuredTemplate.prototype.isTokenInside = isTokenInside;\n\n\t\tconst oldFun = MeasuredTemplate.prototype._onDragLeftMove;\n\t\tMeasuredTemplate.prototype._onDragLeftMove = function(ev) {\n\t\t\tconst ret = oldFun.bind(this)(ev);\n\n\t\t\tfor (let c of ev.data.clones)\n\t\t\t\tthis.getTargets(c);\n\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n\nexport async function dndTemplateSettings() {\n if (game.system.id !== 'dnd5e') return;\n\n\tconst importedJS = (await import(/* webpackIgnore: true */ '/systems/dnd5e/module/pixi/ability-template.js'))\n\tconst AbilityTemplate = importedJS.default || importedJS.AbilityTemplate;\n\n\t// Auto texture creation from item\n\tif (game.settings.get('mess', 'modify-templates')) {\n\t\tHooks.on('renderItemSheet', itemHook);\n\t\t\n\t\t\n\t\tconst _originalFromItem = AbilityTemplate.fromItem;\n\t\tAbilityTemplate.fromItem = function(item) {\n\t\t\tconst template = _originalFromItem.bind(this)(item);\n\t\t\t\n\t\t\t// generate a texture based on the items dmg type, ...\n\t\t\t// Add settings to define custom templates for stuff.\n\t\t\tlet path = item.getFlag('mess', 'templateTexture');\n\t\t\tif (!path && item.hasDamage) {\n\t\t\t\tconst settings = game.settings.get('mess', 'templateTexture') || {};\n\t\t\t\tpath = settings[item.data.data.damage.parts[0][1]] || {};\n\t\t\t\tpath = path[template.data.t];\n\t\t\t}\n\t\t\tif (path)\n\t\t\t\tloadTexture(path).then(tex => {\n\t\t\t\t\ttemplate.texture = tex;\n\t\t\t\t\ttemplate.data.texture = path;\n\t\t\t\t\ttemplate.refresh();\n\t\t\t\t})\n\t\t\ttemplate.item = item;\n\t\t\treturn template;\n\t\t}\n\t}\n\n\n\tif (game.settings.get('mess', 'templateAutoTargeting')) {\n\t\t// rather ugly, maybe find a better way at some point :shrug:\n\t\tconst origPrevListeners = AbilityTemplate.prototype.activatePreviewListeners.toString();\n\t\tconst newFun = origPrevListeners.replace(/this\\.refresh\\(\\)\\;/, \n\t\t\t\t\t// get targets\n\t\t\t\t\t\t`this.refresh();\n\t\t\t\t\t\tthis.getTargets(this);\n\t\t\t\t\t`);\n\n\t\tAbilityTemplate.prototype.getTargets = getTargets;\n\t\tAbilityTemplate.prototype.isTokenInside = isTokenInside;\n\n\t\tAbilityTemplate.prototype.activatePreviewListeners = Function(`\"use strict\"; return ( function ${newFun} )`)();\n\t}\n}\n\n\nfunction isTokenInside(token) {\n\tconst grid = canvas.scene.data.grid,\n\t\t\t\ttemplatePos = {x: this.data.x, y: this.data.y};\n\t// Check for center of each square the token uses.\n\t// e.g. for large tokens all 4 squares\n\tconst startX = token.width >= 1 ? 0.5 : token.width / 2;\n\tconst startY = token.height >= 1 ? 0.5 : token.height / 2;\n\tfor (let x = startX; x < token.width; x++) {\n\t\tfor (let y = startY; y < token.height; y++) {\n\t\t\tconst currGrid = {\n\t\t\t\tx: token.x + x * grid - templatePos.x,\n\t\t\t\ty: token.y + y * grid - templatePos.y\n\t\t\t};\n\t\t\tconst contains = this.shape.contains(currGrid.x, currGrid.y);\n\t\t\tif (contains) return true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction getTargets(template) {\n\tconst tokens = canvas.scene.getEmbeddedCollection('Token');\n\tlet targets = [];\n\t\n\tfor (const token of tokens)\n\t\tif (template.isTokenInside(token)) { targets.push(token._id); }\n\tgame.user.updateTokenTargets(targets);\n}\n\nasync function itemHook(app, html) {\n\tconst div = document.createElement('div');\n\tdiv.classList.add('form-group');\n\tdiv.appendChild(document.createElement('label')).innerText = game.i18n.localize('MESS.itemSheet.templateTexture');\n\tconst formField = div.appendChild(document.createElement('div'));\n\tformField.classList.add('form-fields');\n\tconst inp = formField.appendChild(document.createElement('input'));\n\tinp.dataset.dtype = 'String';\n\tinp.type = 'text';\n\tinp.name = 'flags.mess.templateTexture';\n\tinp.value = app.object.getFlag('mess', 'templateTexture') || \"\";\n\n\tformField.insertAdjacentHTML('beforeend', `\n\t\t\n\t`);\n\tconst button = formField.querySelector('button');\n\tbutton.style.flex = '0';\n app._activateFilePicker(button);\n\tconst target = html[0].querySelector('[name=\"data.target.units\"]');\n if (target)\n\t\ttarget.closest('.form-group').after(div);\n}","export default async function addPreparedSpellTracker() {\n\tHooks.on('renderActorSheet', async function (app, html, data) {\n\t\tconst actor = await fromUuid(`Actor.${data.actor._id}`);\n\t\tif (actor.isNPC) return;\n\t\t\n\t\tconst spellDc = html[0].querySelector('.spell-dc');\n\t\tif (!spellDc) return;\n\t\tlet tracker = document.createElement('div');\n\t\ttracker.classList.add('spell-detail');\n\t\ttracker.classList.add('spell-slots');\n\t\ttracker.style.flex = '1';\n\t\ttracker.style.border = 'none';\n\t\tconst spanPrep = tracker.appendChild(document.createElement('span'));\n\t\tspanPrep.innerText = `${game.i18n.localize('MESS.actorSheet.preparedSpellTracker')}: ${data.preparedSpells}`;\n\n\t\tconst sep = tracker.appendChild(document.createElement('span'));\n\t\tsep.innerText = ' / ';\n\t\tsep.classList.add('sep');\n\n\t\tconst max = tracker.appendChild(document.createElement('input'));\n\t\tmax.type = 'text';\n\t\tmax.value = actor.getFlag('mess', 'maxPreparedSpells') || 0;\n\t\tmax.addEventListener('change', async function(ev) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropagation();\n\t\t\tconst val = Number(ev.currentTarget.value);\n\t\t\tif (isNaN(val)) {\n\t\t\t\tev.currentTarget.value = actor.getFlag('mess', 'maxPreparedSpells') || 0;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tactor.setFlag('mess', 'maxPreparedSpells', val);\n\t\t\treturn false;\n\t\t});\n\t\t\n\t\tif (app.constructor.name === 'Tidy5eSheet') {\n\t\t\tconst el = html[0].querySelector('.spellcasting-ability');\n\t\t\tif (!el)\n\t\t\t\treturn;\n\t\t\tel.appendChild(tracker, el);\n\t\t} else {\n\t\t\tconst el = html[0].querySelector('.spellbook .inventory-list');\n\t\t\tif (!el)\treturn;\n\t\t\ttracker.style.flex = '0';\n\t\t\ttracker.style.alignSelf = 'flex-start';\n\t\t\ttracker.style.margin = '0 8px';\n\t\t\tel.parentNode.insertBefore(tracker, el);\n\t\t}\n\t});\n}","function getAllDmg(li) {\n\tconst results = Array.from(li[0].parentNode.querySelectorAll('.mess-dice-result:not(.mess-versatile')).map(e => Number(e.querySelector('span').innerText));\n\treturn results.reduce((a, b) => a + b, 0);\n}\n\nfunction getAllVersatile(li) {\n\tconst resultArray = Array.from(li[0].parentNode.querySelectorAll('.mess-dice-result'));\n\tif (resultArray.length > 1 && resultArray[1].classList.contains('mess-versatile'))\n\t\tresultArray.splice(0,1)\n\tconst results = resultArray.map(e => Number(e.querySelector('span').innerText));\n\treturn results.reduce((a, b) => a + b, 0);\n}\n\nexport default function modifyApplyDmg() {\n\tconst canApply = (li) => true || canvas.tokens.controlled.length;\n\tconst canApplyNonVersatile = (li) => canApply(li) && li[0].parentNode.querySelector('.mess-dice-result:not(.mess-versatile)');\n\tconst canApplyVersatile = (li) => canApply(li) && li[0].parentNode.querySelector('.mess-versatile');\n\tconst hasTarget = (li) => !!li[0].closest('.mess-attack-card').dataset.targetId;\n\tconst hasNoTarget = (li) => !hasTarget(li);\n\tconst contextOptionsDmg = [\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.applyTarget\"),\n\t\t\tcondition: hasTarget\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.applySelected\"),\n\t\t\tcondition: hasNoTarget\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.dmg\"),\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${getAllDmg(li)}`\n\t\t},\n\t\t{\n\t\t\tname: 'half',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.max(Math.floor(getAllDmg(li) * 0.5), 1)}`\n\t\t},\n\t\t{\n\t\t\tname: 'double',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.floor(getAllDmg(li) * 2)}`\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.healing\"),\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyNonVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, -1),\n\t\t\tcontent: (li) => `${getAllDmg(li)}`\n\t\t},\n\t\t{\n\t\t\tname: [game.i18n.localize('DND5E.Versatile'), ' - ', game.i18n.localize(\"MESS.attackCard.contextMenu.dmg\")],\n\t\t\tcondition: canApplyVersatile,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${getAllVersatile(li)}`\n\t\t},\n\t\t{\n\t\t\tname: 'half',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.max(Math.floor(getAllVersatile(li) * 0.5), 1)}`\n\t\t},\n\t\t{\n\t\t\tname: 'double',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.floor(getAllVersatile(li) * 2)}`\n\t\t},\n\t\t{\n\t\t\tname: [game.i18n.localize('DND5E.Versatile'), ' - ', game.i18n.localize(\"MESS.attackCard.contextMenu.healing\")],\n\t\t\tcondition: canApplyVersatile,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApplyVersatile,\n\t\t\tcallback: (target, li) => applyDamage(li, -1),\n\t\t\tcontent: (li) => `${getAllVersatile(li)}`\n\t\t}\n\t]\n\n\n\tconst contextOptionsRoll = [\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.applyTarget\"),\n\t\t\tcondition: hasTarget\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.applySelected\"),\n\t\t\tcondition: hasNoTarget\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.dmg\"),\n\t\t\tcondition: canApply,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApply,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${li[0].querySelector('span').innerText}`\n\t\t},\n\t\t{\n\t\t\tname: 'half',\n\t\t\ticon: '',\n\t\t\tcondition: canApply,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.max(Math.floor(Number(li[0].querySelector('span').innerText) * 0.5), 1)}`\n\t\t},\n\t\t{\n\t\t\tname: 'double',\n\t\t\ticon: '',\n\t\t\tcondition: canApply,\n\t\t\tcallback: (target, li) => applyDamage(li, 1),\n\t\t\tcontent: (li) => `${Math.floor(Number(li[0].querySelector('span').innerText) * 2)}`\n\t\t},\n\t\t{\n\t\t\tname: game.i18n.localize(\"MESS.attackCard.contextMenu.healing\"),\n\t\t\tcondition: canApply,\n\t\t\ticon: ''\n\t\t},\n\t\t{\n\t\t\tname: 'full',\n\t\t\ticon: '',\n\t\t\tcondition: canApply,\n\t\t\tcallback: (target, li) => applyDamage(li, -1),\n\t\t\tcontent: (li) => `${li[0].querySelector('span').innerText}`\n\t\t}\n\t]\n\n\n\tContextMenu.prototype.bind = Function('\"use strict\"; return ( function ' + ContextMenu.prototype.bind.toString().replace(/this\\.render\\(parent\\)/,`this.render(parent, event)`) + ')')();\n\n\tHooks.on('renderChatLog', (app, html, options) => {\n\t\tnew MessContextMenu(html.find('#chat-log'), \".mess-chat-dmg .mess-dice-result\", contextOptionsRoll);\n\t\tnew MessContextMenu(html.find('#chat-log'), \".mess-chat-dmg .mess-chat-roll-type\", contextOptionsDmg);\n\t})\n\n\tHooks.on('getChatLogEntryContext', function (html, options) {\n\t\tsetProperty(game, 'mess.chatLogEntryContextOptions', options);\n\t\t\n\t\t// Modify existing applies to only work on default rolls and not mess-rolls\n\t\tconst canApply = li => canvas.tokens.controlled.length \n\t\t\t\t\t\t\t\t\t\t\t\t&& li.find(\".dice-roll .dice-result\").length;\n\t\tfor (let i = 1; i < options.length; i++) \n\t\t\toptions[i].condition = canApply;\n\t});\n}\n\nclass MessContextMenu extends ContextMenu {\n\tconstructor(...args) {\n\t\tsuper(...args);\n\n\t\tthis._menuItems = this.menuItems;\n\t}\n\n\trender(target, event) {\n\t\tconst filteredItems = this._menuItems.filter(item => {\n\t\t\tif (!item.condition) return true;\n\t\t\tif (!(item.condition instanceof Function)) return item.condition;\n\t\t\treturn item.condition(target);\n\t\t})\n\n\t\tif (filteredItems.length) event.stopPropagation();\n\t\telse return;\n\t\tthis.menuItems = filteredItems.map(e => {\n\t\t\tif (e.content)\n\t\t\t\te.name = e.content(target);\n\t\t\treturn e;\n\t\t});\n\n let html = $(\"#context-menu\").length ? $(\"#context-menu\") : $('');\n let ol = $('\n\t\t\t\t\t${term}\n\t\t\t\t\t${num >= 0 ? '+'+num : num}\n\t\t\t\t
\n\t\t\t\n\t\t\t\t\t${term}\n\t\t\t\t\t${num >= 0 ? '+'+num : num}\n\t\t\t\t
\n\t\t\t${game.i18n.localize(\"MESS.reloadReminder.text\")}
`,\n\t\t\tbuttons: {\n\t\t\t\tyes: {\n\t\t\t\t\ticon: '',\n\t\t\t\t\tlabel: game.i18n.localize(\"MESS.reloadReminder.yes\"),\n\t\t\t\t\tcallback: () => location.reload()\n\t\t\t\t},\n\t\t\t\tno: {\n\t\t\t\t\ticon: '',\n\t\t\t\t\tlabel: game.i18n.localize(\"MESS.reloadReminder.no\")\n\t\t\t\t}\n\t\t\t}\n\t\t}).render(true);\n\t\t// game.settings.set('mess', 'templateTexture', mergeObject({}, formData))\n\t}\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/templates/attack-card.html b/dist/templates/attack-card.html index 1fc722a..b32e1b2 100644 --- a/dist/templates/attack-card.html +++ b/dist/templates/attack-card.html @@ -7,20 +7,31 @@ {{/unless}} {{#if target.img}}Please keep in mind that i am working on this and my other projects mostly alone, in my spare time and for free. Especially before complaining (rudely) about something not working or needing some time before getting done!
+Stay polite and do your best to describe your issue, question or suggestion as detailed as possible, to help shorten time needed to clarify things and to even keep me motivated to react and go on working on this for free.
Make sure to read the README, for important informations and to learn about this modules features, since there are quite a few and they are not all connected.
Read and follow these instructions. @@ -22,6 +24,23 @@
Want to support development? Click here
+ ${term} + ${num >= 0 ? '+'+num : num} +
++ ${term} + ${num >= 0 ? '+'+num : num} +
+Please keep in mind that i am working on this and my other projects mostly alone, in my spare time and for free. Especially before complaining (rudely) about something not working or needing some time before getting done!
+Stay polite and do your best to describe your issue, question or suggestion as detailed as possible, to help shorten time needed to clarify things and to even keep me motivated to react and go on working on this for free.
Make sure to read the README, for important informations and to learn about this modules features, since there are quite a few and they are not all connected.
Read and follow these instructions. @@ -22,6 +24,23 @@
Want to support development? Click here