Ver Fonte

Minor icon and scenes fixes & improvements

Ivan Arkhipov há 6 anos atrás
pai
commit
4e5b1dd0fc

+ 1 - 1
assets/units/human/atraty-rider/nextgrades.txt

@@ -1 +1 @@
-warlord
+human-warlord

+ 1 - 1
assets/units/human/human-demolisher/nextgrades.txt

@@ -1 +1 @@
-warlord
+human-warlord

+ 2 - 0
include/gui/recruitmentscene.h

@@ -65,6 +65,8 @@ private:
 private slots:
     void on_back_button_clicked();
 
+    void on_apply_clicked();
+
 private:
     int available_money_;
     int current_money_;

+ 1 - 1
include/player.h

@@ -31,7 +31,7 @@ public:
     }
 
     void init(int id) {
-        player_name_ = "Игрок " + QString::number(id);
+        player_name_ = "Игрок " + QString::number(id + 1);
         race_ = RaceManager::getInstance().getRace(
                     RaceManager::getInstance().getAvailableRacesList()[0]
                 );

+ 1 - 1
source/gui/guiscenemanager.cpp

@@ -33,7 +33,7 @@ bool GuiSceneManager::registerScene(QString scene_name, Scene* name) {
 }
 
 bool GuiSceneManager::changeScene(QString scene_name, QString args) {
-    if (scene_name == current_scene_ || scene_name == "main_window") {
+    if (scene_name == "main_window") {
         return false;
     }
 

+ 1 - 1
source/gui/playervsplayerintro.cpp

@@ -26,5 +26,5 @@ void PlayerVsPlayerIntro::on_go_next_clicked()
 {
     PlayerManager::getInstance().setPlayersNum(2);
     /// TODO - Check if money input correct
-    GuiSceneManager::getInstance().changeScene("recruit_army", "1|" + ui->money_->text());
+    GuiSceneManager::getInstance().changeScene("recruit_army", "0|" + ui->money_->text());
 }

+ 1 - 1
source/gui/raceicon.cpp

@@ -107,7 +107,7 @@ void RaceIcon::mousePressEvent(QMouseEvent* event)
     activate();
 
     QTime current_time = QTime::currentTime();
-    if (current_time.msecsSinceStartOfDay() - previous_click_time_.msecsSinceStartOfDay() < 200) {
+    if (current_time.msecsSinceStartOfDay() - previous_click_time_.msecsSinceStartOfDay() < 350) {
         deactivate();
         emit doubleclicked(this);
     } else {

+ 9 - 0
source/gui/recruitmentscene.cpp

@@ -416,3 +416,12 @@ void RecruitmentScene::onGradeUnitIconDoubleClicked(UnitIcon* icon) {
     setMoney(current_money_);
 }
 
+
+void RecruitmentScene::on_apply_clicked()
+{
+    qDebug() << "Exiting recruit army scene with player_id =" << current_player_id_;
+    if (current_player_id_ == 0) {
+        qDebug() << "Changing to 1";
+        GuiSceneManager::getInstance().changeScene("recruit_army", "1|" + QString::number(available_money_));
+    }
+}

+ 1 - 1
source/gui/uniticon.cpp

@@ -110,7 +110,7 @@ void UnitIcon::mousePressEvent(QMouseEvent*)
     activate();
 
     QTime current_time = QTime::currentTime();
-    if (current_time.msecsSinceStartOfDay() - previous_click_time_.msecsSinceStartOfDay() < 300) {
+    if (current_time.msecsSinceStartOfDay() - previous_click_time_.msecsSinceStartOfDay() < 350) {
         deactivate();
         emit doubleclicked(this);
     } else {