The dialog for selecting which random generator to use in the editor. More...
#include <generate_map.hpp>
Public Member Functions | |
teditor_generate_map () | |
void | set_map_generators (std::vector< map_generator * > mg) |
std::vector< map_generator * > | get_map_generators () |
map_generator * | get_selected_map_generator () |
void | select_map_generator (map_generator *mg) |
boost::optional< boost::uint32_t > | get_seed () |
Public Member Functions inherited from gui2::tdialog | |
tdialog () | |
virtual | ~tdialog () |
bool | show (CVideo &video, const unsigned auto_close_time=0) |
Shows the window. More... | |
int | get_retval () const |
void | set_always_save_fields (const bool always_save_fields) |
void | set_restore (const bool restore) |
Private Member Functions | |
virtual const std::string & | window_id () const |
Inherited from tdialog, implemented by REGISTER_DIALOG. More... | |
void | pre_show (twindow &window) |
Inherited from tdialog. More... | |
void | do_generator_selected (twindow &window) |
Callback for generator list selection changes. More... | |
void | do_settings (twindow &window) |
Callback for the generator settings button. More... | |
Private Attributes | |
std::vector< map_generator * > | map_generators_ |
Available map generators. More... | |
map_generator * | last_map_generator_ |
Last used map generator, must be in map_generators_. More... | |
int | current_map_generator_ |
Current map generator index. More... | |
std::string | random_seed_ |
random seed integer input More... | |
Additional Inherited Members | |
Protected Member Functions inherited from gui2::tdialog | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_bool * | register_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>()) |
Creates a new boolean field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>()) |
Creates a new integer field. More... | |
tfield_integer * | register_integer (const std::string &id, const bool mandatory, int &linked_variable) |
Creates a new integer field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_text * | register_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false) |
Creates a new text field. More... | |
tfield_label * | register_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false) |
Registers a new control as a label. More... | |
tfield_label * | register_image (const std::string &id, const bool mandatory, const std::string &filename) |
Registers a new control as image. More... | |
The dialog for selecting which random generator to use in the editor.
Definition at line 32 of file generate_map.hpp.
gui2::teditor_generate_map::teditor_generate_map | ( | ) |
Definition at line 64 of file generate_map.cpp.
Callback for generator list selection changes.
Definition at line 72 of file generate_map.cpp.
References current_map_generator_, gui2::tlistbox::get_selected_row(), map_generators_, and gui2::tbutton::set_active().
Referenced by pre_show().
Callback for the generator settings button.
Definition at line 87 of file generate_map.cpp.
References get_selected_map_generator(), map_generator::user_config(), and gui2::twindow::video().
Referenced by pre_show().
|
inline |
Definition at line 42 of file generate_map.hpp.
References map_generators_.
boost::optional< boost::uint32_t > gui2::teditor_generate_map::get_seed | ( | ) |
Definition at line 145 of file generate_map.cpp.
References lexical_cast(), and random_seed_.
Referenced by editor::context_manager::generate_map_dialog().
map_generator * gui2::teditor_generate_map::get_selected_map_generator | ( | ) |
Definition at line 92 of file generate_map.cpp.
References current_map_generator_, and map_generators_.
Referenced by do_settings(), and editor::context_manager::generate_map_dialog().
Inherited from tdialog.
Reimplemented from gui2::tdialog.
Definition at line 104 of file generate_map.cpp.
References gui2::tlistbox::add_row(), gui2::event::connect_signal_mouse_left_click(), do_generator_selected(), do_settings(), gui2::tlistbox::get_item_count(), last_map_generator_, map_generators_, random_seed_, gui2::tdialog::register_text(), gui2::tlistbox::select_row(), and gui2::tlistbox::set_callback_item_change().
void gui2::teditor_generate_map::select_map_generator | ( | map_generator * | mg | ) |
Definition at line 99 of file generate_map.cpp.
References last_map_generator_.
Referenced by editor::context_manager::generate_map_dialog().
|
inline |
Definition at line 37 of file generate_map.hpp.
References map_generators_.
Referenced by editor::context_manager::generate_map_dialog().
|
privatevirtual |
Inherited from tdialog, implemented by REGISTER_DIALOG.
Implements gui2::tdialog.
|
private |
Current map generator index.
Definition at line 73 of file generate_map.hpp.
Referenced by do_generator_selected(), and get_selected_map_generator().
|
private |
Last used map generator, must be in map_generators_.
Definition at line 70 of file generate_map.hpp.
Referenced by pre_show(), and select_map_generator().
|
private |
Available map generators.
Definition at line 67 of file generate_map.hpp.
Referenced by do_generator_selected(), get_map_generators(), get_selected_map_generator(), pre_show(), and set_map_generators().
|
private |
random seed integer input
Definition at line 76 of file generate_map.hpp.
Referenced by get_seed(), and pre_show().