The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Functions
dialogs Namespace Reference

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...
 

Detailed Description

Various uncategorised dialogs.

Function Documentation

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 
)
static void dialogs::network_transmission_dialog ( CVideo video,
gui2::tnetwork_transmission::connection_data conn,
const std::string msg1,
const std::string msg2 
)
static
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 
)
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 
)
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 
)
void dialogs::show_unit_list ( display gui)