The Battle for Wesnoth  1.17.0-dev
edit_scenario.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2018 by Fabian Müller <fabianmueller5@gmx.de>
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 
15 #define GETTEXT_DOMAIN "wesnoth-lib"
16 
18 
20 #include "gui/widgets/settings.hpp"
21 #include "gui/widgets/text_box.hpp"
22 #include "gui/widgets/window.hpp"
23 
24 namespace gui2::dialogs
25 {
26 
27 REGISTER_DIALOG(editor_edit_scenario)
28 
30  std::string& id,
31  std::string& name,
32  std::string& description,
33  int& turns,
34  int& experience_modifier,
35  bool& victory_when_enemies_defeated,
36  bool& random_start_time)
37 {
38  register_text("id", true, id, true);
39  register_text("name", true, name, false);
40  register_text("description", true, description, false);
41  register_integer("turns", true, turns);
42  register_integer("experience_modifier", true, experience_modifier);
43  register_bool("victory_when_enemies_defeated",
44  true,
45  victory_when_enemies_defeated);
46  register_bool("random_start_time", true, random_start_time);
47 }
48 
50 {
51  win.add_to_tab_order(find_widget<text_box>(&win, "id", false, true));
52  win.add_to_tab_order(find_widget<text_box>(&win, "name", false, true));
53  win.add_to_tab_order(find_widget<text_box>(&win, "description", false, true));
54 }
55 
56 } // namespace dialogs
This file contains the window object, this object is a top level container which has the event manage...
STL namespace.
This file contains the settings handling of the widget library.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Dialog for editing gamemap scenarios.
int turns()
Definition: game.cpp:558
void add_to_tab_order(widget *widget, int at=-1)
Add the widget to the tabbing order.
Definition: window.cpp:1293
bool random_start_time()
Definition: game.cpp:528
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64