diff options
| author | manuel <manuel@mausz.at> | 2011-04-11 02:24:48 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-11 02:24:48 +0200 |
| commit | 43061892c7c9d341bacb7c679444f2885bd56907 (patch) | |
| tree | faae1880915c23f85901fa4f0ef7f2e5465681ec /pacman-c++/mainwidget.cpp | |
| parent | 57e3e48eb558b73077c2b5b4e531ee1cd75b0fbf (diff) | |
| download | foop-43061892c7c9d341bacb7c679444f2885bd56907.tar.gz foop-43061892c7c9d341bacb7c679444f2885bd56907.tar.bz2 foop-43061892c7c9d341bacb7c679444f2885bd56907.zip | |
- make use of my_color (still TODO: pre-game dialog (with intro music) + display own color first in scoreboard)
- remove some audio debugging noice
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 9c53513..bdc2da1 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -10,23 +10,27 @@ MainWidget::MainWidget(QWidget *parent) | |||
| 10 | : SceneHolder(parent), m_currentKey(0), m_running(false) | 10 | : SceneHolder(parent), m_currentKey(0), m_running(false) |
| 11 | { | 11 | { |
| 12 | createGui(); | 12 | createGui(); |
| 13 | updateMap(Util::createDemoMap()); | ||
| 14 | 13 | ||
| 15 | Color::Color myColor = connectToServer(); | 14 | m_color = connectToServer(); |
| 16 | if (myColor == Color::none) | 15 | if (m_color == Color::none) |
| 17 | { | 16 | { |
| 18 | QMessageBox::critical(this, "Error", "Failed to connect to server, falling back to local test mode"); | 17 | QMessageBox::critical(this, "Error", "Failed to connect to server, falling back to local test mode"); |
| 19 | // TODO: quit application here or sth | 18 | // TODO: quit application here or sth |
| 20 | m_socket = NULL; | 19 | m_socket = NULL; |
| 20 | m_color = Color::red; | ||
| 21 | QTimer *timer = new QTimer(this); | 21 | QTimer *timer = new QTimer(this); |
| 22 | connect(timer, SIGNAL(timeout()), this, SLOT(tick())); | 22 | connect(timer, SIGNAL(timeout()), this, SLOT(tick())); |
| 23 | timer->start(Constants::tick); | 23 | timer->start(Constants::tick); |
| 24 | } | 24 | } |
| 25 | else | 25 | |
| 26 | /* call updateMap after m_color ist set! */ | ||
| 27 | updateMap(Util::createDemoMap()); | ||
| 28 | |||
| 29 | if (m_socket != NULL) | ||
| 26 | connect(m_socket, SIGNAL(readyRead()), this, SLOT(tick())); | 30 | connect(m_socket, SIGNAL(readyRead()), this, SLOT(tick())); |
| 27 | 31 | ||
| 28 | // TODO: use mycolor | 32 | // TODO: use mycolor |
| 29 | qDebug() << "mycolor=" << myColor; | 33 | qDebug() << "mycolor=" << m_color; |
| 30 | 34 | ||
| 31 | //TODO: play intro as soon as there are enough players | 35 | //TODO: play intro as soon as there are enough players |
| 32 | //connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(startGame())); | 36 | //connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(startGame())); |
