/* Copyright (C) 2016 - 2017 by the Battle for Wesnoth Project http://www.wesnoth.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See the COPYING file for more details. */ #define GETTEXT_DOMAIN "wesnoth-lib" #include "gui/dialogs/statistics_dialog.hpp" #include "font/constants.hpp" #include "formatter.hpp" #include "gettext.hpp" #include "gui/auxiliary/find_widget.hpp" #include "gui/dialogs/helper.hpp" #include "gui/widgets/label.hpp" #ifdef GUI2_EXPERIMENTAL_LISTBOX #include "gui/widgets/list.hpp" #else #include "gui/widgets/listbox.hpp" #endif #include "gui/widgets/menu_button.hpp" #include "gui/widgets/settings.hpp" #include "gui/widgets/window.hpp" #include "team.hpp" #include "units/types.hpp" #include "utils/functional.hpp" #include namespace gui2 { namespace dialogs { static bool use_campaign = false; REGISTER_DIALOG(statistics_dialog) statistics_dialog::statistics_dialog(const team& current_team) : current_team_(current_team) , campaign_(statistics::calculate_stats(current_team.save_id())) , scenarios_(statistics::level_stats(current_team.save_id())) , scenario_index_(scenarios_.size() - 1) , main_stat_table_() { set_restore(true); } void statistics_dialog::pre_show(window& window) { // // Set title // label& title = find_widget