The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::campaign_selection Class Reference

#include <campaign_selection.hpp>

Inheritance diagram for gui2::dialogs::campaign_selection:
Inheritance graph

Public Member Functions

 campaign_selection (ng::create_engine &eng)
 
int get_choice () const
 
bool get_deterministic () const
 
- Public Member Functions inherited from gui2::dialogs::modal_dialog
 modal_dialog ()
 
virtual ~modal_dialog ()
 
bool show (const unsigned auto_close_time=0)
 Shows the window. More...
 
windowget_window () const
 Returns a pointer to the dialog's window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_restore (const bool restore)
 
void set_allow_plugin_skip (const bool allow_plugin_skip)
 
void set_show_even_without_video (const bool show_even_without_video)
 

Private Types

enum  CAMPAIGN_ORDER { RANK, DATE, NAME }
 

Private Member Functions

void campaign_selected (window &window)
 Called when another campaign is selected. More...
 
virtual const std::string & window_id () const override
 Inherited from modal_dialog, implemented by REGISTER_DIALOG. More...
 
virtual void pre_show (window &window) override
 Inherited from modal_dialog. More...
 
virtual void post_show (window &window) override
 Inherited from modal_dialog. More...
 
void sort_campaigns (window &window, CAMPAIGN_ORDER order, bool ascending)
 
void add_campaign_to_tree (window &window, const config &campaign)
 
void toggle_sorting_selection (window &window, CAMPAIGN_ORDER order)
 
void mod_toggled (window &window)
 
void filter_text_changed (text_box_base *textbox, const std::string &text)
 

Private Attributes

ng::create_engineengine_
 
int choice_
 The chosen campaign. More...
 
bool deterministic_
 whether the player checked the "Deterministic" checkbox. More...
 
boost::dynamic_bitset mod_states_
 
std::vector< std::string > page_ids_
 
CAMPAIGN_ORDER current_sorting_
 
bool currently_sorted_asc_
 
std::vector< std::string > last_search_words_
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::dialogs::modal_dialog
field_boolregister_bool (const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr)
 Creates a new integer field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false)
 Creates a new text field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
field_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new styled_widget as a label. More...
 
field_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new styled_widget as image. More...
 
- Protected Attributes inherited from gui2::dialogs::modal_dialog
std::unique_ptr< windowwindow_
 The window object build for this dialog. More...
 

Detailed Description

Definition at line 29 of file campaign_selection.hpp.

Member Enumeration Documentation

◆ CAMPAIGN_ORDER

Enumerator
RANK 
DATE 
NAME 

Definition at line 31 of file campaign_selection.hpp.

Constructor & Destructor Documentation

◆ campaign_selection()

gui2::dialogs::campaign_selection::campaign_selection ( ng::create_engine eng)
inlineexplicit

Definition at line 33 of file campaign_selection.hpp.

References gui2::dialogs::modal_dialog::set_restore().

Member Function Documentation

◆ add_campaign_to_tree()

void gui2::dialogs::campaign_selection::add_campaign_to_tree ( window window,
const config campaign 
)
private

◆ campaign_selected()

void gui2::dialogs::campaign_selection::campaign_selected ( window window)
private

◆ filter_text_changed()

void gui2::dialogs::campaign_selection::filter_text_changed ( text_box_base textbox,
const std::string &  text 
)
private

◆ get_choice()

int gui2::dialogs::campaign_selection::get_choice ( ) const
inline

Definition at line 47 of file campaign_selection.hpp.

References choice_.

◆ get_deterministic()

bool gui2::dialogs::campaign_selection::get_deterministic ( ) const
inline

◆ mod_toggled()

void gui2::dialogs::campaign_selection::mod_toggled ( window window)
private

Definition at line 398 of file campaign_selection.cpp.

References engine_, i, mod_states_, and ng::create_engine::toggle_mod().

Referenced by get_deterministic(), and pre_show().

◆ post_show()

void gui2::dialogs::campaign_selection::post_show ( window window)
overrideprivatevirtual

◆ pre_show()

void gui2::dialogs::campaign_selection::pre_show ( window window)
overrideprivatevirtual

◆ sort_campaigns()

void gui2::dialogs::campaign_selection::sort_campaigns ( window window,
campaign_selection::CAMPAIGN_ORDER  order,
bool  ascending 
)
private

◆ toggle_sorting_selection()

void gui2::dialogs::campaign_selection::toggle_sorting_selection ( window window,
CAMPAIGN_ORDER  order 
)
private

Definition at line 200 of file campaign_selection.cpp.

References current_sorting_, currently_sorted_asc_, DATE, NAME, RANK, and sort_campaigns().

Referenced by get_deterministic(), and pre_show().

◆ window_id()

virtual const std::string& gui2::dialogs::campaign_selection::window_id ( ) const
overrideprivatevirtual

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Referenced by get_deterministic().

Member Data Documentation

◆ choice_

int gui2::dialogs::campaign_selection::choice_
private

The chosen campaign.

Definition at line 83 of file campaign_selection.hpp.

Referenced by get_choice(), and post_show().

◆ current_sorting_

CAMPAIGN_ORDER gui2::dialogs::campaign_selection::current_sorting_
private

Definition at line 92 of file campaign_selection.hpp.

Referenced by filter_text_changed(), and toggle_sorting_selection().

◆ currently_sorted_asc_

bool gui2::dialogs::campaign_selection::currently_sorted_asc_
private

Definition at line 94 of file campaign_selection.hpp.

Referenced by filter_text_changed(), and toggle_sorting_selection().

◆ deterministic_

bool gui2::dialogs::campaign_selection::deterministic_
private

whether the player checked the "Deterministic" checkbox.

Definition at line 86 of file campaign_selection.hpp.

Referenced by get_deterministic(), and post_show().

◆ engine_

ng::create_engine& gui2::dialogs::campaign_selection::engine_
private

Definition at line 80 of file campaign_selection.hpp.

Referenced by mod_toggled(), post_show(), pre_show(), and sort_campaigns().

◆ last_search_words_

std::vector<std::string> gui2::dialogs::campaign_selection::last_search_words_
private

Definition at line 96 of file campaign_selection.hpp.

Referenced by filter_text_changed(), and sort_campaigns().

◆ mod_states_

boost::dynamic_bitset gui2::dialogs::campaign_selection::mod_states_
private

Definition at line 88 of file campaign_selection.hpp.

Referenced by mod_toggled(), and pre_show().

◆ page_ids_

std::vector<std::string> gui2::dialogs::campaign_selection::page_ids_
private

Definition at line 90 of file campaign_selection.hpp.

Referenced by post_show(), and pre_show().


The documentation for this class was generated from the following files: