The Battle for Wesnoth  1.15.0-dev
Namespaces | Classes | Typedefs | Functions | Variables
gui2::dialogs Namespace Reference

Namespaces

 tip
 

Classes

class  addon_connect
 Addon connect dialog. More...
 
class  addon_manager
 Shows the list of addons on the server. More...
 
class  addon_uninstall_list
 
class  advanced_graphics_options
 
class  attack_predictions
 
class  bookmark_create
 
class  campaign_difficulty
 
class  campaign_selection
 
class  chat_log
 
class  command_console
 A simple command console class. More...
 
class  core_selection
 
class  custom_tod
 
class  debug_clock
 Clock to test the draw events. More...
 
class  depcheck_confirm_change
 
class  depcheck_select_new
 
class  drop_down_menu
 Used by the menu_button widget. More...
 
class  edit_label
 
class  edit_text
 
class  editor_edit_label
 
class  editor_edit_scenario
 
class  editor_edit_side
 
class  editor_generate_map
 The dialog for selecting which random generator to use in the editor. More...
 
class  editor_new_map
 
class  editor_resize_map
 
class  editor_set_starting_position
 
class  end_credits
 
class  event_mode_controller
 
class  faction_select
 
class  file_dialog
 
class  folder_create
 
class  formula_debugger
 
class  game_cache_options
 
class  game_delete
 
class  game_load
 
class  game_save
 
class  game_save_message
 
class  game_save_oos
 
class  game_stats
 
class  game_ui
 
class  game_version
 
class  gamestate_inspector
 
class  generator_settings
 
class  help_browser
 Help browser dialog. More...
 
class  hotkey_bind
 
class  ingame_ui_base
 Base dialog class intended for in-game UIs for the main game and editor. More...
 
class  install_dependencies
 
class  label_settings
 
class  language_selection
 
class  loading_screen
 
struct  lobby_delay_gamelist_update_guard
 
class  lobby_player_info
 
class  log_settings
 
class  lua_interpreter
 
class  message
 Main class to show messages to the user. More...
 
struct  message_implementation
 Helper to implement private functions without modifying the header. More...
 
class  modal_dialog
 Abstract base class for all modal dialogs. More...
 
class  modeless_dialog
 The popup class shows windows that are shown non-modal. More...
 
class  mp_alerts_options
 
class  mp_change_control
 
class  mp_connect
 
class  mp_create_game
 
class  mp_host_game_prompt
 
class  mp_join_game
 
class  mp_join_game_password_prompt
 
class  mp_lobby
 
class  mp_login
 
class  mp_method_selection
 
class  mp_options_helper
 
class  mp_staging
 
class  network_transmission
 Dialog that tracks network transmissions. More...
 
class  outro
 Dialog to display 'The End' at the end of a campaign. More...
 
struct  player_list
 
class  plugin_executor
 
class  preferences_dialog
 
class  screenshot_notification
 
class  select_orb_colors
 
class  simple_item_selector
 
class  single_mode_controller
 
class  sp_options_configure
 
class  statistics_dialog
 
class  story_viewer
 Dialog to view the storyscreen. More...
 
class  stuff_list_adder
 
struct  sub_player_list
 
class  surrender_quit
 
class  synched_choice_wait
 
class  team_mode_controller
 
class  terrain_layers
 
class  theme_list
 
class  title_screen
 This class implements the title screen. More...
 
class  tooltip
 Class to show the tips. More...
 
class  transient_message
 Shows a transient message. More...
 
class  unit_advance
 
class  unit_attack
 
class  unit_create
 
class  unit_list
 
class  unit_mode_controller
 
class  unit_recall
 
class  unit_recruit
 
class  variable_mode_controller
 
class  wml_error
 WML preprocessor/parser error report dialog. More...
 
class  wml_message_base
 Base class for the wml generated messages. More...
 
class  wml_message_double
 Shows a dialog with two portraits, one on each side. More...
 
struct  wml_message_input
 Parameter pack for message text input options. More...
 
class  wml_message_left
 Shows a dialog with the portrait on the left side. More...
 
class  wml_message_option
 Helper class for message options. More...
 
struct  wml_message_options
 Parameter pack for message list input options. More...
 
struct  wml_message_portrait
 Parameter pack for message portrait. More...
 
class  wml_message_right
 Shows a dialog with the portrait on the right side. More...
 

Typedefs

using hp_probability_t = std::pair< int, double >
 
using hp_probability_vector = std::vector< hp_probability_t >
 
using btn_callback = std::function< void()>
 
using unit_ptr_vector = std::vector< unit_const_ptr >
 

Functions

static std::string describe_status_verbose (const addon_tracking_info &state)
 
