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

Namespaces

 tip
 

Classes

class  achievements_dialog
 
class  addon_auth
 
class  addon_connect
 
class  install_dependencies
 
class  addon_license_prompt
 
class  addon_manager
 
class  addon_uninstall_list
 
class  attack_predictions
 
class  campaign_difficulty
 
class  campaign_selection
 
class  chat_log
 
class  core_selection
 
class  debug_clock
 
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_choose_addon
 
class  custom_tod
 
class  editor_edit_label
 
class  editor_edit_pbl
 
class  editor_edit_pbl_translation
 
class  editor_edit_scenario
 
class  editor_edit_side
 
class  editor_edit_unit
 Dialog that allows user to create custom unit types. More...
 
class  editor_generate_map
 
class  generator_settings
 
class  editor_new_map
 
class  editor_resize_map
 
class  tod_new_schedule
 Dialog that takes new schedule ID and name from the player. More...
 
class  end_credits
 
class  file_dialog
 
class  file_progress
 
class  folder_create
 
class  bookmark_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_version
 
class  stuff_list_adder
 
class  single_mode_controller
 
class  variable_mode_controller
 
class  event_mode_controller
 
class  unit_mode_controller
 
class  team_mode_controller
 
class  gamestate_inspector
 
class  gui_test_dialog
 A test dialog for testing various gui2 features. More...
 
class  help_browser
 Help browser dialog. More...
 
class  hotkey_bind
 
class  label_settings
 
class  language_selection
 
class  loading_screen
 
class  log_settings
 
class  lua_interpreter
 
struct  message_implementation
 Helper to implement private functions without modifying the header. More...
 
class  message
 Main class to show messages to the user. More...
 
class  migrate_version_selection
 This shows the dialog to select a previous version of Wesnoth to migrate preferences from and redownload add-ons. 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  faction_select
 
struct  lobby_delay_gamelist_update_guard
 
class  mp_lobby
 
class  mp_match_history
 
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_login
 
class  mp_method_selection
 
class  mp_options_helper
 
class  mp_report
 
class  mp_staging
 
class  lobby_player_info
 
class  plugin_executor
 
class  synched_choice_wait
 
class  network_transmission
 Dialog that tracks network transmissions. More...
 
class  outro
 Dialog to display 'The End' at the end of a campaign. More...
 
class  preferences_dialog
 
class  prompt
 
class  screenshot_notification
 
class  select_orb_colors
 
class  server_info
 
class  simple_item_selector
 
class  sp_options_configure
 
struct  hitrate_table_element
 
class  statistics_dialog
 
class  story_viewer
 Dialog to view the storyscreen. More...
 
class  surrender_quit
 This shows the dialog to confirm surrender and/or quitting the game. More...
 
class  terrain_layers
 
class  theme_list
 
class  title_screen
 This class implements the title screen. More...
 
class  tooltip
 At the moment two kinds of tips are known: More...
 
class  transient_message
 Shows a transient message. More...
 
class  unit_advance
 
class  unit_attack
 
class  unit_create
 
class  unit_list
 
class  unit_recall
 
class  unit_recruit
 
class  wml_error
 
class  wml_message_option
 Helper class for message options. More...
 
class  wml_message_base
 Base class for the wml generated messages. More...
 
class  wml_message_left
 Shows a dialog with the portrait on the left side. More...
 
class  wml_message_right
 Shows a dialog with the portrait on the right side. More...
 
class  wml_message_double
 Shows a dialog with two portraits, one on each side. More...
 
struct  wml_message_options
 Parameter pack for message list input options. More...
 
struct  wml_message_input
 Parameter pack for message text input options. More...
 
struct  wml_message_portrait
 Parameter pack for message portrait. More...
 

Typedefs

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

Functions

static std::string describe_status_verbose (const addon_tracking_info &state)
 
static std::string format_addon_time (std::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)
 
 REGISTER_DIALOG (editor_edit_unit)
 
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...
 
 REGISTER_DIALOG (tod_new_schedule)
 
static bool get_dont_ask_again ()
 Helper to invert .ask_delete_saves. More...
 
static void set_dont_ask_again (const bool ask_again)
 Helper to invert .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 void revert_to_default_pref_values (window &window)
 
static bool get_do_not_show_again ()
 Helper for .ask_delete_saves. More...
 
static void set_do_not_show_again (const bool do_not_show_again)
 Helper for .set_ask_delete_saves. More...
 
static std::string generate_user_description (const config &side)
 
