diff --git a/index.js b/index.js index 9ad0799..e0f40e5 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\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{"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.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","requ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AM3I,YAAY2K,MAAMH,gBAAgBsJ,QAAO,SAAAnU,GAAC,MAAU,UAANA,CAAa,IAC9GwzB,GAAMjqB,GAAGP,MAAM3I,YAAY2K,MAAMH,gBAAgBrL,KAAK,SACzD+J,GAAGP,MAAMyqB,SACb,GAEJE,qBAAsB,CAClBrzB,KAAMwF,KAAKI,KAAKC,SAAS,8DACzBpD,KAAM+C,KAAKI,KAAKC,SAAS,8DACzBitB,MAAO,QACPC,QAAQ,EACRn3B,KAAMoI,QACNgvB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMhqB,GAAGP,MAAMyqB,SAAS,GAEtCG,WAAY,CACRtzB,KAAMwF,KAAKI,KAAKC,SAAS,oDACzBpD,KAAM+C,KAAKI,KAAKC,SAAS,oDACzBitB,MAAO,QACPC,QAAQ,EACRn3B,KAAMoI,QACNgvB,SAAS,EACTO,gBAAgB,EAChBN,SAAU,SAAAA,WAAA,OAAMhqB,GAAGP,MAAMyqB,SAAS,GAEtCK,YAAa,CACTxzB,KAAMwF,KAAKI,KAAKC,SAAS,qDACzBpD,KAAM+C,KAAKI,KAAKC,SAAS,qDACzBitB,MAAO,QACPC,QAAQ,EACRn3B,KAAMoI,QACNgvB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMhqB,GAAGP,MAAMyqB,SAAS,GAEtC3f,mBAAoB,CAChBxT,KAAMwF,KAAKI,KAAKC,SAAS,4DACzBpD,KAAM+C,KAAKI,KAAKC,SAAS,4DACzBitB,MAAO,QACPC,QAAQ,EACRn3B,KAAMoI,QACNgvB,SAAS,EACTC,SAAU,SAAAA,WAAA,OAAMhqB,GAAGP,MAAMyqB,SAAS,IAK9C,CCnEO,IAAM1oB,EAAY,0BAEzBrF,MAAMC,GAAG,SAAS,WACdqtB,mBACAvtB,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.item.use({event, legacy: false}, {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","legacy","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 d542aea..da052c6 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -765,7 +765,7 @@ export function initConfig() { async _onLeftClick(event) { ui.ARGON.interceptNextDialog(event.currentTarget); - const used = await this.activity.use({ event }, { event }); + const used = await this.item.use({event, legacy: false}, {event}); if (used) { DND5eItemButton.consumeActionEconomy(this.activity); }