Fixed right click menu for weapons

pull/2/head
Erebus 2020-12-01 04:22:57 +01:00
parent bec12184da
commit 6f8200c82a
2 changed files with 7 additions and 4 deletions

View File

@ -139,7 +139,7 @@ export class ActorSheetKH extends ActorSheet {
},
]);
new ContextMenu(html, "div.item-weapon", [
new ContextMenu(html, "li.item-weapon", [
{
name: game.i18n.localize("MENU.SHOWROLLDIALOG"),
icon: '<i class="far dice"></i>',
@ -147,8 +147,11 @@ export class ActorSheetKH extends ActorSheet {
let itemId = li.data("itemId");
let _item = this.actor.items.find((element) => element._id == itemId);
let skillName = _item.name
let skillValue = _item.data.data.value
// Retrieve skill based on name
let skill = this.actor.items.find((element) => element.name === _item.data.data.skill.value);
let skillName = skill.name
let skillValue = skill.data.data.value
let showValue = false
if(this.actor.data.type === "character") {

View File

@ -1,5 +1,5 @@
<div id="{{id}}" class="roll-dialog">
<h1 style="text-align: center;">{{skillName}} {{skillValue}}</h1>
<h1 style="text-align: center;">{{skillName}} ({{skillValue}})</h1>
<label>{{localize "ROLL.OPENCLOSE"}}</label>
<input type="button" name="openclosed" min="0" value="{{startopen}}" style="margin-bottom: 10px; min-height: 26px; min-width: 30px;" />
<label name="notopenedorclosed" style="display: inline-block;">&nbsp;</label>