-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
mp_host_game_prompt.cpp
71 lines (59 loc) · 1.7 KB
/
mp_host_game_prompt.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Copyright (C) 2008 - 2018 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
Copyright (C) 2012 - 2018 by Iris Morelle <shadowm2006@gmail.com>
Part of the Battle for Wesnoth Project http://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/mp_host_game_prompt.hpp"
#include "preferences/game.hpp"
#include "gui/widgets/settings.hpp"
namespace gui2
{
namespace dialogs
{
/*WIKI
* @page = GUIWindowDefinitionWML
* @order = 2_mp_host_game_prompt
*
* == Host Networked Game prompt ==
*
* This shows the dialog to confirm deleting a savegame file.
*
* @begin{table}{dialog_widgets}
*
* do_not_show_again & & boolean_selector & m &
* A checkbox to not show this dialog again. $
*
* @end{table}
*/
REGISTER_DIALOG(mp_host_game_prompt)
/**
* Helper for @ref preferences::ask_delete_saves.
*/
static bool get_do_not_show_again()
{
return preferences::mp_server_warning_disabled() != 1;
}
/**
* Helper for @ref preferences::set_ask_delete_saves.
*/
static void set_do_not_show_again(const bool do_not_show_again)
{
preferences::set_mp_server_warning_disabled(do_not_show_again ? 2 : 1);
}
mp_host_game_prompt::mp_host_game_prompt()
{
set_restore(true);
register_bool("do_not_show_again",
true,
&get_do_not_show_again,
&set_do_not_show_again);
}
} // namespace dialogs
} // namespace gui2