| 822 | public: |
| 823 | enum page { MENU, NICKNAME, PROFNAME }; |
| 824 | viewscreen_unitbatchopst(vector<UnitInfo*> &base_units, |
| 825 | bool filter_selected = true, |
| 826 | bool *dirty_flag = NULL |
| 827 | ) |
| 828 | :cur_page(MENU), entry(""), selection_empty(false), dirty(dirty_flag) |
| 829 | { |
| 830 | menu_options.multiselect = false; |
| 831 | menu_options.auto_select = true; |
| 832 | menu_options.allow_search = false; |
| 833 | menu_options.left_margin = 2; |
| 834 | menu_options.bottom_margin = 2; |
| 835 | menu_options.clear(); |
| 836 | menu_options.add("Change nickname", page::NICKNAME); |
| 837 | menu_options.add("Change profession name", page::PROFNAME); |
| 838 | menu_options.filterDisplay(); |
| 839 | formatter.add_option("n", "Displayed name (or nickname)", unit_ops::get_nickname); |
| 840 | formatter.add_option("N", "Real name", unit_ops::get_real_name); |
| 841 | formatter.add_option("en", "Displayed name (or nickname), in English", unit_ops::get_nickname_eng); |
| 842 | formatter.add_option("eN", "Real name, in English", unit_ops::get_real_name_eng); |
| 843 | formatter.add_option("fn", "Displayed first name (or nickname)", unit_ops::get_first_nickname); |
| 844 | formatter.add_option("fN", "Real first name", unit_ops::get_first_name); |
| 845 | formatter.add_option("ln", "Last name", unit_ops::get_last_name); |
| 846 | formatter.add_option("eln", "Last name, in English", unit_ops::get_last_name_eng); |
| 847 | formatter.add_option("p", "Displayed profession", unit_ops::get_profname); |
| 848 | formatter.add_option("P", "Real profession (non-customized)", unit_ops::get_real_profname); |
| 849 | formatter.add_option("bp", "Base profession (excluding nobles & other positions)", unit_ops::get_base_profname); |
| 850 | formatter.add_option("sp", "Short (base) profession name (from manipulator headers)", unit_ops::get_short_profname); |
| 851 | formatter.add_option("a", "Age (in years)", unit_ops::get_age); |
| 852 | formatter.add_option("i", "Position in list", unit_ops::get_list_id); |
| 853 | formatter.add_option("pi", "Position in list, among dwarves with same profession", unit_ops::get_list_id_prof); |
| 854 | formatter.add_option("gi", "Position in list, among dwarves in same profession group", unit_ops::get_list_id_group); |
| 855 | formatter.add_option("ri", "Raw unit ID", unit_ops::get_unit_id); |
| 856 | selection_empty = true; |
| 857 | for (auto it = base_units.begin(); it != base_units.end(); ++it) |
| 858 | { |
| 859 | UnitInfo* uinfo = *it; |
| 860 | if (uinfo->selected || !filter_selected) |
| 861 | { |
| 862 | selection_empty = false; |
| 863 | units.push_back(uinfo); |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | std::string getFocusString() { return "unitlabors/batch"; } |
| 868 | void select_page (page p) |
| 869 | { |
nothing calls this directly
no test coverage detected