Skip to content

Commit

Permalink
Make multiplayer lobby automatically refresh for new games every 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
nihathrael committed Mar 26, 2014
1 parent 8628db8 commit 7d178e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions horizons/gui/modules/multiplayermenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from horizons.util.color import Color
from horizons.util.python.callback import Callback
from horizons.world import load_raw_world
from horizons.extscheduler import ExtScheduler


class MultiplayerMenu(Window):
Expand All @@ -65,6 +66,7 @@ def hide(self):
# Save the player-data on hide so that other menus gets updated data
self._playerdata.save_settings()
self._gui.hide()
ExtScheduler().rem_all_classinst_calls(self)

def show(self):
if not self._check_connection():
Expand All @@ -88,6 +90,8 @@ def show(self):
# TODO: Remove once loading a game is implemented again
self._gui.findChild(name='load').parent.hide()

ExtScheduler().add_new_object(self._refresh, self, run_in=5, loops=-1)

def close(self):
# if the window is not open (due to connection errors), just do nothing
if not self._is_open:
Expand Down

0 comments on commit 7d178e7

Please sign in to comment.