The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
mp_join_game.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2008 - 2025
3 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY.
11
12 See the COPYING file for more details.
13*/
14
15#pragma once
16
19
20class saved_game;
22
23namespace gui2
24{
25class tree_view_node;
26class player_list_helper;
27
28namespace dialogs
29{
30class faction_select;
31
33{
34public:
36 const bool first_scenario = true, const bool observe_game = false);
37
39
40 bool fetch_game_config();
41 bool started() const { return level_["started"].to_bool(); }
42private:
43 virtual const std::string& window_id() const override;
44
45 virtual void pre_show() override;
46
47 virtual void post_show() override;
48
49 /** @returns false if an error ocurred. */
50 bool show_flg_select(int side_num, bool first_time = false);
51
52 void generate_side_list();
53
54 /**
55 * Will close the Faction Select dialog if it's open.
56 *
57 * This is used in @ref network_handler to dismiss the dialog if certain actions
58 * occur, such as the game starting.
59 *
60 * @todo maybe move this to a general-purpose close() function in @ref modal_dialog
61 * and @ref modeless_dialog? It could be useful.
62 */
64
65 void network_handler();
66
68
70
72
74
75 std::size_t update_timer_;
76
77 const bool first_scenario_;
78
81
82 std::map<std::string, tree_view_node*> team_tree_map_;
83
84 std::unique_ptr<player_list_helper> player_list_;
85
87};
88
89} // namespace dialogs
90} // namespace gui2
A config object defines a single node in a WML file, with access to child nodes.
Definition config.hpp:157
Abstract base class for all modal dialogs.
std::unique_ptr< player_list_helper > player_list_
virtual const std::string & window_id() const override
The ID of the window to build.
virtual void pre_show() override
Actions to be taken before showing the window.
std::map< std::string, tree_view_node * > team_tree_map_
virtual void post_show() override
Actions to be taken after the window has been shown.
bool show_flg_select(int side_num, bool first_time=false)
void close_faction_select_dialog_if_open()
Will close the Faction Select dialog if it's open.
wesnothd_connection & network_connection_
A class that represents a TCP/IP connection to the wesnothd server.
Various uncategorised dialogs.
Generic file dialog.