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>
This commit is contained in:
richardroy
2025-08-01 14:26:12 +10:00
committed by GitHub
parent 488188ff86
commit e5f47e34d7
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -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));
}
}
@@ -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(),