Classes | Functions

dialogs Namespace Reference

Various uncategorised dialogs. More...

Classes

class  unit_preview_pane
 Show unit-stats in a side-pane to unit-list, recall-list, etc. More...
class  units_list_preview_pane
class  unit_types_preview_pane
class  file_dialog

Functions

int advance_unit_dialog (const map_location &loc)
 Lets the user to select a unit advancement.
void advance_unit (const map_location &loc, bool random_choice=false, bool add_replay_event=false)
 Function to handle an advancing unit.
bool animate_unit_advancement (const map_location &loc, size_t choice, const bool &fire_event=true)
 Actually levels a unit up.
void show_objectives (const config &level, const std::string &objectives)
std::string load_game_dialog (display &disp, const config &terrain_config, bool *select_difficulty, bool *show_replay, bool *cancel_orders)
 Allow user to select the game they want to load.
void show_unit_description (const unit &u)
void show_unit_description (const unit_type &t)
static network::connection network_data_dialog (display &disp, const std::string &msg, config &cfg, network::connection connection_num, network::statistics(*get_stats)(network::connection handle))
network::connection network_send_dialog (display &disp, const std::string &msg, config &cfg, network::connection connection_num)
network::connection network_receive_dialog (display &disp, const std::string &msg, config &cfg, network::connection connection_num)
network::connection network_connect_dialog (display &disp, const std::string &msg, const std::string &hostname, int port)
int show_file_chooser_dialog (display &displ, 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.
int show_file_chooser_dialog_save (display &displ, 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 filechooser dialog in a "save" mode, that is, without relying on autocomplete to allow saving under any filename.

Detailed Description

Various uncategorised dialogs.


Function Documentation

void dialogs::advance_unit ( const map_location loc,
bool  random_choice = false,
bool  add_replay_event = false 
)

Function to handle an advancing unit.

If there is only one choice to advance to, the unit will be automatically advanced. If there is a choice, and 'random_choice' is true, then a unit will be selected at random. Otherwise, a dialog will be displayed asking the user what to advance to.

Note that 'loc' is not a reference, because deleting an item from the units map (when replacing the unit that is being advanced) will possibly invalidate the reference.

The game only expects an advancement to be triggered by a fight, if the cause for advancement is different (eg unstore_unit) this routine should _not_ be used.

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.

Referenced by unstore_unit_advance_choice::query_user().

Here is the caller graph for this function:

bool dialogs::animate_unit_advancement ( const map_location loc,
size_t  choice,
const bool &  fire_event = 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.

Referenced by do_replay_handle(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

std::string dialogs::load_game_dialog ( display disp,
const config terrain_config,
bool *  select_difficulty,
bool *  show_replay,
bool *  cancel_orders 
)

Allow user to select the game they want to load.

Returns the name of the save they want to load. Stores whether the user wants to show a replay of the game in show_replay. If show_replay is NULL, then the user will not be asked if they want to show a replay.

Referenced by savegame::loadgame::show_dialog().

Here is the caller graph for this function:

network::connection dialogs::network_connect_dialog ( display disp,
const std::string &  msg,
const std::string &  hostname,
int  port 
)

Referenced by open_connection().

Here is the caller graph for this function:

static network::connection dialogs::network_data_dialog ( display disp,
const std::string &  msg,
config cfg,
network::connection  connection_num,
network::statistics(*)(network::connection handle)  get_stats 
) [static]
network::connection dialogs::network_receive_dialog ( display disp,
const std::string &  msg,
config cfg,
network::connection  connection_num 
)

Referenced by mp::wait::join_game(), open_connection(), play_game(), and playmp_controller::wait_for_upload().

Here is the caller graph for this function:

network::connection dialogs::network_send_dialog ( display disp,
const std::string &  msg,
config cfg,
network::connection  connection_num 
)
int dialogs::show_file_chooser_dialog ( display displ,
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.

Referenced by editor::context_manager::apply_mask_dialog(), editor::context_manager::create_mask_to_dialog(), and editor::context_manager::load_map_dialog().

Here is the caller graph for this function:

int dialogs::show_file_chooser_dialog_save ( display disp,
std::string &  filename,
std::string const &  title,
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.

Referenced by events::menu_handler::save_map(), and editor::context_manager::save_map_as_dialog().

Here is the caller graph for this function:

void dialogs::show_objectives ( const config level,
const std::string &  objectives 
)

Referenced by playsingle_controller::check_end_level(), and events::menu_handler::objectives().

Here is the caller graph for this function:

void dialogs::show_unit_description ( const unit u  ) 
void dialogs::show_unit_description ( const unit_type t  ) 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:18:05 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs