14 #ifndef MULTIPLAYER_UI_HPP_INCLUDED
15 #define MULTIPLAYER_UI_HPP_INCLUDED
23 #include "widgets/label.hpp"
28 #include <boost/scoped_ptr.hpp>
58 : time(time), user(user), message(message) {}
105 using widget::set_location;
179 void set_user_list(
const std::vector<std::string>&,
bool silent);
gui::textbox entry_textbox_
bool selected_user_changed() const
virtual void handle_key_event(const SDL_KeyboardEvent &event)
virtual void draw_contents()
std::vector< std::string > user_list_
GLuint GLuint GLsizei GLenum type
boost::scoped_ptr< plugins_context > plugins_context_
ui(CVideo &v, twesnothd_connection *wesnothd_connection, const std::string &title, const config &cfg, chat &c, config &gamelist)
std::map< std::string, time_t > whisper_warnings_
virtual void layout_children(const SDL_Rect &rect)
Lays the children out.
result get_result()
Returns the result of the current widget.
std::string get_color_string(int id)
GLint GLint GLint GLint GLint GLint y
void add_message(const time_t &time, const std::string &user, const std::string &message)
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
std::string format_message(const msg &message)
msg_hist::size_type last_update_
void init_textbox(gui::textbox &textbox)
virtual void process_network_data(const config &data)
Processes any pending network data.
virtual void hide_children(bool hide=true)
Hides or shows all gui::widget children of this widget.
msg_hist message_history_
GLdouble GLdouble GLdouble b
This module controls the multiplayer lobby.
std::string selected_user_
A class that represents a TCP/IP connection to the wesnothd server.
msg(const time_t &time, const std::string &user, const std::string &message)
result set_result(result res)
Sets the result of this dialog, to be checked by get_result().
plugins_context * get_plugins_context()
std::deque< msg > msg_hist
static const int xscale_base
void set_selected_user_changed(const bool &changed)
const config & game_config() const
Returns the main game config, as defined by loading the preprocessed WML files.
const config & game_config_
The main game configuration, as defined by loading the preprocessed WML files.
std::string selected_game_
void add_chat_message(const time_t &time, const std::string &speaker, int side, const std::string &message, events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE)
Override chat_handler.
const gui::label & title() const
virtual void process_event()
void send_to_server(const config &cfg) override
bool initialized_
Set to true when the widgets are initialized.
bool registered
True if this user is registered on the server.
void process_message(const config &msg, const bool whisper=false)
Process chat messages.
void append_to_title(const std::string &name)
Encapsulates the map of the game.
gui::textbox chat_textbox_
virtual void handle_event(const SDL_Event &event)
void send_chat_message(const std::string &message, bool allies_only=false)
SDL_Rect client_area() const
void update_textbox(gui::textbox &textbox)
SDL_Color color_message(const msg &message)
void set_user_list(const std::vector< std::string > &, bool silent)
Sets the user list.
structure which will hide all current floating labels, and cause floating labels instantiated after i...
config & gamelist()
Returns the current gamelist.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
GLint GLint GLint GLint GLint x
bool gamelist_initialized_
const std::vector< std::string > & user_list() const
GLuint const GLchar * name
void set_user_menu_items(const std::vector< std::string > &list)
bool selected_user_changed_
void set_selected_game(const std::string &game_name)
Sets the name of the selected game which is used to highlight the names of the players which have joi...
void process_network()
Asks the multiplayer_ui to pump some data from the network, and then to process it.
void set_location(const SDL_Rect &rect)
Hides children, moves them (using layout_children), then shows them.
twesnothd_connection * wesnothd_connection_
GLsizei GLenum GLuint GLuint GLsizei char * message
this class memorizes a chat session.
static const int yscale_base
std::string get_selected_user_game()
A config object defines a single node in a WML file, with access to child nodes.
bool receive_from_server(config &dst)
bool operator>(const user_info &b) const
GLsizei const GLcharARB ** string
a base class for the different multiplayer base dialogs: game list, create game, wait game...
virtual void gamelist_updated(bool silent=true)
Called each time the gamelist_ variable is updated.