asacolips-projects / pbta

Run games for any PbtA system in Foundry VTT!
https://asacolips.gitbook.io/pbta-system
MIT License
3 stars 4 forks source link

BUG: ListMany label disappears forever after any attribute value updates #248

Closed fe5hua closed 1 month ago

fe5hua commented 1 month ago

See title.

debility: {
  type: "ListMany",
  position: "left",
  label: game.i18n.localize("brein.character.debility.label"),
  options: [
     {
       label: game.i18n.localize("brein.character.debility.weakened"),
       value: false,
     },
     {
       label: game.i18n.localize("brein.character.debility.dazed"),
       value: false,
     },
     {
       label: game.i18n.localize("brein.character.debility.miserable"),
       value: false,
     },
  ],
},
mclemente commented 1 month ago

Is this a module that you can link to me? It's easier for me to test it out since I don't have a "test module" to copy-paste JS objects.

I think your issue might be that options should be an Object rather than an Array. E.g.

options: {
     weakened: {
       label: game.i18n.localize("brein.character.debility.weakened"),
       value: false,
     },
     dazed: {
       label: game.i18n.localize("brein.character.debility.dazed"),
       value: false,
     },
     miserable: {
       label: game.i18n.localize("brein.character.debility.miserable"),
       value: false,
     },
  }

They are generally defined as Arrays in TOML, but they are parsed as Objects by the system, and the system doesn't parse modules' JSON at all, it assumes it is correct.

fe5hua commented 1 month ago

that worked. thank you!