00001 /* $Id: multiplayer_wait.hpp 25333 2008-03-30 13:49:03Z jhinrichs $ */ 00002 /* 00003 Copyright (C) 2007 - 2008 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License version 2 00008 or at your option any later version. 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY. 00011 00012 See the COPYING file for more details. 00013 */ 00014 00015 #ifndef MULTIPLAYER_WAIT_HPP_INCLUDED 00016 #define MULTIPLAYER_WAIT_HPP_INCLUDED 00017 00018 #include "widgets/label.hpp" 00019 #include "widgets/button.hpp" 00020 #include "widgets/menu.hpp" 00021 #include "widgets/combo.hpp" 00022 00023 #include "gamestatus.hpp" 00024 #include "multiplayer_ui.hpp" 00025 00026 namespace mp { 00027 00028 class wait : public ui 00029 { 00030 public: 00031 wait(game_display& disp, const config& cfg, chat& c, config& gamelist); 00032 virtual void process_event(); 00033 00034 void join_game(bool observe); 00035 00036 const game_state& get_state(); 00037 00038 void start_game(); 00039 00040 // Gets current game snapshot if observer wants to skip the replay 00041 game_state& request_snapshot(); 00042 00043 protected: 00044 virtual void layout_children(const SDL_Rect& rect); 00045 virtual void hide_children(bool hide=true); 00046 virtual void process_network_data(const config& data, const network::connection sock); 00047 private: 00048 class leader_preview_pane : public gui::preview_pane 00049 { 00050 public: 00051 leader_preview_pane(game_display& disp, 00052 const config::child_list& side_list); 00053 00054 bool show_above() const; 00055 bool left_side() const; 00056 void set_selection(int index); 00057 std::string get_selected_leader(); 00058 std::string get_selected_gender(); 00059 00060 handler_vector handler_members(); 00061 private: 00062 virtual void draw_contents(); 00063 virtual void process_event(); 00064 00065 const config::child_list side_list_; 00066 gui::combo leader_combo_; // Must appear before the leader_list_manager 00067 gui::combo gender_combo_; // Must appear before the leader_list_manager 00068 leader_list_manager leaders_; 00069 size_t selection_; 00070 }; 00071 00072 void generate_menu(); 00073 00074 gui::button cancel_button_; 00075 gui::label start_label_; 00076 gui::menu game_menu_; 00077 00078 // int team_; 00079 00080 config level_; 00081 game_state state_; 00082 00083 bool stop_updates_; 00084 }; 00085 00086 } 00087 #endif
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |