Skip to content

Commit

Permalink
Merge pull request #203 from vigoren/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
vigoren committed Sep 9, 2021
2 parents a2681e0 + abfdd04 commit 9ad67f1
Show file tree
Hide file tree
Showing 40 changed files with 3,932 additions and 6,192 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules/
docs/coverage/
dist/
/.vs
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Change Log

## v1.3.39 - Season Changes, QoL Improvements, API Changes and Bug Fixing

### Season Changes

- Updated the Starting Month and Starting Day fields to be one field "Starting Date" that uses the built-in Date Selector to choose a month and day.
- Added the ability to set the Sunrise and Sunset times for the first day of the season:
- The setting of the times uses the built-in Time Selector to ensure that only times that work with your calendar can be chosen and that the sunset is always after the sunrise.
- Sunrise and sunset times slowly change as days progress to meet the sunrise/sunset time of the next season. This is to add a smooth transition between seasons sunrise and sunset times.
- Added buttons to the time control to advance to the next dawn, midday, dusk or midnight.
- Dawn will advance to the next sunrise.
- Midday will advance to the next middle of the day. The midday is calculated as the exact middle of the day, for most calendars this will be 12:00pm but for calendars with different hours per day it will calculate correctly.
- Dusk will advance to the next sunset.
- Midnight will advance to the next beginning of the day, time 00:00.
- Set up default sunrise/sunset times for predefined calendars. Where information was available used that otherwise they will default to a 6am sunrise and a 6pm sunset.

### Quality of Life Improvements

- Added a new time setting to specify how long a round of combat lasts in seconds. This is to address the issue where the clock did not advance as combat rounds passed when using systems that do not increment time during combat.
- Removed the Import/Export dialog for about-time and Calendar/Weather that appears on the first load of a world. This dialog was causing issues for some users and is no longer needed as these options can be reached through the calendar configuration dialog.

### API Changes

- Functions that return season information (`SimpleCalendar.api.getCurrentSeason`, `SimpleCalendar.api.getAllSeasons` and `SimpleCalendar.api.timstampToDate`) now includes the sunrise and sunset times for the season, as set through the new season options. The times are represented as seconds passed for that day eg. 3600 would be 1:00am in a Gregorian calendar.
- The function `SimpleCalendar.api.timestampToDate` has 2 new properties, sunrise and sunset. These values represent the timestamps for the sunrise and sunset times parsed from the passed in timestamp.
- Fixed a bug with the `SimpleCalendar.api.timestampToDate` function where the display time was always returning as the current time not the time from the passed in timestamp.


### Bug Fixes

- Fixed a bug with seasons always showing the last season for all, or most months. Seasons were expecting to be in order, now order does not matter.
- Improvements to the built-in date/time selector to ensure a better user experience.
- Fixed a bug where setting a different hours per day could cause the clock to not advance days properly.

### Foundry 0.8.9

- Made sure that Simple Calendar works as expected with Foundry version 0.8.9!

### Translations

