From 311b19d9c2c67b3cc350d517ad24d46963de6e48 Mon Sep 17 00:00:00 2001 From: Jakob Haag Date: Sat, 2 May 2020 16:15:03 +0200 Subject: [PATCH] add label of user is not logged in to GameCenter --- GoldWars/GoldWars/Scenes/MenuScene.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GoldWars/GoldWars/Scenes/MenuScene.swift b/GoldWars/GoldWars/Scenes/MenuScene.swift index 943c568..cd5f9a8 100644 --- a/GoldWars/GoldWars/Scenes/MenuScene.swift +++ b/GoldWars/GoldWars/Scenes/MenuScene.swift @@ -57,10 +57,13 @@ class MenuScene: SKScene { // TODO: Notfalllösung if(!GameCenterHelper.isAuthenticated) { - let label = SKLabelNode(text: "Authenticated") - label.zPosition = 2 - label.position = CGPoint(x: self.size.width / 2, y: self.size.height / 2) - self.addChild(label) + let authLabel = SKLabelNode(text: "Yout are not logged in to Gamecenter. Please login via GameCenterApp") + authLabel.name = "authLabel" + authLabel.zPosition = 2 + authLabel.position = CGPoint(x: self.size.width / 2, y: self.size.height / 5) + self.addChild(authLabel) + } else { + self.childNode(withName: "authLabel")?.removeFromParent() } } }