-
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
80b9da2
Character Sheet encumbrance bar fix
Henrik-Bonsmann 0b80f75
Fixed Treasure value sum
Henrik-Bonsmann ca73cfe
Changed item weight calculation
Henrik-Bonsmann 761f6d4
Resolved conflict with parent static field
Henrik-Bonsmann 0fdc683
Derive NetValues for items.
Henrik-Bonsmann faadd55
Added documentation
Henrik-Bonsmann 6b367e3
Implemented derived item data as getters
Henrik-Bonsmann 93d2384
Updated Speed calculations
Henrik-Bonsmann 05609f4
Reverted unnecessary changes
Henrik-Bonsmann 39514a6
Fixed a typo
Henrik-Bonsmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,13 +19,24 @@ export default class OseDataModelItem extends foundry.abstract.DataModel { | |||||
cost: new NumberField({ min: 0, initial: 0 }), | ||||||
containerId: new StringField(), | ||||||
quantity: new SchemaField({ | ||||||
value: new NumberField({ min: 0, initial: 0 }), | ||||||
value: new NumberField({ min: 0, initial: 1 }), | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Typo.
Suggested change
|
||||||
return this.weight * this.quantity.value; | ||||||
} | ||||||
|
||||||
get cummulativeCost(){ | ||||||
return this.cost * this.quantity.value; | ||||||
} | ||||||
|
||||||
get cummulativeItemslots(){ | ||||||
return Math.ceil(this.itemslots * this.quantity.value); | ||||||
} | ||||||
|
||||||
static migrateData(source) { | ||||||
if (source.details?.description && !source.description) | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
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 thedata-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 to1600
when this goes out. That default gets pulled fromtemplate.json
if we're not specifically setting a schema field up for it.