Zusammenführung-von-Fertigkeiten,-Waffen-und-Rüstungen-im-Kampf-Tab-#15 #48

Merged
oskaloq merged 5 commits from Zusammenführung-von-Fertigkeiten,-Waffen-und-Rüstungen-im-Kampf-Tab-#15 into develop 2024-01-16 11:25:41 +01:00
3 changed files with 50 additions and 17 deletions
Showing only changes of commit 5be10276ca - Show all commits

View File

@ -246,6 +246,28 @@ export default class M5CharacterSheet extends ActorSheet {
const roll = M5Roll.resistanceBody(this.actor);
await roll.toMessage();
});
html.find(".change-equipped").on("click", async (event) => {
let row = event.target.parentElement;
let itemId = row.dataset["item"];
while (!itemId) {
row = row.parentElement;
if (!row) return;
itemId = row.dataset["item"];
}
const context = this.actor as any;
const item = context.items.get(itemId);
if (item.system.equipped === true) {
item.system.equipped = false;
}
else {
item.system.equipped = true;
}
this.render();
});
// Drag & Drop
const dragDrop = new DragDrop({
dragSelector: ".items-list .item",

View File

@ -188,6 +188,11 @@
width: 5rem;
}
input.checkbox {
width: 1rem;
height: 1rem;
}
.new-skill {
font-style: italic;
background: rgba(0, 0, 0, 0.3);
@ -200,10 +205,10 @@
button.roll-button {
background: url(/icons/svg/d20-black.svg) no-repeat;
background-size: 24px 24px;
background-size: 1rem 1rem;
border: #000000 solid 0px;
width: 26px;
height: 26px;
width: 1rem;
height: 1rem;
}
span.spell-process {

View File

@ -34,7 +34,7 @@
<div class="flexpart-header">
<img src="icons/tools/hand/scale-balances-merchant-brown.webp" class="flexpart-icon">
{{localize "midgard5.gear"}}
(alle <input id="data.info.showAllItems" type="checkbox" name="data.info.showAllItems" {{checked data.info.showAllItems}}>)
(alle <input id="data.info.showAllItems" class="checkbox" type="checkbox" name="data.info.showAllItems" {{checked data.info.showAllItems}}>)
</div>
<table>
<thead class="theader">
@ -42,7 +42,7 @@
<th class="title">{{localize "TYPES.Item.item"}}</th>
<th class="title center">{{localize "midgard5.item-quantity"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title center"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
<th class="title">&nbsp;</th>
</tr>
@ -66,13 +66,15 @@
<span class="spell-process">{{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}}</span>
{{/unless}}
</td>
<td>
<td class="change-equipped">
{{#if item.equipped}}
<img src="/systems/midgard5/assets/icons/icon/confirmed.svg" class="table-icon">
<i class="fa-solid fa-circle-check"></i>
{{else}}
<i class="fa-regular fa-circle"></i>
{{/if}}
</td>
<td class="fixed-value">{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
<td>{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/if}}
{{/each}}
@ -107,13 +109,15 @@
<span class="spell-process">{{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}}</span>
{{/unless}}
</td>
<td>
<td class="change-equipped">
{{#if item.equipped}}
<img src="/systems/midgard5/assets/icons/icon/confirmed.svg" class="table-icon">
<i class="fa-solid fa-circle-check"></i>
{{else}}
<i class="fa-regular fa-circle"></i>
{{/if}}
</td>
<td class="fixed-value">{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
<td>{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
</tbody>
@ -152,13 +156,15 @@
<span class="spell-process">{{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}}</span>
{{/unless}}
</td>
<td>
<td class="change-equipped">
{{#if item.equipped}}
<img src="/systems/midgard5/assets/icons/icon/confirmed.svg" class="table-icon">
<i class="fa-solid fa-circle-check"></i>
{{else}}
<i class="fa-regular fa-circle"></i>
{{/if}}
</td>
<td class="fixed-value">{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
<td>{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/if}}
{{/each}}