The Battle for Wesnoth  1.17.0-dev
edit_scenario.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2021
3  by Fabian Müller <fabianmueller5@gmx.de>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #define GETTEXT_DOMAIN "wesnoth-lib"
17 
19 
21 #include "gui/widgets/settings.hpp"
22 #include "gui/widgets/text_box.hpp"
23 #include "gui/widgets/window.hpp"
24 
25 namespace gui2::dialogs
26 {
27 
28 REGISTER_DIALOG(editor_edit_scenario)
29 
31  std::string& id,
32  std::string& name,
33  std::string& description,
34  int& turns,
35  int& experience_modifier,
36  bool& victory_when_enemies_defeated,
37  bool& random_start_time)
38 {
39  register_text("id", true, id, true);
40  register_text("name", true, name, false);
41  register_text("description", true, description, false);
42  register_integer("turns", true, turns);
43  register_integer("experience_modifier", true, experience_modifier);
44  register_bool("victory_when_enemies_defeated",
45  true,
46  victory_when_enemies_defeated);
47  register_bool("random_start_time", true, random_start_time);
48 }
49 
51 {
52  win.add_to_tab_order(find_widget<text_box>(&win, "id", false, true));
53  win.add_to_tab_order(find_widget<text_box>(&win, "name", false, true));
54  win.add_to_tab_order(find_widget<text_box>(&win, "description", false, true));
55 }
56 
57 } // 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:559
void add_to_tab_order(widget *widget, int at=-1)
Add the widget to the tabbing order.
Definition: window.cpp:1294
bool random_start_time()
Definition: game.cpp:529
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:65