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

Option to use dekads (10 days period) rather than weeks (7 days period) #276

Closed
7 tasks done
GregoryWarn opened this issue Dec 8, 2024 · 7 comments · Fixed by #302
Closed
7 tasks done

Option to use dekads (10 days period) rather than weeks (7 days period) #276

GregoryWarn opened this issue Dec 8, 2024 · 7 comments · Fixed by #302
Assignees
Labels
core feature A core planned feature in progress Implementation is in progress
Milestone

Comments

@GregoryWarn
Copy link
Contributor

GregoryWarn commented Dec 8, 2024

Is your feature request related to a problem? Please describe.
It's not a big problem, but I use to divide each month in 3 dekads (10 days period) in my campaign setting like ancient greeks.
So, for example, day 18 should be "day 8, dekad 2" rather than "day 4, week 3"

Describe the solution you'd like
A setting option which let choose dekads or weeks

Describe alternatives you've considered
A sort of counter that every {7or10 days} add +1 to {week or dekad}

PS: I'm a self-taught beginner programmer so I don't realize if it's an easy thing to do or not


  • Module setting for the number of days in a week, up to a max of 14.
  • localised default values for the day names. Days up to 7 will use the traditional names. Days > 7 will use names in the format "Eightday", "Nineday", "Tenday" up to "Fourteenday". Those are boring names, but anyone who wants to use this option will need to come up with their own names. That's not my job!
  • Refactor the weekday names settings menu to use the new settings.
  • Refactor the weekday names settings menu so that the name of the week setting is visually distinct from the day names. At the moment it looks like a day name and that's bad UI design.
  • Code changes to Constants so that daysPerWeek is a proxy for the module setting.
  • Refactor the UI to use the new settings
  • Test test test
@GregoryWarn GregoryWarn added the enhancement New feature or request label Dec 8, 2024
@DC23
Copy link
Owner

DC23 commented Dec 8, 2024

It should be quite doable, since I don't actually track weeks or months at all internally. Those are simply calculated based on values stored or derived in src/constants.mjs. The same value can/should be used for the number of segments in the circular clock for weeks.

@DC23 DC23 self-assigned this Dec 9, 2024
@DC23 DC23 modified the milestone: v1.2.0 Dec 9, 2024
@DC23
Copy link
Owner

DC23 commented Dec 9, 2024

Actually, I have thought a little more about this. It's true that calculation of the number of "weeks" based on an arbitrary number of days in a "week" is already data driven, based on whatever number is in Constants.daysPerWeek, and the design of that class already supports values drawn from module settings. See Constants.minutesPerStretch, (which I need to rename to minutesPerTurn as I am removing code references to Dragonbane stretches, but that's a different topic!). However, #169 added customisable names of the days of the week, so that requires some thought regarding the impact of this feature.

If I implement the feature as you request, with a hard switch between 7-day weeks and 10-day dekads, I'm almost certain at some point in the future to get a new request for "my game world uses weekly divisions of 5 days, or 6, or 12".

I'm torn between two responses now. First is to implement something simple:

  1. support an arbitrary but bounded week length. Say a minimum of 5 and a maximum of 12 or something.
  2. Extend the current module settings for customising the named days of the week to allow unique names for each day. There are a few ways this can be done, depending on which path I choose it's either a minimal or large UI change.
  3. Update the documentation which currently has a lot of references to "7-day week"

I already have customisation support for the word used for "week". Once this is all in place, you could then implement Dekads by setting the week length to 10 days, and the word used for "week" to "dekad". But it's flexible, because I don't need to implement something else for the 12 day week, or the 5, the 6 or whatever.

The other response is to say "meh, it's too hard, just use Small Time and the Simple Calendar modules". But I already know I'm not going to say that 😄

@DC23 DC23 added this to the v1.2.0 milestone Dec 9, 2024
DC23 added a commit that referenced this issue Dec 9, 2024
@DC23 DC23 added core feature A core planned feature and removed enhancement New feature or request labels Dec 10, 2024
@DC23 DC23 added the in progress Implementation is in progress label Dec 15, 2024
DC23 added a commit that referenced this issue Dec 15, 2024
…o separate section.

It's still a work in progress. Needs to dynamically redraw to respond to week lengths but it's a start.
#276
@DC23
Copy link
Owner

DC23 commented Dec 15, 2024

Getting there:
image

@DC23
Copy link
Owner

DC23 commented Dec 15, 2024

I think it's done. I'll make an alpha pre-release build and you can start testing.
Weeks from 5 to 14 days long are supported. The actual time isn't changed when changing the week length, so if you are at 10 days with a seven-day week, it will display as "Wednesday week 2". Change the settings to 10-day weeks and after the reload it will now be "Tenday week 1". It's the same thing: the tenth day from when time starts counting.

image

@DC23
Copy link
Owner

DC23 commented Dec 15, 2024

@GregoryWarn If you have time to test, then the v1.2.0-alpha2 release contains this feature. You can install in Foundry using the manifest URL:

https://github.com/DC23/jd-easytimekeeping/releases/download/v1.2.0-alpha2/module.json

Everything looks ok to me, but other people always seem to find things that I miss. The main issue I am aware of is that the settings form layout gets a little messy as elements get hidden when reducing the number of days in the week. I can't find a way to convince the form to redo the flex layout. It's not a major issue though.

@GregoryWarn
Copy link
Contributor Author

I tried it in different configurations and it seems to work fine!!! Great job!
PS: Not strictly related but a possible future feature could be an option to shrink black window width and keep fixed window near the corner to save space on the screen
Master
Player

@DC23
Copy link
Owner

DC23 commented Dec 15, 2024

Thanks for testing, I'm glad it seems to be working.

The window size/spacing issue has been a nuisance for a while. I made adjustments recently to the padding and margins in the CSS, so that in my browser I see perfect alignment with the core Player UI when docked:
image

And the default floating UI size is also nice and compact. I didn't make any manual resizing changes before the screen shot:
image

I think there are browser differences, and/or language differences (different word length) affecting what you see.

As for "keeping the fixed window near the corner", it has a left margin of 15 pixels on purpose to align it neatly with the left edge of the Player UI because I think that looks better. The intent is for the width to match the core UI, but it will expand to the right when needed to fit things in.

As you say, any future changes are a new issue though. I'll close this one now. Thanks again for testing. This one was hard work. Took half a weekend!

@DC23 DC23 closed this as completed Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature A core planned feature in progress Implementation is in progress
Projects
None yet
2 participants