The Battle for Wesnoth  1.19.0-dev
edit_scenario.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2024
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/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  : modal_dialog(window_id())
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
Dialog for editing gamemap scenarios.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on.
Definition: window.hpp:63
void add_to_tab_order(widget *widget, int at=-1)
Add the widget to the tabbing order.
Definition: window.cpp:1233
This file contains the window object, this object is a top level container which has the event manage...
REGISTER_DIALOG(tod_new_schedule)
bool random_start_time()
Definition: game.cpp:512
int turns()
Definition: game.cpp:542