diff --git a/index.js b/index.js index 5198e29..9ad0799 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ /*! For license information please see index.js.LICENSE.txt */ -(()=>{"use strict";var t={d:(r,a)=>{for(var i in a)t.o(a,i)&&!t.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){u=!0,l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}},_get.apply(this,arguments)}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,a){return this.delegate={iterator:values(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;aa});var r={};function initConfig(){Hooks.on("argonInit",(function(t){var i;if("dnd5e"===game.system.id){!function registerItems(){r[game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name"),type:"feat",img:"modules/enhancedcombathud/icons/journey.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"turn"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"}},sort:0,flags:{core:{sourceId:"Item.wyQkeuZkttllAFB1"},"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name"),type:"feat",img:"modules/enhancedcombathud/icons/armor-upgrade.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"round"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name"),type:"feat",img:"modules/enhancedcombathud/icons/clockwork.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name"),type:"feat",img:"modules/enhancedcombathud/icons/cloak-dagger.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},recharge:{value:null,charged:!1},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name"),type:"feat",img:"modules/enhancedcombathud/icons/walking-boot.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name"),type:"feat",img:"modules/enhancedcombathud/icons/shield-bash.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:1,width:null,units:"",type:"creature"},range:{value:null,long:null,units:"touch"},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}}}();var o=t.ARGON,l=null===(i=game.modules.get("midi-qol"))||void 0===i?void 0:i.active,c=function getMidiFlag(t){var r,a;return l&&ui.ARGON._actor?null!==(a=(null!==(r=ui.ARGON._actor.getFlag("midi-qol","actions"))&&void 0!==r?r:{})[t])&&void 0!==a&&a?0:1:null},u=function getActivationType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a||null===(a=a.activation)||void 0===a?void 0:a.type},d=function getActionType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a?void 0:a.actionType},p={action:["action"],bonus:["bonus"],reaction:["reaction","reactiondamage","reactionmanual"],free:["special"]},h={spell:["spell"],feat:["feat"],consumable:["consumable","equipment","loot"]},m=[];game.settings.get(a,"showWeaponsItems")&&h.consumable.push("weapon"),game.settings.get(a,"showClassActions")&&m.push("class"),t.DND5E={actionTypes:p,itemTypes:h,mainBarFeatures:m,ECHItems:r},Hooks.callAll("enhanced-combat-hud.dnd5e.initConfig",{actionTypes:p,itemTypes:h,ECHItems:r});var y=function(t){_inherits(DND5ePortraitPanel,t);var r,a,i=_createSuper(DND5ePortraitPanel);function DND5ePortraitPanel(){_classCallCheck(this,DND5ePortraitPanel);for(var t=arguments.length,r=new Array(t),a=0;a=1||a.details.cr<=0?a.details.cr:"1/".concat(1/a.details.cr);return"CR ".concat(d," ").concat(u)}if(o){var p=Object.values(i.classes).map((function(t){return t.name})).join(" / ");return"Level ".concat(a.details.level," ").concat(p," (").concat(a.details.race,")")}return""}},{key:"isDead",get:function get(){return this.isDying&&"character"!==this.actor.type}},{key:"isDying",get:function get(){return this.actor.system.attributes.hp.value<=0}},{key:"successes",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.success)&&void 0!==t?t:0}},{key:"failures",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.failure)&&void 0!==t?t:0}},{key:"configurationTemplate",get:function get(){return"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs"}},{key:"_onDeathSave",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){return _regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:this.actor.rollDeathSave({});case 1:case"end":return t.stop()}}),_callee,this)}))),function _onDeathSave(t){return a.apply(this,arguments)})},{key:"getStatBlocks",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return a=game.i18n.localize("DND5E.HitPoints").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),i=game.i18n.localize("DND5E.ArmorClass").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),o=game.i18n.localize("DND5E.SaveDC").replace("{ability}","").replace("{dc}","").trim(),l=this.actor.system.attributes.hp.temp?"#6698f3":"rgb(0 255 170)",c=this.actor.system.attributes.hp.tempmax,u=c?c>0?"rgb(222 91 255)":"#ffb000":"rgb(255 255 255)",d.abrupt("return",[[{text:"".concat(this.actor.system.attributes.hp.value+(null!==(t=this.actor.system.attributes.hp.temp)&&void 0!==t?t:0)),color:l},{text:"/"},{text:"".concat(this.actor.system.attributes.hp.max+(null!==(r=this.actor.system.attributes.hp.tempmax)&&void 0!==r?r:0)),color:u},{text:a}],[{text:i},{text:this.actor.system.attributes.ac.value,color:"var(--ech-movement-baseMovement-background)"}],[{text:o},{text:this.actor.system.attributes.spelldc,color:"var(--ech-movement-baseMovement-background)"}]]);case 7:case"end":return d.stop()}}),_callee2,this)}))),function getStatBlocks(){return r.apply(this,arguments)})}]),DND5ePortraitPanel}(o.PORTRAIT.PortraitPanel),v=function(t){_inherits(DND5eDrawerButton,t);var r,a=_createSuper(DND5eDrawerButton);function DND5eDrawerButton(t,r,i){var o;return _classCallCheck(this,DND5eDrawerButton),(o=a.call(this,t)).item=r,o.type=i,o}return _createClass(DND5eDrawerButton,[{key:"hasTooltip",get:function get(){return!0}},{key:"tooltipOrientation",get:function get(){return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT}},{key:"getTooltipData",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var t;return _regeneratorRuntime().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item,this.type);case 2:return t=r.sent,r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee3,this)}))),function getTooltipData(){return r.apply(this,arguments)})}]),DND5eDrawerButton}(o.DRAWER.DrawerButton),g=function(t){_inherits(DND5eDrawerPanel,t);var r=_createSuper(DND5eDrawerPanel);function DND5eDrawerPanel(){_classCallCheck(this,DND5eDrawerPanel);for(var t=arguments.length,a=new Array(t),i=0;i=0?"+".concat(t):t};return[{gridCols:"5fr 2fr 2fr",captions:[{label:"Abilities",align:"left"},{label:"Check",align:"center"},{label:"Save",align:"center"}],align:["left","center","center"],buttons:Object.keys(r).map((function(a){var i=r[a];return new v([{label:CONFIG.DND5E.abilities[a].label,onClick:function onClick(r){return t.actor.rollAbility(a,{event:r})}},{label:o(i.mod+(i.checkBonus||0)),onClick:function onClick(r){return t.actor.rollAbilityTest(a,{event:r})}},{label:o(i.save),onClick:function onClick(r){return t.actor.rollAbilitySave(a,{event:r})}}],a,"save")}))},{gridCols:"7fr 2fr",captions:[{label:"Skills"},{label:""}],buttons:Object.keys(a).map((function(r){var i=a[r];return new v([{label:getProficiencyIcon(i.proficient)+CONFIG.DND5E.skills[r].label,onClick:function onClick(a){return t.actor.rollSkill(r,{event:a})}},{label:"".concat(o(i.total),'(').concat(i.passive,")"),style:"display: flex; justify-content: flex-end;"}],r,"skill")}))},{gridCols:"7fr 2fr",captions:[{label:"Tools"},{label:""}],buttons:i.map((function(a){return new v([{label:getProficiencyIcon(a.system.proficient)+a.name,onClick:function onClick(t){return a.rollToolCheck({event:t})}},{label:o(r[a.abilityMod].mod+a.system.proficiencyMultiplier*t.actor.system.attributes.prof)}],a)}))}]}},{key:"title",get:function get(){return"".concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.saves.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.skills.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.tools.name"))}}]),DND5eDrawerPanel}(o.DRAWER.DrawerPanel),b=function(i){_inherits(DND5eActionActionPanel,i);var l,d=_createSuper(DND5eActionActionPanel);function DND5eActionActionPanel(){_classCallCheck(this,DND5eActionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a';case"bludgeoning":return'';case"cold":return'';case"fire":return'';case"force":return'';case"lightning":return'';case"necrotic":return'';case"piercing":return'';case"poison":return'';case"psychic":return'';case"radiant":return'';case"slashing":return'';case"thunder":return'';case"healing":return'';default:return""}}function getProficiencyIcon(t){return 0==t?' ':1==t?' ':2==t?' ':.5==t?' ':' '}function condenseItemButtons(t){if(!game.settings.get(a,"condenseClassActions"))return t.map((function(t){return new P({item:t,inActionPanel:!0})}));for(var r=[],i=t.length,l=i-i%2,c=null,u=0;ut.length)&&(r=t.length);for(var a=0,i=new Array(r);a{"use strict";var t={d:(r,a)=>{for(var i in a)t.o(a,i)&&!t.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:a[i]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)};function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){u=!0,l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(t,r,a){var i=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}},_get.apply(this,arguments)}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l,c,u=[],d=!0,p=!1;try{if(l=(a=a.call(t)).next,0===r){if(Object(a)!==a)return;d=!1}else for(;!(d=(i=l.call(a)).done)&&(u.push(i.value),u.length!==r);d=!0);}catch(t){p=!0,o=t}finally{try{if(!d&&null!=a.return&&(c=a.return(),Object(c)!==c))return}finally{if(p)throw o}}return u}}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a=0;--i){var o=this.tryEntries[i],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),d}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,a){return this.delegate={iterator:values(t),resultName:r,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;aa});var r={};function initConfig(){Hooks.on("argonInit",(function(t){var i;if("dnd5e"===game.system.id){!function registerItems(){r[game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.name"),type:"feat",img:"modules/enhancedcombathud/icons/journey.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.disengage.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"turn"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"}},sort:0,flags:{core:{sourceId:"Item.wyQkeuZkttllAFB1"},"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.name"),type:"feat",img:"modules/enhancedcombathud/icons/armor-upgrade.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dodge.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:1,units:"round"},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.name"),type:"feat",img:"modules/enhancedcombathud/icons/clockwork.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.ready.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.name"),type:"feat",img:"modules/enhancedcombathud/icons/cloak-dagger.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.hide.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},recharge:{value:null,charged:!1},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.name"),type:"feat",img:"modules/enhancedcombathud/icons/walking-boot.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.dash.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:null,width:null,units:"",type:"self"},range:{value:null,long:null,units:""},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}},r[game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name")]={name:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.name"),type:"feat",img:"modules/enhancedcombathud/icons/shield-bash.webp",system:{type:{value:"",subtype:""},description:{value:game.i18n.localize("enhancedcombathud-dnd5e.items.shove.desc"),chat:"",unidentified:""},source:"",quantity:1,weight:0,price:0,attuned:!1,attunement:0,equipped:!1,rarity:"",identified:!0,activation:{type:"action",cost:1,condition:""},duration:{value:null,units:""},target:{value:1,width:null,units:"",type:"creature"},range:{value:null,long:null,units:"touch"},consume:{type:"",target:"",amount:null},ability:"",actionType:"util",attackBonus:0,chatFlavor:"",critical:null,damage:{parts:[],versatile:""},formula:"",save:{ability:"",dc:null,scaling:"spell"},consumableType:"trinket"},sort:0,flags:{"midi-qol":{onUseMacroName:""}}}}();var o=t.ARGON,l=null===(i=game.modules.get("midi-qol"))||void 0===i?void 0:i.active,c=function getMidiFlag(t){var r,a;return l&&ui.ARGON._actor?null!==(a=(null!==(r=ui.ARGON._actor.getFlag("midi-qol","actions"))&&void 0!==r?r:{})[t])&&void 0!==a&&a?0:1:null},u=function getActivationType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a||null===(a=a.activation)||void 0===a?void 0:a.type},d=function getActionType(t){var r,a;if(null!=t&&null!==(r=t.system)&&void 0!==r&&r.activities)return null===(a=Array.from(t.system.activities)[0])||void 0===a?void 0:a.actionType},p={action:["action"],bonus:["bonus"],reaction:["reaction","reactiondamage","reactionmanual"],free:["special"]},h={spell:["spell"],feat:["feat"],consumable:["consumable","equipment","loot"]},m=[];game.settings.get(a,"showWeaponsItems")&&h.consumable.push("weapon"),game.settings.get(a,"showClassActions")&&m.push("class"),t.DND5E={actionTypes:p,itemTypes:h,mainBarFeatures:m,ECHItems:r},Hooks.callAll("enhanced-combat-hud.dnd5e.initConfig",{actionTypes:p,itemTypes:h,ECHItems:r});var y=function(t){_inherits(DND5ePortraitPanel,t);var r,a,i=_createSuper(DND5ePortraitPanel);function DND5ePortraitPanel(){_classCallCheck(this,DND5ePortraitPanel);for(var t=arguments.length,r=new Array(t),a=0;a=1||a.details.cr<=0?a.details.cr:"1/".concat(1/a.details.cr);return"CR ".concat(d," ").concat(u)}if(o){var p=Object.values(i.classes).map((function(t){return t.name})).join(" / ");return"Level ".concat(a.details.level," ").concat(p," (").concat(a.details.race,")")}return""}},{key:"isDead",get:function get(){return this.isDying&&"character"!==this.actor.type}},{key:"isDying",get:function get(){return this.actor.system.attributes.hp.value<=0}},{key:"successes",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.success)&&void 0!==t?t:0}},{key:"failures",get:function get(){var t,r;return null!==(t=null===(r=this.actor.system.attributes)||void 0===r||null===(r=r.death)||void 0===r?void 0:r.failure)&&void 0!==t?t:0}},{key:"configurationTemplate",get:function get(){return"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs"}},{key:"_onDeathSave",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(t){return _regeneratorRuntime().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:this.actor.rollDeathSave({});case 1:case"end":return t.stop()}}),_callee,this)}))),function _onDeathSave(t){return a.apply(this,arguments)})},{key:"getStatBlocks",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var t,r,a,i,o,l,c,u;return _regeneratorRuntime().wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return a=game.i18n.localize("DND5E.HitPoints").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),i=game.i18n.localize("DND5E.ArmorClass").split(" ").map((function(t){return t.charAt(0).toUpperCase()})).join(""),o=game.i18n.localize("DND5E.SaveDC").replace("{ability}","").replace("{dc}","").trim(),l=this.actor.system.attributes.hp.temp?"#6698f3":"rgb(0 255 170)",c=this.actor.system.attributes.hp.tempmax,u=c?c>0?"rgb(222 91 255)":"#ffb000":"rgb(255 255 255)",d.abrupt("return",[[{text:"".concat(this.actor.system.attributes.hp.value+(null!==(t=this.actor.system.attributes.hp.temp)&&void 0!==t?t:0)),color:l},{text:"/"},{text:"".concat(this.actor.system.attributes.hp.max+(null!==(r=this.actor.system.attributes.hp.tempmax)&&void 0!==r?r:0)),color:u},{text:a}],[{text:i},{text:this.actor.system.attributes.ac.value,color:"var(--ech-movement-baseMovement-background)"}],[{text:o},{text:this.actor.system.attributes.spelldc,color:"var(--ech-movement-baseMovement-background)"}]]);case 7:case"end":return d.stop()}}),_callee2,this)}))),function getStatBlocks(){return r.apply(this,arguments)})}]),DND5ePortraitPanel}(o.PORTRAIT.PortraitPanel),v=function(t){_inherits(DND5eDrawerButton,t);var r,a=_createSuper(DND5eDrawerButton);function DND5eDrawerButton(t,r,i){var o;return _classCallCheck(this,DND5eDrawerButton),(o=a.call(this,t)).item=r,o.type=i,o}return _createClass(DND5eDrawerButton,[{key:"hasTooltip",get:function get(){return!0}},{key:"tooltipOrientation",get:function get(){return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT}},{key:"getTooltipData",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(){var t;return _regeneratorRuntime().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,getTooltipDetails(this.item,this.type);case 2:return t=r.sent,r.abrupt("return",t);case 4:case"end":return r.stop()}}),_callee3,this)}))),function getTooltipData(){return r.apply(this,arguments)})}]),DND5eDrawerButton}(o.DRAWER.DrawerButton),g=function(t){_inherits(DND5eDrawerPanel,t);var r=_createSuper(DND5eDrawerPanel);function DND5eDrawerPanel(){_classCallCheck(this,DND5eDrawerPanel);for(var t=arguments.length,a=new Array(t),i=0;i=0?"+".concat(t):t};return[{gridCols:"5fr 2fr 2fr",captions:[{label:"Abilities",align:"left"},{label:"Check",align:"center"},{label:"Save",align:"center"}],align:["left","center","center"],buttons:Object.keys(r).map((function(a){var i=r[a];return new v([{label:CONFIG.DND5E.abilities[a].label,onClick:function onClick(r){return t.actor.rollAbility(a,{event:r})}},{label:o(i.mod+(i.checkBonus||0)),onClick:function onClick(r){return t.actor.rollAbilityTest(a,{event:r})}},{label:o(i.save),onClick:function onClick(r){return t.actor.rollAbilitySave(a,{event:r})}}],a,"save")}))},{gridCols:"7fr 2fr",captions:[{label:"Skills"},{label:""}],buttons:Object.keys(a).map((function(r){var i=a[r];return new v([{label:getProficiencyIcon(i.proficient)+CONFIG.DND5E.skills[r].label,onClick:function onClick(a){return t.actor.rollSkill(r,{event:a})}},{label:"".concat(o(i.total),'(').concat(i.passive,")"),style:"display: flex; justify-content: flex-end;"}],r,"skill")}))},{gridCols:"7fr 2fr",captions:[{label:"Tools"},{label:""}],buttons:i.map((function(a){return new v([{label:getProficiencyIcon(a.system.proficient)+a.name,onClick:function onClick(t){return a.rollToolCheck({event:t})}},{label:o(r[a.abilityMod].mod+a.system.proficiencyMultiplier*t.actor.system.attributes.prof)}],a)}))}]}},{key:"title",get:function get(){return"".concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.saves.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.skills.name")," / ").concat(game.i18n.localize("enhancedcombathud-dnd5e.hud.tools.name"))}}]),DND5eDrawerPanel}(o.DRAWER.DrawerPanel),b=function(i){_inherits(DND5eActionActionPanel,i);var l,d=_createSuper(DND5eActionActionPanel);function DND5eActionActionPanel(){_classCallCheck(this,DND5eActionActionPanel);for(var t=arguments.length,r=new Array(t),a=0;a\n\n
\n\n
\n \n
\n ').concat(this.label,'\n \n Feature\n \n
\n \n
\n\n
\n
\n ').concat(this.item.system.description.value,"\n
\n
\n
\n\n\n\n ")});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),_callee18,this)}))),function createChatMessage(){return r.apply(this,arguments)})}]),DND5eSpecialActionButton}(o.MAIN.BUTTONS.ActionButton),T=function(t){_inherits(DND5eMovementHud,t);var r=_createSuper(DND5eMovementHud);function DND5eMovementHud(){var t,a;_classCallCheck(this,DND5eMovementHud);for(var i=arguments.length,o=new Array(i),l=0;l';case"bludgeoning":return'';case"cold":return'';case"fire":return'';case"force":return'';case"lightning":return'';case"necrotic":return'';case"piercing":return'';case"poison":return'';case"psychic":return'';case"radiant":return'';case"slashing":return'';case"thunder":return'';case"healing":return'';default:return""}}function getProficiencyIcon(t){return 0==t?' ':1==t?' ':2==t?' ':.5==t?' ':' '}function condenseItemButtons(t){if(!game.settings.get(a,"condenseClassActions"))return t.map((function(t){return new P({item:t,inActionPanel:!0})}));for(var r=[],i=t.length,l=i-i%2,c=null,u=0;ut.length)&&(r=t.length);for(var a=0,i=new Array(r);a {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { MODULE_ID } from \"./main.js\";\r\n\r\nconst ECHItems = {};\r\n\r\nexport function initConfig() {\r\n Hooks.on(\"argonInit\", (CoreHUD) => {\r\n if (game.system.id !== \"dnd5e\") return;\r\n registerItems();\r\n const ARGON = CoreHUD.ARGON;\r\n\r\n const isMIDI = game.modules.get(\"midi-qol\")?.active;\r\n const getMidiFlag = (actionType) => {\r\n if (!isMIDI || !ui.ARGON._actor) return null;\r\n const flag = ui.ARGON._actor.getFlag(\"midi-qol\", \"actions\") ?? {};\r\n const value = flag[actionType] ?? false;\r\n const midiAction = value ? 0 : 1;\r\n return midiAction;\r\n };\r\n\r\n const getActivationType = (item) => {\r\n if (!item?.system?.activities) {\r\n return\r\n }\r\n return Array.from(item.system.activities)[0]?.activation?.type;\r\n }\r\n\r\n const getActionType = (item) => {\r\n if (!item?.system?.activities) {\r\n return\r\n }\r\n return Array.from(item.system.activities)[0]?.actionType;\r\n }\r\n\r\n const actionTypes = {\r\n action: [\"action\"],\r\n bonus: [\"bonus\"],\r\n reaction: [\"reaction\", \"reactiondamage\", \"reactionmanual\"],\r\n free: [\"special\"],\r\n };\r\n\r\n const itemTypes = {\r\n spell: [\"spell\"],\r\n feat: [\"feat\"],\r\n consumable: [\"consumable\", \"equipment\", \"loot\"],\r\n };\r\n\r\n const mainBarFeatures = [];\r\n\r\n if (game.settings.get(MODULE_ID, \"showWeaponsItems\")) itemTypes.consumable.push(\"weapon\");\r\n if (game.settings.get(MODULE_ID, \"showClassActions\")) mainBarFeatures.push(\"class\");\r\n\r\n CoreHUD.DND5E = {\r\n actionTypes,\r\n itemTypes,\r\n mainBarFeatures,\r\n ECHItems,\r\n };\r\n\r\n Hooks.callAll(\"enhanced-combat-hud.dnd5e.initConfig\", { actionTypes, itemTypes, ECHItems });\r\n\r\n async function getTooltipDetails(item, type) {\r\n let title, description, itemType, subtitle, target, range, dt;\r\n let damageTypes = [];\r\n let properties = [];\r\n let materialComponents = \"\";\r\n\r\n if (type == \"skill\") {\r\n title = CONFIG.DND5E.skills[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.skills.${item}.tooltip`);\r\n } else if (type == \"save\") {\r\n title = CONFIG.DND5E.abilities[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.abilities.${item}.tooltip`);\r\n } else {\r\n if (!item || !item.system) return;\r\n\r\n title = item.name;\r\n description = item.system.identified ? item.system.description.value : item.system.description.unidentified ?? item.system.description.value;\r\n itemType = item.type;\r\n target = item.labels?.target || \"-\";\r\n range = item.labels?.range || \"-\";\r\n properties = [];\r\n dt = item.labels?.damageTypes?.split(\", \");\r\n damageTypes = dt && dt.length ? dt : [];\r\n materialComponents = \"\";\r\n\r\n switch (itemType) {\r\n case \"weapon\":\r\n subtitle = CONFIG.DND5E.weaponTypes[item.system.weaponType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n for (let [key, value] of Object.entries(item.system.properties)) {\r\n let prop = value && CONFIG.DND5E.weaponProperties[key] ? CONFIG.DND5E.weaponProperties[key] : undefined;\r\n if (prop) properties.push(prop);\r\n }\r\n break;\r\n case \"spell\":\r\n subtitle = `${item.labels.level} ${item.labels.school}`;\r\n properties.push(CONFIG.DND5E.spellSchools[item.system.school]);\r\n properties.push(item.labels.duration);\r\n properties.push(item.labels.save);\r\n for (let comp of item.labels.components.all) {\r\n properties.push(comp.abbr);\r\n }\r\n if (item.labels.materials) materialComponents = item.labels.materials;\r\n break;\r\n case \"consumable\":\r\n subtitle = CONFIG.DND5E.consumableTypes[item.system.consumableType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n case \"feat\":\r\n subtitle = item.system.requirements;\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n }\r\n }\r\n\r\n if (description) description = await TextEditor.enrichHTML(description, { async: true });\r\n let details = [];\r\n if (target || range) {\r\n details = [\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.target.name\",\r\n value: target,\r\n },\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.range.name\",\r\n value: range,\r\n },\r\n ];\r\n }\r\n if (item?.labels?.toHit) {\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.toHit.name\",\r\n value: item.labels.toHit,\r\n });\r\n }\r\n if (item?.labels?.derivedDamage?.length) {\r\n let dmgString = \"\";\r\n item.labels.derivedDamage.forEach((dDmg) => {\r\n dmgString += dDmg.formula + \" \" + getDamageTypeIcon(dDmg.damageType) + \" \";\r\n });\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.damage.name\",\r\n value: dmgString,\r\n });\r\n }\r\n\r\n const tooltipProperties = [];\r\n if (damageTypes?.length) damageTypes.forEach((d) => tooltipProperties.push({ label: d, primary: true }));\r\n if (properties?.length) properties.forEach((p) => tooltipProperties.push({ label: p?.label ?? p, secondary: true }));\r\n return { title, description, subtitle, details, properties: tooltipProperties, footerText: materialComponents };\r\n }\r\n\r\n function getDamageTypeIcon(damageType) {\r\n switch (damageType.toLowerCase()) {\r\n case \"acid\":\r\n return '';\r\n case \"bludgeoning\":\r\n return '';\r\n case \"cold\":\r\n return '';\r\n case \"fire\":\r\n return '';\r\n case \"force\":\r\n return '';\r\n case \"lightning\":\r\n return '';\r\n case \"necrotic\":\r\n return '';\r\n case \"piercing\":\r\n return '';\r\n case \"poison\":\r\n return '';\r\n case \"psychic\":\r\n return '';\r\n case \"radiant\":\r\n return '';\r\n case \"slashing\":\r\n return '';\r\n case \"thunder\":\r\n return '';\r\n case \"healing\":\r\n return '';\r\n default:\r\n return \"\";\r\n }\r\n }\r\n\r\n function getProficiencyIcon(proficiency) {\r\n if (proficiency == 0) return ' ';\r\n else if (proficiency == 1) return ' ';\r\n else if (proficiency == 2) return ' ';\r\n else if (proficiency == 0.5) return ' ';\r\n else return ' ';\r\n }\r\n\r\n function condenseItemButtons(items) {\r\n const condenseClassActions = game.settings.get(MODULE_ID, \"condenseClassActions\");\r\n if (!condenseClassActions) return items.map((item) => new DND5eItemButton({ item, inActionPanel: true }));\r\n const condensedItems = [];\r\n const barItemsLength = items.length;\r\n const barItemsMultipleOfTwo = barItemsLength - (barItemsLength % 2);\r\n let currentSplitButtonItemButton = null;\r\n for (let i = 0; i < barItemsLength; i++) {\r\n const isCondensedButton = i < barItemsMultipleOfTwo;\r\n const item = items[i];\r\n if (isCondensedButton) {\r\n if (currentSplitButtonItemButton) {\r\n const button = new DND5eItemButton({ item, inActionPanel: false });\r\n condensedItems.push(new ARGON.MAIN.BUTTONS.SplitButton(currentSplitButtonItemButton, button));\r\n currentSplitButtonItemButton = null;\r\n } else {\r\n currentSplitButtonItemButton = new DND5eItemButton({ item, inActionPanel: false });\r\n }\r\n } else {\r\n condensedItems.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n }\r\n }\r\n return condensedItems;\r\n }\r\n\r\n class DND5ePortraitPanel extends ARGON.PORTRAIT.PortraitPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get description() {\r\n const { type, system } = this.actor;\r\n const actor = this.actor;\r\n const isNPC = type === \"npc\";\r\n const isPC = type === \"character\";\r\n if (isNPC) {\r\n const creatureType = game.i18n.localize(CONFIG.DND5E.creatureTypes[actor.system.details.type.value]?.label ?? actor.system.details.type.custom);\r\n const cr = system.details.cr >= 1 || system.details.cr <= 0 ? system.details.cr : `1/${1 / system.details.cr}`;\r\n return `CR ${cr} ${creatureType}`;\r\n } else if (isPC) {\r\n const classes = Object.values(actor.classes)\r\n .map((c) => c.name)\r\n .join(\" / \");\r\n return `Level ${system.details.level} ${classes} (${system.details.race})`;\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n get isDead() {\r\n return this.isDying && this.actor.type !== \"character\";\r\n }\r\n\r\n get isDying() {\r\n return this.actor.system.attributes.hp.value <= 0;\r\n }\r\n\r\n get successes() {\r\n return this.actor.system.attributes?.death?.success ?? 0;\r\n }\r\n\r\n get failures() {\r\n return this.actor.system.attributes?.death?.failure ?? 0;\r\n }\r\n\r\n get configurationTemplate() {\r\n return \"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs\";\r\n }\r\n\r\n async _onDeathSave(event) {\r\n this.actor.rollDeathSave({});\r\n }\r\n\r\n async getStatBlocks() {\r\n const HPText = game.i18n\r\n .localize(\"DND5E.HitPoints\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const ACText = game.i18n\r\n .localize(\"DND5E.ArmorClass\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const SpellDC = game.i18n.localize(\"DND5E.SaveDC\").replace(\"{ability}\", \"\").replace(\"{dc}\", \"\").trim();\r\n\r\n const hpColor = this.actor.system.attributes.hp.temp ? \"#6698f3\" : \"rgb(0 255 170)\";\r\n const tempMax = this.actor.system.attributes.hp.tempmax;\r\n const hpMaxColor = tempMax ? (tempMax > 0 ? \"rgb(222 91 255)\" : \"#ffb000\") : \"rgb(255 255 255)\";\r\n\r\n return [\r\n [\r\n {\r\n text: `${this.actor.system.attributes.hp.value + (this.actor.system.attributes.hp.temp ?? 0)}`,\r\n color: hpColor,\r\n },\r\n {\r\n text: `/`,\r\n },\r\n {\r\n text: `${this.actor.system.attributes.hp.max + (this.actor.system.attributes.hp.tempmax ?? 0)}`,\r\n color: hpMaxColor,\r\n },\r\n {\r\n text: HPText,\r\n },\r\n ],\r\n [\r\n {\r\n text: ACText,\r\n },\r\n {\r\n text: this.actor.system.attributes.ac.value,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n [\r\n {\r\n text: SpellDC,\r\n },\r\n {\r\n text: this.actor.system.attributes.spelldc,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n ];\r\n }\r\n }\r\n\r\n class DND5eDrawerButton extends ARGON.DRAWER.DrawerButton {\r\n constructor(buttons, item, type) {\r\n super(buttons);\r\n this.item = item;\r\n this.type = type;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get tooltipOrientation() {\r\n return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item, this.type);\r\n return tooltipData;\r\n }\r\n }\r\n\r\n class DND5eDrawerPanel extends ARGON.DRAWER.DrawerPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get categories() {\r\n const abilities = this.actor.system.abilities;\r\n const skills = this.actor.system.skills;\r\n const tools = this.actor.itemTypes.tool;\r\n\r\n const addSign = (value) => {\r\n if (value >= 0) return `+${value}`;\r\n return value;\r\n };\r\n\r\n const abilitiesButtons = Object.keys(abilities).map((ability) => {\r\n const abilityData = abilities[ability];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: CONFIG.DND5E.abilities[ability].label,\r\n onClick: (event) => this.actor.rollAbility(ability, { event }),\r\n },\r\n {\r\n label: addSign(abilityData.mod + (abilityData.checkBonus || 0)),\r\n onClick: (event) => this.actor.rollAbilityTest(ability, { event }),\r\n },\r\n {\r\n label: addSign(abilityData.save),\r\n onClick: (event) => this.actor.rollAbilitySave(ability, { event }),\r\n },\r\n ],\r\n ability,\r\n \"save\",\r\n );\r\n });\r\n\r\n const skillsButtons = Object.keys(skills).map((skill) => {\r\n const skillData = skills[skill];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(skillData.proficient) + CONFIG.DND5E.skills[skill].label,\r\n onClick: (event) => this.actor.rollSkill(skill, { event }),\r\n },\r\n {\r\n label: `${addSign(skillData.total)}(${skillData.passive})`,\r\n style: \"display: flex; justify-content: flex-end;\",\r\n },\r\n ],\r\n skill,\r\n \"skill\",\r\n );\r\n });\r\n\r\n const toolButtons = tools.map((tool) => {\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(tool.system.proficient) + tool.name,\r\n onClick: (event) => tool.rollToolCheck({ event }),\r\n },\r\n {\r\n label: addSign(abilities[tool.abilityMod].mod + tool.system.proficiencyMultiplier * this.actor.system.attributes.prof),\r\n },\r\n ],\r\n tool,\r\n );\r\n });\r\n\r\n return [\r\n {\r\n gridCols: \"5fr 2fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Abilities\",\r\n align: \"left\",\r\n },\r\n {\r\n label: \"Check\",\r\n align: \"center\",\r\n },\r\n {\r\n label: \"Save\",\r\n align: \"center\",\r\n },\r\n ],\r\n align: [\"left\", \"center\", \"center\"],\r\n buttons: abilitiesButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Skills\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: skillsButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Tools\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: toolButtons,\r\n },\r\n ];\r\n }\r\n\r\n get title() {\r\n return `${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.saves.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.skills.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.tools.name\")}`;\r\n }\r\n }\r\n\r\n class DND5eActionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Action\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"action\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const spellItems = this.actor.items.filter((item) => itemTypes.spell.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const featItems = this.actor.items.filter((item) => itemTypes.feat.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const consumableItems = this.actor.items.filter((item) => itemTypes.consumable.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n\r\n const spellButton = !spellItems.length ? [] : [new DND5eButtonPanelButton({ type: \"spell\", items: spellItems, color: 0 })].filter((button) => button.hasContents);\r\n\r\n const specialActions = Object.values(ECHItems);\r\n\r\n const showSpecialActions = game.settings.get(MODULE_ID, \"showSpecialActions\");\r\n const buttons = [];\r\n if (showSpecialActions) {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[0]), new DND5eSpecialActionButton(specialActions[1])), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[2]), new DND5eSpecialActionButton(specialActions[3])), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[4]), new DND5eSpecialActionButton(specialActions[5])), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n } else {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.action.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons.filter((button) => button.hasContents || button.items == undefined || button.items.length);\r\n }\r\n }\r\n\r\n class DND5eBonusActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.BonusAction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"bonus\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: false })];\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.bonus.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 1 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.bonus.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eReactionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Reaction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"reaction\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true })];\r\n //buttons.push(new DND5eEquipmentButton({slot: 1}));\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.reaction.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 3 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.reaction.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eFreeActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Special\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.isActionUsed ? 0 : 1;\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.free.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 2 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.free.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLegActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LegendaryActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? this.actor.system.resources?.legact?.max ?? null : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources?.legact?.value ?? null;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const legendary = this.actor.items.filter((item) => getActivationType(item) === \"legendary\");\r\n legendary.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLairActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LairActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources.lair?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const lair = this.actor.items.filter((item) => getActivationType(item) === \"lair\");\r\n lair.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eMythicActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.MythicActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return null; //this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return null; //this.actor.system.resources.mythic?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const mythic = this.actor.items.filter((item) => getActivationType(item) === \"mythic\");\r\n mythic.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eItemButton extends ARGON.MAIN.BUTTONS.ItemButton {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get activity() {\r\n if(!this.item?.system?.activities) {\r\n return\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get ranges() {\r\n const item = this.activity;\r\n const touchRange = item.range.units == \"touch\" ? canvas?.scene?.grid?.distance : null;\r\n return {\r\n normal: item?.range?.value ?? touchRange,\r\n long: item?.range?.long ?? null,\r\n };\r\n }\r\n\r\n get targets() {\r\n const item = this.activity;\r\n const validTargets = [\"creature\", \"ally\", \"enemy\"];\r\n const actionType = item.actionType;\r\n const affects = item.target?.affects ?? {};\r\n const targetType = affects.type;\r\n if (!item.target?.template?.units && validTargets.includes(targetType)) {\r\n return affects.count ?? 1;\r\n } else if (actionType === \"mwak\" || actionType === \"rwak\") {\r\n return affects.count || 1;\r\n }\r\n return null;\r\n }\r\n\r\n get visible() {\r\n if (!this._isWeaponSet) return super.visible;\r\n const isReaction = this.parent instanceof DND5eReactionActionPanel;\r\n const isMelee = this.activity?.actionType === \"mwak\";\r\n if (isReaction && !isMelee) return false;\r\n if (this._isPrimary) return super.visible;\r\n if (this.activity?.type?.value === \"shield\") return false;\r\n return super.visible;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n ui.ARGON.interceptNextDialog(event.currentTarget);\r\n const used = await this.activity.use({ event }, { event });\r\n if (used) {\r\n DND5eItemButton.consumeActionEconomy(this.activity);\r\n }\r\n }\r\n\r\n async _onRightClick(event) {\r\n this.activity?.sheet?.render(true);\r\n }\r\n\r\n static consumeActionEconomy(item) {\r\n const activationType = getActivationType(item);\r\n let actionType = null;\r\n for (const [type, types] of Object.entries(actionTypes)) {\r\n if (types.includes(activationType)) actionType = type;\r\n }\r\n if (!actionType) return;\r\n if (game.combat?.combatant?.actor !== item.parent) actionType = \"reaction\";\r\n if (actionType === \"action\") {\r\n ui.ARGON.components.main[0].isActionUsed = true;\r\n ui.ARGON.components.main[0].updateActionUse();\r\n } else if (actionType === \"bonus\") {\r\n ui.ARGON.components.main[1].isActionUsed = true;\r\n ui.ARGON.components.main[1].updateActionUse();\r\n } else if (actionType === \"reaction\") {\r\n ui.ARGON.components.main[2].isActionUsed = true;\r\n ui.ARGON.components.main[2].updateActionUse();\r\n } else if (actionType === \"free\") {\r\n ui.ARGON.components.main[3].isActionUsed = true;\r\n ui.ARGON.components.main[3].updateActionUse();\r\n } else if (actionType === \"legendary\") {\r\n ui.ARGON.components.main[4].isActionUsed = true;\r\n }\r\n }\r\n\r\n async render(...args) {\r\n await super.render(...args);\r\n if (this.activity) {\r\n const weapons = this.actor.items.filter((item) => item.consume?.target === this.activity.id);\r\n ui.ARGON.updateItemButtons(weapons);\r\n }\r\n }\r\n\r\n get quantity() {\r\n if (!this.activity) return null;\r\n const showQuantityItemTypes = [\"consumable\"];\r\n const consumeType = this.activity.consume?.type;\r\n if (consumeType === \"ammo\") {\r\n const ammoItem = this.actor.items.get(this.activity.consume.target);\r\n if (!ammoItem) return null;\r\n return Math.floor((ammoItem.quantity ?? 0) / this.activity.consume.amount);\r\n } else if (consumeType === \"attribute\") {\r\n return Math.floor(getProperty(this.actor, this.activity.consume.target) / this.activity.consume.amount);\r\n } else if (consumeType === \"charges\") {\r\n const chargesItem = this.actor.items.get(this.activity.consume.target);\r\n if (!chargesItem) return null;\r\n return Math.floor((chargesItem.uses?.value ?? 0) / this.activity.consume.amount);\r\n } else if (showQuantityItemTypes.includes(this.activity.type)) {\r\n return this.activity.uses?.value ?? this.activity.quantity;\r\n } else if (this.activity.uses.value !== null && this.activity.uses.per !== null && this.activity.uses.max) {\r\n return this.activity.uses.value;\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n class DND5eButtonPanelButton extends ARGON.MAIN.BUTTONS.ButtonPanelButton {\r\n constructor({ type, items, color }) {\r\n super();\r\n this.type = type;\r\n this.items = items;\r\n this.color = color;\r\n this.itemsWithSpells = [];\r\n this._spells = this.prePrepareSpells();\r\n }\r\n\r\n get hasContents() {\r\n return this._spells ? !!this._spells.length || !!this.itemsWithSpells.length : !!this.items.length;\r\n }\r\n\r\n get colorScheme() {\r\n return this.color;\r\n }\r\n\r\n get id() {\r\n return `${this.type}-${this.color}`;\r\n }\r\n\r\n get label() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"enhancedcombathud-dnd5e.hud.castspell.name\";\r\n case \"feat\":\r\n return \"enhancedcombathud-dnd5e.hud.usepower.name\";\r\n case \"consumable\":\r\n return \"enhancedcombathud-dnd5e.hud.useitem.name\";\r\n }\r\n }\r\n\r\n get icon() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"modules/enhancedcombathud/icons/spell-book.webp\";\r\n case \"feat\":\r\n return \"modules/enhancedcombathud/icons/mighty-force.webp\";\r\n case \"consumable\":\r\n return \"modules/enhancedcombathud/icons/drink-me.webp\";\r\n }\r\n }\r\n\r\n get showPreparedOnly() {\r\n if (this.actor.type !== \"character\") return false;\r\n const preparedFlag = this.actor.getFlag(MODULE_ID, \"showPrepared\");\r\n if (preparedFlag === \"all\") return false;\r\n if (preparedFlag === \"preparedOnly\") return true;\r\n const classes = Object.keys(this.actor.classes);\r\n const requiresPreparation = [\"cleric\", \"druid\", \"paladin\", \"wizard\", \"artificer\"].some((className) => classes.includes(className));\r\n return requiresPreparation;\r\n }\r\n\r\n prePrepareSpells() {\r\n if (this.type !== \"spell\") return;\r\n\r\n const spellLevels = CONFIG.DND5E.spellLevels;\r\n const itemsToIgnore = [];\r\n if (game.modules.get(\"items-with-spells-5e\")?.active) {\r\n const IWSAPI = game.modules.get(\"items-with-spells-5e\").api;\r\n const actionType = this.items[0].system.activation?.type;\r\n const spellItems = this.actor.items.filter((item) => item.flags[\"items-with-spells-5e\"]?.[\"item-spells\"]?.length);\r\n for (const item of spellItems) {\r\n const spellData = item.flags[\"items-with-spells-5e\"][\"item-spells\"];\r\n const itemsInSpell = spellData.map((spell) => this.actor.items.get(spell.id)).filter((item) => item && getActivationType(item) === actionType);\r\n if (!itemsInSpell.length) continue;\r\n itemsToIgnore.push(...itemsInSpell);\r\n if (!IWSAPI.isUsableItem(item)) continue;\r\n this.itemsWithSpells.push({\r\n label: item.name,\r\n buttons: itemsInSpell.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return { max: item.system.uses?.max, value: item.system.uses?.value };\r\n },\r\n });\r\n }\r\n this.items = this.items.filter((item) => !itemsToIgnore.includes(item));\r\n }\r\n if (this.showPreparedOnly) {\r\n const allowIfNotPrepared = [\"atwill\", \"innate\", \"pact\", \"always\"];\r\n this.items = this.items.filter((item) => {\r\n if (allowIfNotPrepared.includes(item.system.preparation.mode)) return true;\r\n if (item.system.level == 0) return true;\r\n return item.system.preparation.prepared;\r\n });\r\n }\r\n\r\n const spells = [\r\n ...this.itemsWithSpells,\r\n {\r\n label: \"DND5E.SpellPrepAtWill\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"atwill\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.SpellPrepInnate\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"innate\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: Object.values(spellLevels)[0],\r\n buttons: this.items.filter((item) => item.system.level == 0).map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.PactMagic\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"pact\").map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells.pact;\r\n },\r\n },\r\n ];\r\n for (const [level, label] of Object.entries(spellLevels)) {\r\n const levelSpells = this.items.filter((item) => item.system.level == level && (item.system.preparation.mode === \"prepared\" || item.system.preparation.mode === \"always\"));\r\n if (!levelSpells.length || level == 0) continue;\r\n spells.push({\r\n label,\r\n buttons: levelSpells.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells[`spell${level}`];\r\n },\r\n });\r\n }\r\n return spells.filter((spell) => spell.buttons.length);\r\n }\r\n\r\n async _getPanel() {\r\n if (this.type === \"spell\") {\r\n return new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanel({ id: this.id, accordionPanelCategories: this._spells.map(({ label, buttons, uses }) => new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanelCategory({ label, buttons, uses })) });\r\n } else {\r\n return new ARGON.MAIN.BUTTON_PANELS.ButtonPanel({ id: this.id, buttons: this.items.map((item) => new DND5eItemButton({ item })) });\r\n }\r\n }\r\n }\r\n\r\n class DND5eSpecialActionButton extends ARGON.MAIN.BUTTONS.ActionButton {\r\n constructor(specialItem) {\r\n super();\r\n const actorItem = this.actor.items.getName(specialItem.name);\r\n this.item =\r\n actorItem ??\r\n new CONFIG.Item.documentClass(specialItem, {\r\n parent: this.actor,\r\n });\r\n }\r\n\r\n get label() {\r\n return this.item.name;\r\n }\r\n\r\n get icon() {\r\n return this.item.img;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n const useCE = game.modules.get(\"dfreds-convenient-effects\")?.active && game.dfreds.effectInterface.findEffect({effectName: this.label});\r\n let success = false;\r\n if (useCE) {\r\n success = true;\r\n await game.dfreds.effectInterface.toggleEffect({effectName: this.label, overlay: false, uuids: [this.actor.uuid] });\r\n } else {\r\n success = await this.item.use({ event }, { event });\r\n }\r\n if (success) {\r\n DND5eItemButton.consumeActionEconomy(this.item);\r\n }\r\n }\r\n }\r\n\r\n class DND5eMovementHud extends ARGON.MovementHud {\r\n constructor(...args) {\r\n super(...args);\r\n this.getMovementMode = game.modules.get(\"elevation-drag-ruler\")?.api?.getMovementMode;\r\n }\r\n\r\n get visible() {\r\n return game.combat?.started;\r\n }\r\n\r\n get movementMode() {\r\n return this.getMovementMode ? this.getMovementMode(this.token) : \"walk\";\r\n }\r\n\r\n get movementMax() {\r\n if (!this.actor) return 0;\r\n return this.actor.system.attributes.movement[this.movementMode] / canvas.scene.dimensions.distance;\r\n }\r\n }\r\n\r\n class DND5eButtonHud extends ARGON.ButtonHud {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get visible() {\r\n return !game.combat?.started;\r\n }\r\n\r\n async _getButtons() {\r\n return [\r\n {\r\n label: \"DND5E.LongRest\",\r\n onClick: (event) => this.actor.longRest(),\r\n icon: \"fas fa-bed\",\r\n },\r\n {\r\n label: \"DND5E.ShortRest\",\r\n onClick: (event) => this.actor.shortRest(),\r\n icon: \"fas fa-coffee\",\r\n },\r\n ];\r\n }\r\n }\r\n\r\n class DND5eWeaponSets extends ARGON.WeaponSets {\r\n async getDefaultSets() {\r\n const sets = await super.getDefaultSets();\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n if (this.actor.type !== \"npc\" && !isTransformed) return sets;\r\n const actions = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"action\");\r\n const bonus = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"bonus\");\r\n return {\r\n 1: {\r\n primary: actions[0]?.uuid ?? null,\r\n secondary: bonus[0]?.uuid ?? null,\r\n },\r\n 2: {\r\n primary: actions[1]?.uuid ?? null,\r\n secondary: bonus[1]?.uuid ?? null,\r\n },\r\n 3: {\r\n primary: actions[2]?.uuid ?? null,\r\n secondary: bonus[2]?.uuid ?? null,\r\n },\r\n };\r\n }\r\n\r\n async _getSets() {\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n\r\n const sets = isTransformed ? await this.getDefaultSets() : foundry.utils.mergeObject(await this.getDefaultSets(), foundry.utils.deepClone(this.actor.getFlag(\"enhancedcombathud\", \"weaponSets\") || {}));\r\n\r\n for (const [set, slots] of Object.entries(sets)) {\r\n slots.primary = slots.primary ? await fromUuid(slots.primary) : null;\r\n slots.secondary = slots.secondary ? await fromUuid(slots.secondary) : null;\r\n }\r\n return sets;\r\n }\r\n\r\n async _onSetChange({ sets, active }) {\r\n const switchEquip = game.settings.get(\"enhancedcombathud-dnd5e\", \"switchEquip\");\r\n if (!switchEquip) return;\r\n const updates = [];\r\n const activeSet = sets[active];\r\n const activeItems = Object.values(activeSet).filter((item) => item);\r\n const inactiveSets = Object.values(sets).filter((set) => set !== activeSet);\r\n const inactiveItems = inactiveSets\r\n .flatMap((set) => Object.values(set))\r\n .filter((item) => item)\r\n .filter((item) => !activeItems.includes(item));\r\n activeItems.forEach((item) => {\r\n if (!item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": true });\r\n });\r\n inactiveItems.forEach((item) => {\r\n if (item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": false });\r\n });\r\n return await this.actor.updateEmbeddedDocuments(\"Item\", updates);\r\n }\r\n }\r\n\r\n const enableMacroPanel = game.settings.get(MODULE_ID, \"macroPanel\");\r\n\r\n const mainPanels = [DND5eActionActionPanel, DND5eBonusActionPanel, DND5eReactionActionPanel, DND5eFreeActionPanel, DND5eLegActionPanel, DND5eLairActionPanel, DND5eMythicActionPanel];\r\n if (enableMacroPanel) mainPanels.push(ARGON.PREFAB.MacroPanel);\r\n mainPanels.push(ARGON.PREFAB.PassTurnPanel);\r\n\r\n CoreHUD.definePortraitPanel(DND5ePortraitPanel);\r\n CoreHUD.defineDrawerPanel(DND5eDrawerPanel);\r\n CoreHUD.defineMainPanels(mainPanels);\r\n CoreHUD.defineMovementHud(DND5eMovementHud);\r\n CoreHUD.defineButtonHud(DND5eButtonHud);\r\n CoreHUD.defineWeaponSets(DND5eWeaponSets);\r\n CoreHUD.defineSupportedActorTypes([\"character\", \"npc\"]);\r\n });\r\n}\r\n\r\nfunction registerItems() {\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/journey.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"turn\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n },\r\n sort: 0,\r\n flags: {\r\n core: {\r\n sourceId: \"Item.wyQkeuZkttllAFB1\",\r\n },\r\n\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/armor-upgrade.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"round\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/clockwork.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/cloak-dagger.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n recharge: {\r\n value: null,\r\n charged: false,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/walking-boot.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/shield-bash.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: 1,\r\n width: null,\r\n units: \"\",\r\n type: \"creature\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"touch\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n}\r\n","import { MODULE_ID } from \"./main.js\";\r\n\r\nexport function registerSettings() {\r\n const settings = {\r\n showWeaponsItems: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.itemTypes.consumable = ui.ARGON.constructor.DND5E.itemTypes.consumable.filter(i => i !== \"weapon\");\r\n if(sett) ui.ARGON.constructor.DND5E.itemTypes.consumable.push(\"weapon\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n showClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.mainBarFeatures = ui.ARGON.constructor.DND5E.mainBarFeatures.filter(i => i !== \"class\");\r\n if(sett) ui.ARGON.constructor.DND5E.mainBarFeatures.push(\"class\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n condenseClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n macroPanel: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n requiresReload: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n switchEquip: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n showSpecialActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n };\r\n\r\n registerSettingsArray(settings);\r\n}\r\n\r\nexport function getSetting(key) {\r\n return game.settings.get(MODULE_ID, key);\r\n}\r\n\r\nexport async function setSetting(key, value) {\r\n return await game.settings.set(MODULE_ID, key, value);\r\n}\r\n\r\nfunction registerSettingsArray(settings) {\r\n for(const [key, value] of Object.entries(settings)) {\r\n game.settings.register(MODULE_ID, key, value);\r\n }\r\n}","import {initConfig} from \"./config.js\";\r\nimport { registerSettings } from \"./settings.js\";\r\n\r\nexport const MODULE_ID = \"enhancedcombathud-dnd5e\";\r\n\r\nHooks.on(\"setup\", () => {\r\n registerSettings();\r\n initConfig();\r\n});"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_regeneratorRuntime","Op","hasOwn","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_toPrimitive","input","hint","prim","toPrimitive","res","String","Number","_createClass","protoProps","staticProps","_inherits","subClass","superClass","_setPrototypeOf","p","bind","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","e","_createSuperInternal","Super","_getPrototypeOf","NewTarget","arguments","apply","_possibleConstructorReturn","_assertThisInitialized","ReferenceError","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","ECHItems","initConfig","Hooks","on","CoreHUD","_game$modules$get","game","system","id","registerItems","i18n","localize","img","subtype","description","chat","unidentified","source","quantity","weight","price","attuned","attunement","equipped","rarity","identified","activation","cost","condition","duration","units","width","range","long","consume","amount","ability","actionType","attackBonus","chatFlavor","critical","damage","parts","versatile","formula","save","dc","scaling","sort","flags","core","sourceId","onUseMacroName","consumableType","recharge","charged","ARGON","isMIDI","modules","active","getMidiFlag","_ui$ARGON$_actor$getF","_flag$actionType","ui","_actor","getFlag","getActivationType","item","_item$system","_Array$from$","activities","Array","from","getActionType","_item$system2","_Array$from$2","actionTypes","action","bonus","reaction","free","itemTypes","spell","feat","consumable","mainBarFeatures","settings","MODULE_ID","DND5E","callAll","DND5ePortraitPanel","_ARGON$PORTRAIT$Portr","_getStatBlocks","_onDeathSave2","_super","_len","_key","concat","_this$actor","this","actor","isPC","_CONFIG$DND5E$creatur","_CONFIG$DND5E$creatur2","creatureType","CONFIG","creatureTypes","details","label","custom","cr","classes","map","c","join","level","race","isDying","attributes","hp","_this$actor$system$at","_this$actor$system$at2","death","success","_this$actor$system$at3","_this$actor$system$at4","failure","_callee","event","_callee$","_context","rollDeathSave","_onDeathSave","_x3","_callee2","_this$actor$system$at5","_this$actor$system$at6","HPText","ACText","SpellDC","hpColor","tempMax","hpMaxColor","_callee2$","_context2","split","word","toUpperCase","replace","trim","temp","tempmax","text","color","max","ac","spelldc","getStatBlocks","PORTRAIT","PortraitPanel","DND5eDrawerButton","_ARGON$DRAWER$DrawerB","_getTooltipData","_super2","buttons","_this","TooltipManager","TOOLTIP_DIRECTIONS","RIGHT","_callee3","tooltipData","_callee3$","_context3","getTooltipDetails","getTooltipData","DRAWER","DrawerButton","DND5eDrawerPanel","_ARGON$DRAWER$DrawerP","_super3","_len2","_key2","_this2","abilities","skills","tools","tool","addSign","gridCols","captions","align","abilityData","onClick","rollAbility","mod","checkBonus","rollAbilityTest","rollAbilitySave","skill","skillData","getProficiencyIcon","proficient","rollSkill","total","passive","style","rollToolCheck","abilityMod","proficiencyMultiplier","prof","DrawerPanel","DND5eActionActionPanel","_ARGON$MAIN$ActionPan","_getButtons2","_super4","_len3","_key3","_this$actor2","inCombat","_getMidiFlag","isActionUsed","_onNewRound","combat","updateActionUse","_callee4","spellItems","featItems","consumableItems","spellButton","specialActions","showSpecialActions","barItems","_callee4$","_context4","items","filter","_item$system$type","includes","_item$system$type2","_item$system$type3","DND5eButtonPanelButton","button","hasContents","DND5eItemButton","isWeaponSet","isPrimary","MAIN","BUTTONS","SplitButton","DND5eSpecialActionButton","_toConsumableArray","_item$system$type4","condenseItemButtons","_getButtons","ActionPanel","DND5eBonusActionPanel","_ARGON$MAIN$ActionPan2","_getButtons3","_super5","_len4","_key4","_this$actor3","_getMidiFlag2","_callee5","_loop","_i","_Object$entries","_this3","_callee5$","_context6","_Object$entries$_i","types","_loop$","_context5","_slicedToArray","_item$system$type5","entries","t0","_item$system$type6","DND5eReactionActionPanel","_ARGON$MAIN$ActionPan3","_getButtons4","_super6","_len5","_key5","_this$actor4","_getMidiFlag3","_callee6","_loop2","_i2","_Object$entries2","_this4","_callee6$","_context8","_Object$entries2$_i","_loop2$","_context7","_item$system$type7","_item$system$type8","DND5eFreeActionPanel","_ARGON$MAIN$ActionPan4","_getButtons5","_super7","_len6","_key6","_this$actor5","_callee7","_loop3","_i3","_Object$entries3","_this5","_callee7$","_context10","_Object$entries3$_i","_loop3$","_context9","_item$system$type9","_item$system$type10","DND5eLegActionPanel","_ARGON$MAIN$ActionPan5","_getButtons6","_super8","_len7","_key7","_this$actor6","_this$actor$system$re","_this$actor$system$re2","resources","legact","_this$actor$system$re3","_this$actor$system$re4","_callee8","_callee8$","_context11","inActionPanel","DND5eLairActionPanel","_ARGON$MAIN$ActionPan6","_getButtons7","_super9","_len8","_key8","_this$actor7","_this$actor$system$re5","lair","_callee9","_callee9$","_context12","DND5eMythicActionPanel","_ARGON$MAIN$ActionPan7","_getButtons8","_super10","_len9","_key9","_callee10","_callee10$","_context13","_ARGON$MAIN$BUTTONS$I","_render","_onRightClick2","_onLeftClick2","_getTooltipData2","_super11","_len10","_key10","_this$item","_canvas","_item$range$value","_item$range","_item$range$long","_item$range2","activity","touchRange","canvas","scene","grid","distance","normal","_item$target$affects","_item$target","_item$target2","_affects$count","affects","targetType","template","count","_this$activity","_this$activity2","_isWeaponSet","_get","isReaction","parent","isMelee","_isPrimary","_callee11","_callee11$","_context14","propertiesLabel","_callee12","_callee12$","_context15","interceptNextDialog","currentTarget","use","consumeActionEconomy","_onLeftClick","_x4","_callee13","_this$activity3","_callee13$","_context16","sheet","render","_onRightClick","_x5","_callee14","_get2","_len11","_key11","weapons","_this6","_args17","_callee14$","_context17","_item$consume","updateItemButtons","_this$activity$consum","_this$activity$uses$v","_this$activity$uses","consumeType","_ammoItem$quantity","ammoItem","Math","floor","getProperty","_chargesItem$uses$val","_chargesItem$uses","chargesItem","uses","per","_game$combat","activationType","_i4","_Object$entries4","_Object$entries4$_i","combatant","components","main","ItemButton","_ARGON$MAIN$BUTTONS$B","_getPanel2","_super12","_ref","_this7","itemsWithSpells","_spells","prePrepareSpells","preparedFlag","some","className","_game$modules$get2","_this8","spellLevels","itemsToIgnore","_this$items$0$system$","_step","IWSAPI","api","_iterator","_createForOfIteratorHelper","_item$flags$itemsWit","_loop4","itemsInSpell","isUsableItem","_item$system$uses","_item$system$uses2","s","n","f","showPreparedOnly","allowIfNotPrepared","preparation","mode","prepared","spells","Infinity","pact","_loop5","_Object$entries5$_i","_Object$entries5","_i5","levelSpells","_callee15","_callee15$","_context18","BUTTON_PANELS","ACCORDION","AccordionPanel","accordionPanelCategories","_ref2","AccordionPanelCategory","ButtonPanel","_getPanel","ButtonPanelButton","_ARGON$MAIN$BUTTONS$A","_onLeftClick3","_getTooltipData3","_super13","specialItem","_this9","actorItem","getName","Item","documentClass","_callee16","_callee16$","_context19","_callee17","_game$modules$get3","useCE","_callee17$","_context20","dfreds","effectInterface","findEffect","effectName","toggleEffect","overlay","uuids","uuid","_x6","ActionButton","DND5eMovementHud","_ARGON$MovementHud","_super14","_game$modules$get4","_this10","_len12","_key12","getMovementMode","_game$combat2","started","token","movement","movementMode","dimensions","MovementHud","DND5eButtonHud","_ARGON$ButtonHud","_getButtons9","_super15","_len13","_key13","_game$combat3","_callee18","_this11","_callee18$","_context21","longRest","icon","shortRest","ButtonHud","DND5eWeaponSets","_ARGON$WeaponSets","_onSetChange2","_getSets2","_getDefaultSets","_super16","_callee19","_this$actor$flags","_actions$0$uuid","_actions$","_bonus$0$uuid","_bonus$","_actions$1$uuid","_actions$2","_bonus$1$uuid","_bonus$2","_actions$2$uuid","_actions$3","_bonus$2$uuid","_bonus$3","sets","isTransformed","actions","_callee19$","_context22","dnd5e","isPolymorphed","primary","secondary","getDefaultSets","_callee20","_this$actor$flags2","_i6","_Object$entries6","_Object$entries6$_i","slots","_callee20$","_context23","t1","foundry","utils","t2","t3","deepClone","mergeObject","fromUuid","t4","t5","_getSets","_callee21","_ref3","updates","activeSet","activeItems","inactiveSets","inactiveItems","_callee21$","_context24","set","flatMap","_item$system3","_id","_item$system4","updateEmbeddedDocuments","_onSetChange","_x7","WeaponSets","enableMacroPanel","mainPanels","PREFAB","MacroPanel","PassTurnPanel","definePortraitPanel","defineDrawerPanel","defineMainPanels","defineMovementHud","defineButtonHud","defineWeaponSets","defineSupportedActorTypes","_x","_x2","_getTooltipDetails","_callee22","_item$labels4","_item$labels5","_damageTypes","_properties","title","itemType","subtitle","dt","damageTypes","properties","materialComponents","_item$system$descript","_item$labels","_item$labels2","_item$labels3","_i7","_Object$entries7","_Object$entries7$_i","_iterator2","_step2","comp","dmgString","tooltipProperties","_callee22$","_context25","labels","weaponTypes","weaponType","itemActionTypes","weaponProperties","school","spellSchools","all","abbr","materials","consumableTypes","requirements","TextEditor","enrichHTML","toHit","derivedDamage","dDmg","getDamageTypeIcon","damageType","d","_p$label","footerText","toLowerCase","proficiency","condensedItems","barItemsLength","barItemsMultipleOfTwo","currentSplitButtonItemButton","isCondensedButton","arr","_arrayWithHoles","isArray","_iterableToArrayLimit","_s","_e","_r","_arr","_n","_d","_unsupportedIterableToArray","minLen","_arrayLikeToArray","toString","test","_nonIterableRest","len","arr2","registerSettings","registerSettingsArray","register","showWeaponsItems","scope","config","default","onChange","sett","refresh","showClassActions","condenseClassActions","macroPanel","requiresReload","switchEquip"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"./index.js","mappings":";mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,8+FCClFI,oBAAA,SAAAA,sBAAA,OAAAb,CAAA,MAAAA,EAAA,GAAAc,EAAAV,OAAAM,UAAAK,EAAAD,EAAAH,eAAAN,EAAAD,OAAAC,gBAAA,SAAAG,EAAAN,EAAAc,GAAAR,EAAAN,GAAAc,EAAAC,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,OAAAlB,EAAAN,EAAAe,GAAA,OAAAb,OAAAC,eAAAG,EAAAN,EAAA,CAAAe,MAAAA,EAAAX,YAAA,EAAAqB,cAAA,EAAAC,UAAA,IAAApB,EAAAN,EAAA,KAAAwB,OAAA,aAAAG,GAAAH,OAAA,SAAAA,OAAAlB,EAAAN,EA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KI,KAAKC,SAAS,4DACzBgtB,MAAO,QACPC,QAAQ,EACRl3B,KAAMoI,QACN+uB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAM/pB,GAAGP,MAAMwqB,SAAS,IAK9C,CCnEO,IAAMzoB,EAAY,0BAEzBrF,MAAMC,GAAG,SAAS,WACdotB,mBACAttB,YACJ","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./scripts/config.js","webpack:///./scripts/settings.js","webpack:///./scripts/main.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { MODULE_ID } from \"./main.js\";\r\n\r\nconst ECHItems = {};\r\n\r\nexport function initConfig() {\r\n Hooks.on(\"argonInit\", (CoreHUD) => {\r\n if (game.system.id !== \"dnd5e\") return;\r\n registerItems();\r\n const ARGON = CoreHUD.ARGON;\r\n\r\n const isMIDI = game.modules.get(\"midi-qol\")?.active;\r\n const getMidiFlag = (actionType) => {\r\n if (!isMIDI || !ui.ARGON._actor) return null;\r\n const flag = ui.ARGON._actor.getFlag(\"midi-qol\", \"actions\") ?? {};\r\n const value = flag[actionType] ?? false;\r\n const midiAction = value ? 0 : 1;\r\n return midiAction;\r\n };\r\n\r\n const getActivationType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.activation?.type;\r\n };\r\n\r\n const getActionType = (item) => {\r\n if (!item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(item.system.activities)[0]?.actionType;\r\n };\r\n\r\n const actionTypes = {\r\n action: [\"action\"],\r\n bonus: [\"bonus\"],\r\n reaction: [\"reaction\", \"reactiondamage\", \"reactionmanual\"],\r\n free: [\"special\"],\r\n };\r\n\r\n const itemTypes = {\r\n spell: [\"spell\"],\r\n feat: [\"feat\"],\r\n consumable: [\"consumable\", \"equipment\", \"loot\"],\r\n };\r\n\r\n const mainBarFeatures = [];\r\n\r\n if (game.settings.get(MODULE_ID, \"showWeaponsItems\")) itemTypes.consumable.push(\"weapon\");\r\n if (game.settings.get(MODULE_ID, \"showClassActions\")) mainBarFeatures.push(\"class\");\r\n\r\n CoreHUD.DND5E = {\r\n actionTypes,\r\n itemTypes,\r\n mainBarFeatures,\r\n ECHItems,\r\n };\r\n\r\n Hooks.callAll(\"enhanced-combat-hud.dnd5e.initConfig\", { actionTypes, itemTypes, ECHItems });\r\n\r\n async function getTooltipDetails(item, type) {\r\n let title, description, itemType, subtitle, target, range, dt;\r\n let damageTypes = [];\r\n let properties = [];\r\n let materialComponents = \"\";\r\n\r\n if (type == \"skill\") {\r\n title = CONFIG.DND5E.skills[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.skills.${item}.tooltip`);\r\n } else if (type == \"save\") {\r\n title = CONFIG.DND5E.abilities[item].label;\r\n description = game.i18n.localize(`enhancedcombathud-dnd5e.abilities.${item}.tooltip`);\r\n } else {\r\n if (!item || !item.system) return;\r\n\r\n title = item.name;\r\n description = item.system.identified ? item.system.description.value : item.system.description.unidentified ?? item.system.description.value;\r\n itemType = item.type;\r\n target = item.labels?.target || \"-\";\r\n range = item.labels?.range || \"-\";\r\n properties = [];\r\n dt = item.labels?.damageTypes?.split(\", \");\r\n damageTypes = dt && dt.length ? dt : [];\r\n materialComponents = \"\";\r\n\r\n switch (itemType) {\r\n case \"weapon\":\r\n subtitle = CONFIG.DND5E.weaponTypes[item.system.weaponType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n for (let [key, value] of Object.entries(item.system.properties)) {\r\n let prop = value && CONFIG.DND5E.weaponProperties[key] ? CONFIG.DND5E.weaponProperties[key] : undefined;\r\n if (prop) properties.push(prop);\r\n }\r\n break;\r\n case \"spell\":\r\n subtitle = `${item.labels.level} ${item.labels.school}`;\r\n properties.push(CONFIG.DND5E.spellSchools[item.system.school]);\r\n properties.push(item.labels.duration);\r\n properties.push(item.labels.save);\r\n for (let comp of item.labels.components.all) {\r\n properties.push(comp.abbr);\r\n }\r\n if (item.labels.materials) materialComponents = item.labels.materials;\r\n break;\r\n case \"consumable\":\r\n subtitle = CONFIG.DND5E.consumableTypes[item.system.consumableType];\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n case \"feat\":\r\n subtitle = item.system.requirements;\r\n properties.push(CONFIG.DND5E.itemActionTypes[getActionType(item)]);\r\n break;\r\n }\r\n }\r\n\r\n if (description) description = await TextEditor.enrichHTML(description, { async: true });\r\n let details = [];\r\n if (target || range) {\r\n details = [\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.target.name\",\r\n value: target,\r\n },\r\n {\r\n label: \"enhancedcombathud-dnd5e.tooltip.range.name\",\r\n value: range,\r\n },\r\n ];\r\n }\r\n if (item?.labels?.toHit) {\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.toHit.name\",\r\n value: item.labels.toHit,\r\n });\r\n }\r\n if (item?.labels?.derivedDamage?.length) {\r\n let dmgString = \"\";\r\n item.labels.derivedDamage.forEach((dDmg) => {\r\n dmgString += dDmg.formula + \" \" + getDamageTypeIcon(dDmg.damageType) + \" \";\r\n });\r\n details.push({\r\n label: \"enhancedcombathud-dnd5e.tooltip.damage.name\",\r\n value: dmgString,\r\n });\r\n }\r\n\r\n const tooltipProperties = [];\r\n if (damageTypes?.length) damageTypes.forEach((d) => tooltipProperties.push({ label: d, primary: true }));\r\n if (properties?.length) properties.forEach((p) => tooltipProperties.push({ label: p?.label ?? p, secondary: true }));\r\n return { title, description, subtitle, details, properties: tooltipProperties, footerText: materialComponents };\r\n }\r\n\r\n function getDamageTypeIcon(damageType) {\r\n switch (damageType.toLowerCase()) {\r\n case \"acid\":\r\n return '';\r\n case \"bludgeoning\":\r\n return '';\r\n case \"cold\":\r\n return '';\r\n case \"fire\":\r\n return '';\r\n case \"force\":\r\n return '';\r\n case \"lightning\":\r\n return '';\r\n case \"necrotic\":\r\n return '';\r\n case \"piercing\":\r\n return '';\r\n case \"poison\":\r\n return '';\r\n case \"psychic\":\r\n return '';\r\n case \"radiant\":\r\n return '';\r\n case \"slashing\":\r\n return '';\r\n case \"thunder\":\r\n return '';\r\n case \"healing\":\r\n return '';\r\n default:\r\n return \"\";\r\n }\r\n }\r\n\r\n function getProficiencyIcon(proficiency) {\r\n if (proficiency == 0) return ' ';\r\n else if (proficiency == 1) return ' ';\r\n else if (proficiency == 2) return ' ';\r\n else if (proficiency == 0.5) return ' ';\r\n else return ' ';\r\n }\r\n\r\n function condenseItemButtons(items) {\r\n const condenseClassActions = game.settings.get(MODULE_ID, \"condenseClassActions\");\r\n if (!condenseClassActions) return items.map((item) => new DND5eItemButton({ item, inActionPanel: true }));\r\n const condensedItems = [];\r\n const barItemsLength = items.length;\r\n const barItemsMultipleOfTwo = barItemsLength - (barItemsLength % 2);\r\n let currentSplitButtonItemButton = null;\r\n for (let i = 0; i < barItemsLength; i++) {\r\n const isCondensedButton = i < barItemsMultipleOfTwo;\r\n const item = items[i];\r\n if (isCondensedButton) {\r\n if (currentSplitButtonItemButton) {\r\n const button = new DND5eItemButton({ item, inActionPanel: false });\r\n condensedItems.push(new ARGON.MAIN.BUTTONS.SplitButton(currentSplitButtonItemButton, button));\r\n currentSplitButtonItemButton = null;\r\n } else {\r\n currentSplitButtonItemButton = new DND5eItemButton({ item, inActionPanel: false });\r\n }\r\n } else {\r\n condensedItems.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n }\r\n }\r\n return condensedItems;\r\n }\r\n\r\n class DND5ePortraitPanel extends ARGON.PORTRAIT.PortraitPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get description() {\r\n const { type, system } = this.actor;\r\n const actor = this.actor;\r\n const isNPC = type === \"npc\";\r\n const isPC = type === \"character\";\r\n if (isNPC) {\r\n const creatureType = game.i18n.localize(CONFIG.DND5E.creatureTypes[actor.system.details.type.value]?.label ?? actor.system.details.type.custom);\r\n const cr = system.details.cr >= 1 || system.details.cr <= 0 ? system.details.cr : `1/${1 / system.details.cr}`;\r\n return `CR ${cr} ${creatureType}`;\r\n } else if (isPC) {\r\n const classes = Object.values(actor.classes)\r\n .map((c) => c.name)\r\n .join(\" / \");\r\n return `Level ${system.details.level} ${classes} (${system.details.race})`;\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n get isDead() {\r\n return this.isDying && this.actor.type !== \"character\";\r\n }\r\n\r\n get isDying() {\r\n return this.actor.system.attributes.hp.value <= 0;\r\n }\r\n\r\n get successes() {\r\n return this.actor.system.attributes?.death?.success ?? 0;\r\n }\r\n\r\n get failures() {\r\n return this.actor.system.attributes?.death?.failure ?? 0;\r\n }\r\n\r\n get configurationTemplate() {\r\n return \"modules/enhancedcombathud-dnd5e/templates/argon-actor-config.hbs\";\r\n }\r\n\r\n async _onDeathSave(event) {\r\n this.actor.rollDeathSave({});\r\n }\r\n\r\n async getStatBlocks() {\r\n const HPText = game.i18n\r\n .localize(\"DND5E.HitPoints\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const ACText = game.i18n\r\n .localize(\"DND5E.ArmorClass\")\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase())\r\n .join(\"\");\r\n const SpellDC = game.i18n.localize(\"DND5E.SaveDC\").replace(\"{ability}\", \"\").replace(\"{dc}\", \"\").trim();\r\n\r\n const hpColor = this.actor.system.attributes.hp.temp ? \"#6698f3\" : \"rgb(0 255 170)\";\r\n const tempMax = this.actor.system.attributes.hp.tempmax;\r\n const hpMaxColor = tempMax ? (tempMax > 0 ? \"rgb(222 91 255)\" : \"#ffb000\") : \"rgb(255 255 255)\";\r\n\r\n return [\r\n [\r\n {\r\n text: `${this.actor.system.attributes.hp.value + (this.actor.system.attributes.hp.temp ?? 0)}`,\r\n color: hpColor,\r\n },\r\n {\r\n text: `/`,\r\n },\r\n {\r\n text: `${this.actor.system.attributes.hp.max + (this.actor.system.attributes.hp.tempmax ?? 0)}`,\r\n color: hpMaxColor,\r\n },\r\n {\r\n text: HPText,\r\n },\r\n ],\r\n [\r\n {\r\n text: ACText,\r\n },\r\n {\r\n text: this.actor.system.attributes.ac.value,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n [\r\n {\r\n text: SpellDC,\r\n },\r\n {\r\n text: this.actor.system.attributes.spelldc,\r\n color: \"var(--ech-movement-baseMovement-background)\",\r\n },\r\n ],\r\n ];\r\n }\r\n }\r\n\r\n class DND5eDrawerButton extends ARGON.DRAWER.DrawerButton {\r\n constructor(buttons, item, type) {\r\n super(buttons);\r\n this.item = item;\r\n this.type = type;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get tooltipOrientation() {\r\n return TooltipManager.TOOLTIP_DIRECTIONS.RIGHT;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item, this.type);\r\n return tooltipData;\r\n }\r\n }\r\n\r\n class DND5eDrawerPanel extends ARGON.DRAWER.DrawerPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get categories() {\r\n const abilities = this.actor.system.abilities;\r\n const skills = this.actor.system.skills;\r\n const tools = this.actor.itemTypes.tool;\r\n\r\n const addSign = (value) => {\r\n if (value >= 0) return `+${value}`;\r\n return value;\r\n };\r\n\r\n const abilitiesButtons = Object.keys(abilities).map((ability) => {\r\n const abilityData = abilities[ability];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: CONFIG.DND5E.abilities[ability].label,\r\n onClick: (event) => this.actor.rollAbility(ability, { event }),\r\n },\r\n {\r\n label: addSign(abilityData.mod + (abilityData.checkBonus || 0)),\r\n onClick: (event) => this.actor.rollAbilityTest(ability, { event }),\r\n },\r\n {\r\n label: addSign(abilityData.save),\r\n onClick: (event) => this.actor.rollAbilitySave(ability, { event }),\r\n },\r\n ],\r\n ability,\r\n \"save\",\r\n );\r\n });\r\n\r\n const skillsButtons = Object.keys(skills).map((skill) => {\r\n const skillData = skills[skill];\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(skillData.proficient) + CONFIG.DND5E.skills[skill].label,\r\n onClick: (event) => this.actor.rollSkill(skill, { event }),\r\n },\r\n {\r\n label: `${addSign(skillData.total)}(${skillData.passive})`,\r\n style: \"display: flex; justify-content: flex-end;\",\r\n },\r\n ],\r\n skill,\r\n \"skill\",\r\n );\r\n });\r\n\r\n const toolButtons = tools.map((tool) => {\r\n return new DND5eDrawerButton(\r\n [\r\n {\r\n label: getProficiencyIcon(tool.system.proficient) + tool.name,\r\n onClick: (event) => tool.rollToolCheck({ event }),\r\n },\r\n {\r\n label: addSign(abilities[tool.abilityMod].mod + tool.system.proficiencyMultiplier * this.actor.system.attributes.prof),\r\n },\r\n ],\r\n tool,\r\n );\r\n });\r\n\r\n return [\r\n {\r\n gridCols: \"5fr 2fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Abilities\",\r\n align: \"left\",\r\n },\r\n {\r\n label: \"Check\",\r\n align: \"center\",\r\n },\r\n {\r\n label: \"Save\",\r\n align: \"center\",\r\n },\r\n ],\r\n align: [\"left\", \"center\", \"center\"],\r\n buttons: abilitiesButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Skills\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: skillsButtons,\r\n },\r\n {\r\n gridCols: \"7fr 2fr\",\r\n captions: [\r\n {\r\n label: \"Tools\",\r\n },\r\n {\r\n label: \"\",\r\n },\r\n ],\r\n buttons: toolButtons,\r\n },\r\n ];\r\n }\r\n\r\n get title() {\r\n return `${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.saves.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.skills.name\")} / ${game.i18n.localize(\"enhancedcombathud-dnd5e.hud.tools.name\")}`;\r\n }\r\n }\r\n\r\n class DND5eActionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Action\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"action\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const spellItems = this.actor.items.filter((item) => itemTypes.spell.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const featItems = this.actor.items.filter((item) => itemTypes.feat.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n const consumableItems = this.actor.items.filter((item) => itemTypes.consumable.includes(item.type) && actionTypes.action.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n\r\n const spellButton = !spellItems.length ? [] : [new DND5eButtonPanelButton({ type: \"spell\", items: spellItems, color: 0 })].filter((button) => button.hasContents);\r\n\r\n const specialActions = Object.values(ECHItems);\r\n\r\n const showSpecialActions = game.settings.get(MODULE_ID, \"showSpecialActions\");\r\n const buttons = [];\r\n if (showSpecialActions) {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[0]), new DND5eSpecialActionButton(specialActions[1])), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[2]), new DND5eSpecialActionButton(specialActions[3])), new ARGON.MAIN.BUTTONS.SplitButton(new DND5eSpecialActionButton(specialActions[4]), new DND5eSpecialActionButton(specialActions[5])), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n } else {\r\n buttons.push(...[new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true }), ...spellButton, new DND5eButtonPanelButton({ type: \"feat\", items: featItems, color: 0 }), new DND5eButtonPanelButton({ type: \"consumable\", items: consumableItems, color: 0 })]);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.action.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons.filter((button) => button.hasContents || button.items == undefined || button.items.length);\r\n }\r\n }\r\n\r\n class DND5eBonusActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.BonusAction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"bonus\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: false })];\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.bonus.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 1 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.bonus.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eReactionActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Reaction\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return getMidiFlag(\"reaction\") ?? (this.isActionUsed ? 0 : 1);\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [new DND5eItemButton({ item: null, isWeaponSet: true, isPrimary: true })];\r\n //buttons.push(new DND5eEquipmentButton({slot: 1}));\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.reaction.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 3 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.reaction.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eFreeActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.Special\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.isActionUsed ? 0 : 1;\r\n }\r\n\r\n _onNewRound(combat) {\r\n this.isActionUsed = false;\r\n this.updateActionUse();\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n\r\n for (const [type, types] of Object.entries(itemTypes)) {\r\n const items = this.actor.items.filter((item) => types.includes(item.type) && actionTypes.free.includes(getActivationType(item)) && !CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value));\r\n if (!items.length) continue;\r\n const button = new DND5eButtonPanelButton({ type, items, color: 2 });\r\n if (button.hasContents) buttons.push(button);\r\n }\r\n\r\n const barItems = this.actor.items.filter((item) => CoreHUD.DND5E.mainBarFeatures.includes(item.system.type?.value) && actionTypes.free.includes(getActivationType(item)));\r\n buttons.push(...condenseItemButtons(barItems));\r\n\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLegActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LegendaryActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? this.actor.system.resources?.legact?.max ?? null : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources?.legact?.value ?? null;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const legendary = this.actor.items.filter((item) => getActivationType(item) === \"legendary\");\r\n legendary.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eLairActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.LairActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return this.actor.system.resources.lair?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const lair = this.actor.items.filter((item) => getActivationType(item) === \"lair\");\r\n lair.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eMythicActionPanel extends ARGON.MAIN.ActionPanel {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get label() {\r\n return \"DND5E.MythicActionLabel\";\r\n }\r\n\r\n get maxActions() {\r\n return null; //this.actor?.inCombat ? 1 : null;\r\n }\r\n\r\n get currentActions() {\r\n return null; //this.actor.system.resources.mythic?.value * 1;\r\n }\r\n\r\n async _getButtons() {\r\n const buttons = [];\r\n const mythic = this.actor.items.filter((item) => getActivationType(item) === \"mythic\");\r\n mythic.forEach((item) => {\r\n buttons.push(new DND5eItemButton({ item, inActionPanel: true }));\r\n });\r\n return buttons;\r\n }\r\n }\r\n\r\n class DND5eItemButton extends ARGON.MAIN.BUTTONS.ItemButton {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get ranges() {\r\n const item = this.activity;\r\n const touchRange = item.range.units == \"touch\" ? canvas?.scene?.grid?.distance : null;\r\n return {\r\n normal: item?.range?.value ?? touchRange,\r\n long: item?.range?.long ?? null,\r\n };\r\n }\r\n\r\n get targets() {\r\n const item = this.activity;\r\n const validTargets = [\"creature\", \"ally\", \"enemy\"];\r\n const actionType = item.actionType;\r\n const affects = item.target?.affects ?? {};\r\n const targetType = affects.type;\r\n if (!item.target?.template?.units && validTargets.includes(targetType)) {\r\n return affects.count ?? 1;\r\n } else if (actionType === \"mwak\" || actionType === \"rwak\") {\r\n return affects.count || 1;\r\n }\r\n return null;\r\n }\r\n\r\n get visible() {\r\n if (!this._isWeaponSet) return super.visible;\r\n const isReaction = this.parent instanceof DND5eReactionActionPanel;\r\n const isMelee = this.activity?.actionType === \"mwak\";\r\n if (isReaction && !isMelee) return false;\r\n if (this._isPrimary) return super.visible;\r\n if (this.activity?.type?.value === \"shield\") return false;\r\n return super.visible;\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n ui.ARGON.interceptNextDialog(event.currentTarget);\r\n const used = await this.activity.use({ event }, { event });\r\n if (used) {\r\n DND5eItemButton.consumeActionEconomy(this.activity);\r\n }\r\n }\r\n\r\n async _onRightClick(event) {\r\n this.activity?.sheet?.render(true);\r\n }\r\n\r\n static consumeActionEconomy(item) {\r\n const activationType = getActivationType(item);\r\n let actionType = null;\r\n for (const [type, types] of Object.entries(actionTypes)) {\r\n if (types.includes(activationType)) actionType = type;\r\n }\r\n if (!actionType) return;\r\n if (game.combat?.combatant?.actor !== item.parent) actionType = \"reaction\";\r\n if (actionType === \"action\") {\r\n ui.ARGON.components.main[0].isActionUsed = true;\r\n ui.ARGON.components.main[0].updateActionUse();\r\n } else if (actionType === \"bonus\") {\r\n ui.ARGON.components.main[1].isActionUsed = true;\r\n ui.ARGON.components.main[1].updateActionUse();\r\n } else if (actionType === \"reaction\") {\r\n ui.ARGON.components.main[2].isActionUsed = true;\r\n ui.ARGON.components.main[2].updateActionUse();\r\n } else if (actionType === \"free\") {\r\n ui.ARGON.components.main[3].isActionUsed = true;\r\n ui.ARGON.components.main[3].updateActionUse();\r\n } else if (actionType === \"legendary\") {\r\n ui.ARGON.components.main[4].isActionUsed = true;\r\n }\r\n }\r\n\r\n async render(...args) {\r\n await super.render(...args);\r\n if (this.activity) {\r\n const weapons = this.actor.items.filter((item) => item.consume?.target === this.activity.id);\r\n ui.ARGON.updateItemButtons(weapons);\r\n }\r\n }\r\n\r\n get quantity() {\r\n if (!this.activity) return null;\r\n const showQuantityItemTypes = [\"consumable\"];\r\n const consumeType = this.activity.consume?.type;\r\n if (consumeType === \"ammo\") {\r\n const ammoItem = this.actor.items.get(this.activity.consume.target);\r\n if (!ammoItem) return null;\r\n return Math.floor((ammoItem.quantity ?? 0) / this.activity.consume.amount);\r\n } else if (consumeType === \"attribute\") {\r\n return Math.floor(getProperty(this.actor, this.activity.consume.target) / this.activity.consume.amount);\r\n } else if (consumeType === \"charges\") {\r\n const chargesItem = this.actor.items.get(this.activity.consume.target);\r\n if (!chargesItem) return null;\r\n return Math.floor((chargesItem.uses?.value ?? 0) / this.activity.consume.amount);\r\n } else if (showQuantityItemTypes.includes(this.activity.type)) {\r\n return this.activity.uses?.value ?? this.activity.quantity;\r\n } else if (this.activity.uses.value !== null && this.activity.uses.per !== null && this.activity.uses.max) {\r\n return this.activity.uses.value;\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n class DND5eButtonPanelButton extends ARGON.MAIN.BUTTONS.ButtonPanelButton {\r\n constructor({ type, items, color }) {\r\n super();\r\n this.type = type;\r\n this.items = items;\r\n this.color = color;\r\n this.itemsWithSpells = [];\r\n this._spells = this.prePrepareSpells();\r\n }\r\n\r\n get hasContents() {\r\n return this._spells ? !!this._spells.length || !!this.itemsWithSpells.length : !!this.items.length;\r\n }\r\n\r\n get colorScheme() {\r\n return this.color;\r\n }\r\n\r\n get id() {\r\n return `${this.type}-${this.color}`;\r\n }\r\n\r\n get label() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"enhancedcombathud-dnd5e.hud.castspell.name\";\r\n case \"feat\":\r\n return \"enhancedcombathud-dnd5e.hud.usepower.name\";\r\n case \"consumable\":\r\n return \"enhancedcombathud-dnd5e.hud.useitem.name\";\r\n }\r\n }\r\n\r\n get icon() {\r\n switch (this.type) {\r\n case \"spell\":\r\n return \"modules/enhancedcombathud/icons/spell-book.webp\";\r\n case \"feat\":\r\n return \"modules/enhancedcombathud/icons/mighty-force.webp\";\r\n case \"consumable\":\r\n return \"modules/enhancedcombathud/icons/drink-me.webp\";\r\n }\r\n }\r\n\r\n get showPreparedOnly() {\r\n if (this.actor.type !== \"character\") return false;\r\n const preparedFlag = this.actor.getFlag(MODULE_ID, \"showPrepared\");\r\n if (preparedFlag === \"all\") return false;\r\n if (preparedFlag === \"preparedOnly\") return true;\r\n const classes = Object.keys(this.actor.classes);\r\n const requiresPreparation = [\"cleric\", \"druid\", \"paladin\", \"wizard\", \"artificer\"].some((className) => classes.includes(className));\r\n return requiresPreparation;\r\n }\r\n\r\n prePrepareSpells() {\r\n if (this.type !== \"spell\") return;\r\n\r\n const spellLevels = CONFIG.DND5E.spellLevels;\r\n const itemsToIgnore = [];\r\n if (game.modules.get(\"items-with-spells-5e\")?.active) {\r\n const IWSAPI = game.modules.get(\"items-with-spells-5e\").api;\r\n const actionType = this.items[0].system.activation?.type;\r\n const spellItems = this.actor.items.filter((item) => item.flags[\"items-with-spells-5e\"]?.[\"item-spells\"]?.length);\r\n for (const item of spellItems) {\r\n const spellData = item.flags[\"items-with-spells-5e\"][\"item-spells\"];\r\n const itemsInSpell = spellData.map((spell) => this.actor.items.get(spell.id)).filter((item) => item && getActivationType(item) === actionType);\r\n if (!itemsInSpell.length) continue;\r\n itemsToIgnore.push(...itemsInSpell);\r\n if (!IWSAPI.isUsableItem(item)) continue;\r\n this.itemsWithSpells.push({\r\n label: item.name,\r\n buttons: itemsInSpell.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return { max: item.system.uses?.max, value: item.system.uses?.value };\r\n },\r\n });\r\n }\r\n this.items = this.items.filter((item) => !itemsToIgnore.includes(item));\r\n }\r\n if (this.showPreparedOnly) {\r\n const allowIfNotPrepared = [\"atwill\", \"innate\", \"pact\", \"always\"];\r\n this.items = this.items.filter((item) => {\r\n if (allowIfNotPrepared.includes(item.system.preparation.mode)) return true;\r\n if (item.system.level == 0) return true;\r\n return item.system.preparation.prepared;\r\n });\r\n }\r\n\r\n const spells = [\r\n ...this.itemsWithSpells,\r\n {\r\n label: \"DND5E.SpellPrepAtWill\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"atwill\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.SpellPrepInnate\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"innate\").map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: Object.values(spellLevels)[0],\r\n buttons: this.items.filter((item) => item.system.level == 0).map((item) => new DND5eItemButton({ item })),\r\n uses: { max: Infinity, value: Infinity },\r\n },\r\n {\r\n label: \"DND5E.PactMagic\",\r\n buttons: this.items.filter((item) => item.system.preparation.mode === \"pact\").map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells.pact;\r\n },\r\n },\r\n ];\r\n for (const [level, label] of Object.entries(spellLevels)) {\r\n const levelSpells = this.items.filter((item) => item.system.level == level && (item.system.preparation.mode === \"prepared\" || item.system.preparation.mode === \"always\"));\r\n if (!levelSpells.length || level == 0) continue;\r\n spells.push({\r\n label,\r\n buttons: levelSpells.map((item) => new DND5eItemButton({ item })),\r\n uses: () => {\r\n return this.actor.system.spells[`spell${level}`];\r\n },\r\n });\r\n }\r\n return spells.filter((spell) => spell.buttons.length);\r\n }\r\n\r\n async _getPanel() {\r\n if (this.type === \"spell\") {\r\n return new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanel({ id: this.id, accordionPanelCategories: this._spells.map(({ label, buttons, uses }) => new ARGON.MAIN.BUTTON_PANELS.ACCORDION.AccordionPanelCategory({ label, buttons, uses })) });\r\n } else {\r\n return new ARGON.MAIN.BUTTON_PANELS.ButtonPanel({ id: this.id, buttons: this.items.map((item) => new DND5eItemButton({ item })) });\r\n }\r\n }\r\n }\r\n\r\n class DND5eSpecialActionButton extends ARGON.MAIN.BUTTONS.ActionButton {\r\n constructor(specialItem) {\r\n super();\r\n const actorItem = this.actor.items.getName(specialItem.name);\r\n this.actorItem = actorItem;\r\n this.item =\r\n actorItem ??\r\n new CONFIG.Item.documentClass(specialItem, {\r\n parent: this.actor,\r\n });\r\n }\r\n\r\n get label() {\r\n return this.item.name;\r\n }\r\n\r\n get icon() {\r\n return this.item.img;\r\n }\r\n\r\n get hasTooltip() {\r\n return true;\r\n }\r\n\r\n get activity() {\r\n if (!this.item?.system?.activities) {\r\n return;\r\n }\r\n return Array.from(this.item.system.activities)[0];\r\n }\r\n\r\n async getTooltipData() {\r\n const tooltipData = await getTooltipDetails(this.item);\r\n tooltipData.propertiesLabel = \"enhancedcombathud-dnd5e.tooltip.properties.name\";\r\n return tooltipData;\r\n }\r\n\r\n async _onLeftClick(event) {\r\n const useCE = game.modules.get(\"dfreds-convenient-effects\")?.active && game.dfreds.effectInterface.findEffect({ effectName: this.label });\r\n let success = false;\r\n if (useCE) {\r\n success = true;\r\n await game.dfreds.effectInterface.toggleEffect({ effectName: this.label, overlay: false, uuids: [this.actor.uuid] });\r\n } else {\r\n success = this.actorItem ? await this.activity.use({ event }, { event }) : await this.createChatMessage();\r\n }\r\n if (success) {\r\n DND5eItemButton.consumeActionEconomy(this.item);\r\n }\r\n }\r\n\r\n async createChatMessage() {\r\n return await ChatMessage.create({\r\n user: game.user,\r\n speaker: {\r\n actor: this.actor,\r\n token: this.actor.token,\r\n alias: this.actor.name,\r\n },\r\n content: `\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n ${this.label}\r\n \r\n Feature\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n ${this.item.system.description.value}\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n `,\r\n });\r\n }\r\n }\r\n\r\n class DND5eMovementHud extends ARGON.MovementHud {\r\n constructor(...args) {\r\n super(...args);\r\n this.getMovementMode = game.modules.get(\"elevation-drag-ruler\")?.api?.getMovementMode;\r\n }\r\n\r\n get visible() {\r\n return game.combat?.started;\r\n }\r\n\r\n get movementMode() {\r\n return this.getMovementMode ? this.getMovementMode(this.token) : \"walk\";\r\n }\r\n\r\n get movementMax() {\r\n if (!this.actor) return 0;\r\n return this.actor.system.attributes.movement[this.movementMode] / canvas.scene.dimensions.distance;\r\n }\r\n }\r\n\r\n class DND5eButtonHud extends ARGON.ButtonHud {\r\n constructor(...args) {\r\n super(...args);\r\n }\r\n\r\n get visible() {\r\n return !game.combat?.started;\r\n }\r\n\r\n async _getButtons() {\r\n return [\r\n {\r\n label: \"DND5E.LongRest\",\r\n onClick: (event) => this.actor.longRest(),\r\n icon: \"fas fa-bed\",\r\n },\r\n {\r\n label: \"DND5E.ShortRest\",\r\n onClick: (event) => this.actor.shortRest(),\r\n icon: \"fas fa-coffee\",\r\n },\r\n ];\r\n }\r\n }\r\n\r\n class DND5eWeaponSets extends ARGON.WeaponSets {\r\n async getDefaultSets() {\r\n const sets = await super.getDefaultSets();\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n if (this.actor.type !== \"npc\" && !isTransformed) return sets;\r\n const actions = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"action\");\r\n const bonus = this.actor.items.filter((item) => item.type === \"weapon\" && getActivationType(item) === \"bonus\");\r\n return {\r\n 1: {\r\n primary: actions[0]?.uuid ?? null,\r\n secondary: bonus[0]?.uuid ?? null,\r\n },\r\n 2: {\r\n primary: actions[1]?.uuid ?? null,\r\n secondary: bonus[1]?.uuid ?? null,\r\n },\r\n 3: {\r\n primary: actions[2]?.uuid ?? null,\r\n secondary: bonus[2]?.uuid ?? null,\r\n },\r\n };\r\n }\r\n\r\n async _getSets() {\r\n const isTransformed = this.actor.flags?.dnd5e?.isPolymorphed;\r\n\r\n const sets = isTransformed ? await this.getDefaultSets() : foundry.utils.mergeObject(await this.getDefaultSets(), foundry.utils.deepClone(this.actor.getFlag(\"enhancedcombathud\", \"weaponSets\") || {}));\r\n\r\n for (const [set, slots] of Object.entries(sets)) {\r\n slots.primary = slots.primary ? await fromUuid(slots.primary) : null;\r\n slots.secondary = slots.secondary ? await fromUuid(slots.secondary) : null;\r\n }\r\n return sets;\r\n }\r\n\r\n async _onSetChange({ sets, active }) {\r\n const switchEquip = game.settings.get(\"enhancedcombathud-dnd5e\", \"switchEquip\");\r\n if (!switchEquip) return;\r\n const updates = [];\r\n const activeSet = sets[active];\r\n const activeItems = Object.values(activeSet).filter((item) => item);\r\n const inactiveSets = Object.values(sets).filter((set) => set !== activeSet);\r\n const inactiveItems = inactiveSets\r\n .flatMap((set) => Object.values(set))\r\n .filter((item) => item)\r\n .filter((item) => !activeItems.includes(item));\r\n activeItems.forEach((item) => {\r\n if (!item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": true });\r\n });\r\n inactiveItems.forEach((item) => {\r\n if (item.system?.equipped) updates.push({ _id: item.id, \"system.equipped\": false });\r\n });\r\n return await this.actor.updateEmbeddedDocuments(\"Item\", updates);\r\n }\r\n }\r\n\r\n const enableMacroPanel = game.settings.get(MODULE_ID, \"macroPanel\");\r\n\r\n const mainPanels = [DND5eActionActionPanel, DND5eBonusActionPanel, DND5eReactionActionPanel, DND5eFreeActionPanel, DND5eLegActionPanel, DND5eLairActionPanel, DND5eMythicActionPanel];\r\n if (enableMacroPanel) mainPanels.push(ARGON.PREFAB.MacroPanel);\r\n mainPanels.push(ARGON.PREFAB.PassTurnPanel);\r\n\r\n CoreHUD.definePortraitPanel(DND5ePortraitPanel);\r\n CoreHUD.defineDrawerPanel(DND5eDrawerPanel);\r\n CoreHUD.defineMainPanels(mainPanels);\r\n CoreHUD.defineMovementHud(DND5eMovementHud);\r\n CoreHUD.defineButtonHud(DND5eButtonHud);\r\n CoreHUD.defineWeaponSets(DND5eWeaponSets);\r\n CoreHUD.defineSupportedActorTypes([\"character\", \"npc\"]);\r\n });\r\n}\r\n\r\nfunction registerItems() {\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/journey.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.disengage.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"turn\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n },\r\n sort: 0,\r\n flags: {\r\n core: {\r\n sourceId: \"Item.wyQkeuZkttllAFB1\",\r\n },\r\n\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/armor-upgrade.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dodge.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: 1,\r\n units: \"round\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/clockwork.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.ready.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/cloak-dagger.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.hide.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n recharge: {\r\n value: null,\r\n charged: false,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/walking-boot.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.dash.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: null,\r\n width: null,\r\n units: \"\",\r\n type: \"self\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n ECHItems[game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\")] = {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.name\"),\r\n type: \"feat\",\r\n img: \"modules/enhancedcombathud/icons/shield-bash.webp\",\r\n system: {\r\n type: {\r\n value: \"\",\r\n subtype: \"\",\r\n },\r\n description: {\r\n value: game.i18n.localize(\"enhancedcombathud-dnd5e.items.shove.desc\"),\r\n chat: \"\",\r\n unidentified: \"\",\r\n },\r\n source: \"\",\r\n quantity: 1,\r\n weight: 0,\r\n price: 0,\r\n attuned: false,\r\n attunement: 0,\r\n equipped: false,\r\n rarity: \"\",\r\n identified: true,\r\n activation: {\r\n type: \"action\",\r\n cost: 1,\r\n condition: \"\",\r\n },\r\n duration: {\r\n value: null,\r\n units: \"\",\r\n },\r\n target: {\r\n value: 1,\r\n width: null,\r\n units: \"\",\r\n type: \"creature\",\r\n },\r\n range: {\r\n value: null,\r\n long: null,\r\n units: \"touch\",\r\n },\r\n\r\n consume: {\r\n type: \"\",\r\n target: \"\",\r\n amount: null,\r\n },\r\n ability: \"\",\r\n actionType: \"util\",\r\n attackBonus: 0,\r\n chatFlavor: \"\",\r\n critical: null,\r\n damage: {\r\n parts: [],\r\n versatile: \"\",\r\n },\r\n formula: \"\",\r\n save: {\r\n ability: \"\",\r\n dc: null,\r\n scaling: \"spell\",\r\n },\r\n consumableType: \"trinket\",\r\n },\r\n sort: 0,\r\n flags: {\r\n \"midi-qol\": {\r\n onUseMacroName: \"\",\r\n },\r\n },\r\n };\r\n}\r\n","import { MODULE_ID } from \"./main.js\";\r\n\r\nexport function registerSettings() {\r\n const settings = {\r\n showWeaponsItems: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showWeaponsItems.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.itemTypes.consumable = ui.ARGON.constructor.DND5E.itemTypes.consumable.filter(i => i !== \"weapon\");\r\n if(sett) ui.ARGON.constructor.DND5E.itemTypes.consumable.push(\"weapon\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n showClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: (sett) => {\r\n ui.ARGON.constructor.DND5E.mainBarFeatures = ui.ARGON.constructor.DND5E.mainBarFeatures.filter(i => i !== \"class\");\r\n if(sett) ui.ARGON.constructor.DND5E.mainBarFeatures.push(\"class\");\r\n ui.ARGON.refresh()\r\n },\r\n },\r\n condenseClassActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.condenseClassActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n macroPanel: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.macroPanel.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: false,\r\n requiresReload: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n switchEquip: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.switchEquip.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n showSpecialActions: {\r\n name: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.name\"),\r\n hint: game.i18n.localize(\"enhancedcombathud-dnd5e.settings.showSpecialActions.hint\"),\r\n scope: \"world\",\r\n config: true,\r\n type: Boolean,\r\n default: true,\r\n onChange: () => ui.ARGON.refresh(),\r\n },\r\n };\r\n\r\n registerSettingsArray(settings);\r\n}\r\n\r\nexport function getSetting(key) {\r\n return game.settings.get(MODULE_ID, key);\r\n}\r\n\r\nexport async function setSetting(key, value) {\r\n return await game.settings.set(MODULE_ID, key, value);\r\n}\r\n\r\nfunction registerSettingsArray(settings) {\r\n for(const [key, value] of Object.entries(settings)) {\r\n game.settings.register(MODULE_ID, key, value);\r\n }\r\n}","import {initConfig} from \"./config.js\";\r\nimport { registerSettings } from \"./settings.js\";\r\n\r\nexport const MODULE_ID = \"enhancedcombathud-dnd5e\";\r\n\r\nHooks.on(\"setup\", () => {\r\n registerSettings();\r\n initConfig();\r\n});"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_regeneratorRuntime","Op","hasOwn","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_toPrimitive","input","hint","prim","toPrimitive","res","String","Number","_createClass","protoProps","staticProps","_inherits","subClass","superClass","_setPrototypeOf","p","bind","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","e","_createSuperInternal","Super","_getPrototypeOf","NewTarget","arguments","apply","_possibleConstructorReturn","_assertThisInitialized","ReferenceError","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","ECHItems","initConfig","Hooks","on","CoreHUD","_game$modules$get","game","system","id","registerItems","i18n","localize","img","subtype","description","chat","unidentified","source","quantity","weight","price","attuned","attunement","equipped","rarity","identified","activation","cost","condition","duration","units","width","range","long","consume","amount","ability","actionType","attackBonus","chatFlavor","critical","damage","parts","versatile","formula","save","dc","scaling","sort","flags","core","sourceId","onUseMacroName","consumableType","recharge","charged","ARGON","isMIDI","modules","active","getMidiFlag","_ui$ARGON$_actor$getF","_flag$actionType","ui","_actor","getFlag","getActivationType","item","_item$system","_Array$from$","activities","Array","from","getActionType","_item$system2","_Array$from$2","actionTypes","action","bonus","reaction","free","itemTypes","spell","feat","consumable","mainBarFeatures","settings","MODULE_ID","DND5E","callAll","DND5ePortraitPanel","_ARGON$PORTRAIT$Portr","_getStatBlocks","_onDeathSave2","_super","_len","_key","concat","_this$actor","this","actor","isPC","_CONFIG$DND5E$creatur","_CONFIG$DND5E$creatur2","creatureType","CONFIG","creatureTypes","details","label","custom","cr","classes","map","c","join","level","race","isDying","attributes","hp","_this$actor$system$at","_this$actor$system$at2","death","success","_this$actor$system$at3","_this$actor$system$at4","failure","_callee","event","_callee$","_context","rollDeathSave","_onDeathSave","_x3","_callee2","_this$actor$system$at5","_this$actor$system$at6","HPText","ACText","SpellDC","hpColor","tempMax","hpMaxColor","_callee2$","_context2","split","word","toUpperCase","replace","trim","temp","tempmax","text","color","max","ac","spelldc","getStatBlocks","PORTRAIT","PortraitPanel","DND5eDrawerButton","_ARGON$DRAWER$DrawerB","_getTooltipData","_super2","buttons","_this","TooltipManager","TOOLTIP_DIRECTIONS","RIGHT","_callee3","tooltipData","_callee3$","_context3","getTooltipDetails","getTooltipData","DRAWER","DrawerButton","DND5eDrawerPanel","_ARGON$DRAWER$DrawerP","_super3","_len2","_key2","_this2","abilities","skills","tools","tool","addSign","gridCols","captions","align","abilityData","onClick","rollAbility","mod","checkBonus","rollAbilityTest","rollAbilitySave","skill","skillData","getProficiencyIcon","proficient","rollSkill","total","passive","style","rollToolCheck","abilityMod","proficiencyMultiplier","prof","DrawerPanel","DND5eActionActionPanel","_ARGON$MAIN$ActionPan","_getButtons2","_super4","_len3","_key3","_this$actor2","inCombat","_getMidiFlag","isActionUsed","_onNewRound","combat","updateActionUse","_callee4","spellItems","featItems","consumableItems","spellButton","specialActions","showSpecialActions","barItems","_callee4$","_context4","items","filter","_item$system$type","includes","_item$system$type2","_item$system$type3","DND5eButtonPanelButton","button","hasContents","DND5eItemButton","isWeaponSet","isPrimary","MAIN","BUTTONS","SplitButton","DND5eSpecialActionButton","_toConsumableArray","_item$system$type4","condenseItemButtons","_getButtons","ActionPanel","DND5eBonusActionPanel","_ARGON$MAIN$ActionPan2","_getButtons3","_super5","_len4","_key4","_this$actor3","_getMidiFlag2","_callee5","_loop","_i","_Object$entries","_this3","_callee5$","_context6","_Object$entries$_i","types","_loop$","_context5","_slicedToArray","_item$system$type5","entries","t0","_item$system$type6","DND5eReactionActionPanel","_ARGON$MAIN$ActionPan3","_getButtons4","_super6","_len5","_key5","_this$actor4","_getMidiFlag3","_callee6","_loop2","_i2","_Object$entries2","_this4","_callee6$","_context8","_Object$entries2$_i","_loop2$","_context7","_item$system$type7","_item$system$type8","DND5eFreeActionPanel","_ARGON$MAIN$ActionPan4","_getButtons5","_super7","_len6","_key6","_this$actor5","_callee7","_loop3","_i3","_Object$entries3","_this5","_callee7$","_context10","_Object$entries3$_i","_loop3$","_context9","_item$system$type9","_item$system$type10","DND5eLegActionPanel","_ARGON$MAIN$ActionPan5","_getButtons6","_super8","_len7","_key7","_this$actor6","_this$actor$system$re","_this$actor$system$re2","resources","legact","_this$actor$system$re3","_this$actor$system$re4","_callee8","_callee8$","_context11","inActionPanel","DND5eLairActionPanel","_ARGON$MAIN$ActionPan6","_getButtons7","_super9","_len8","_key8","_this$actor7","_this$actor$system$re5","lair","_callee9","_callee9$","_context12","DND5eMythicActionPanel","_ARGON$MAIN$ActionPan7","_getButtons8","_super10","_len9","_key9","_callee10","_callee10$","_context13","_ARGON$MAIN$BUTTONS$I","_render","_onRightClick2","_onLeftClick2","_getTooltipData2","_super11","_len10","_key10","_this$item","_canvas","_item$range$value","_item$range","_item$range$long","_item$range2","activity","touchRange","canvas","scene","grid","distance","normal","_item$target$affects","_item$target","_item$target2","_affects$count","affects","targetType","template","count","_this$activity","_this$activity2","_isWeaponSet","_get","isReaction","parent","isMelee","_isPrimary","_callee11","_callee11$","_context14","propertiesLabel","_callee12","_callee12$","_context15","interceptNextDialog","currentTarget","use","consumeActionEconomy","_onLeftClick","_x4","_callee13","_this$activity3","_callee13$","_context16","sheet","render","_onRightClick","_x5","_callee14","_get2","_len11","_key11","weapons","_this6","_args17","_callee14$","_context17","_item$consume","updateItemButtons","_this$activity$consum","_this$activity$uses$v","_this$activity$uses","consumeType","_ammoItem$quantity","ammoItem","Math","floor","getProperty","_chargesItem$uses$val","_chargesItem$uses","chargesItem","uses","per","_game$combat","activationType","_i4","_Object$entries4","_Object$entries4$_i","combatant","components","main","ItemButton","_ARGON$MAIN$BUTTONS$B","_getPanel2","_super12","_ref","_this7","itemsWithSpells","_spells","prePrepareSpells","preparedFlag","some","className","_game$modules$get2","_this8","spellLevels","itemsToIgnore","_this$items$0$system$","_step","IWSAPI","api","_iterator","_createForOfIteratorHelper","_item$flags$itemsWit","_loop4","itemsInSpell","isUsableItem","_item$system$uses","_item$system$uses2","s","n","f","showPreparedOnly","allowIfNotPrepared","preparation","mode","prepared","spells","Infinity","pact","_loop5","_Object$entries5$_i","_Object$entries5","_i5","levelSpells","_callee15","_callee15$","_context18","BUTTON_PANELS","ACCORDION","AccordionPanel","accordionPanelCategories","_ref2","AccordionPanelCategory","ButtonPanel","_getPanel","ButtonPanelButton","_ARGON$MAIN$BUTTONS$A","_createChatMessage","_onLeftClick3","_getTooltipData3","_super13","specialItem","_this9","actorItem","getName","Item","documentClass","_this$item2","_callee16","_callee16$","_context19","_callee17","_game$modules$get3","useCE","_callee17$","_context20","dfreds","effectInterface","findEffect","effectName","toggleEffect","overlay","uuids","uuid","createChatMessage","_x6","_callee18","_callee18$","_context21","ChatMessage","user","speaker","token","alias","content","icon","ActionButton","DND5eMovementHud","_ARGON$MovementHud","_super14","_game$modules$get4","_this10","_len12","_key12","getMovementMode","_game$combat2","started","movement","movementMode","dimensions","MovementHud","DND5eButtonHud","_ARGON$ButtonHud","_getButtons9","_super15","_len13","_key13","_game$combat3","_callee19","_this11","_callee19$","_context22","longRest","shortRest","ButtonHud","DND5eWeaponSets","_ARGON$WeaponSets","_onSetChange2","_getSets2","_getDefaultSets","_super16","_callee20","_this$actor$flags","_actions$0$uuid","_actions$","_bonus$0$uuid","_bonus$","_actions$1$uuid","_actions$2","_bonus$1$uuid","_bonus$2","_actions$2$uuid","_actions$3","_bonus$2$uuid","_bonus$3","sets","isTransformed","actions","_callee20$","_context23","dnd5e","isPolymorphed","primary","secondary","getDefaultSets","_callee21","_this$actor$flags2","_i6","_Object$entries6","_Object$entries6$_i","slots","_callee21$","_context24","t1","foundry","utils","t2","t3","deepClone","mergeObject","fromUuid","t4","t5","_getSets","_callee22","_ref3","updates","activeSet","activeItems","inactiveSets","inactiveItems","_callee22$","_context25","set","flatMap","_item$system3","_id","_item$system4","updateEmbeddedDocuments","_onSetChange","_x7","WeaponSets","enableMacroPanel","mainPanels","PREFAB","MacroPanel","PassTurnPanel","definePortraitPanel","defineDrawerPanel","defineMainPanels","defineMovementHud","defineButtonHud","defineWeaponSets","defineSupportedActorTypes","_x","_x2","_getTooltipDetails","_callee23","_item$labels4","_item$labels5","_damageTypes","_properties","title","itemType","subtitle","dt","damageTypes","properties","materialComponents","_item$system$descript","_item$labels","_item$labels2","_item$labels3","_i7","_Object$entries7","_Object$entries7$_i","_iterator2","_step2","comp","dmgString","tooltipProperties","_callee23$","_context26","labels","weaponTypes","weaponType","itemActionTypes","weaponProperties","school","spellSchools","all","abbr","materials","consumableTypes","requirements","TextEditor","enrichHTML","toHit","derivedDamage","dDmg","getDamageTypeIcon","damageType","d","_p$label","footerText","toLowerCase","proficiency","condensedItems","barItemsLength","barItemsMultipleOfTwo","currentSplitButtonItemButton","isCondensedButton","arr","_arrayWithHoles","isArray","_iterableToArrayLimit","_s","_e","_r","_arr","_n","_d","_unsupportedIterableToArray","minLen","_arrayLikeToArray","toString","test","_nonIterableRest","len","arr2","registerSettings","registerSettingsArray","register","showWeaponsItems","scope","config","default","onChange","sett","refresh","showClassActions","condenseClassActions","macroPanel","requiresReload","switchEquip"],"sourceRoot":""} \ No newline at end of file diff --git a/scripts/config.js b/scripts/config.js index 9c2e3e2..d542aea 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -19,17 +19,17 @@ export function initConfig() { const getActivationType = (item) => { if (!item?.system?.activities) { - return + return; } return Array.from(item.system.activities)[0]?.activation?.type; - } + }; const getActionType = (item) => { if (!item?.system?.activities) { - return + return; } return Array.from(item.system.activities)[0]?.actionType; - } + }; const actionTypes = { action: ["action"], @@ -714,8 +714,8 @@ export function initConfig() { } get activity() { - if(!this.item?.system?.activities) { - return + if (!this.item?.system?.activities) { + return; } return Array.from(this.item.system.activities)[0]; } @@ -971,6 +971,7 @@ export function initConfig() { constructor(specialItem) { super(); const actorItem = this.actor.items.getName(specialItem.name); + this.actorItem = actorItem; this.item = actorItem ?? new CONFIG.Item.documentClass(specialItem, { @@ -990,6 +991,13 @@ export function initConfig() { return true; } + get activity() { + if (!this.item?.system?.activities) { + return; + } + return Array.from(this.item.system.activities)[0]; + } + async getTooltipData() { const tooltipData = await getTooltipDetails(this.item); tooltipData.propertiesLabel = "enhancedcombathud-dnd5e.tooltip.properties.name"; @@ -997,18 +1005,55 @@ export function initConfig() { } async _onLeftClick(event) { - const useCE = game.modules.get("dfreds-convenient-effects")?.active && game.dfreds.effectInterface.findEffect({effectName: this.label}); + const useCE = game.modules.get("dfreds-convenient-effects")?.active && game.dfreds.effectInterface.findEffect({ effectName: this.label }); let success = false; if (useCE) { success = true; - await game.dfreds.effectInterface.toggleEffect({effectName: this.label, overlay: false, uuids: [this.actor.uuid] }); + await game.dfreds.effectInterface.toggleEffect({ effectName: this.label, overlay: false, uuids: [this.actor.uuid] }); } else { - success = await this.item.use({ event }, { event }); + success = this.actorItem ? await this.activity.use({ event }, { event }) : await this.createChatMessage(); } if (success) { DND5eItemButton.consumeActionEconomy(this.item); } } + + async createChatMessage() { + return await ChatMessage.create({ + user: game.user, + speaker: { + actor: this.actor, + token: this.actor.token, + alias: this.actor.name, + }, + content: ` +
+ +
+ +
+ +
+ ${this.label} + + Feature + +
+ +
+ +
+
+ ${this.item.system.description.value} +
+
+
+ + +
+ `, + }); + } } class DND5eMovementHud extends ARGON.MovementHud {