Merge branch 'master' into ai/issue-64
All checks were successful
Test / test (push) Successful in 2s

This commit is contained in:
2026-10-15 15:19:46 +00:00
13 changed files with 179 additions and 37 deletions

View File

@@ -20,13 +20,13 @@ function initialForm() {
if (!editing) {
return {
name: '', type: 'character', species: '', className: '', level: '', background: '', challengeRating: '',
category: 'adventuring-gear', rarity: 'common', quantity: 1, weight: '', properties: '', description: ''
category: 'adventuring-gear', rarity: 'common', weight: '', properties: '', description: ''
};
}
return {
name: editing.name ?? '', type: 'character', species: '', className: '', level: '', background: '', challengeRating: '',
category: editing.category ?? 'adventuring-gear', rarity: editing.rarity ?? 'common',
quantity: editing.quantity ?? 1, weight: editing.weight ?? '', properties: editing.properties ?? '',
weight: editing.weight ?? '', properties: editing.properties ?? '',
description: editing.description ?? ''
};
}
@@ -49,7 +49,7 @@ async function saveEntry() {
? { name: form.value.name.trim(), campaign: data.campaign }
: { name: form.value.name.trim(), ...(editing ? { id: editing._id } : { campaign: data.campaign }) };
if (!isActor) {
for (const field of ['category', 'rarity', 'quantity', 'weight', 'properties', 'description']) {
for (const field of ['category', 'rarity', 'weight', 'properties', 'description']) {
payload[field] = form.value[field];
}
}
@@ -105,10 +105,6 @@ async function saveEntry() {
<option value="artifact">{{ $t('campaigns.item.rarities.artifact') }}</option>
</select>
</label>
<label class="form-field">
<span>{{ $t('campaigns.item.quantity') }}</span>
<input v-model.number="form.quantity" type="number" min="1" required>
</label>
<label class="form-field">
<span>{{ $t('campaigns.item.weight') }}</span>
<input v-model="form.weight" type="number" min="0" step="0.1">

View File

@@ -22,7 +22,6 @@ function normalizeItem(item) {
name: item?.name ?? '',
category: item?.category ?? 'adventuring-gear',
rarity: item?.rarity ?? 'common',
quantity: Number(item?.quantity ?? 1),
weight: item?.weight ?? '',
properties: item?.properties ?? '',
description: item?.description ?? '',
@@ -161,11 +160,9 @@ async function removeIcon() {
<input ref="photoInput" class="photo-input" type="file" accept="image/*" @change="onIconSelected">
</div>
<!-- Quantity is the actor inventory's business (Syndria98/dragonroll#63); the item
sheet only states what the item itself is. -->
<dl class="item-facts">
<div class="item-fact">
<dt>{{ $t('campaigns.item.quantity') }}</dt>
<dd>{{ form.quantity }}</dd>
</div>
<div v-if="form.weight !== '' && form.weight !== undefined" class="item-fact">
<dt>{{ $t('campaigns.item.weight') }}</dt>
<dd>{{ Number(form.weight).toFixed(1) }} lb</dd>