mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 00:28:14 +00:00
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:
co-authored by
Drills Kibo
parent
488188ff86
commit
e5f47e34d7
@@ -391,7 +391,8 @@ export class InputHandler {
|
|||||||
|
|
||||||
private onShiftScroll(event: WheelEvent) {
|
private onShiftScroll(event: WheelEvent) {
|
||||||
if (event.shiftKey) {
|
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));
|
this.eventBus.emit(new AttackRatioEvent(ratio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,7 +475,6 @@ export class EventsDisplay extends LitElement implements Layer {
|
|||||||
const recipient = this.game.playerBySmallID(
|
const recipient = this.game.playerBySmallID(
|
||||||
update.request.recipientID,
|
update.request.recipientID,
|
||||||
) as PlayerView;
|
) as PlayerView;
|
||||||
|
|
||||||
this.addEvent({
|
this.addEvent({
|
||||||
description: translateText("events_display.alliance_request_status", {
|
description: translateText("events_display.alliance_request_status", {
|
||||||
name: recipient.name(),
|
name: recipient.name(),
|
||||||
|
|||||||
Reference in New Issue
Block a user