mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:10:46 +00:00
Add Alt + Click hotkey for sending emotes (#408)
## Description: Allows the player to Alt + Click to send emotes to other players or themself in order to ease communication. Of course, the hotkey can be something different. Alt + Click is just a suggestion.  ## Please complete the following: - [ x ] I have added screenshots for all UI updates - [ x ] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [ x ] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: kanekane0448 PS: The new emoji table looks really good! --------- Co-authored-by: kanekane0448 <no@mail.pls>
This commit is contained in:
@@ -69,6 +69,12 @@ export class ShowBuildMenuEvent implements GameEvent {
|
||||
public readonly y: number,
|
||||
) {}
|
||||
}
|
||||
export class ShowEmojiMenuEvent implements GameEvent {
|
||||
constructor(
|
||||
public readonly x: number,
|
||||
public readonly y: number,
|
||||
) {}
|
||||
}
|
||||
|
||||
export class AttackRatioEvent implements GameEvent {
|
||||
constructor(public readonly attackRatio: number) {}
|
||||
@@ -292,6 +298,10 @@ export class InputHandler {
|
||||
this.eventBus.emit(new ShowBuildMenuEvent(event.clientX, event.clientY));
|
||||
return;
|
||||
}
|
||||
if (event.altKey) {
|
||||
this.eventBus.emit(new ShowEmojiMenuEvent(event.clientX, event.clientY));
|
||||
return;
|
||||
}
|
||||
|
||||
const dist =
|
||||
Math.abs(event.x - this.lastPointerDownX) +
|
||||
|
||||
Reference in New Issue
Block a user