Skip to content

Commit

Permalink
Added graphical clock for days of the week
Browse files Browse the repository at this point in the history
Implements #147
  • Loading branch information
DC23 committed Nov 20, 2024
1 parent 634c97c commit 87e7e57
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
"JDTIMEKEEPING.UI.set": "Set the Time",
"JDTIMEKEEPING.Time.Stretch": "Stretch",
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.name": "Show players the exact time",
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.hint": "The exact time is always shown to the GM and Assistant GM"
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.hint": "The exact time is always shown to the GM and Assistant GM",
"JDTIMEKEEPING.Time.DayAndWeek": "Day {day}, week {week}"
}
3 changes: 2 additions & 1 deletion lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
"JDTIMEKEEPING.UI.set": "Régler l'heure",
"JDTIMEKEEPING.Time.Stretch": "Période",
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.name": "Show players the exact time",
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.hint": "The exact time is always shown to the GM and Assistant GM"
"JDTIMEKEEPING.Settings.ShowPlayersExactTime.hint": "The exact time is always shown to the GM and Assistant GM",
"JDTIMEKEEPING.Time.DayAndWeek": "Day {day}, week {week}"
}
37 changes: 20 additions & 17 deletions src/uipanel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) {
id: 'etk-stretches',
value: time.stretches + 1,
max: Constants.stretchesPerShift,
name: game.i18n.localize('JDTIMEKEEPING.Time.Stretch') + ' ' + (time.stretches+1).toString(),
name:
game.i18n.localize('JDTIMEKEEPING.Time.Stretch') +
' ' +
(time.stretches + 1).toString(),
color: UIPanel.#clockColor,
backgroundColor: '#ffffff',
},
Expand All @@ -123,22 +126,22 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) {
color: UIPanel.#clockColor,
backgroundColor: '#ffffff',
},
// {
// id: 'etk-days',
// value: time.days + 1,
// max: 128,
// name: 'Day',
// color: UIPanel.#clockColor,
// backgroundColor: '#ffffff',
// },
// {
// id: 'etk-totalStretches',
// value: time.totalStretches % Constants.stretchesPerDay,
// max: Constants.stretchesPerDay,
// name: 'Stretches',
// color: UIPanel.#clockColor,
// backgroundColor: '#ffffff',
// },
{
/**
* note that we need to display everything in
* 1-based values, but all the calculations
* are 0-based. Thus we have +1 all over the place.
*/
id: 'etk-days',
value: (time.days + 1) % 7,
max: 7,
name: game.i18n.format('JDTIMEKEEPING.Time.DayAndWeek', {
day: (time.days + 1) % 7,
week: Math.floor(time.days / 7) + 1,
}),
color: UIPanel.#clockColor,
backgroundColor: '#ffffff',
},
]
// derive the radial data
const maxSpokes = 28
Expand Down
2 changes: 1 addition & 1 deletion templates/uipanel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{/if}}
{{/inline}}

{{log this}}
{{!-- {{log this}} --}}
<div class="et-time flexcol receive-pointer-events">
{{> timePartial time=time color=textColor }}

Expand Down

0 comments on commit 87e7e57

Please sign in to comment.