25 #include <boost/dynamic_bitset.hpp>
77 virtual const std::string&
window_id()
const override;
86 void write_macro(std::ostream& out,
unsigned level,
const std::string macro_name);
123 void select_file(
const std::string& default_dir,
const std::string& id_stem);
138 for (
unsigned i = 0;
i < values.size(); ++
i) {
139 if(values.at(
i)[
"label"] == item) {
147 for (
unsigned i = 0;
i < values.size(); ++
i) {
148 if(values.at(
i)[
"label"] == item) {
160 const SDL_Keycode key,
161 SDL_Keymod modifier);
A config object defines a single node in a WML file, with access to child nodes.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
void set_selected(unsigned selected, bool fire_event=true)
Dialog that allows user to create custom unit types.
unsigned int selected_attack_
0 means there are no attacks.
void write()
Write the cfg file.
void quit_confirmation()
Quit confirmation.
bool check_id(std::string id)
Utility method to check if ID contains any invalid characters.
std::vector< config > defense_list_
boost::dynamic_bitset res_toggles_
Used to control checkboxes for various resistances, defences, etc.
const game_config_view & game_config_
std::vector< std::string > sel_abilities_
Need this because can't store macros in config.
std::vector< std::pair< boost::dynamic_bitset<>, config > > attacks_
std::vector< config > abilities_list_
void store_attack()
Callbacks for attack page.
void set_selected_from_string(menu_button &list, std::vector< config > values, std::string item)
std::vector< config > movetype_list_
std::vector< config > race_list_
void update_defenses()
Callbacks for defense list.
std::string generated_wml
Generated WML.
void save_unit_type()
Save Unit Type data to cfg.
std::vector< config > align_list_
void button_state_change()
Callback to enable/disable OK button if ID/Name is invalid.
void signal_handler_sdl_key_down(const event::ui_event, bool &handled, const SDL_Keycode key, SDL_Keymod modifier)
editor_edit_unit(const game_config_view &game_config, const std::string &addon_id)
void select_file(const std::string &default_dir, const std::string &id_stem)
Callback for file select button.
preproc_map specials_map_
boost::dynamic_bitset move_toggles_
void update_movement_costs()
Callbacks for movement list.
std::vector< config > resistances_list_
preproc_map abilities_map_
void enable_defense_slider()
void on_page_select()
Callback when an tab item in the "page" listbox is selected.
void update_resistances()
Callback for resistance list.
const std::string & addon_id_
void store_movement_costs()
void enable_movement_slider()
std::vector< config > specials_list_
virtual const std::string & window_id() const override
The ID of the window to build.
void enable_resistances_slider()
void set_selected_from_string(combobox &list, std::vector< config > values, std::string item)
void write_macro(std::ostream &out, unsigned level, const std::string macro_name)
Write macro to a stream at specified tab level.
std::vector< std::string > sel_specials_
boost::dynamic_bitset def_toggles_
void load_unit_type()
Load Unit Type data from cfg.
virtual void pre_show() override
Actions to be taken before showing the window.
void update_wml_view()
Update wml preview.
std::vector< config > usage_type_list_
DEFINE_SIMPLE_EXECUTE_WRAPPER(editor_edit_unit)
The execute function.
void load_movetype()
Callback for loading movetype data in UI.
void update_image(const std::string &id_stem)
Callback for image update.
Abstract base class for all modal dialogs.
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
Various uncategorised dialogs.
Game configuration data as global variables.
ui_event
The event sent to the dispatcher.
std::map< std::string, struct preproc_define > preproc_map