The Battle for Wesnoth  1.17.0-dev
match_history.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2021 - 2021
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 
16 
17 #include "formula/string_utils.hpp"
19 #include "gettext.hpp"
20 #include "gui/widgets/window.hpp"
21 #include "wesnothd_connection.hpp"
22 
23 namespace gui2::dialogs
24 {
25 REGISTER_DIALOG(mp_match_history)
26 
28  : info_(info)
29  , connection_(connection)
30 {
31  register_label("title", true, VGETTEXT("Match History — $player", {{"player", info_.name}}));
32 }
33 
35 {
36  request_history(0);
37 }
38 
40 {
41  connection_.send_data({ "game_history_request", config { "offset", offset } });
42 }
43 
44 } // 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:89
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:52
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:61
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:65