-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
match_history.cpp
46 lines (37 loc) · 1.23 KB
/
match_history.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Copyright (C) 2021 by the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#include "gui/dialogs/multiplayer/match_history.hpp"
#include "formula/string_utils.hpp"
#include "game_initialization/lobby_data.hpp"
#include "gettext.hpp"
#include "gui/widgets/window.hpp"
#include "wesnothd_connection.hpp"
namespace gui2
{
namespace dialogs
{
REGISTER_DIALOG(mp_match_history)
mp_match_history::mp_match_history(mp::user_info& info, wesnothd_connection& connection)
: info_(info)
, connection_(connection)
{
register_label("title", true, VGETTEXT("Match History — $player", {{"player", info_.name}}));
}
void mp_match_history::pre_show(window& /*window*/)
{
request_history(0);
}
void mp_match_history::request_history(int offset)
{
connection_.send_data({ "game_history_request", config { "offset", offset } });
}
} // namespace dialogs
} // namespace gui2