static std::string format_addon_time (time_t time)
 
static std::string get_probability_string (const double prob)
 
config generate_difficulty_config (const config &source)
 Helper function to convert old difficulty markup. More...
 
static custom_tod::string_pair tod_getter_image (const time_of_day &tod)
 
static custom_tod::string_pair tod_getter_mask (const time_of_day &tod)
 
static custom_tod::string_pair tod_getter_sound (const time_of_day &tod)
 
static int resize_grid_xy_to_idx (const int x, const int y)
 Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds. More...
 
static bool get_dont_ask_again ()
 Helper to invert preferences::ask_delete_saves. More...
 
static void set_dont_ask_again (const bool ask_again)
 Helper to invert preferences::set_ask_delete_saves. More...
 
static std::string controller_name (const team &t)
 
static stuff_list_adder add_unit_entry (stuff_list_adder &progress, const unit &u, const display_context &dc)
 
static std::string format_help_text (const config &cfg)
 
static toggle_buttonsetup_pref_toggle_button (const std::string &id, bool def, window &window)
 
static void setup_item (const std::string &item, window &window)
 
static void set_pref_and_button (const std::string &id, bool value, window &window)
 
static void revert_to_default_pref_values (window &window)
 
static void show_server_list (window &window, field_text *host_name)
 
static bool get_do_not_show_again ()
 Helper for preferences::ask_delete_saves. More...
 
static void set_do_not_show_again (const bool do_not_show_again)
 Helper for preferences::set_ask_delete_saves. More...
 
static std::string generate_user_description (const config &side)
 
static config get_title_area_decor_config ()
 
static void register_button (window &win, const std::string &id, hotkey::HOTKEY_COMMAND hk, btn_callback callback)
 
static void launch_lua_console ()
 
static std::string format_level_string (const int level)
 
static std::string format_if_leader (unit_const_ptr u, const std::string str)
 
static std::string format_movement_string (unit_const_ptr u)
 
void show_unit_list (display &gui)
 
template<typename T >
static void dump_recall_list_to_console (const T &units)
 
static std::string format_level_string (const int level)
 
static std::string format_cost_string (int unit_recall_cost, const int team_recall_cost)
 
static std::string get_title_suffix (int side_num)
 
static std::string can_afford_unit (const std::string &text, const bool can_afford)
 
int show_wml_message (const std::string &title, const std::string &message, const wml_message_portrait *left, const wml_message_portrait *right, const wml_message_options &options, const wml_message_input &input)
 Helper function to show a portrait. More...
 
std::string unit_test_mark_as_tested (const modal_dialog &dialog)
 
std::string unit_test_mark_popup_as_tested (const modeless_dialog &dialog)
 
windowunit_test_window (const modeless_dialog &dialog)
 
modal_dialogunit_test_mp_server_list ()
 

Variables

static int max_coastal = 5
 
static int extra_size_per_player = 2
 
static int min_size = 20
 
static const int LOAD_GAME = 100
 
static bool use_campaign = false
 
static const unsigned int LAYER_BACKGROUND = 1
 
static const unsigned int LAYER_TEXT = 2
 
bool show_debug_clock_button = false
 Do we wish to show the button for the debug clock. More...
 
static listbox::order_pair sort_last {-1, listbox::SORT_NONE}
 
static listbox::order_pair sort_default { 2, listbox::SORT_DESCENDING}
 

Typedef Documentation

◆ btn_callback

using gui2::dialogs::btn_callback = typedef std::function<void()>

Definition at line 146 of file title_screen.cpp.

◆ hp_probability_t

using gui2::dialogs::hp_probability_t = typedef std::pair<int, double>

Definition at line 33 of file attack_predictions.hpp.

◆ hp_probability_vector

Definition at line 34 of file attack_predictions.hpp.

◆ unit_ptr_vector

using gui2::dialogs::unit_ptr_vector = typedef std::vector<unit_const_ptr>

Definition at line 33 of file unit_list.hpp.

Function Documentation

◆ add_unit_entry()

static stuff_list_adder gui2::dialogs::add_unit_entry ( stuff_list_adder progress,
const unit u,
const display_context dc 
)
static

◆ can_afford_unit()

static std::string gui2::dialogs::can_afford_unit ( const std::string &  text,
const bool  can_afford 
)
static

Definition at line 57 of file unit_recruit.cpp.

Referenced by gui2::dialogs::unit_recruit::pre_show().

◆ controller_name()

static std::string gui2::dialogs::controller_name ( const team t)
static

Definition at line 74 of file game_stats.cpp.

References _(), team::controller(), and names.

Referenced by gui2::dialogs::game_stats::pre_show().

◆ describe_status_verbose()

