-
Notifications
You must be signed in to change notification settings - Fork 57
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
Conversation
Henrik-Bonsmann
commented
Feb 7, 2024
- 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
+ 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
fixes #498 |
There was a problem hiding this 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.
src/module/actor/data-model-classes/data-model-character-encumbrance-detailed.ts
Outdated
Show resolved
Hide resolved
*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.
There was a problem hiding this 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.
src/module/actor/data-model-classes/data-model-character-encumbrance-complete.ts
Outdated
Show resolved
Hide resolved
value: new NumberField({ integer: false }), | ||
max: new NumberField({ integer: false }), | ||
}), | ||
encumbrance: new ObjectField(), |
There was a problem hiding this comment.
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?
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/module/item/data-model-item.js
Outdated
max: new NumberField({ min: 0, initial: 0 }), | ||
}), | ||
weight: new NumberField({ min: 0, initial: 0 }), | ||
itemslots: new NumberField({ min: 0, initial: 0 }), | ||
}; | ||
} | ||
get cummulativeWeight(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
get cummulativeWeight(){ | |
get cumulativeWeight(){ |
There was a problem hiding this 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
@all-contributors add Henrik-Bonsmann for code |
I've put up a pull request to add @Henrik-Bonsmann! 🎉 |