Fix lag if run from lobby

This commit is contained in:
2019-05-08 21:43:22 +02:00
parent 6e38223186
commit 5485abe927

View File

@@ -29,6 +29,7 @@ class Lobby:
# Network
self.networkManager = NetworkManager()
self.isUpdating = True
# First
self.nameDisplay()
@@ -97,6 +98,7 @@ class Lobby:
self.update()
def update(self):
if self.isUpdating:
messages = self.networkManager.requestMessages()
scores = self.networkManager.requestScores()
@@ -169,6 +171,7 @@ class Lobby:
self.win.iconify()
# Display
self.isUpdating = False
quadraLudi.main(self.win, lambda score: self.playEnd(score))
def playEnd(self, score):
@@ -176,6 +179,7 @@ class Lobby:
self.win.deiconify()
self.win.focus_force()
self.chatEntry.focus()
self.isUpdating = True
# Send score
self.sendScore(score)