The Battle for Wesnoth  1.17.0-dev
match_history.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2021 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
15 
16 #include "formula/string_utils.hpp"
18 #include "gettext.hpp"
19 #include "gui/widgets/window.hpp"
20 #include "wesnothd_connection.hpp"
21 
22 namespace gui2::dialogs
23 {
24 REGISTER_DIALOG(mp_match_history)
25 
27  : info_(info)
28  , connection_(connection)
29 {
30  register_label("title", true, VGETTEXT("Match History — $player", {{"player", info_.name}}));
31 }
32 
34 {
35  request_history(0);
36 }
37 
39 {
40  connection_.send_data({ "game_history_request", config { "offset", offset } });
41 }
42 
43 } // namespace dialogs
void send_data(const configr_of &request)
Queues the given data to be sent to the server.
wesnothd_connection & connection_
logger & info()
Definition: log.cpp:88
This file contains the window object, this object is a top level container which has the event manage...
Main entry points of multiplayer mode.
Definition: lobby_data.cpp:51
A class that represents a TCP/IP connection to the wesnothd server.
#define VGETTEXT(msgid,...)
Handy wrappers around interpolate_variables_into_string and gettext.
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:59
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64