static std::string gui2::dialogs::describe_status_verbose ( const addon_tracking_info state)
static

◆ dump_recall_list_to_console()

template<typename T >
static void gui2::dialogs::dump_recall_list_to_console ( const T &  units)
static

Definition at line 73 of file unit_recall.cpp.

References log_display, LOG_DP, and log_scope2.

Referenced by gui2::dialogs::unit_recall::dismiss_unit().

◆ format_addon_time()

static std::string gui2::dialogs::format_addon_time ( time_t  time)
static

◆ format_cost_string()

static std::string gui2::dialogs::format_cost_string ( int  unit_recall_cost,
const int  team_recall_cost 
)
static

Definition at line 100 of file unit_recall.cpp.

Referenced by gui2::dialogs::unit_recall::pre_show().

◆ format_help_text()

static std::string gui2::dialogs::format_help_text ( const config cfg)
static

◆ format_if_leader()

static std::string gui2::dialogs::format_if_leader ( unit_const_ptr  u,
const std::string  str 
)
static

Definition at line 74 of file unit_list.cpp.

Referenced by gui2::dialogs::unit_list::pre_show().

◆ format_level_string() [1/2]

static std::string gui2::dialogs::format_level_string ( const int  level)
static

◆ format_level_string() [2/2]

static std::string gui2::dialogs::format_level_string ( const int  level)
static

Definition at line 85 of file unit_recall.cpp.

◆ format_movement_string()

static std::string gui2::dialogs::format_movement_string ( unit_const_ptr  u)
static

Definition at line 79 of file unit_list.cpp.

References moves_left.

Referenced by gui2::dialogs::unit_list::pre_show().

◆ generate_difficulty_config()

config gui2::dialogs::generate_difficulty_config ( const config source)

Helper function to convert old difficulty markup.

Declared outside class to allow other classes to make use of it.

Definition at line 76 of file campaign_difficulty.cpp.

References config::add_child(), config::append_children(), deprecated_message(), gui2::legacy_menu_item::description(), config::empty(), FOR_REMOVAL, i, gui2::legacy_menu_item::icon(), gui2::legacy_menu_item::is_default(), gui2::legacy_menu_item::label(), and utils::split().

Referenced by mp::game_info::game_info().

◆ generate_user_description()

static std::string gui2::dialogs::generate_user_description ( const config side)
static

Definition at line 237 of file mp_join_game.cpp.

References _(), config::get(), and VGETTEXT.

Referenced by gui2::dialogs::mp_join_game::generate_side_list().

◆ get_do_not_show_again()

static bool gui2::dialogs::get_do_not_show_again ( )
static

◆ get_dont_ask_again()

static bool gui2::dialogs::get_dont_ask_again ( )
static

Helper to invert preferences::ask_delete_saves.

The value stored and the way shown is inverted.

Definition at line 48 of file game_delete.cpp.

References preferences::ask_delete_saves().

Referenced by gui2::dialogs::game_delete::game_delete().

◆ get_probability_string()

static std::string gui2::dialogs::get_probability_string ( const double  prob)
static

◆ get_title_area_decor_config()

static config gui2::dialogs::get_title_area_decor_config ( )
static

Definition at line 40 of file story_viewer.cpp.

Referenced by gui2::dialogs::story_viewer::display_part().

◆ get_title_suffix()

static std::string gui2::dialogs::get_title_suffix ( int  side_num)
static

◆ launch_lua_console()

static void gui2::dialogs::launch_lua_console ( )
static

◆ register_button()

static void gui2::dialogs::register_button ( window win,
const std::string &  id,
hotkey::HOTKEY_COMMAND  hk,
btn_callback  callback 
)
static

◆ resize_grid_xy_to_idx()

static int gui2::dialogs::resize_grid_xy_to_idx ( const int  x,
const int  y 
)
static

Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds.

Definition at line 142 of file resize_map.cpp.

Referenced by gui2::dialogs::editor_resize_map::update_expand_direction().

◆ revert_to_default_pref_values()

static void gui2::dialogs::revert_to_default_pref_values ( window window)
static

◆ set_do_not_show_again()

static void gui2::dialogs::set_do_not_show_again ( const bool  do_not_show_again)
static

◆ set_dont_ask_again()

static void gui2::dialogs::set_dont_ask_again ( const bool  ask_again)
static

Helper to invert preferences::set_ask_delete_saves.

The value stored and the way shown is inverted.

Definition at line 58 of file game_delete.cpp.

References preferences::set_ask_delete_saves().

Referenced by gui2::dialogs::game_delete::game_delete().

◆ set_pref_and_button()

static void gui2::dialogs::set_pref_and_button ( const std::string &  id,
bool  value,
window window 
)
static

