playervsplayerintro.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "ui/hotseat_intro/playervsplayerintro.h"
  2. #include "gui/guiscenemanager.h"
  3. #include "playermanager.h"
  4. #include "soundengine.h"
  5. #include "gui/scene.h"
  6. #include "ui_playervsplayerintro.h"
  7. #include <QMovie>
  8. PlayerVsPlayerIntro::PlayerVsPlayerIntro(QWidget *parent) :
  9. Scene(parent),
  10. ui(new Ui::PlayerVsPlayerIntro)
  11. {
  12. ui->setupUi(this);
  13. watcher = new ButtonEventListener(this);
  14. ui->back_button->installEventFilter(watcher);
  15. ui->continue_button->installEventFilter(watcher);
  16. movie = new QMovie(":/assets/hotseat_intro/image.gif");
  17. ui->image->setMovie(movie);
  18. movie->start();
  19. }
  20. void PlayerVsPlayerIntro::init()
  21. {
  22. // GuiSceneManager::getInstance().show("main_menu_background");
  23. // raise();
  24. }
  25. PlayerVsPlayerIntro::~PlayerVsPlayerIntro()
  26. {
  27. delete ui;
  28. delete watcher;
  29. }
  30. void PlayerVsPlayerIntro::on_back_button_clicked() {
  31. GuiSceneManager::getInstance().changeScene("main_menu");
  32. }
  33. void PlayerVsPlayerIntro::on_continue_button_clicked() {
  34. PlayerManager::getInstance().setPlayersNum(2);
  35. /// TODO - Check if money input correct
  36. GuiSceneManager::getInstance().changeScene("recruit_army", "0|" + ui->money->text());
  37. }