RC-103 | Add Access to the rest of the item types that require it

This commit is contained in:
Oliver-Akins 2025-02-16 12:19:56 -07:00
parent 4ccfc03e59
commit 43fe433900
5 changed files with 84 additions and 7 deletions

View file

@ -28,12 +28,6 @@ export class WeaponData extends CommonItemData {
}),
damage: requiredInteger({ min: 0, initial: 0 }),
wear: barAttribute(0, 0, 4),
access: new fields.StringField({
blank: true,
nullable: false,
trim: true,
choices: gameTerms.Access,
}),
equipped: new fields.BooleanField({
initial: false,
required: true,
@ -87,7 +81,7 @@ export class WeaponData extends CommonItemData {
// #endregion
// #region Sheet Data
getFormFields(_ctx) {
async getFormFields(_ctx) {
const fields = [
{
id: `quantity`,
@ -97,6 +91,24 @@ export class WeaponData extends CommonItemData {
value: this.quantity,
min: 0,
},
{
id: `access`,
type: `dropdown`,
label: `Access`,
path: `system.access`,
value: this.access,
limited: false,
options: [
{
label: `RipCrypt.common.empty`,
value: ``,
},
...gameTerms.Access.map(opt => ({
label: `RipCrypt.common.access.${opt}`,
value: opt,
})),
],
},
{
id: `traits`,
type: `string-set`,