Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring available currencies in the CONFIG is not reversible #2161

Closed
krbz999 opened this issue Feb 6, 2023 · 1 comment · Fixed by #2179
Closed

Configuring available currencies in the CONFIG is not reversible #2161

krbz999 opened this issue Feb 6, 2023 · 1 comment · Fixed by #2179
Assignees
Labels
bug Functionality which is not working as intended
Milestone

Comments

@krbz999
Copy link
Contributor

krbz999 commented Feb 6, 2023

Running a script such as

Hooks.once("setup", function(){
  const data = {
    hg: {label: "Heartnergold", abbreviation: "hg", conversion: 0.25},
    ps: {label: "Pansun", abbreviation: "ps", conversion: 2},
    cd: {label: "Credits", abbreviation: "cd", conversion: 200}
  };
  foundry.utils.mergeObject(CONFIG.DND5E.currencies, data);
});

does not immediately display any added currencies on the character sheet. Secondly, if one was to later remove currencies, the input fields never disappear, only labels do, and the sheet looks like this:

image

@arbron arbron added the bug Functionality which is not working as intended label Feb 7, 2023
@arbron
Copy link
Collaborator

arbron commented Feb 7, 2023

This is because we don't have a prepareBaseCurrencies method similar to what we are doing with skills and abilities to ensure that the proper values are available in character data. I have some plans to try and rework this functionality into the new MappingField so that should make it easier to get this working properly on normal characters, group actors, and containers (though currencies aren't shown on containers yet so no one notices the bug there).

@arbron arbron added this to the D&D5E 2.2.0 milestone Feb 7, 2023
@arbron arbron self-assigned this Feb 10, 2023
arbron added a commit to arbron/dnd5e that referenced this issue Feb 10, 2023
arbron added a commit to arbron/dnd5e that referenced this issue Feb 10, 2023
arbron added a commit to arbron/dnd5e that referenced this issue Feb 10, 2023
@arbron arbron linked a pull request Feb 10, 2023 that will close this issue
Fyorl added a commit that referenced this issue May 23, 2023
@Fyorl Fyorl closed this as completed May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants