summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-11 02:24:48 +0200
committermanuel <manuel@mausz.at>2011-04-11 02:24:48 +0200
commit43061892c7c9d341bacb7c679444f2885bd56907 (patch)
treefaae1880915c23f85901fa4f0ef7f2e5465681ec /pacman-c++/mainwidget.cpp
parent57e3e48eb558b73077c2b5b4e531ee1cd75b0fbf (diff)
downloadfoop-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.cpp14
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()));