From 6d7fad6b4c372ff36f627d782ceaeb8747f8eaa7 Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Fri, 24 Feb 2023 14:02:03 -0800 Subject: [PATCH] Tweak wording on the upcoming Salmon Run shift post --- .../generators/SalmonRunUpcomingStatus.mjs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/social/generators/SalmonRunUpcomingStatus.mjs b/app/social/generators/SalmonRunUpcomingStatus.mjs index 3aa4032..8cb14db 100644 --- a/app/social/generators/SalmonRunUpcomingStatus.mjs +++ b/app/social/generators/SalmonRunUpcomingStatus.mjs @@ -30,11 +30,11 @@ export default class SalmonRunUpcomingStatus extends StatusGenerator _getDescription(schedule) { switch (true) { case schedule.isBigRun: - return `A BIG RUN shift has been added to the schedule! #salmonrun #splatoon3`; + return `A BIG RUN shift on ${schedule.settings.coopStage.name} has been added to the schedule! #salmonrun #splatoon3`; case schedule.isGrizzcoMystery: - return `A Salmon Run shift with GRIZZCO MYSTERY WEAPONS has been added to the schedule! #salmonrun #splatoon3`; + return `A Salmon Run shift with GRIZZCO MYSTERY WEAPONS on ${schedule.settings.coopStage.name} has been added to the schedule! #salmonrun #splatoon3`; case schedule.isMystery: - return `A Salmon Run shift with MYSTERY WEAPONS has been added to the schedule! #salmonrun #splatoon3`; + return `A Salmon Run shift with MYSTERY WEAPONS on ${schedule.settings.coopStage.name} has been added to the schedule! #salmonrun #splatoon3`; } } @@ -52,10 +52,17 @@ export default class SalmonRunUpcomingStatus extends StatusGenerator let startTime = Date.parse(schedule.startTime); let now = useTimeStore().now; - let hours = Math.min((startTime - now) / (1000 * 60 * 60)); - hours = hours === 1 ? '1 hour' : `${hours} hours`; + let hours = Math.floor((startTime - now) / (1000 * 60 * 60)); - lines.push(`In ${hours} this shift will begin on ${schedule.settings.coopStage.name} with:`); + let formattedTime; + if (hours >= 24) { + let days = Math.floor(hours / 24); + formattedTime = days === 1 ? '1 day' : `${days} days`; + } else { + formattedTime = hours === 1 ? '1 hour' : `${hours} hours`; + } + + lines.push(`This shift will start in ${formattedTime} with these weapons:`); lines.push(...schedule.settings.weapons.map(w => `– ${w.name}`)); return lines.join('\n');