Package horizons :: Package gui :: Package modules :: Module multiplayermenu :: Class GameLobby
[hide private]
[frames] | no frames]

Class GameLobby

source code

windows.Window --+
                 |
                GameLobby

Chat with other players, change name, wait for the game to begin.

Instance Methods [hide private]
 
__init__(self, windows) source code
 
_on_ready_button_pressed(self) source code
 
hide(self)
Hide the window.
source code
 
_cancel(self)
When the lobby is cancelled, close the window and leave the game.
source code
 
on_escape(self)
Define what happens when ESC is pressed.
source code
 
close(self)
Closes the window.
source code
 
open(self)
Open the window.
source code
 
show(self)
Show the window.
source code
 
_on_error(self, error, fatal=True) source code
 
_prepare_game(self, game) source code
 
_update_game_details(self)
Set map name and other misc data
source code
 
_update_players_box(self, game)
Updates player list.
source code
 
_show_change_player_details_popup(self, game)
Shows a dialog where the player can change its name and/or color
source code
 
_send_chat_message(self)
Sends a chat message.
source code
 
_print_event(self, msg, wrap="*") source code
 
_on_chat_message(self, game, player, msg) source code
 
_on_player_joined(self, game, player) source code
 
_on_player_left(self, game, player) source code
 
_on_player_toggled_ready(self, game, plold, plnew, myself) source code
 
_on_player_changed_name(self, game, plold, plnew, myself) source code
 
_on_player_changed_color(self, game, plold, plnew, myself) source code
 
_on_player_kicked(self, game, player, myself) source code
    Inherited from windows.Window
 
_hide_modal_background(self) source code
 
_show_modal_background(self)
Loads transparent background that de facto prohibits access to other gui elements by eating all input events.
source code
 
on_return(self)
Define what happens when RETURN is pressed.
source code
Method Details [hide private]

__init__(self, windows)
(Constructor)

source code 
Overrides: windows.Window.__init__

hide(self)

source code 

Hide the window.

After this call, the window should not be visible anymore. However, it remains in the stack of open windows and will be visible once it becomes the topmost window again.

You should *never* call this directly in your code, other than in `close()` when you overwrote it in your subclass.

Overrides: windows.Window.hide
(inherited documentation)

_cancel(self)

source code 

When the lobby is cancelled, close the window and leave the game.

We can't do this in `close`, because the window will be closed when a game starts as well, and we don't want to leave the game then.

on_escape(self)

source code 

Define what happens when ESC is pressed.

By default, the window will be closed.

Overrides: windows.Window.on_escape
(inherited documentation)

close(self)

source code 

Closes the window.

You should *never* call this directly in your code. Use `self._windows.close()` to ask the WindowManager to remove the window instead.

You may override this method in a subclass if you need to do stuff when a window is closed.

Overrides: windows.Window.close
(inherited documentation)

open(self)

source code 

Open the window.

After this call, the window should be visible. If you decide to not show the window here (e.g. an error occurred), you'll need to call `self._windows.close()` to remove the window from the manager.

You may override this method in a subclass if you need to do stuff when a window is first shown.

Overrides: windows.Window.open
(inherited documentation)

show(self)

source code 

Show the window.

After this call, the window should be visible. You should *never* call this directly in your code.

Overrides: windows.Window.show
(inherited documentation)

_send_chat_message(self)

source code 

Sends a chat message. Called when user presses enter in the input field