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

feat: Character Sheet v2 #479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wyrmisis
Copy link
Collaborator

Intent

This changeset implements Phase 1 of the new character sheet, while attempting to maintain the existing character sheet.

Wait, phase one? We never discussed phases!

In the interest of getting this sheet out this year, I'm opting to put it up for review at feature parity (plus a little extra) with the current sheet. In my opinion, adding things like spell sources, ability categories, and so on are too disruptive to the existing character sheet; I'd prefer to hold off on them until we can safely end-of-life the old sheet.

What's missing?

  • Combat tab: The character info fields are a little messy, and they're missing Retainer fields.
  • Combat tab: The ability to roll HD
  • Abilities tab: Use the correct icons for the exploration skills
  • Abilities tab: Language picker. I'd like to use Tagify for this.
  • Inventory tab: Adding zebra striping to the inventory rows
  • Magic tab: dragging a prepared spell to another character's spells will cause the recipient to prepare it, too.
  • The ability to add hotbar macros.

Where did I veer "off road"?

  • I added a dark theme. Sorry @Godforsaken84 😝
  • I added a spell slot grid to the top of each spell level on the Magic tab, as well as under the move speed fields on the Combat tab.
  • Container queries have enabled us to create a flexible UI that adapts to resizing (including on editor fields)
  • If you drag gear or treasure with a quantity of at least one to another actor, you'll have the option to give that actor a set amount, and optionally deduct that amount from the original owner. We can absolutely remove this if enough modules cover this, though.

Anything else of note?

  • I'd really appreciate a close look at my drag and drop code. There's just a lot there and I'd like some help simplifying it.
  • There'll be mentions of FACE, or Form Associated Custom Elements in the code, specifically about how they don't work gracefully in Foundry. for some reason, no matter what, I can't get focus back onto a custom element after editing. Hopefully FACEs work in v12 (because I'm sure the core devs are tired of me asking about it).

Beyond that... This isn't 100% ready to go in, but it can be -- with your help. There's a lot here. I've been staring at it for a long time, and I'm likely missing stuff. Pull the sheet down, and really put it through the ringer.
image

@anthonyronda
Copy link
Member

I'll be taking a few screenshots for folks who want to give feedback without pulling it locally

@anthonyronda
Copy link
Member

image image Weapons in containers appear bugged: can't be clicked on or dragged out of the container. Drag behavior has some issues we'll address in a separate comment image image New actor. I like the little hover animation image

@@ -16,7 +16,7 @@
"env": {
"browser": true
},
"ignorePatterns": ["**/lang/**/*.json", "**/*.d.ts"],
"ignorePatterns": ["rollup.config.mjs", "**/lang/**/*.json", "**/*.d.ts"],
Copy link
Member

Choose a reason for hiding this comment

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

rollup config is removed from linting? any particular reason?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry that I forgot how to contain everything in a single review for a couple of these!

@anthonyronda
Copy link
Member

shield.svg doesn't appear to be in use

shield2.svg looks like the aspect ratio is a bit messed up?

@@ -51,22 +54,30 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-scanjs-rules": "^0.2.1",
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

yeah this one was really being a PITA

@anthonyronda
Copy link
Member

I could be wrong but I think the Tweaks menu functionality should also be written somewhere as TODO items

Comment on lines +79 to +81
"@fortawesome/fontawesome-free": "^6.4.0",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0"
Copy link
Member

Choose a reason for hiding this comment

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

I forget what our conversation on this was. Why are these included as dependencies when Foundry includes fontawesome?

import { defineConfig } from "rollup";

// shared rollup plugins
Copy link
Member

Choose a reason for hiding this comment

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

what is meant by shared vs system rollup plugins? UFT vs OSE?

Comment on lines +26 to +30
if (!this.hasAttribute("readonly") && !this.hasAttribute("disabled"))
this.shadowRoot
?.querySelector("label")
?.addEventListener("click", (e) => {
const evt = new Event("roll") as Event & {metaKey: boolean, ctrlKey: boolean};
Copy link
Member

Choose a reason for hiding this comment

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

what is the reasoning here? Why do we check if the ability score is editable before allowing rolls on it? When is it disabled?

Comment on lines +12 to +13
font-size: var(--spacing-full); /* TODO: variables! ems! */
line-height: 38px !important;
Copy link
Member

Choose a reason for hiding this comment

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

We only get to use Foundry's font scaling settings if we use Foundry's own font size variables

@@ -16,7 +16,7 @@
"env": {
"browser": true
},
"ignorePatterns": ["**/lang/**/*.json", "**/*.d.ts"],
"ignorePatterns": ["rollup.config.mjs", "**/lang/**/*.json", "**/*.d.ts"],
Copy link
Member

Choose a reason for hiding this comment

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

Sorry that I forgot how to contain everything in a single review for a couple of these!

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.

Less of a request for changes, more of a request for dialog :)

Comment on lines +15 to +29
get #value() {
const value = parseInt(this.getAttribute("value") || '');
if (isNaN(value)) return 0;
return value;
}

get #max() {
const max = parseInt(this.getAttribute("max") || '');
if (isNaN(max)) return 100;
return max;
}

get #progress() {
return (this.#value / this.#max * 100) || 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

it's missing the (admittedly hard to make extensible) tick marks for each of the encumbrance step-down points

image

Copy link
Member

Choose a reason for hiding this comment

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

I like how it looks though

Comment on lines +37 to +38
<uft-expandable-section type="ability" can-create aria-expanded>
<h2 slot="heading">{{localize "OSE.category.abilities"}}</h2>
Copy link
Member

Choose a reason for hiding this comment

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

I don't have a lot of imagination for why this has to be expandable. I'll have to go back to the original design to see what that looked like

image

@anthonyronda
Copy link
Member

this is frustrating. 5-6 of my review comments got lost :(

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.

2 participants