From a5019fc27a59e43e2f93465a01f2dd82e765a647 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 8 Mar 2026 20:12:23 +0100 Subject: [PATCH] Add JoinMenu and join error handling Add a new JoinMenu.vue component to provide a UI for joining existing games (emits a "join" event and offers Cancel/Join buttons). Improve UX by adding spacing to GameCreationMenu.vue header. Update OnlineMode.vue to import GameCreationMenu. In the API, send a client-side error message when adding a player fails (GameManager.cs now notifies the player's connection with "Spiel Existiert nicht!" before returning null) so users receive immediate feedback when a join attempt is invalid. --- API/Services/GameManager/GameManager.cs | 6 +++++- GUI/src/components/GameCreationMenu.vue | 2 +- GUI/src/components/JoinMenu.vue | 21 +++++++++++++++++++++ GUI/src/routes/OnlineMode.vue | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 GUI/src/components/JoinMenu.vue diff --git a/API/Services/GameManager/GameManager.cs b/API/Services/GameManager/GameManager.cs index 291c4e3..c64a9d6 100644 --- a/API/Services/GameManager/GameManager.cs +++ b/API/Services/GameManager/GameManager.cs @@ -21,7 +21,11 @@ public class GameManager(IGameRepository gameRepository, IHubContext -

Spiel Erstellen

+

Spiel Erstellen

diff --git a/GUI/src/components/JoinMenu.vue b/GUI/src/components/JoinMenu.vue new file mode 100644 index 0000000..3183fcb --- /dev/null +++ b/GUI/src/components/JoinMenu.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/GUI/src/routes/OnlineMode.vue b/GUI/src/routes/OnlineMode.vue index ebf3c6a..7818b12 100644 --- a/GUI/src/routes/OnlineMode.vue +++ b/GUI/src/routes/OnlineMode.vue @@ -1,5 +1,6 @@