The Battle for Wesnoth  1.17.17+dev
Functions
gui2::tip_of_the_day Namespace Reference

Functions

std::vector< game_tipload (const config &cfg)
 Loads the tips from a config. More...
 
std::vector< game_tipshuffle (const std::vector< game_tip > &tips)
 Shuffles the tips. More...
 

Function Documentation

◆ load()

std::vector< game_tip > gui2::tip_of_the_day::load ( const config cfg)

Loads the tips from a config.

Parameters
cfgA config with the tips.
Returns
The loaded tips.

Definition at line 36 of file tips.cpp.

References config::child_range(), and gui2::dialogs::tip::tip.

Referenced by ai::lua_candidate_action_wrapper_external::generate_code(), lua_kernel_base::get_attribute_names(), game_launcher::load_game(), play_controller::load_game(), and gui2::dialogs::mp_create_game::load_game_callback().

◆ shuffle()

std::vector< game_tip > gui2::tip_of_the_day::shuffle ( const std::vector< game_tip > &  tips)

Shuffles the tips.

This routine shuffles the tips and filters out the unwanted ones.

Parameters
tipsThe tips.
Returns
The filtered tips in random order.

Definition at line 47 of file tips.cpp.

References preferences::encountered_units(), gui2::dialogs::tip::tip, and gui2::settings::tips.

Referenced by choose_track(), default_map_generator_job::generate_river_internal(), ai::default_recruitment::recruitment::get_best_leader_from_ratio_scores(), gui2::dialogs::title_screen::init_callbacks(), and editor::editor_action_shuffle_area::perform_without_undo().