qmlFrontend/qml/qmlFrontend/GameConfig.qml
branchqmlfrontend
changeset 11443 5182d44fb733
parent 11440 330c14f4ba69
child 11786 0aa4b3d02cba
--- a/qmlFrontend/qml/qmlFrontend/GameConfig.qml	Thu Dec 03 23:59:06 2015 +0300
+++ b/qmlFrontend/qml/qmlFrontend/GameConfig.qml	Sat Dec 05 16:14:59 2015 +0300
@@ -213,13 +213,18 @@
                    }
                 }
 
-                Text { text: name
+                Text {
+                    text: name
                     MouseArea {
                         z: 1
                         anchors.fill: parent
                         onClicked: HWEngine.tryRemoveTeam(name)
                    }
                 }
+
+                Text {
+                    text: hedgehogsNumber
+                }
             }
 
 
@@ -231,6 +236,7 @@
                                                              "aiLevel": aiLevel
                                                              , "name": teamName
                                                              , "local": isLocal
+                                                             , "hedgehogsNumber" : 4
                                                              , "teamColor": "#000000"
                                                          })
             onPlayingTeamRemoved: {
@@ -245,6 +251,12 @@
 
                 if(i >= 0) playingTeamsModel.setProperty(i, "teamColor", colorValue)
             }
+            onHedgehogsNumberChanged: {
+                var i = playingTeamsModel.count - 1;
+                while ((i >= 0) && (playingTeamsModel.get(i).name !== teamName)) --i
+
+                if(i >= 0) playingTeamsModel.setProperty(i, "hedgehogsNumber", hedgehogsNumber)
+            }
         }
     }