From 5c1d2f63978d33044343379c01762e3c2d99353e Mon Sep 17 00:00:00 2001 From: Mute Date: Thu, 27 Oct 2022 22:50:08 +0000 Subject: [PATCH] dev.5 I thought I was being clever with Intl API, but it was a mistake, had to make it dumb and simple instead. Fixes time display with non-US locales. --- mbchc-dev.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mbchc-dev.user.js b/mbchc-dev.user.js index 675162a..93b1d3f 100644 --- a/mbchc-dev.user.js +++ b/mbchc-dev.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name MBCHC -// @version dev.4 +// @version dev.5 // @description Mute's Bondage Club Hacks Collection // @author codename.mute@proton.me // @namespace https://code.fleshless.org/mute/ @@ -24,7 +24,7 @@ if (!window.AsylumGGTSSAddItems) throw "AsylumGGTSSAddItems() not found, aborting MBCHC loading" if (window.MBCHC) throw "MBCHC found, aborting loading" window.MBCHC = { - VERSION: "dev.4", + VERSION: "dev.5", TARGET_VERSION: "R85", NEXT_MESSAGE: 1, LOG_MESSAGES: false, @@ -623,8 +623,8 @@ window.DrawRect(CharX + 175 * Zoom, CharY, 50 * Zoom, 50 * Zoom, colour) } if ((window.ChatRoomHideIconState < 1) && C.MBCHC_LOCAL && C.MBCHC_LOCAL.TZ) { - let localtime = new Date(window.CommonTime() + window.MBCHC.UTC_OFFSET + C.MBCHC_LOCAL.TZ * 60 * 60 * 1000) - let text = localtime.toLocaleTimeString([], {hourCycle: "h24", hour: "2-digit"}) + let hours = new Date(window.CommonTime() + window.MBCHC.UTC_OFFSET + C.MBCHC_LOCAL.TZ * 60 * 60 * 1000).getHours() + let text = (hours < 10) ? "0" + hours.toString() : hours.toString() window.DrawTextFit(text, CharX + 200 * Zoom, CharY + 25 * Zoom, 46 * Zoom, "white", "black") } return(next(nextargs))