Added a visual indicator for equipped / readied
Now only equipped armor / weapon will show in conflict tab, and all armors/weapons now show in inventory tab
This commit is contained in:
@@ -12,6 +12,9 @@
|
|||||||
- Added a GM Dialog Tool for setting global difficulty (TN) value / hidden (with DicePicker live refresh)
|
- Added a GM Dialog Tool for setting global difficulty (TN) value / hidden (with DicePicker live refresh)
|
||||||
- Compendium now display Ring and Rank if any in list view
|
- Compendium now display Ring and Rank if any in list view
|
||||||
- DicePicker : Fixed the initial display of "use a void point"
|
- DicePicker : Fixed the initial display of "use a void point"
|
||||||
|
- PC/NPC Sheet :
|
||||||
|
- Added a visual indicator for equipped / readied
|
||||||
|
- Now only equipped armor / weapon will show in conflict tab, and all armors/weapons now show in inventory tab
|
||||||
|
|
||||||
## 1.0.0 - First public release
|
## 1.0.0 - First public release
|
||||||
- Removed the 0ds if no skill point
|
- Removed the 0ds if no skill point
|
||||||
|
|||||||
@@ -197,6 +197,13 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Equipped / Readied
|
||||||
|
html.find(".equip-readied-control").on("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
this._switchEquipReadied(event);
|
||||||
|
});
|
||||||
|
|
||||||
// *** Items : add, edit, delete ***
|
// *** Items : add, edit, delete ***
|
||||||
html.find(".item-add").on("click", (event) => {
|
html.find(".item-add").on("click", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -339,4 +346,32 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switch Readied state on a weapon
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_switchEquipReadied(event) {
|
||||||
|
const type = $(event.currentTarget).data("type");
|
||||||
|
if (!["equipped", "readied"].includes(type)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemId = $(event.currentTarget).data("item-id");
|
||||||
|
const tmpItem = this.actor.getOwnedItem(itemId);
|
||||||
|
if (!tmpItem || tmpItem.data.data[type] === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpItem.data.data[type] = !tmpItem.data.data[type];
|
||||||
|
const data = {
|
||||||
|
equipped: tmpItem.data.data.equipped,
|
||||||
|
};
|
||||||
|
// Only weapons
|
||||||
|
if (tmpItem.data.data.readied !== undefined) {
|
||||||
|
data.readied = tmpItem.data.data.readied;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpItem.update({ data });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</legend>
|
</legend>
|
||||||
<ul class="item-list">
|
<ul class="item-list">
|
||||||
{{#each actor.items as |item id|}}
|
{{#each actor.items as |item id|}}
|
||||||
{{#ifCond item.type '==' 'armor'}}
|
{{#ifCond (ifCond item.type '==' 'armor') '&&' (ifCond item.data.equipped '==' true)}}
|
||||||
{{> 'systems/l5r5e/templates/items/armor/armor-entry.html' item=item id=id editable=../editable }}
|
{{> 'systems/l5r5e/templates/items/armor/armor-entry.html' item=item id=id editable=../editable }}
|
||||||
{{/ifCond}}
|
{{/ifCond}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
<li class="item-img"><img src="{{item.img}}" title="{{item.name}}" width="32px" height="32px"/></li>
|
<li class="item-img"><img src="{{item.img}}" title="{{item.name}}" width="32px" height="32px"/></li>
|
||||||
<li class="item-name">{{ item.name }} <sub>x{{ item.data.quantity }}</sub></li>
|
<li class="item-name">{{ item.name }} <sub>x{{ item.data.quantity }}</sub></li>
|
||||||
{{#if editable}}
|
{{#if editable}}
|
||||||
<li data-item-id="{{item._id}}" class="item-edit" title="{{localize 'l5r5e.global.edit'}}"><i class="fas fa-edit"></i></li>
|
<li data-item-id="{{item._id}}" data-type="equipped" class="item-equip equip-readied-control" title="{{localize 'l5r5e.armors.equipped'}}"><i class="fas {{#if item.data.equipped}}fa-tshirt{{else}}fa-suitcase{{/if}}"></i></li>
|
||||||
<li data-item-id="{{item._id}}" class="item-delete" title="{{localize 'l5r5e.global.delete'}}"><i class="fas fa-trash"></i></li>
|
<li data-item-id="{{item._id}}" class="item-edit" title="{{localize 'l5r5e.global.edit'}}"><i class="fas fa-edit"></i></li>
|
||||||
|
<li data-item-id="{{item._id}}" class="item-delete" title="{{localize 'l5r5e.global.delete'}}"><i class="fas fa-trash"></i></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="item-properties">
|
<ul class="item-properties">
|
||||||
@@ -13,6 +14,6 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if item.data.description}}
|
{{#if item.data.description}}
|
||||||
<div class="item-description item-description-{{item._id}}">{{{ item.data.description }}}</div>
|
<div class="item-description item-description-{{item._id}}">{{{ item.data.description }}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</legend>
|
</legend>
|
||||||
<ul class="item-list">
|
<ul class="item-list">
|
||||||
{{#each actor.items as |item id|}}
|
{{#each actor.items as |item id|}}
|
||||||
{{#ifCond item.type '==' 'item'}}
|
{{#ifCond '["item", "armor", "weapon"]' 'includes' item.type}}
|
||||||
{{> 'systems/l5r5e/templates/items/item/item-entry.html' item=item id=id editable=../editable }}
|
{{> 'systems/l5r5e/templates/items/item/item-entry.html' item=item id=id editable=../editable }}
|
||||||
{{/ifCond}}
|
{{/ifCond}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -13,11 +13,14 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="item-properties">
|
<ul class="item-properties">
|
||||||
|
<li class="equip-readied-control" data-item-id="{{item._id}}" data-type="readied">
|
||||||
|
<i class="i_readied fa{{^if item.data.readied}}r{{/if}} fa-hand-rock" title="{{#if item.data.readied}}{{localize 'l5r5e.weapons.readied'}}{{else}}{{localize 'l5r5e.weapons.sheathed'}}{{/if}}"></i>
|
||||||
|
</li>
|
||||||
{{#each item.data.properties as |property id|}}
|
{{#each item.data.properties as |property id|}}
|
||||||
<li>{{{ property.name }}}</li>
|
<li>{{{ property.name }}}</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if item.data.description}}
|
{{#if item.data.description}}
|
||||||
<div class="item-description item-description-{{item._id}}">{{{ item.data.description }}}</div>
|
<div class="item-description item-description-{{item._id}}">{{{ item.data.description }}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</legend>
|
</legend>
|
||||||
<ul class="item-list">
|
<ul class="item-list">
|
||||||
{{#each actor.items as |item id|}}
|
{{#each actor.items as |item id|}}
|
||||||
{{#ifCond item.type '==' 'weapon'}}
|
{{#ifCond (ifCond item.type '==' 'weapon') '&&' (ifCond item.data.equipped '==' true)}}
|
||||||
{{> 'systems/l5r5e/templates/items/weapon/weapon-entry.html' item=item id=id editable=../editable }}
|
{{> 'systems/l5r5e/templates/items/weapon/weapon-entry.html' item=item id=id editable=../editable }}
|
||||||
{{/ifCond}}
|
{{/ifCond}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
Reference in New Issue
Block a user