The Battle for Wesnoth
1.15.10+dev
gui
dialogs
multiplayer
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
14
#include "
gui/dialogs/multiplayer/match_history.hpp
"
15
16
#include "
formula/string_utils.hpp
"
17
#include "
game_initialization/lobby_data.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
26
mp_match_history
::
mp_match_history
(
mp
::user_info&
info
,
wesnothd_connection
& connection)
27
: info_(info)
28
, connection_(connection)
29
{
30
register_label(
"title"
,
true
,
VGETTEXT
(
"Match History — $player"
, {{
"player"
, info_.name}}));
31
}
32
33
void
mp_match_history::pre_show
(
window
&
/*window*/
)
34
{
35
request_history
(0);
36
}
37
38
void
mp_match_history::request_history
(
int
offset)
39
{
40
connection_
.
send_data
({
"game_history_request"
,
config
{
"offset"
, offset } });
41
}
42
43
}
// namespace dialogs
wesnothd_connection::send_data
void send_data(const configr_of &request)
Queues the given data to be sent to the server.
Definition:
wesnothd_connection.cpp:194
REGISTER_DIALOG
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
Definition:
modal_dialog.hpp:87
gettext.hpp
gui2::dialogs::mp_match_history::connection_
wesnothd_connection & connection_
Definition:
match_history.hpp:51
gui2::dialogs::mp_match_history
Definition:
match_history.hpp:28
lg::info
logger & info()
Definition:
log.cpp:88
window.hpp
This file contains the window object, this object is a top level container which has the event manage...
lobby_data.hpp
wesnothd_connection.hpp
mp
Main entry points of multiplayer mode.
Definition:
lobby_data.cpp:51
gui2::dialogs
Definition:
connect.cpp:28
wesnothd_connection
A class that represents a TCP/IP connection to the wesnothd server.
Definition:
wesnothd_connection.hpp:60
gui2::dialogs::mp_match_history::request_history
void request_history(int offset)
Definition:
match_history.cpp:38
match_history.hpp
VGETTEXT
#define VGETTEXT(msgid,...)
Handy wrappers around interpolate_variables_into_string and gettext.
Definition:
string_utils.hpp:112
string_utils.hpp
config
A config object defines a single node in a WML file, with access to child nodes.
Definition:
config.hpp:59
gui2::dialogs::mp_match_history::pre_show
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Definition:
match_history.cpp:33
gui2::window
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition:
window.hpp:64
Generated by
1.8.13