static bool sound_on ()
 
static bool set_sound (bool v)
 
static int sound_volume ()
 
static void set_sound_volume (int v)
 
static bool music_on ()
 
static bool set_music (bool v)
 
static int music_volume ()
 
static void set_music_volume (int v)
 
static bool turn_bell ()
 
static bool set_turn_bell (bool v)
 
static int bell_volume ()
 
static void set_bell_volume (int v)
 
static bool ui_sound_on ()
 
static bool set_ui_sound (bool v)
 
static int ui_volume ()
 
static void set_ui_volume (int v)
 
static std::ostream & write_actual_and_expected (std::ostream &str, const long long actual, const double expected)
 
static hitrate_table_element tally (const statistics_t::stats::hitrate_map &by_cth, const bool more_is_better)
 
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 void make_screenshot ()
 
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 const std::string maybe_inactive (const std::string &str, bool active)
 
static std::string format_level_string (const int level, bool recallable)
 
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 gray_if_unrecruitable (const std::string &text, const bool is_recruitable)
 
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 get_modal_dialog_id (const modal_dialog &dialog)
 
std::string get_modeless_dialog_id (const modeless_dialog &dialog)
 

Variables

const std::array type_values
 
const std::array tag_values
 
static int max_coastal = 5
 
static int extra_size_per_player = 2
 
static int min_size = 20
 
static const int LOAD_GAME = 100
 
static const std::string forum_registration_url = "https://forums.wesnoth.org/ucp.php?mode=register"
 
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, sort_order::type::none}
 
static listbox::order_pair sort_default { 2, sort_order::type::descending}
 
static const color_t inactive_row_color (0x96, 0x96, 0x96)
 
static const color_t inactive_row_color (0x96, 0x96, 0x96)
 

Typedef Documentation

◆ btn_callback

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

Definition at line 89 of file title_screen.cpp.

◆ hp_probability_vector

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

Definition at line 33 of file attack_predictions.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

◆ bell_volume()

static int gui2::dialogs::bell_volume ( )
static

◆ controller_name()

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

Definition at line 61 of file game_stats.cpp.

References _(), names, and t.

Referenced by gui2::dialogs::game_stats::pre_show(), and ng::side_engine::set_controller_commandline().

◆ 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 68 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 ( std::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 112 of file unit_recall.cpp.

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

◆ format_if_leader()

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

Definition at line 64 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,
bool  recallable 
)
static

◆ format_movement_string()

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

Definition at line 69 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 38 of file campaign_difficulty.cpp.

References config::append_children(), deprecated_message(), config::empty(), and REMOVED.

Referenced by gui2::dialogs::campaign_selection::campaign_selected(), and mp::game_info::game_info().

◆ generate_user_description()

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

Definition at line 209 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 .ask_delete_saves.

The value stored and the way shown is inverted.

Definition at line 30 of file game_delete.cpp.

References prefs::ask_delete_saves(), and prefs::get().

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

◆ get_modal_dialog_id()

