The Battle for Wesnoth  1.17.12+dev
match_history.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2021 - 2022
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  : modal_dialog(window_id())
29  , info_(info)
30  , connection_(connection)
31 {
32  register_label("title", true, VGETTEXT("Match History — $player", {{"player", info_.name}}));
33 }
34 
36 {
37  request_history(0);
38 }
39 
41 {
42  connection_.send_data({ "game_history_request", config { "offset", offset } });
43 }
44 
45 } // 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:182
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.
Abstract base class for all modal dialogs.
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:60
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:66