- I am happy to say that Simple Calendar has been translated to French thanks to [JDR-Ninja](https://github.com/JDR-Ninja) with input from [Julien Stébenne](https://github.com/TheBird956)!
- Updates to the Spanish translation thanks to [lozalojo](https://github.com/lozalojo)!

## v1.3.28 - API Changes

- Updated the [DateTimeChange hook](./docs/Hooks.md#datetime-change) to have a new property in its returned value called "date". This property contains the same contents as the [API timestampToDate function](./docs/API.md#simplecalendarapitimestamptodatetimestamp) with the current timestamp passed in. This is to have the exact same data available in the hook as the API function. As a result some existing properties will be removed as stated below:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ Language|Translator(s)
--------|----------
German (de)|[MasterZelgadis](https://github.com/MasterZelgadis) <br/> [BlueSkyBlackBird](https://github.com/BlueSkyBlackBird) <br/> [Fallayn](https://github.com/Fallayn)
Traditional Chinese (zh)|[benwater12](https://github.com/benwater12)
Spanish (es)|[areymoreno](https://github.com/areymoreno)
Spanish (es)|[areymoreno](https://github.com/areymoreno) <br/> [lozalojo](https://github.com/lozalojo)
Korean (ko)|[drdwing](https://github.com/drdwing)
Portuguese Brasil (pt-BR)|[castanhocorreia](https://github.com/castanhocorreia)
Czech (cs)|[robertjunek](https://github.com/robertjunek)
French (fr)|[JDR Ninja](https://github.com/JDR-Ninja) <br/> [TheBird956](https://github.com/TheBird956)

If your language is missing from the list, and you would like to help translate Simple Calendar please follow these steps:

Expand Down
5 changes: 2 additions & 3 deletions __mocks__/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const game = {
switch (settingName){
case SettingNames.AllowPlayersToAddNotes:
case SettingNames.DefaultNoteVisibility:
case SettingNames.ImportRan:
return false;
case SettingNames.YearConfiguration:
return {numericRepresentation: 0, prefix: '', postfix: '', showWeekdayHeadings: true, firstWeekday: 0, yearZero: 0, yearNames: [], yearNamingRule: 'default', yearNamesStart: 0};
Expand All @@ -71,9 +70,9 @@ const game = {
case SettingNames.GeneralConfiguration:
return {gameWorldTimeIntegration: GameWorldTimeIntegrations.None, showClock: false, pf2eSync: true, permissions: {viewCalendar: {player:true, trustedPlayer: true, assistantGameMaster: true, users: undefined}, addNotes:{player:false, trustedPlayer: false, assistantGameMaster: false, users: undefined}, reorderNotes:{player:false, trustedPlayer: false, assistantGameMaster: false}, changeDateTime:{player:false, trustedPlayer: false, assistantGameMaster: false, users: undefined}}}
case SettingNames.TimeConfiguration:
return {hoursInDay:0, minutesInHour: 1, secondsInMinute: 2, gameTimeRatio: 3, unifyGameAndClockPause: false, updateFrequency: 1};
return {hoursInDay:0, minutesInHour: 1, secondsInMinute: 2, secondsInCombatRound: 6, gameTimeRatio: 3, unifyGameAndClockPause: false, updateFrequency: 1};
case SettingNames.SeasonConfiguration:
return [[{name:'', startingMonth: 1, startingDay: 1, color: '#ffffff'}]];
return [[{name:'', startingMonth: 1, startingDay: 1, color: '#ffffff', sunriseTime: 0, sunsetTime: 0}]];
case SettingNames.MoonConfiguration:
return [[{"name":"","cycleLength":0,"firstNewMoon":{"yearReset":"none","yearX":0,"year":0,"month":1,"day":1},"phases":[{"name":"","length":3.69,"icon":"new","singleDay":true}],"color":"#ffffff","cycleDayAdjust":0}]];
}
Expand Down
4 changes: 4 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ month|Number|0|The index of the month represented in the timestamp.
monthName|String|""|**Depreciated** Please use display.monthName instead. This will be removed when Foundry v9 Stable is released.
second|Number|0|The seconds represented in the timestamp.
showWeekdayHeadings|Boolean|true|If to show the weekday headings for the month.
sunrise|Number|0|The timestamp of when the sun rises for this date.
sunset|Number|0|The timestamp of when the sun sets for this date.
weekdays|String Array|[]|A list of weekday names.
year|Number|0|The year represented in the timestamp.
yearName|String|""|**Depreciated** Please use display.yearName instead. This will be removed when Foundry v9 Stable is released.
Expand Down Expand Up @@ -696,6 +698,8 @@ name|String|''|The name of the season.
color|String|#ffffff|The color associated with this season.
startingDay|Number|1|The day index of the month that the season starts on.
startingMonth|Number|1|The month index that the season starts on.
sunrise|Number|0|The number of seconds into the starting day of the season that the sun rises. EG. a value of 3600 would be 1:00am in a Gregorian Calendar.
sunset|Number|0|The number of seconds into the starting day of the season that the sun sets. EG. a value of 82800 would be 11:00pm in a Gregorian Calendar.

## Time Object

Expand Down
16 changes: 13 additions & 3 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Configuration of the calendar is straight forward. As the GM open the configuration dialog and start customizing your calendar!

## Settings
- [General Settings](#general-settings)
- [Note Settings](#note-settings)
- [Year Settings](#year-settings)
- [Month Settings](#month-settings)
- [Weekday Settings](#weekday-settings)
- [Leap Year Settings](#leap-year-settings)
- [Time Settings](#time-settings)
- [Moon Settings](#moon-settings)

## General Settings

This tab allows you to set some general settings for the entire calendar.
Expand Down Expand Up @@ -145,10 +155,9 @@ The options available for customizing each Season are listed below:
Setting | Description
--------|------------
Season Name | These text boxes for each season allow you to change the name of an existing season.
Starting Month | These drop downs for each season show all of the months of your calendar and allow you to choose which month this season starts in.
Starting Day | These drop downs for each season show all of the days for the selected Starting Month and allow you to choose with day the season starts on in that month.
Starting Date | This field will open up a date selector that allows you to choose a month and day from the calendar for when the season starts.
Sunrise/Sunset Time | This field will open up a time selector that allows you to choose the sunrise and sunset times. It also makes sure that the sunset time is after the sunrise time.
Color | Seasons can be assigned a color, this color is used as the background color for the calendar display when it is the current season. There is a list of predefined colors that work well for standard season and the option to enter a custom color.
Custom Color | If the color option is set to Custom Color this text box will appear where you can enter a custom Hex representation of a color to use for the season.
Remove Button | These buttons for each season allow you to remove the specific season from the list.
Add New Season Button | This button will add a new season to the bottom of the list with a default name that you can then configure to your liking.
Remove All Seasons Button | This button will remove all of the seasons from the list.
Expand Down Expand Up @@ -212,6 +221,7 @@ Setting | Description
Hours in a Day | This defines how many hours make up a single day.
Minutes in a Hour | This defines how many minutes make up a single hour.
Seconds in a Minute | This defines how many seconds make up a single minute.
Seconds per Combat Round | This defines how many seconds pass during 1 round of combat. **Important**: This is only applied if the current system does not increment time during combat rounds!

### Clock Settings

Expand Down
Loading

0 comments on commit 9ad67f1

Please sign in to comment.