diff options
| author | manuel <manuel@mausz.at> | 2011-04-14 20:58:59 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-14 20:58:59 +0200 |
| commit | 0ef2d7931ba97db3105e6099cfc277f28ee2f6c6 (patch) | |
| tree | ab92c06804f4944438577590b6b52818ae9c2d39 | |
| parent | dfc5a1e3cce2c0fc7fc9069e3536d5ae17e03055 (diff) | |
| download | foop-0ef2d7931ba97db3105e6099cfc277f28ee2f6c6.tar.gz foop-0ef2d7931ba97db3105e6099cfc277f28ee2f6c6.tar.bz2 foop-0ef2d7931ba97db3105e6099cfc277f28ee2f6c6.zip | |
instead of displaying the score of all possible players only display scores up to maxplayers
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 1fc7687..daa5806 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -59,13 +59,15 @@ void MainWidget::createGui() | |||
| 59 | QVBoxLayout *layout = new QVBoxLayout(this); | 59 | QVBoxLayout *layout = new QVBoxLayout(this); |
| 60 | layout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); | 60 | layout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); |
| 61 | QHBoxLayout *scoreLayout = new QHBoxLayout(); | 61 | QHBoxLayout *scoreLayout = new QHBoxLayout(); |
| 62 | for (unsigned int i = 0; Color::order[i] != Color::none; ++i) | 62 | for (unsigned int i = 0; i < m_maxplayers; ++i) |
| 63 | { | 63 | { |
| 64 | QGridLayout *playerLayout = new QGridLayout(); | 64 | QGridLayout *playerLayout = new QGridLayout(); |
| 65 | playerLayout->addWidget(new QLabel("Current:", this), 0, 0); | 65 | playerLayout->addWidget(new QLabel("Current:", this), 0, 0); |
| 66 | playerLayout->addWidget(new QLabel("Total:", this), 1, 0); | 66 | playerLayout->addWidget(new QLabel("Total:", this), 1, 0); |
| 67 | playerLayout->addWidget(new QLabel("0", this), 0, 1); | 67 | playerLayout->addWidget(new QLabel("0", this), 0, 1, Qt::AlignLeft); |
| 68 | playerLayout->addWidget(new QLabel("0", this), 1, 1); | 68 | playerLayout->addWidget(new QLabel("0", this), 1, 1, Qt::AlignLeft); |
| 69 | playerLayout->setColumnStretch(1, 10); | ||
| 70 | playerLayout->setSizeConstraint(QLayout::SetMinimumSize); | ||
| 69 | 71 | ||
| 70 | QGroupBox *scoreBox = new QGroupBox(QString("Player %1").arg(i + 1), this); | 72 | QGroupBox *scoreBox = new QGroupBox(QString("Player %1").arg(i + 1), this); |
| 71 | scoreBox->setObjectName(QString("actor%1").arg(i + 1)); | 73 | scoreBox->setObjectName(QString("actor%1").arg(i + 1)); |
