Gerdofal / foundryvtt-cyberpunkred

GNU General Public License v3.0
20 stars 18 forks source link

Add option to unlink NPC healthpool from BOD stat #87

Closed njfox closed 3 years ago

njfox commented 3 years ago

This addresses #50 by adding a boolean to the actor model that specifies whether the healthpool should be linked to the BOD stat or not, which defaults to true. The option can be disabled by deselecting a checkbox on the NPC sheet, at which point the user can manually update the max health total. If you reselect the checkbox it will behave like it did before by automatically adjusting based on the current BOD stat value.

I'm opening this as a draft because the checkbox setup I'm using in actor-npc-sheet.html is extremely bad and ugly, and I could use some help or advice on how to present this option in a pretty way (my HTML skills are not very good).

Gerdofal commented 3 years ago

This looks like it would work. I'll be working on the sheet tonight and tomorrow hopefully for release Thursday or Friday :)

njfox commented 3 years ago

Great, can you help with the styling for the unlink checkbox? Or do you want me to remove the checkbox but leave the data changes for you to add an option element somewhere else on the sheet?

Gerdofal commented 3 years ago

Yep. Easiest way would be to code it the way I did the settings tab, the CSS is already in place for that:

Here it is from line 704 of actor-character-sheet.html

<input class="settings" type="checkbox" id="set_simplecombatsetup" name="data.settings.prefs.simpleCombatSetup" {{checked data.settings.prefs.simpleCombatSetup}}>
<label class="cpr-center settings-item settings clickable" for="set_simplecombatsetup">{{localize "CPRED.usesimplecombatname"}}</label>

So in your case, I think this would work:

<input class="settings" type="checkbox" id="set_linkbodytohealth" name="data.settings.prefs.linkBodyToHealth" {{checked data.settings.prefs.linkBodyToHealth}}>
<label class="cpr-center settings-item settings clickable" for="set_linkbodytohealth">{{localize "CPRED.linktobod"}}</label>
njfox commented 3 years ago

Thanks! I saw that, but I wasn't sure if it made sense to stick it next to the health label since there is no settings tab on the NPC sheet. It ends up looking kind of wonky like this:

linkbod

Do you think it's worth adding a settings tab to the NPC sheet? Or should we shrink this down into a small text option in parentheses next to the "Health Pool" label? (Like "Health Pool (Link to BOD?)"?

Gerdofal commented 3 years ago

Hmmm. Maybe keep it simple and add something like style="width: 100px;" to the tag?

njfox commented 3 years ago

How's this? Still doesn't look great IMO but it might work for now.

linkbod

Gerdofal commented 3 years ago

I think this is usable for now, we will need to re-do the UI for weapons completely some version, but functionality is important at the moment