CarlosFdez / global-progress-clocks

FoundryVTT module for Blades in the Dark style progress clocks that show on the sidebar
MIT License
7 stars 7 forks source link

Private Clocks #7

Closed buttonboy closed 7 months ago

buttonboy commented 7 months ago

Added ability for GMs to create private clocks that can not be viewed by players.

CarlosFdez commented 7 months ago

Thanks for doing this. This seems against the spirit of clocks, but it can't hurt.

Can you change how visibility is set using a hidden css class? Something like {{#if (and clock.private @root.editable)}}hidden{{/if}}. If that doesn't mess with sortable then it would be much preferred as a solution. Otherwise making it a single if using the "and" handlebars helper would be preferred as well.

buttonboy commented 7 months ago

Not a problem! That's actually the first way I did it. I was just slightly concerned a skilled player would be able to unhide the private clock. However the css class approach is much simpler code. I was unfortunatly unable to figure out how to do an 'and' with handlebarjs and could not find any documentation. So I settled on an 'unless' nested in an 'if'. I hope this will suffice.

Sorting works fine with this approach. The only noticable diffrence is there is not animation when hiding or unhiding a clock. But in reality I don't think that will happen very often.

My GM likes to use clocks for various things like tracking if an encounter is close to happening. So hopefully other GMs will find uses for private clocks.

buttonboy commented 7 months ago

Awesome! Thank you! It looks like that is working.

CarlosFdez commented 7 months ago

Thank you. I wont' release this immediately, but it'll be in there when I finally get to finishing the clock theming stuff.