std::string gui2::dialogs::get_modal_dialog_id ( 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 179 of file test_gui2.cpp.

◆ get_modeless_dialog_id()

std::string gui2::dialogs::get_modeless_dialog_id ( 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 184 of file test_gui2.cpp.

◆ 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 41 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

◆ gray_if_unrecruitable()

static std::string gui2::dialogs::gray_if_unrecruitable ( const std::string &  text,
const bool  is_recruitable 
)
inlinestatic

Definition at line 57 of file unit_recruit.cpp.

References inactive_row_color, and font::span_color().

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

◆ launch_lua_console()

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

◆ make_screenshot()

static void gui2::dialogs::make_screenshot ( )
static

◆ maybe_inactive()

static const std::string gui2::dialogs::maybe_inactive ( const std::string &  str,
bool  active 
)
inlinestatic

Definition at line 82 of file unit_recall.cpp.

References inactive_row_color, and font::span_color().

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

◆ music_on()

static bool gui2::dialogs::music_on ( )
static

◆ music_volume()

static int gui2::dialogs::music_volume ( )
static

◆ register_button()

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

◆ REGISTER_DIALOG() [1/2]

gui2::dialogs::REGISTER_DIALOG ( editor_edit_unit  )

◆ REGISTER_DIALOG() [2/2]

gui2::dialogs::REGISTER_DIALOG ( tod_new_schedule  )

◆ 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 78 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_bell_volume()

static void gui2::dialogs::set_bell_volume ( int  v)
static

Definition at line 390 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_bell_volume().

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

The value stored and the way shown is inverted.

Definition at line 40 of file game_delete.cpp.

References prefs::get(), and prefs::set_ask_delete_saves().

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

◆ set_music()

static bool gui2::dialogs::set_music ( bool  v)
static

Definition at line 382 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_music().

◆ set_music_volume()

static void gui2::dialogs::set_music_volume ( int  v)
static

Definition at line 384 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_music_volume().

◆ set_sound()

static bool gui2::dialogs::set_sound ( bool  v)
static

Definition at line 376 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_sound().

◆ set_sound_volume()

static void gui2::dialogs::set_sound_volume ( int  v)
static

Definition at line 378 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_sound_volume().

◆ set_turn_bell()

static bool gui2::dialogs::set_turn_bell ( bool  v)
static

Definition at line 388 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_turn_bell().

◆ set_ui_sound()

static bool gui2::dialogs::set_ui_sound ( bool  v)
static

Definition at line 394 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_ui_sound().

◆ set_ui_volume()

static void gui2::dialogs::set_ui_volume ( int  v)
static

Definition at line 396 of file preferences_dialog.cpp.

References prefs::get(), and prefs::set_ui_volume().

◆ 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 154 of file wml_message.cpp.

Referenced by lua_gui2::show_message_dialog().

◆ sound_on()

static bool gui2::dialogs::sound_on ( )
static

◆ sound_volume()

static int gui2::dialogs::sound_volume ( )
static

◆ tally()

static hitrate_table_element gui2::dialogs::tally ( const statistics_t::stats::hitrate_map by_cth,
const bool  more_is_better 
)
static

◆ tod_getter_image()

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

Definition at line 41 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 47 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 53 of file custom_tod.cpp.

References time_of_day::sounds.

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

◆ turn_bell()

static bool gui2::dialogs::turn_bell ( )
static

Definition at line 387 of file preferences_dialog.cpp.

References prefs::get(), and prefs::turn_bell().

◆ ui_sound_on()

static bool gui2::dialogs::ui_sound_on ( )
static

◆ ui_volume()

static int gui2::dialogs::ui_volume ( )
static

◆ write_actual_and_expected()

static std::ostream& gui2::dialogs::write_actual_and_expected ( std::ostream &  str,
const long long  actual,
const double  expected 
)
static

Variable Documentation

◆ extra_size_per_player

int gui2::dialogs::extra_size_per_player = 2
static

◆ forum_registration_url

const std::string gui2::dialogs::forum_registration_url = "https://forums.wesnoth.org/ucp.php?mode=register"
static

◆ inactive_row_color [1/2]

const color_t gui2::dialogs::inactive_row_color(0x96, 0x96, 0x96) ( 0x96  ,
0x96  ,
0x96   
)
static

◆ inactive_row_color [2/2]

const color_t gui2::dialogs::inactive_row_color(0x96, 0x96, 0x96) ( 0x96  ,
0x96  ,
0x96   
)
static

◆ LAYER_BACKGROUND

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

Definition at line 54 of file story_viewer.cpp.

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

◆ LAYER_TEXT

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

Definition at line 55 of file story_viewer.cpp.

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

◆ LOAD_GAME

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

◆ max_coastal

int gui2::dialogs::max_coastal = 5
static

◆ 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 74 of file title_screen.cpp.

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

◆ sort_default

listbox::order_pair gui2::dialogs::sort_default { 2, sort_order::type::descending}
static

Definition at line 53 of file unit_recall.cpp.

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

◆ sort_last

listbox::order_pair gui2::dialogs::sort_last {-1, sort_order::type::none}
static

◆ tag_values

const std::array gui2::dialogs::tag_values
Initial value:
= {
"cooperative",
"cosmetic",
"difficulty",
"rng",
"survival",
"terraforming",
}

Definition at line 62 of file edit_pbl.cpp.

Referenced by gui2::dialogs::editor_edit_pbl::create_cfg(), and gui2::dialogs::editor_edit_pbl::pre_show().

◆ type_values

const std::array gui2::dialogs::type_values
Initial value:
= {
"",
"core",
"campaign",
"campaign_sp_mp",
"campaign_mp",
"scenario",
"scenario_mp",
"faction",
"era",
"map_pack",
"mod_mp",
"media",
"other",
}

Definition at line 46 of file edit_pbl.cpp.

Referenced by gui2::dialogs::editor_edit_pbl::create_cfg(), and gui2::dialogs::editor_edit_pbl::pre_show().