From e5f47e34d746c7c7c5b8182e9dacbd2e334fc9ed Mon Sep 17 00:00:00 2001 From: richardroy Date: Fri, 1 Aug 2025 14:26:12 +1000 Subject: [PATCH] Shift scroll only increase (#1625) ## Description: Determine which scroll event delta, x or y, has the non zero value. Use it to determine troop ratio increase or decrease. Shift + Scroll can change scroll diretion from Y to X axis. If that is enabled this change will still allow troop ratio increase / decrease ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [ ] I have added relevant tests to the test directory - [ ] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [ ] I have read and accepted the CLA agreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: richard012659 --------- Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com> --- src/client/InputHandler.ts | 3 ++- src/client/graphics/layers/EventsDisplay.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/InputHandler.ts b/src/client/InputHandler.ts index 1ab1a3a67..f089df82f 100644 --- a/src/client/InputHandler.ts +++ b/src/client/InputHandler.ts @@ -391,7 +391,8 @@ export class InputHandler { private onShiftScroll(event: WheelEvent) { if (event.shiftKey) { - const ratio = event.deltaY > 0 ? -10 : 10; + const scrollValue = event.deltaY === 0 ? event.deltaX : event.deltaY; + const ratio = scrollValue > 0 ? -10 : 10; this.eventBus.emit(new AttackRatioEvent(ratio)); } } diff --git a/src/client/graphics/layers/EventsDisplay.ts b/src/client/graphics/layers/EventsDisplay.ts index 04747486c..388486909 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -475,7 +475,6 @@ export class EventsDisplay extends LitElement implements Layer { const recipient = this.game.playerBySmallID( update.request.recipientID, ) as PlayerView; - this.addEvent({ description: translateText("events_display.alliance_request_status", { name: recipient.name(),