-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feat/ancestry sheets #12 #56
Feat/ancestry sheets #12 #56
Conversation
…a model. Swapped to built-in prosemirror custom element. Updated Item styling to use vertical tabs.
I'd intentionally left the tabs in the middle of the sheet instead of vertically on the right, as we don't have an actual design for the item sheets and I wanted to remain as generic as possible. Also, for the sake of commonality, this matches what 5e does. |
I think here we follow what other systems do and have edit/view mode only for actor sheets (as they're interacted with a lot), and have item sheets always editable (if you have the right permissions). |
Yeah, that's the route I would have wanted to go as well. Didn't realise it was a pattern, but recognised that it's just easier to work with sheets that are ready to edit when you open them. I also notice you've resolved most of this in the changes to the header component in your last few commits, so will strike that off! |
OK, a bit of a google shows me that it's more prevalent than I thought (though I'm sure I've played at least one system that does the side tabs for non-actors). My own preference would be for the side tabs as they free up more space in the main window for content, plus it's internal consistency if all sheet tabs are the same, and it'd be more expandable. I'd honestly just thought that people left the horizontal tabs on things because they hadn't gotten round to changing it 🤣 |
… and placeholder decsriptions
…into feat/ancestry-sheets-#12
… specialty items to use the prosemirror element correctly and have initial placeholder values. Updated cultre and ancestry sheets to make use of base item's form actions. Fixed specialty item initialisation issues.
if ( | ||
this.item.system.description!.value === | ||
CONFIG.COSMERE.items.types.injury.desc_placeholder | ||
) { | ||
this.item.system.description!.value = game.i18n!.localize( | ||
this.item.system.description!.value!, | ||
); | ||
} | ||
|
||
const enrichedDescValue = await TextEditor.enrichHTML( | ||
this.item.system.description!.value!, | ||
); | ||
|
||
return { | ||
...(await super._prepareContext(options)), | ||
isPermanent: | ||
this.item.system.type === InjuryType.PermanentInjury || | ||
this.item.system.type === InjuryType.Death, | ||
descHtml: enrichedDescValue, |
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.
Can't we move the description enrichment into the base item? We can probably move the assignment of the placeholder value into the data model, since its acting more like an initial value.
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.
Done the refactor to make the description code common. I don't think we can move the localisation of the values into the data models due to the way the mixin process works, the i18n objects isn't populated on the game object when the mixins are initialised (if I'm following your thought correctly).
I did try and provide the ancestry DescriptionItemMixin call the localised string when I was first implementing the initial values bit as it seemed more sense to me to just do it cleanly there, but alas it didn't work.
I was thinking there was a lot of repeated code and trying to come up with
a better approach after I'd turned the PC off.
That definitely sounds like a good plan to try!
…On Sun, 29 Sept 2024, 08:28 stanavdb, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/system/applications/item/injury-sheet.ts
<#56 (comment)>:
> + if (
+ this.item.system.description!.value ===
+ CONFIG.COSMERE.items.types.injury.desc_placeholder
+ ) {
+ this.item.system.description!.value = game.i18n!.localize(
+ this.item.system.description!.value!,
+ );
+ }
+
+ const enrichedDescValue = await TextEditor.enrichHTML(
+ this.item.system.description!.value!,
+ );
+
return {
...(await super._prepareContext(options)),
isPermanent:
this.item.system.type === InjuryType.PermanentInjury ||
this.item.system.type === InjuryType.Death,
+ descHtml: enrichedDescValue,
Can't we move the description enrichment into the base item?
—
Reply to this email directly, view it on GitHub
<#56 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANGKWFPC3QRQR5OGB5TBZJTZY6TZDAVCNFSM6AAAAABPABUXUCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMZVG42TGNJQGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…into feat/ancestry-sheets-#12
…into feat/ancestry-sheets-#12
…ceholders & details icons
…into feat/ancestry-sheets-#12
created issue #69 to cover the character sheet component aspect (and widened scope to be al item types) |
Final style touches done, will open another issue for theming. |
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.
While reviewing I ran into some small usability issues with the advancements. I figured I'd just do some suggested changes on a branch from this PR. If you like them you can merge them into the PR.
https://github.com/stanavdb/cosmere-rpg/tree/ancestry-sheet-pr
What I've changed:
- Free path is now a reference to an Item instead of an id. We should use ids for things like prerequisites or other form of dependencies (so that GMs can modify/clone Items as they like but they'll still count as the "same"). However here we want to grant some path upon taking the ancestry, so we should refer to the Item directly.
- Free talents now uses references to Talent items instead of ids. Same as point 1.
- Refactored talent picks to bonus talents and changed the way they're edited. I've moved the restrictions to be per level, and changed up the way they're edited to be consistent with other Item sheets.
OK, taken a look at that now. 3: I like that it's refactored to support the embedded collections. That makes a lot of sense, and mechanically it's a lot simpler in places. And the styling and consistency is great. I did have the restrictions per-level originally and then moved them up top because I wasn't sure how much busy work it would be to have to repeat the same or very nearly the same on each one... 🤷🏻♂️ |
The only real reason I haven't been using just regular tables is that they get a lot of default styling out of the box that we do not want. |
Cool. I'll have a deep dive on this idea at some point this week. We can override a lot of the styling or potentially look at a sub-grid option to get the same row-container type approach. I might just merge the changes in tomorrow and then open a new issue/PR for the tables refactor, it'd likely be a new component or an overall approach I'd want to apply across any existing examples. But I'll also do more digging around what exactly is best practice these days (assuming we even can follow it within a foundry form!) |
Ancestry sheet pr
…into feat/ancestry-sheets-#12
|
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.
We're almost there. I've highlighted a couple of minor issues.
One more thing to think about: ATM you're applying the font globally, is that something we want? We'll want the font for our sheets but all the other Foundry element obviously weren't designed with it in mind. Might be better to keep the Foundry defaults for Foundry stuff and only use our fonts on our sheets.
That's a fair point. Without rambling too much (and perhaps there lies the evidence that this should be a separate Discussion?), I have a personal preference towards seeing the foundry interface themed up. I wish there were more style themes around in the modules list (or even a separate section jus for themes, but I digress), and like it when a system takes the time to use the fact that Foundry was intentionally built on a basis that it can be easily themed from top to bottom. It improves immersion (or at least product familiarity) to me. And honestly I think the Laski sans font works quite well for the job, I'd not use Penumbra for UI elements and even hesitate to use the Palatin option (if we can find some way to provide that for the subheadings) for much beyond a few labels. |
Yeah I'd like to take a look at complete foundry theming at some point, but that should be its own separate issue |
Moved from global vars to just sheet styles (as per the h1s) |
- removed orphaned & redundant code - small caps applied to headers - font changes restricted to document sheets for now - hid the item titles when sheets not minimised - description tab only shows editor if the sheet is editable for the user
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.
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.
Basic Ancestry Sheet functionality added. Moved item tabs to be vertical on the right as per the actor sheets. Switched the editor to the built-in
<prose-mirror>
element.Also fixed up the custom fonts.
TO DO: