From 8b7b77d821e7a8c82057c8991a51a947ffdb5e2a Mon Sep 17 00:00:00 2001 From: josh-romer Date: Fri, 20 Mar 2026 21:17:02 -0400 Subject: [PATCH 1/3] fixed smooth progress bar reset bug --- packages/userscripts/hud-improved/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/userscripts/hud-improved/index.ts b/packages/userscripts/hud-improved/index.ts index fe44cdb..4660a3d 100644 --- a/packages/userscripts/hud-improved/index.ts +++ b/packages/userscripts/hud-improved/index.ts @@ -173,7 +173,7 @@ animationStyleSelect?.addEventListener("change", (e) => { let count = 0; let prevProgress = 0; const countTickFraction = (() => { - const tickFrames = 28; + const tickFrames = 30; return () => { const totalFrames = (progress_bar_target + 1) * tickFrames; if (progress_bar_at <= 0 && prevProgress !== 0) { @@ -200,7 +200,7 @@ function paintCustomProgressBar() { //progress bar const { x, y, height, width, colors } = config; if (progress_bar_active) { - const percent = getPercent(config.animation); + const percent = getPercent(config.animation) ?? 0; ctx.fillStyle = colors.activeBackgroundColor; ctx.fillRect(x, y - TILE_SIZE / 8, width, height); ctx.fillStyle = colors.activeForegroundColor; @@ -209,6 +209,7 @@ function paintCustomProgressBar() { ctx.strokeRect(x, y - TILE_SIZE / 8, width, height); } else { prevProgress = 0; + count = 0; ctx.fillStyle = colors.idleBackgroundColor; ctx.fillRect(x, y - TILE_SIZE / 8, width, height); ctx.strokeStyle = colors.idleStrokeColor; From cc22ad0fdb594ffb3b46c48252dc672b53aaab87 Mon Sep 17 00:00:00 2001 From: josh-romer Date: Fri, 20 Mar 2026 21:46:38 -0400 Subject: [PATCH 2/3] added menu for settings toggle --- packages/userscripts/hud-improved/index.ts | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/userscripts/hud-improved/index.ts b/packages/userscripts/hud-improved/index.ts index 4660a3d..739e0eb 100644 --- a/packages/userscripts/hud-improved/index.ts +++ b/packages/userscripts/hud-improved/index.ts @@ -230,6 +230,15 @@ window.addEventListener("keyup", setCoordinates); unsafeWindow.paint_progress_bar = paint_progress_bar_proxy; +const openModal = () => { + const modal = document.getElementById("color-picker-modal"); + if (modal) { + modal.style.display = modal.style.display === "none" ? "block" : "none"; + } +}; + +GM_registerMenuCommand("Settings menu", openModal, {}); + GM_registerMenuCommand( "Reset to default settings", () => { @@ -246,33 +255,30 @@ GM_registerMenuCommand( ); function moveBar(this: Window, ev: KeyboardEvent) { - if (ev.altKey && ev.ctrlKey && ev.key === "z") { + if (ev.altKey && ev.key === "z") { config.x = mouse_over_now.x; config.y = mouse_over_now.y; } - if (ev.altKey && ev.ctrlKey && ev.key === "j") { + if (ev.altKey && ev.key === "j") { config.width = config.width * 0.9; config.height = config.height * 0.9; } - if (ev.altKey && ev.ctrlKey && ev.key === "k") { + if (ev.altKey && ev.key === "k") { config.width = config.width * 1.1; config.height = config.height * 1.1; } - if (ev.altKey && ev.ctrlKey && ev.key === "m") { - const modal = document.getElementById("color-picker-modal"); - if (modal) { - modal.style.display = modal.style.display === "none" ? "block" : "none"; - } + if (ev.altKey && ev.key === "m") { + openModal(); } } function setCoordinates(this: Window, ev: KeyboardEvent) { - if (ev.altKey && ev.ctrlKey && ev.key === "z") { + if (ev.altKey && ev.key === "z") { GM_setValue("config", config); } - if (ev.altKey && ev.ctrlKey && ev.key === "j") { + if (ev.altKey && ev.key === "j") { GM_setValue("config", config); } - if (ev.altKey && ev.ctrlKey && ev.key === "k") { + if (ev.altKey && ev.key === "k") { GM_setValue("config", config); } } From 5c83d7faef3b1eb127a745f6955e9695593cf50b Mon Sep 17 00:00:00 2001 From: josh-romer Date: Fri, 20 Mar 2026 22:24:12 -0400 Subject: [PATCH 3/3] added keybinding to instructions modal --- packages/userscripts/hud-improved/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/userscripts/hud-improved/index.ts b/packages/userscripts/hud-improved/index.ts index 739e0eb..cfc124e 100644 --- a/packages/userscripts/hud-improved/index.ts +++ b/packages/userscripts/hud-improved/index.ts @@ -104,7 +104,16 @@ const menuModal = `
- Press Ctrl+Alt+M to toggle + Press Alt+M to toggle settings menu +
+
+ Hold Alt+Z to move bar +
+
+ Hold Alt+J to move increase bar size +
+
+ Press Alt+K to move increase bar size
`;