From a309d8d1f9857c161f20ac21fb619fae2856efe4 Mon Sep 17 00:00:00 2001 From: nicfv Date: Thu, 6 Aug 2026 16:43:48 -0700 Subject: [PATCH 1/5] higher contrast for disabled buttons --- www/games/orbit-idle/src/button.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/games/orbit-idle/src/button.ts b/www/games/orbit-idle/src/button.ts index 4d2a19b..8b8ea27 100644 --- a/www/games/orbit-idle/src/button.ts +++ b/www/games/orbit-idle/src/button.ts @@ -24,7 +24,7 @@ export class Button implements Drawable { constructor(protected text: string, protected color: Color, protected enabled: boolean, protected x: number, protected y: number, protected w: number, protected h: number, protected callback: () => void) { this.isHover = false; this.label = new Label(text, color.getContrastingColor(), 1, false, 'center', 'top', this.x + this.w / 2, this.y + Label.fontSize / 2); - this.disabledColor = new Color(color.red, color.green, color.blue, color.alpha * 0.75); + this.disabledColor = new Color(color.red, color.green, color.blue, color.alpha * 0.5); } /** * Update the value, color, and positioning of the button text. From 959a163502a87de35711325702f9d71503577962 Mon Sep 17 00:00:00 2001 From: nicfv Date: Thu, 6 Aug 2026 16:45:14 -0700 Subject: [PATCH 2/5] reset menu buttons after 5s --- www/games/orbit-idle/src/index.ts | 2 +- www/games/orbit-idle/src/menu.ts | 38 ++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/www/games/orbit-idle/src/index.ts b/www/games/orbit-idle/src/index.ts index a72e3f3..58e4e1b 100644 --- a/www/games/orbit-idle/src/index.ts +++ b/www/games/orbit-idle/src/index.ts @@ -23,7 +23,7 @@ const canv: Canvas = new Canvas({ canv.clear(1); canv.clear(2); system.step(dt); - menu.autosave(dt); + menu.tick(dt); canv.draw(system, 0); canv.draw(player, 1); canv.draw(zoom, 1); diff --git a/www/games/orbit-idle/src/menu.ts b/www/games/orbit-idle/src/menu.ts index 60953a0..d02ccf4 100644 --- a/www/games/orbit-idle/src/menu.ts +++ b/www/games/orbit-idle/src/menu.ts @@ -28,6 +28,10 @@ export class Menu implements Drawable { * Autosave label duration shown in milliseconds */ private static readonly autosaveLabelDuration: number = 2e3; + /** + * Button reset duration in milliseconds + */ + private static readonly buttonResetDuration: number = 5e3; /** * Menu title */ @@ -64,6 +68,14 @@ export class Menu implements Drawable { * Autosave timer in milliseconds */ private autosaveTick: number; + /** + * The number of milliseconds until resetting the save button + */ + private saveReset: number; + /** + * The number of milliseconds until resetting the clear button + */ + private clearReset: number; /** * The callback for saving data */ @@ -86,10 +98,12 @@ export class Menu implements Drawable { constructor(x: number, y: number, width: number) { this.isOpen = false; this.autosaveTick = 0; + this.saveReset = 0; + this.clearReset = 0; this.title = new Label('Menu', new Color(255, 255, 255), 1, false, 'center', 'bottom', x, y - Menu.btnPadding); this.autosaveLabel = new Label(`Created by Nicolas Ventura [${version}]`, new Color(255, 255, 255), 1, false, 'right', 'bottom', 0, 0); this.save = new ToggleButton([ - ['Save', Menu.btnColor, () => this.saveCallback()], + ['Save', Menu.btnColor, () => { this.saveReset = Menu.buttonResetDuration; this.saveCallback(); }], ['Saved!', new Color(150, 250, 150), () => { return }], ], x - (width / 2), y, width, Menu.btnHeight); this.help = new ToggleButton([ @@ -101,7 +115,7 @@ export class Menu implements Drawable { ['Unmute', Menu.btnColor, () => this.unmuteCallback()], ], x - (width / 2), y + (Menu.btnHeight + Menu.btnPadding) * 2, width, Menu.btnHeight); this.clear = new ToggleButton([ - ['Wipe Data', Menu.btnColor, () => { return }], + ['Wipe Data', Menu.btnColor, () => this.clearReset = Menu.buttonResetDuration], ['Confirm', new Color(255, 0, 0), () => this.clearCallback()], ['Reload Page', Menu.btnColor, () => window.location.reload()], ], x - (width / 2), y + (Menu.btnHeight + Menu.btnPadding) * 3, width, Menu.btnHeight); @@ -127,10 +141,28 @@ export class Menu implements Drawable { this.save.reset(); this.clear.reset(); } + /** + * Menu tick for resetting buttons and autosaving + */ + public tick(dt: number): void { + if (this.saveReset > 0) { + this.saveReset -= dt; + if (this.saveReset <= 0) { + this.save.reset(); + } + } + if (this.clearReset > 0) { + this.clearReset -= dt; + if (this.clearReset <= 0) { + this.clear.reset(); + } + } + this.autosave(dt); + } /** * Perform an autosave at the specified interval */ - public autosave(dt: number): void { + private autosave(dt: number): void { this.autosaveTick += dt; if (this.autosaveTick > Menu.autosaveInterval) { this.autosaveLabel.value = 'Autosaved!'; From 1c9a5ac032d3508221621d06daf0b64af2b0f371 Mon Sep 17 00:00:00 2001 From: nicfv Date: Thu, 6 Aug 2026 16:51:58 -0700 Subject: [PATCH 3/5] increment version --- www/games/orbit-idle/src/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/games/orbit-idle/src/state.ts b/www/games/orbit-idle/src/state.ts index 9e91472..1ac12e5 100644 --- a/www/games/orbit-idle/src/state.ts +++ b/www/games/orbit-idle/src/state.ts @@ -11,7 +11,7 @@ import { Tutorial } from './tutorial'; import { Zoom } from './zoom'; // Global constants -export const version = 'v1.2.0'; +export const version = 'v1.2.1'; // UI elements export const cursor: Cursor = new Cursor(); From 5e0d75335823a96d540272e2a42428ee03101886 Mon Sep 17 00:00:00 2001 From: nicfv Date: Thu, 6 Aug 2026 17:09:48 -0700 Subject: [PATCH 4/5] add powers for larger numbers up to 1 decillion --- www/games/orbit-idle/src/lib.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/games/orbit-idle/src/lib.ts b/www/games/orbit-idle/src/lib.ts index 4a68c94..d50b0cb 100644 --- a/www/games/orbit-idle/src/lib.ts +++ b/www/games/orbit-idle/src/lib.ts @@ -3,8 +3,18 @@ */ export function N(num: number): string { const log10: number = Math.log10(Math.abs(num)) | 0; - if (log10 >= 21) { + if (log10 >= 36) { return `${(num / (10 ** log10)).toFixed(2)}E${log10}`; + } else if (log10 >= 33) { + return `${(num / 1e33).toFixed(2)}D`; + } else if (log10 >= 30) { + return `${(num / 1e30).toFixed(2)}N`; + } else if (log10 >= 27) { + return `${(num / 1e27).toFixed(2)}o`; + } else if (log10 >= 24) { + return `${(num / 1e24).toFixed(2)}S`; + } else if (log10 >= 21) { + return `${(num / 1e21).toFixed(2)}s`; } else if (log10 >= 18) { return `${(num / 1e18).toFixed(2)}Q`; } else if (log10 >= 15) { From c7d662edb30b30ab665891d095906605be34eb4b Mon Sep 17 00:00:00 2001 From: nicfv Date: Thu, 6 Aug 2026 17:11:03 -0700 Subject: [PATCH 5/5] v alpha --- www/games/orbit-idle/src/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/games/orbit-idle/src/state.ts b/www/games/orbit-idle/src/state.ts index 1ac12e5..41ea334 100644 --- a/www/games/orbit-idle/src/state.ts +++ b/www/games/orbit-idle/src/state.ts @@ -11,7 +11,7 @@ import { Tutorial } from './tutorial'; import { Zoom } from './zoom'; // Global constants -export const version = 'v1.2.1'; +export const version = 'v1.2.1-alpha'; // UI elements export const cursor: Cursor = new Cursor();