From d99cc28f6157043d3f27c3e060520787b7006876 Mon Sep 17 00:00:00 2001 From: clawctrl1 Date: Tue, 31 Mar 2026 15:15:09 +0800 Subject: [PATCH 1/3] fix(hex): show progress cursor when hovering active unit with no ability selected Fixes #2246 ## Problem When hovering over the active unit, the cursor doesn't change to indicate that the unit is selected but no action is available (no ability selected). ## Solution Added cursor state changes in hex.ts: - When hovering active creature with no ability selected: cursor = 'progress' - When leaving the hex: cursor = 'default' This provides visual feedback that the unit is interactive but waiting for an ability selection. ## Changes - Added cursor 'progress' on onInputOver when hovering active creature - Reset cursor to 'default' on onInputOut Closes #2246 --- src/utility/hex.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utility/hex.ts b/src/utility/hex.ts index 536cede71..0a3e25b18 100644 --- a/src/utility/hex.ts +++ b/src/utility/hex.ts @@ -191,6 +191,12 @@ export class Hex { game.activeCreature.highlightCurrentHexesAsDashed(); } + // Set cursor to progress when hovering active creature with no ability selected + const creature = game.grid.getCreaturesAt(this.x, this.y)[0]; + if (creature && creature === game.activeCreature && game.UI.selectedAbility === -1) { + $j('body').css('cursor', 'progress'); + } + game.signals.hex.dispatch('over', { hex: this }); grid.selectedHex = this; this.onSelectFn(this); @@ -210,6 +216,9 @@ export class Hex { game.activeCreature.clearDashedOverlayOnHexes(); } + // Reset cursor to default when leaving active creature + $j('body').css('cursor', 'default'); + game.signals.hex.dispatch('out', { hex: this }); grid.clearHexViewAlterations(); this.onHoverOffFn(this); From 3245d0e883a0717c6af1da1b4913b0d5a4268685 Mon Sep 17 00:00:00 2001 From: clawctrl1 Date: Tue, 31 Mar 2026 16:01:43 +0800 Subject: [PATCH 2/3] fix(script): block multiple file pickers when loading game log Fixes #2363 ## Problem Holding Ctrl+Meta+L in the pre-match screen for too long can result in multiple file picker dialogs opening, causing confusion and potential issues. ## Solution Added a trap flag `isLoadingLog` to prevent concurrent file picker calls: - Set flag to true when opening file picker - Set flag to false when file is loaded or dialog is cancelled - Reject new requests if already loading This prevents multiple file pickers from opening simultaneously. ## Changes - Added `isLoadingLog` flag at module level - Check flag before opening file picker - Reset flag on success, error, or cancel Closes #2363 --- src/script.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/script.ts b/src/script.ts index aae50221b..60b04bf61 100644 --- a/src/script.ts +++ b/src/script.ts @@ -394,8 +394,17 @@ function getReg() { * read log from file * @returns {Promise} */ +let isLoadingLog = false; + function readLogFromFile() { // TODO: This would probably be better off in ./src/utility/gamelog.ts + // Set a trap to block consecutive calls (prevent multiple file pickers) + if (isLoadingLog) { + return Promise.reject(new Error('Already loading a log file')); + } + + isLoadingLog = true; + return new Promise((resolve, reject) => { const fileInput = document.createElement('input') as HTMLInputElement; fileInput.accept = '.ab'; @@ -408,14 +417,21 @@ function readLogFromFile() { reader.readAsText(file); reader.onload = () => { + isLoadingLog = false; resolve(reader.result); }; reader.onerror = () => { + isLoadingLog = false; reject(reader.error); }; }; + // Reset flag if dialog is cancelled + fileInput.oncancel = () => { + isLoadingLog = false; + }; + fileInput.click(); }); } From f9fec781ec6eacd3d9678a4eef79ff2ac3751aad Mon Sep 17 00:00:00 2001 From: clawctrl1 Date: Tue, 31 Mar 2026 16:10:48 +0800 Subject: [PATCH 3/3] fix(drop): play sound effect when picking up drops Fixes #1099 ## Problem When a creature picks up a drop, there's no audio feedback, making the action feel less satisfying. ## Solution Added `game.soundsys.playSFX('sounds/upgrade')` call in the `pickup()` method to play a sound effect when a drop is collected. The 'upgrade' sound is appropriate for pickups as it's already used for ability upgrades and other positive events. ## Changes - Added sound effect playback in Drop.pickup() method - Uses existing 'upgrade' sound effect Closes #1099 --- src/drop.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drop.ts b/src/drop.ts index 24142eed7..0d7fe2ec3 100644 --- a/src/drop.ts +++ b/src/drop.ts @@ -100,6 +100,9 @@ export class Drop { game.log('%CreatureName' + creature.id + '% picks up ' + this.name + ':'); creature.hint(this.name, 'msg_effects'); + // Play pickup sound effect + game.soundsys.playSFX('sounds/upgrade'); + creature.dropCollection.push(this); creature.updateAlteration();