Skip to content

Commit

Permalink
Merge pull request #153 from DC23/152-shift-and-day-graphical-clocks-…
Browse files Browse the repository at this point in the history
…dont-wrap-correctly

Fixed shift and day clock bug. They now transition smoothly.
DC23 authored Nov 20, 2024
2 parents 21038a8 + 589a2a2 commit df1ba7c
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/uipanel.mjs
Original file line number Diff line number Diff line change
@@ -91,19 +91,6 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) {
this.render(true)
}

/**
* Simple remapping of the shifts.
* Technically night shift is 12am to 6am and is the first shift of the day,
* but I think it looks better if displayed as the last shift of the day.
* This lookup table rotates the shift indicies for the radial clock.
*/
static #shiftDisplay = {
0: 4, // night, 12am to 6am
1: 1, // morning, 6am to 12pm
2: 2, // afternoon, 12pm to 6pm
3: 3, // evening, 6pm to 12am
}

#prepareClocks (time) {
const displayDay = (time.days % 7) + 1
// prep the time data
@@ -121,7 +108,7 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) {
},
{
id: 'etk-shifts',
value: UIPanel.#shiftDisplay[time.shifts],
value: time.shifts + 1,
max: Constants.shiftsPerDay,
name: time.shiftName,
color: UIPanel.#clockColor,

0 comments on commit df1ba7c

Please sign in to comment.