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

Character sheet inventory fixes #500

Merged
merged 10 commits into from
Apr 1, 2024
Merged

Conversation

Henrik-Bonsmann
Copy link
Contributor

  • fixed encumbrance bar and breakpoints
  • fixed "double weight" issue for treasure weight calculation
  • fixed treasure value total in Treasure header
  • Unified weight display across Treasure, Misc and Container items to be multiplied with item number

image

+ specified steps for complete and detailed encumbrance separately
+ fixed treasure weight in the item list
* Item weight calculation now takes quantity into account for Misc items and stuff in containers, making it consistent with treasures
@Henrik-Bonsmann
Copy link
Contributor Author

fixes #498

Copy link
Collaborator

@wyrmisis wyrmisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions for you.

*To avoid excessive handlebar maths in the inventory tab, derive the product of quantity and (weight, cost & itemslots) in the item dataModel.

* Set default quantity of new items to 1 to avoid confusion.
Copy link
Collaborator

@wyrmisis wyrmisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to hound you on this one. Let's see if we can't hammer this out together. :)

Maybe there's some stuff we can pull into another PR, if we can isolate the changes that'll fix encumbrance.

value: new NumberField({ integer: false }),
max: new NumberField({ integer: false }),
}),
encumbrance: new ObjectField(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind trying something?

Suggested change
encumbrance: new ObjectField(),
encumbrance: new SchemaField({
max: new NumberField({ initial: 1600 }),
}),

See if that fixes it, as well. My guess is that we haven't been setting an initial encumbrance max all this time.

If it doesn't work, eh, heck with it, we'll keep it as you have it. If it does, then maybe we add a system setting for default initial value for max carry weight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes it worse. If I see things correctly, setting a SchemaField() here makes it impossible to add other variables to it from the data-model-classes, so everything not specified will never be exposed, which is also why #467 looks as is does with this massive schema field.

This is also consistent with prior behavior, because setting the missing max in "Tweaks" did not actually resolve the issue of no bar or breakpoints.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. Fair enough. It was worth a try.

We may want to add a migration to ensure that null/undefined values for encumbrance.max are set to 1600 when this goes out. That default gets pulled from template.json if we're not specifically setting a schema field up for it.

Unified encumbrance classes to utilize a shared set of bools for speed calculation
Copy link
Collaborator

@wyrmisis wyrmisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So clean!

Fix the typo and I'm good with this.

max: new NumberField({ min: 0, initial: 0 }),
}),
weight: new NumberField({ min: 0, initial: 0 }),
itemslots: new NumberField({ min: 0, initial: 0 }),
};
}
get cummulativeWeight(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo.

Suggested change
get cummulativeWeight(){
get cumulativeWeight(){

Copy link
Member

@anthonyronda anthonyronda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'll get started on a PR for initializing the value of encumbrance.max

@anthonyronda anthonyronda merged commit 2e8daa5 into vttred:main Apr 1, 2024
@anthonyronda
Copy link
Member

@all-contributors add Henrik-Bonsmann for code

Copy link
Contributor

@anthonyronda

I've put up a pull request to add @Henrik-Bonsmann! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants