recruitmentscene.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <gui/recruitmentscene.h>
  2. #include <gui/uniticon.h>
  3. #include <ui_recruitmentscene.h>
  4. #include <QHBoxLayout>
  5. RecruitmentScene::RecruitmentScene(QWidget *parent)
  6. : QWidget(parent)
  7. , ui(new Ui::RecruitmentScene)
  8. {
  9. ui->setupUi(this);
  10. for (int i = 0; i < 5; i++) {
  11. available_units_icons_[i] = new UnitIcon(ui->available_units_list_);
  12. ui->available_units_layout_->addWidget(available_units_icons_[i], 0, i);
  13. available_units_icons_[i]->setUnitIcon("norace", "nounit");
  14. }
  15. for (int i = 0; i < 10; i++) {
  16. chosen_units_icons_[i] = new UnitIcon(ui->chosen_units_grid_);
  17. chosen_units_icons_[i]->setUnitIcon("warcraft", "rogue");
  18. ui->chosen_units_layout_->addWidget(chosen_units_icons_[i], i / 5, i % 5);
  19. }
  20. ui->parent_spec_unit_->resize(45, 45);
  21. ui->parent_spec_unit_->setUnitIcon("warcraft", "chaosorc");
  22. ui->current_spec_unit_->resize(45, 45);
  23. ui->current_spec_unit_->setUnitIcon("warcraft", "chaosorc");
  24. ui->next_spec_unit_1_->resize(45, 45);
  25. ui->next_spec_unit_2_->resize(45, 45);
  26. ui->next_spec_unit_3_->resize(45, 45);
  27. ui->next_spec_unit_4_->resize(45, 45);
  28. ui->next_spec_unit_1_->setUnitIcon("warcraft", "chaosorc");
  29. ui->next_spec_unit_2_->setUnitIcon("warcraft", "chaosorc");
  30. ui->next_spec_unit_3_->setUnitIcon("warcraft", "chaosorc");
  31. ui->next_spec_unit_4_->setUnitIcon("warcraft", "chaosorc");
  32. available_units_icons_[0]->setUnitIcon("warcraft", "blademaster");
  33. available_units_icons_[1]->setUnitIcon("warcraft", "chaosorc");
  34. available_units_icons_[2]->setUnitIcon("warcraft", "nagasummoner");
  35. available_units_icons_[3]->setUnitIcon("warcraft", "rogue");
  36. available_units_icons_[4]->setUnitIcon("norace", "nounit");
  37. }
  38. RecruitmentScene::~RecruitmentScene()
  39. {
  40. delete ui;
  41. }