Various uncategorised dialogs. More...
Classes | |
struct | connect_wesnothd_connection_data |
class | file_dialog |
struct | read_wesnothd_connection_data |
class | unit_preview_pane |
Show unit-stats in a side-pane to unit-list, recall-list, etc. More... | |
class | unit_types_preview_pane |
class | units_list_preview_pane |
Functions | |
int | advance_unit_dialog (const map_location &loc) |
Lets the user to select a unit advancement. More... | |
bool | animate_unit_advancement (const map_location &loc, size_t choice, const bool &fire_event=true, const bool animate=true) |
Actually levels a unit up. More... | |
void | show_unit_list (display &gui) |
void | show_objectives (const std::string &scenarioname, const std::string &objectives) |
int | recruit_dialog (display &disp, std::vector< const unit_type * > &units, const std::vector< std::string > &items, int side, const std::string &title_suffix) |
int | recall_dialog (display &disp, const boost::shared_ptr< std::vector< unit_const_ptr > > &units, int side, const std::string &title_suffix, const int team_recall_cost) |
static void | network_transmission_dialog (CVideo &video, gui2::tnetwork_transmission::connection_data &conn, const std::string &msg1, const std::string &msg2) |
bool | network_receive_dialog (CVideo &video, const std::string &msg, config &cfg, twesnothd_connection &wesnothd_connection) |
std::unique_ptr < twesnothd_connection > | network_connect_dialog (CVideo &video, const std::string &msg, const std::string &hostname, int port) |
int | show_file_chooser_dialog (CVideo &video, std::string &filename, std::string const &title, bool show_directory_buttons=true, const std::string &file_to_search="", int xloc=-1, int yloc=-1) |
Show a dialog where the user can navigate through files and select a file. More... | |
int | show_file_chooser_dialog_save (CVideo &video, std::string &filename, std::string const &title, const std::string &default_file_name="", bool show_directory_buttons=true, const std::string &file_to_search="", int xloc=-1, int yloc=-1) |
Show a filechooser dialog in a "save" mode, that is, without relying on autocomplete to allow saving under any filename. More... | |
Various uncategorised dialogs.
int dialogs::advance_unit_dialog | ( | const map_location & | loc | ) |
Lets the user to select a unit advancement.
This should always be used from WML events, advance_unit can only be used safely for normal levels.
Definition at line 172 of file dialogs.cpp.
References _(), unit::absolute_image(), COLUMN_SEPARATOR, preferences::encountered_units(), unit_map::find(), get_advanced_unit(), get_amla_unit(), IMAGE_PREFIX, gui::OK_ONLY, preferences::options(), resources::screen, gui::dialog::set_menu(), gui::dialog::set_panes(), gui::dialog::show(), unit::type_name(), and resources::units.
bool dialogs::animate_unit_advancement | ( | const map_location & | loc, |
size_t | choice, | ||
const bool & | fire_event = true , |
||
const bool | animate = true |
||
) |
Actually levels a unit up.
This is the other part of the low-level interface to the advancing code (along with advance_unit_dialog). This needs to be used to implement advances from any nonstandard situation. It does not add a replay.
Definition at line 233 of file dialogs.cpp.
References unit_animator::add_animation(), advance_unit(), display::draw(), unit_map::find(), display::invalidate(), display::invalidate_all(), game_display::invalidate_unit(), preferences::options(), events::pump(), resources::screen, unit_animator::set_all_standing(), unit_animator::start_animations(), resources::units, and unit_animator::wait_for_end().
Referenced by advance_unit_at().
std::unique_ptr< twesnothd_connection > dialogs::network_connect_dialog | ( | CVideo & | video, |
const std::string & | msg, | ||
const std::string & | hostname, | ||
int | port | ||
) |
Definition at line 1195 of file dialogs.cpp.
References _(), and network_transmission_dialog().
Referenced by open_connection().
bool dialogs::network_receive_dialog | ( | CVideo & | video, |
const std::string & | msg, | ||
config & | cfg, | ||
twesnothd_connection & | wesnothd_connection | ||
) |
Definition at line 1179 of file dialogs.cpp.
References _(), network_transmission_dialog(), and twesnothd_connection::receive_data().
Referenced by mp::wait::download_level_data(), open_connection(), and playmp_controller::wait_for_upload().
|
static |
Definition at line 1155 of file dialogs.cpp.
References CVideo::faked(), gui2::tnetwork_transmission::connection_data::finished(), gui2::tnetwork_transmission::connection_data::poll(), and gui2::tdialog::show().
Referenced by network_connect_dialog(), and network_receive_dialog().
int dialogs::recall_dialog | ( | display & | disp, |
const boost::shared_ptr< std::vector< unit_const_ptr > > & | units, | ||
int | side, | ||
const std::string & | title_suffix, | ||
const int | team_recall_cost | ||
) |
Definition at line 466 of file dialogs.cpp.
References _(), unit::absolute_image(), gui::menu::bluebg_style, font::BOLD_TEXT, gui::dialog::BUTTON_HELP, unit::can_advance(), unit::can_recruit(), font::color2markup(), COLUMN_SEPARATOR, gui::dialog::default_style, unit::experience(), gui::filter_textbox::get_index(), team::get_side_color_index(), HEADING_PREFIX, IMAGE_PREFIX, unit::leader_crown(), unit::level(), unit::max_experience(), gui::dialog::max_menu_width, unit::name(), font::NORMAL_TEXT, gui::OK_CANCEL, preferences::options(), unit::overlays(), unit::recall_cost(), font::relative_size(), gui::menu::basic_sorter::set_alpha_sort(), gui::menu::basic_sorter::set_level_sort(), gui::menu::basic_sorter::set_xp_sort(), unit::team_color(), unit::trait_names(), unit::type_name(), utils::unicode_em_dash, resources::units, display::video(), and unit::xp_color().
Referenced by events::menu_handler::recall().
int dialogs::recruit_dialog | ( | display & | disp, |
std::vector< const unit_type * > & | units, | ||
const std::vector< std::string > & | items, | ||
int | side, | ||
const std::string & | title_suffix | ||
) |
Definition at line 432 of file dialogs.cpp.
References _(), gui::dialog::add_button(), gui::menu::bluebg_style, gui::dialog::BUTTON_HELP, gui::dialog::default_style, mp_ui_alerts::items, gui::dialog::max_menu_width, gui::OK_CANCEL, font::relative_size(), gui::menu::style::scale_images(), gui::menu::basic_sorter::set_alpha_sort(), gui::menu::sort_by(), and display::video().
int dialogs::show_file_chooser_dialog | ( | CVideo & | video, |
std::string & | filename, | ||
std::string const & | title, | ||
bool | show_directory_buttons = true , |
||
const std::string & | file_to_search = "" , |
||
int | xloc = -1 , |
||
int | yloc = -1 |
||
) |
Show a dialog where the user can navigate through files and select a file.
The filename is used as a starting point in the navigation and contains the chosen file when the function returns. Return the index of the button pressed, or -1 if the dialog was canceled through keypress.
Definition at line 30 of file filechooser.cpp.
References d, dialogs::file_dialog::get_choice(), gui::dialog::result(), dialogs::file_dialog::select_file(), and gui::dialog::show().
Referenced by editor::context_manager::apply_mask_dialog(), editor::context_manager::create_mask_to_dialog(), editor::context_manager::load_map_dialog(), gui2::tcustom_tod::select_file(), and preferences::show_wesnothd_server_search().
int dialogs::show_file_chooser_dialog_save | ( | CVideo & | video, |
std::string & | filename, | ||
std::string const & | title, | ||
const std::string & | default_file_name, | ||
bool | show_directory_buttons, | ||
const std::string & | type_a_head, | ||
int | xloc, | ||
int | yloc | ||
) |
Show a filechooser dialog in a "save" mode, that is, without relying on autocomplete to allow saving under any filename.
Definition at line 44 of file filechooser.cpp.
References d, dialogs::file_dialog::get_choice(), gui::dialog::result(), dialogs::file_dialog::select_file(), dialogs::file_dialog::set_autocomplete(), and gui::dialog::show().
Referenced by events::menu_handler::save_map(), editor::context_manager::save_map_as_dialog(), and editor::context_manager::save_scenario_as_dialog().
void dialogs::show_objectives | ( | const std::string & | scenarioname, |
const std::string & | objectives | ||
) |
Definition at line 425 of file dialogs.cpp.
References _(), resources::screen, and gui2::show_transient_message().
Referenced by playsingle_controller::check_objectives(), and events::menu_handler::objectives().
Definition at line 294 of file dialogs.cpp.
References _(), unit_map::begin(), font::BOLD_TEXT, gui::dialog::BUTTON_STANDARD, font::color2markup(), COLUMN_SEPARATOR, DEFAULT_ITEM, unit_map::end(), display::get_units(), font::GREEN_TEXT, HEADING_PREFIX, i, IMAGE_PREFIX, IMG_TEXT_SEPARATOR, mp_ui_alerts::items, utils::join(), font::NORMAL_TEXT, gui::NULL_DIALOG, gui::OK_CANCEL, font::RED_TEXT, display::scroll_to_tile(), display::select_hex(), game_config::images::selected, display::selected_hex(), gui::menu::basic_sorter::set_alpha_sort(), gui::menu::basic_sorter::set_level_sort(), gui::dialog::set_menu(), gui::menu::basic_sorter::set_numeric_sort(), dialogs::unit_preview_pane::set_selection(), gui::menu::basic_sorter::set_xp_sort(), unit::STATE_PETRIFIED, unit::STATE_POISONED, unit::STATE_SLOWED, resources::units, display::video(), display::viewing_side(), and display::WARP.
Referenced by events::menu_handler::unit_list(), and editor::editor_controller::unit_list().