diff --git a/front/src/Components/ActionsMenu/ActionsMenu.svelte b/front/src/Components/ActionsMenu/ActionsMenu.svelte
index 3f60e4d8..06eee23d 100644
--- a/front/src/Components/ActionsMenu/ActionsMenu.svelte
+++ b/front/src/Components/ActionsMenu/ActionsMenu.svelte
@@ -1,8 +1,12 @@
@@ -26,13 +26,15 @@
Actions
diff --git a/front/src/Phaser/Entity/RemotePlayer.ts b/front/src/Phaser/Entity/RemotePlayer.ts
index 428bd8aa..8e162632 100644
--- a/front/src/Phaser/Entity/RemotePlayer.ts
+++ b/front/src/Phaser/Entity/RemotePlayer.ts
@@ -3,6 +3,7 @@ import type { PointInterface } from "../../Connexion/ConnexionModels";
import { Character } from "../Entity/Character";
import type { PlayerAnimationDirections } from "../Player/Animation";
import { requestVisitCardsStore, requestActionsMenuStore } from "../../Stores/GameStore";
+import { actionsMenuStore } from '../../Stores/ActionsMenuStore';
/**
* Class representing the sprite of a remote player (a player that plays on another computer)
@@ -44,7 +45,30 @@ export class RemotePlayer extends Character {
this.on("pointerdown", (event: Phaser.Input.Pointer) => {
if (event.downElement.nodeName === "CANVAS") {
- // requestVisitCardsStore.set(this.visitCardUrl);
+ actionsMenuStore.addPossibleAction(
+ "visit-card",
+ "Visiting Card", () => {
+ requestVisitCardsStore.set(this.visitCardUrl);
+ actionsMenuStore.clearActions();
+ requestActionsMenuStore.set(false);
+ });
+ actionsMenuStore.addPossibleAction(
+ "log-hello",
+ "Log Hello", () => {
+ console.log('HELLO');
+ // requestActionsMenuStore.set(false);
+ });
+ actionsMenuStore.addPossibleAction(
+ "log-goodbye",
+ "Log Goodbye", () => {
+ console.log('GOODBYE');
+ // requestActionsMenuStore.set(false);
+ });
+ actionsMenuStore.addPossibleAction(
+ "clear",
+ "Clear Actions", () => {
+ actionsMenuStore.clearActions();
+ });
requestActionsMenuStore.set(true);
}
});
diff --git a/front/src/Stores/ActionsMenuStore.ts b/front/src/Stores/ActionsMenuStore.ts
new file mode 100644
index 00000000..c3c2b56b
--- /dev/null
+++ b/front/src/Stores/ActionsMenuStore.ts
@@ -0,0 +1,36 @@
+import { writable } from "svelte/store";
+
+export interface ActionsMenuInterface {
+ displayName: string;
+ callback: Function;
+}
+
+function createActionsMenuStore() {
+
+ const actions = new Map();
+ const { subscribe, update, set } = writable