From 2cd088c0499b9de561ea80df0c9053b8c216d12d Mon Sep 17 00:00:00 2001 From: Lurkars Date: Sat, 18 Dec 2021 10:43:23 +0100 Subject: [PATCH] Change follow request to "F" button, use nes-css buttons --- .../Components/FollowMenu/FollowMenu.svelte | 28 ++++++------------- front/src/Phaser/Player/Player.ts | 2 +- .../src/Phaser/UserInput/UserInputManager.ts | 5 ++++ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/front/src/Components/FollowMenu/FollowMenu.svelte b/front/src/Components/FollowMenu/FollowMenu.svelte index 590fd61c..983fc507 100644 --- a/front/src/Components/FollowMenu/FollowMenu.svelte +++ b/front/src/Components/FollowMenu/FollowMenu.svelte @@ -95,16 +95,19 @@ vim: ft=typescript

Do you want to follow {name(followUsers[0])}?

- - + +
{:else if followRole === followRoles.leader}

Ask others to follow you?

- - + +
{/if} @@ -125,8 +128,8 @@ vim: ft=typescript {/if}
- - + +
{/if} @@ -206,19 +209,6 @@ vim: ft=typescript font-weight: bold; height: 2.5em; } - - .accept { - background-color: #00ff0088; - } - .accept:hover { - background-color: #00ff00cc; - } - .deny { - background-color: #ff000088; - } - .deny:hover { - background-color: #ff0000cc; - } } } diff --git a/front/src/Phaser/Player/Player.ts b/front/src/Phaser/Player/Player.ts index f34d1478..f37927e3 100644 --- a/front/src/Phaser/Player/Player.ts +++ b/front/src/Phaser/Player/Player.ts @@ -114,7 +114,7 @@ export class Player extends Character { const state = get(followStateStore); const role = get(followRoleStore); - if (activeEvents.get(UserInputEvent.Interact)) { + if (activeEvents.get(UserInputEvent.Follow)) { if (state === followStates.off && this.scene.groups.size > 0) { followStateStore.set(followStates.requesting); followRoleStore.set(followRoles.leader); diff --git a/front/src/Phaser/UserInput/UserInputManager.ts b/front/src/Phaser/UserInput/UserInputManager.ts index bb7041d2..71dbb6c3 100644 --- a/front/src/Phaser/UserInput/UserInputManager.ts +++ b/front/src/Phaser/UserInput/UserInputManager.ts @@ -16,6 +16,7 @@ export enum UserInputEvent { MoveDown, SpeedUp, Interact, + Follow, Shout, JoystickMove, } @@ -147,6 +148,10 @@ export class UserInputManager { event: UserInputEvent.Interact, keyInstance: this.Scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE, false), }, + { + event: UserInputEvent.Follow, + keyInstance: this.Scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.F, false), + }, { event: UserInputEvent.Shout, keyInstance: this.Scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.F, false),