◆ setup_item()

static void gui2::dialogs::setup_item ( const std::string &  item,
window window 
)
static

◆ setup_pref_toggle_button()

static toggle_button* gui2::dialogs::setup_pref_toggle_button ( const std::string &  id,
bool  def,
window window 
)
static

◆ show_server_list()

static void gui2::dialogs::show_server_list ( window window,
field_text host_name 
)
static

◆ show_unit_list()

void gui2::dialogs::show_unit_list ( display gui)

◆ show_wml_message()

int gui2::dialogs::show_wml_message ( const std::string &  title,
const std::string &  message,
const wml_message_portrait left,
const wml_message_portrait right,
const wml_message_options options,
const wml_message_input input 
)

Helper function to show a portrait.

Parameters
titleThe title of the dialog.
messageThe message to show.
leftPortrait to show on the left.
rightPortrait to show on the right.
optionsOptions to offer.
inputInfo on text input.

Definition at line 161 of file wml_message.cpp.

Referenced by lua_gui2::show_message_dialog().

◆ tod_getter_image()

static custom_tod::string_pair gui2::dialogs::tod_getter_image ( const time_of_day tod)
static

Definition at line 86 of file custom_tod.cpp.

References time_of_day::image.

Referenced by gui2::dialogs::custom_tod::pre_show().

◆ tod_getter_mask()

static custom_tod::string_pair gui2::dialogs::tod_getter_mask ( const time_of_day tod)
static

Definition at line 92 of file custom_tod.cpp.

References time_of_day::image_mask.

Referenced by gui2::dialogs::custom_tod::pre_show().

◆ tod_getter_sound()

static custom_tod::string_pair gui2::dialogs::tod_getter_sound ( const time_of_day tod)
static

Definition at line 98 of file custom_tod.cpp.

References REGISTER_DIALOG, and time_of_day::sounds.

Referenced by gui2::dialogs::custom_tod::pre_show().

◆ unit_test_mark_as_tested()

std::string gui2::dialogs::unit_test_mark_as_tested ( const modal_dialog dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 142 of file test_gui2.cpp.

References gui2::unit_test_registered_window_list(), and gui2::dialogs::modal_dialog::window_id().

Referenced by unit_test_mp_server_list().

◆ unit_test_mark_popup_as_tested()

std::string gui2::dialogs::unit_test_mark_popup_as_tested ( const modeless_dialog dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 149 of file test_gui2.cpp.

References gui2::unit_test_registered_window_list(), and gui2::dialogs::modeless_dialog::window_id().

Referenced by unit_test_mp_server_list().

◆ unit_test_mp_server_list()

modal_dialog* gui2::dialogs::unit_test_mp_server_list ( )

◆ unit_test_window()

window* gui2::dialogs::unit_test_window ( const modeless_dialog dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 156 of file test_gui2.cpp.

References gui2::dialogs::modeless_dialog::window_.

Referenced by unit_test_mp_server_list().

Variable Documentation

◆ extra_size_per_player

int gui2::dialogs::extra_size_per_player = 2
static

Definition at line 33 of file generator_settings.cpp.

◆ LAYER_BACKGROUND

const unsigned int gui2::dialogs::LAYER_BACKGROUND = 1
static

Definition at line 53 of file story_viewer.cpp.

◆ LAYER_TEXT

const unsigned int gui2::dialogs::LAYER_TEXT = 2
static

Definition at line 54 of file story_viewer.cpp.

◆ LOAD_GAME

const int gui2::dialogs::LOAD_GAME = 100
static

Definition at line 70 of file mp_create_game.cpp.

◆ max_coastal

int gui2::dialogs::max_coastal = 5
static

Definition at line 32 of file generator_settings.cpp.

Referenced by default_map_generator::generate_map().

◆ min_size

int gui2::dialogs::min_size = 20
static

◆ show_debug_clock_button

bool gui2::dialogs::show_debug_clock_button = false

Do we wish to show the button for the debug clock.

Definition at line 132 of file title_screen.cpp.

Referenced by game_launcher::game_launcher(), gui2::dialogs::title_screen::pre_show(), and gui2::dialogs::title_screen::show_debug_clock_window().

◆ sort_default

listbox::order_pair gui2::dialogs::sort_default { 2, listbox::SORT_DESCENDING}
static

Definition at line 59 of file unit_recall.cpp.

Referenced by gui2::dialogs::unit_recall::pre_show().

◆ sort_last

listbox::order_pair gui2::dialogs::sort_last {-1, listbox::SORT_NONE}
static

◆ use_campaign

bool gui2::dialogs::use_campaign = false
static

Definition at line 42 of file statistics_dialog.cpp.