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: added very basic character sheet locking #27

Merged
merged 4 commits into from
Oct 16, 2023
Merged

feat: added very basic character sheet locking #27

merged 4 commits into from
Oct 16, 2023

Conversation

EddieDover
Copy link

Fixes #26

Implements very, very basic character sheet field locking. For now, at least, it prevents players from accidentally clicking on something and not realizing it. It's a global, all-or-none, setting.

Future refinements would include a per-character real-time lock (the way Illandril's Character Sheet Lockdown does it).

It currently locks:

  • Actor Name
  • Actor Size
  • Actor Ability Scores
  • Actor Ability Score Proficiencies
  • Skill Proficiencies

image

@eastcw
Copy link
Owner

eastcw commented Oct 12, 2023

This looks like a good first step! What is here seems to work well, and I like it. I think before this ready for release it needs to reload sheets when they are locked or unlocked - this is essential, otherwise it's unintuitive to use when you need to edit a character sheet as currently you would need to close and reopen the sheet to reload the setting. The next steps after that as I see them would be:

  1. Allowing individual sheets to be locked and unlocked
  2. Being able to let players lock and unlock their own character sheets and/or set a permissions level for locking

@EddieDover
Copy link
Author

I think before this ready for release it needs to reload sheets when they are locked or unlocked

  1. Allowing individual sheets to be locked and unlocked

I already have a branch that moves the lock/unlock feature out of the options and onto the sheet itself, and reloads the sheet after it's toggled. This puts the lock control directly in the players' hands and leaves the GM out of it.

  1. Being able to let players lock and unlock their own character sheets and/or set a permissions level for locking

Having the GM lock/unlock the sheet for the player is easy enough, but will need socket to be enabled, so we can establish two-way communication with the GM and that specific player. I could probably implement this over the weekend.

Having the player lock/unlock the sheets themselves (no sockets needed) would be easier, but we need to decide how much of a hands-on/off approach we want to take with the locking feature.

If it's primarily for a non-malicious “I just like clicking on stuff” player (like some of mine, e.g., the reason I'm invested in this), then there's no issue. But, if we would like to start establishing accountability, then we'd need to consider at the least a notification that “Player X has unlocked/locked their character sheet”.

@eastcw
Copy link
Owner

eastcw commented Oct 13, 2023

Having the GM lock/unlock the sheet for the player is easy enough, but will need socket to be enabled, so we can establish two-way communication with the GM and that specific player.

I hadn't considered needing sockets. I think that's probably beyond the scope of this character sheet since I'd like to keep it as simple and easy to maintain as possible.

If it's primarily for a non-malicious “I just like clicking on stuff” player (like some of mine, e.g., the reason I'm invested in this), then there's no issue.

I agree. I would hope there aren't too many gms that can't trust their players to that extent anyway tbh.

I think at least to start, just a feature that reloads sheets on lock and unlock would be good. If we want to build more later that's okay but as I say I'd like to keep the sheet reasonably streamlined if possible.

@EddieDover
Copy link
Author

@eastcw Thoughts?

@eastcw
Copy link
Owner

eastcw commented Oct 13, 2023

This is really nice!

As somebody who doesn't need or use sheet locking I'm a little concerned that sheets are locked by default whenever you refresh Foundry. Would it be an acceptable compromise to combine the two approaches? I'm thinking perhaps a GM accessible global setting to turn the locking feature on and off, and then if it's turned on it functions as it does here. I think this would be a good compromise between being able to lock sheets, and not being impacted if you don't want to, but without having to communicate between clients or store lock data per sheet. What do you think?

@EddieDover
Copy link
Author

Would it be an acceptable compromise to combine the two approaches?

Fair enough. Updated the code. Let me know what you think.

@eastcw
Copy link
Owner

eastcw commented Oct 13, 2023

First glance looks good! I'll have a proper look through and test it with my group this weekend and hopefully we'll get a release out early next week :)

@eastcw eastcw merged commit b98ee3e into eastcw:main Oct 16, 2023
@EddieDover EddieDover deleted the basic-locking branch October 16, 2023 12:32
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.

[BUG] Doesn't work with Illandril's Character Sheet Lockdown (5e) v4.0.0
2 participants