I have been tossing around the idea of creating a new Extension that will extend the functionality for the Calendar in Fantasy Grounds for tracking the moons in a campaign world. For a better idea of what I am talking about, take a look at the Fantasy Calendar Generator over at donjon. Given a number of moons to track, the number of days per moon cycle, and the length of the weeks, months, and years on the calendar, this generator is able to calculate the phases of the moon on any given calendar day.

I think this functionality is pretty awesome, and in some initial testing I have been able to replicate it within my Lua code within Fantasy Grounds. However, just having the code loop that will calculate the moon phases in place is a far cry from having a working extension I can use and share with the community, and I am putting some thought into what the best path to go from where I currently am in my development to having a complete extension that I can share with others. So, here are my thoughts and some questions as well, which hopefully the community might have a few suggestions on how I can build the extension I have in my mind.

What I would like to be able to do is take the main Calendar window and add a new button to it to open up a new "Configure Moons" window. This window would allow you to set a number of moons to track, how many days per moon cycle, the phase, shift, and a name for each moon. So, I guess in this regard my first question would be what the best way to add said button to the window might be? I don't want to have to re-define all the calendar windowclasses and Lua functionality in my extension just to be able to add a single button to the window, especially since some custom rulesets might have redefined these windows as well and I want to respect those changes rather than impose my own.

Once I resolve that little issue, the next thought that comes to mind is on how to convey the moon phase information back to the user once it has been calculated. For this, my first idea was to create a new widget to be attached to each calendar_day windowinstance within a calendar month. My intention was that clicking/hovering over this widget would cause a little details window to be displayed with the details for each moon and its current phase. From what I have been able to tell though, this approach won't work out too well since widget's don't appear to support the hover or the click event, and it also seems like it would be a pain having to completely overwrite the existing code in the calander_period_list.lua file that is creating the calendar for display just to add a widget to the day's display (especially when that widget is effectively only a graphic with no functional value).

So, that is pretty much where I am at with it so far... Great idea but not sure on the implementation details. I am also curious how much the community might be interested in seeing an extension such as this, since my development time is rather limited and I like to spend it working on projects that will likely be put to good use both in my own games as well as by others. Even if I do take this extension idea to the next level, it may be a bit before I get much of a chance to actually dive into it in full, but I think this is a pretty good extension idea and I would very much like to flush it out a bit and try to develop it more fully.

Thanks, as always, for any suggestions, comments, or feedback you might have.