From 2a3bd7001bd17c180ab81f9c108b6478bb09dd8c Mon Sep 17 00:00:00 2001
From: HoelShare <git@hoelshare.de>
Date: Sun, 28 May 2017 09:28:32 +0200
Subject: [PATCH] GPN

---
 GPN_BadgeLasertag.ino | 2 +-
 GameClient.cpp        | 5 +----
 GameServer.cpp        | 6 ++++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/GPN_BadgeLasertag.ino b/GPN_BadgeLasertag.ino
index 13c5dcb..2d5494d 100644
--- a/GPN_BadgeLasertag.ino
+++ b/GPN_BadgeLasertag.ino
@@ -192,7 +192,7 @@ void loop() {
         Serial.println("Loop - Server - Ende");
     }
     if (client) {
-//        client->update();
+        client->update();
     }
     Serial.println("Loop - Ende");
 }
diff --git a/GameClient.cpp b/GameClient.cpp
index c91e4a3..7608db4 100644
--- a/GameClient.cpp
+++ b/GameClient.cpp
@@ -77,10 +77,7 @@ void GameClient::joinGame(String ip) {
 
 void GameClient::update() {
     Serial.println("GameClient - Update");
-    if(reopen) {
-        reopen = false;
-        ui->open(playerList);
-    }
+
 //    String lastHitBy;
 //    int lastDamage;
 //
diff --git a/GameServer.cpp b/GameServer.cpp
index c2a48f0..eecc078 100644
--- a/GameServer.cpp
+++ b/GameServer.cpp
@@ -24,11 +24,13 @@ void GameServer::secureQuestion() {
     secureMenu = new PlayerListMenu(4);
     secureMenu->addMenuItem(new MenuItem("Start?", [=]() { this->startGame(); Serial.println("Lambda Start - Ende"); }));
     secureMenu->addMenuItem(new MenuItem("Cancel?", [=]() {
-        ui->open(playerList);
+        ui->dispatchInput(badge->getJoystickState());
+        ui->closeCurrent();
         ui->draw();
     }));
     secureMenu->setRightAction([=]() {
-        ui->open(playerList);
+        ui->dispatchInput(badge->getJoystickState());
+        ui->closeCurrent();
         ui->draw();
     });
     secureMenu->setLeftAction([=]() { this->startGame(); });
-- 
GitLab