#include <statistics_dialog.hpp>
Public Member Functions | |
statistics_dialog (game_display &disp, const std::string &title, const unsigned int team, const std::string &team_id, const std::string &player) | |
~statistics_dialog () | |
Public Member Functions inherited from gui::dialog | |
dialog (CVideo &video, const std::string &title="", const std::string &message="", const DIALOG_TYPE type=MESSAGE, const style &dialog_style=default_style) | |
virtual | ~dialog () |
void | set_image (dialog_image *const img) |
void | set_image (surface surf, const std::string &caption="") |
void | set_menu (menu *const m) |
void | set_menu (const std::vector< std::string > &menu_items, menu::sorter *sorter=nullptr) |
void | set_menu_items (const std::vector< std::string > &menu_items, bool keep_selection=false) |
Changes (or sets, if not previously set) the dialog's menu items to the provided list. More... | |
void | add_pane (preview_pane *const pp) |
void | set_panes (std::vector< preview_pane * > panes) |
void | set_textbox (dialog_textbox *const box) |
void | set_textbox (const std::string &text_widget_label="", const std::string &text_widget_text="", const int text_widget_max_chars=256, const unsigned int text_box_width=font::relative_size(350)) |
void | add_button (dialog_button *const btn, BUTTON_LOCATION loc) |
void | add_button (dialog_button_info btn_info, BUTTON_LOCATION loc=BUTTON_EXTRA) |
void | add_option (const std::string &label, bool checked=false, BUTTON_LOCATION loc=BUTTON_CHECKBOX, const std::string &help_string="") |
virtual dimension_measurements | layout (int xloc=-1, int yloc=-1) |
void | set_layout (dimension_measurements &new_dim) |
dimension_measurements | get_layout () const |
dialog_frame & | get_frame () |
void | set_basic_behavior (DIALOG_TYPE type) |
int | show (int xloc, int yloc) |
int | show () |
int | result () const |
menu & | get_menu () |
bool | done () const |
std::string | textbox_text () const |
dialog_textbox & | get_textbox () const |
bool | option_checked (unsigned int option_index=0) |
CVideo & | get_video () |
Protected Member Functions | |
void | action (gui::dialog_process_info &dp_info) |
Protected Member Functions inherited from gui::dialog | |
void | set_result (const int result) |
void | refresh () |
label & | get_message () const |
Private Member Functions | |
const statistics::stats & | current_stats () |
Picks out the stats structure that was selected for displaying. More... | |
void | display_stats (bool campaign) |
Fills in the text to be displayed in the dialog. More... | |
void | do_scene_selection () |
Implements the scenario selection popup. More... | |
Private Attributes | |
gui::dialog_button * | detail_btn_ |
gui::dialog_button * | toggle_btn_ |
gui::dialog_button * | scene_btn_ |
std::string | player_name_ |
const statistics::stats | campaign_ |
const statistics::levels | scenarios_ |
size_t | scenario_index_ |
unsigned int | team_num_ |
std::vector< int > | unit_count_ |
Static Private Attributes | |
static bool | use_campaign_ = false |
Additional Inherited Members | |
Public Types inherited from gui::dialog | |
enum | BUTTON_LOCATION { BUTTON_STANDARD, BUTTON_EXTRA, BUTTON_EXTRA_LEFT, BUTTON_CHECKBOX, BUTTON_CHECKBOX_LEFT, BUTTON_HELP, BUTTON_TOP } |
typedef dialog_frame::style | style |
Static Public Member Functions inherited from gui::dialog | |
static void | delete_empty_menu () |
Explicit freeing of class static resources. More... | |
Static Public Attributes inherited from gui::dialog | |
static const style & | default_style = dialog_frame::default_style |
static const style & | message_style = dialog_frame::message_style |
static const style | hotkeys_style |
static const int | message_font_size = font::SIZE_PLUS |
static const int | caption_font_size = font::SIZE_LARGE |
static const int | max_menu_width = -1 |
static const size_t | left_padding = font::relative_size(10) |
static const size_t | right_padding = font::relative_size(10) |
static const size_t | image_h_pad = font::relative_size( 10) |
static const size_t | top_padding = font::relative_size(10) |
static const size_t | bottom_padding = font::relative_size(10) |
Definition at line 27 of file statistics_dialog.hpp.
statistics_dialog::statistics_dialog | ( | game_display & | disp, |
const std::string & | title, | ||
const unsigned int | team, | ||
const std::string & | team_id, | ||
const std::string & | player | ||
) |
Definition at line 161 of file statistics_dialog.cpp.
References _(), gui::dialog::add_button(), gui::dialog::BUTTON_EXTRA, gui::dialog::BUTTON_EXTRA_LEFT, gui::dialog::BUTTON_STANDARD, detail_btn_, display_stats(), gui::dialog::layout(), scenarios_, scene_btn_, toggle_btn_, use_campaign_, and display::video().
statistics_dialog::~statistics_dialog | ( | ) |
Definition at line 198 of file statistics_dialog.cpp.
|
protectedvirtual |
Reimplemented from gui::dialog.
Definition at line 98 of file statistics_dialog.cpp.
References _(), BUTTON_SCENE, BUTTON_TOGGLE, gui::dialog_process_info::clear_buttons(), gui::CLOSE_DIALOG, gui::CLOSE_ONLY, gui::CONTINUE_DIALOG, current_stats(), d, detail_btn_, display_stats(), do_scene_selection(), gui::dialog_process_info::double_clicked, gui::button::enable(), gui::dialog::get_menu(), gui::dialog::get_video(), gui::dialog_process_info::key_down, gui::dialog_process_info::new_key_down, player_name_, gui::dialog::result(), gui::menu::selection(), gui::dialog::set_menu(), gui::dialog::set_result(), gui::dialog::show(), team_num_, unit_count_, and use_campaign_.
|
inlineprivate |
Picks out the stats structure that was selected for displaying.
Definition at line 92 of file statistics_dialog.cpp.
References campaign_, scenario_index_, scenarios_, and use_campaign_.
Referenced by action(), and display_stats().
|
private |
Fills in the text to be displayed in the dialog.
This also updates the scenario/campaign toggle button.
[in] | campaign | Indicates whether or not the campaign stats are to be displayed. |
Definition at line 210 of file statistics_dialog.cpp.
References _(), statistics::stats::advanced_to, font::BOLD_TEXT, COLUMN_SEPARATOR, current_stats(), statistics::stats::damage_inflicted, statistics::stats::damage_taken, statistics::stats::deaths, gui::button::enable(), statistics::stats::expected_damage_inflicted, statistics::stats::expected_damage_taken, HEADING_PREFIX, IMAGE_PREFIX, mp_ui_alerts::items, statistics::stats::killed, statistics::stats::recall_cost, statistics::stats::recalls, statistics::stats::recruit_cost, statistics::stats::recruits, scenario_index_, scenarios_, scene_btn_, gui::button::set_label(), gui::dialog::set_menu_items(), statistics::sum_cost_str_int_map(), statistics::sum_str_int_map(), toggle_btn_, statistics::stats::turn_damage_inflicted, statistics::stats::turn_damage_taken, statistics::stats::turn_expected_damage_inflicted, statistics::stats::turn_expected_damage_taken, unit_count_, and use_campaign_.
Referenced by action(), do_scene_selection(), and statistics_dialog().
|
private |
Implements the scenario selection popup.
Definition at line 311 of file statistics_dialog.cpp.
References display_stats(), gui::dialog::get_video(), i, gui::widget::location(), gui::MESSAGE, scenario_index_, scenarios_, scene_btn_, gui::button::set_label(), and gui::show_dialog().
Referenced by action().
|
private |
Definition at line 50 of file statistics_dialog.hpp.
Referenced by current_stats().
|
private |
Definition at line 46 of file statistics_dialog.hpp.
Referenced by action(), and statistics_dialog().
|
private |
Definition at line 49 of file statistics_dialog.hpp.
Referenced by action().
|
private |
Definition at line 52 of file statistics_dialog.hpp.
Referenced by current_stats(), display_stats(), and do_scene_selection().
|
private |
Definition at line 51 of file statistics_dialog.hpp.
Referenced by current_stats(), display_stats(), do_scene_selection(), and statistics_dialog().
|
private |
Definition at line 48 of file statistics_dialog.hpp.
Referenced by display_stats(), do_scene_selection(), and statistics_dialog().
|
private |
Definition at line 53 of file statistics_dialog.hpp.
Referenced by action().
|
private |
Definition at line 47 of file statistics_dialog.hpp.
Referenced by display_stats(), and statistics_dialog().
|
private |
Definition at line 54 of file statistics_dialog.hpp.
Referenced by action(), and display_stats().
|
staticprivate |
Definition at line 57 of file statistics_dialog.hpp.
Referenced by action(), current_stats(), display_stats(), and statistics_dialog().