25 #include "eng3d/texture.hpp"
26 #include "eng3d/string.hpp"
27 #include "eng3d/ui/piechart.hpp"
28 #include "eng3d/ui/label.hpp"
29 #include "eng3d/ui/image.hpp"
30 #include "eng3d/ui/tooltip.hpp"
31 #include "eng3d/ui/button.hpp"
32 #include "eng3d/ui/table.hpp"
33 #include "eng3d/ui/close_button.hpp"
47 void SelectedUnitsMenu::update_unit_list(std::vector<Unit::Id> selected_units,
UI::Table<UnitId::Type>& unit_table) {
49 for(
auto& unit_id : selected_units) {
50 auto& row = unit_table.
get_row(unit_id);
54 auto name = row.get_element(row_index++);
61 :
UI::Window(-200, -300, 200, 300),
68 std::vector<int> sizes{ 160 };
69 std::vector<std::string> header{
"Size" };
70 auto& unit_table = this->make_widget<UI::Table<UnitId::Type>>(0, 0, this->
height, 30, sizes, header);
74 this->is_render = !selected_units.empty();
75 update_unit_list(selected_units, unit_table);
const std::vector< UnitId > get_selected_units() const
auto add_listener(std::function< void(std::vector< UnitId >)> callback)
A dynamic/smart table that can sort elements by ascending/descending order.
void make_rows_unactive()
UI::TableRow & get_row(T _row_id)
void clear_unactive_rows()
Eng3D::Freelist< Unit > units
std::string string_format(const std::string_view format, Args &&... args)
String formatter.