Skip to content

Commit

Permalink
Fixed 0 to 1-based display for fuzzy time changes
Browse files Browse the repository at this point in the history
fixes #132
  • Loading branch information
DC23 committed Nov 20, 2024
1 parent a494fbc commit 6ce4204
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/uipanel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,17 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) {
if (UIPanel.#showDBTime || UIPanel.#showRadialClocks) {
const dbtime = Helpers.factorDragonbaneTime(this.#time)
dbtime.shiftName = Helpers.getDragonbaneShiftName(dbtime.shifts)
dbtime.textColor = context.textColor // it's the same color for now, but could be different
dbtime.textColor = context.textColor // it's the same color for now, but could be different

if (UIPanel.#showDBTime) {
// new approach: just pass in a data object and handle layout in the template
if (Helpers.showTimeOfDay) dbtime.days = null // hide days if they are already shown in time string
context.dbtime = dbtime
context.dbtime = foundry.utils.deepClone(dbtime)
// display as 1-based
context.dbtime.days += 1
context.dbtime.shifts += 1
context.dbtime.stretches += 1
// make adjustments just to the copy, since the original is used for the graphical display
if (Helpers.showTimeOfDay) context.dbtime.days = null // hide days if they are already shown in time string
}

if (UIPanel.#showRadialClocks) context.clocks = this.#prepareClocks(dbtime)
Expand Down

0 comments on commit 6ce4204

Please sign in to comment.