# HG changeset patch
# User unc0rr
# Date 1180475745 0
# Node ID f0b962214436e575caf0222dc69a9cac07f8f828
# Parent 812682c1ab62bcd9487b553570dd3d81b182cf5c
Easter egg (with stub image, will paint later)
diff -r 812682c1ab62 -r f0b962214436 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Sun May 27 20:17:55 2007 +0000
+++ b/QTfrontend/hedgewars.qrc Tue May 29 21:55:45 2007 +0000
@@ -13,6 +13,7 @@
res/botlevels/net3.png
res/botlevels/net4.png
res/botlevels/net5.png
+ res/bonus.png
res/Hedgehog.svg
res/net.png
diff -r 812682c1ab62 -r f0b962214436 QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp Sun May 27 20:17:55 2007 +0000
+++ b/QTfrontend/hwform.cpp Tue May 29 21:55:45 2007 +0000
@@ -59,7 +59,8 @@
connect(ui.pageMain->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos()));
connect(ui.pageMain->BtnNet, SIGNAL(clicked()), this, SLOT(GoToNet()));
connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), this, SLOT(GoToInfo()));
- connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(close()));
+ connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
+ connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
connect(ui.pageLocalGame->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
connect(ui.pageLocalGame->BtnSimpleGame, SIGNAL(clicked()), this, SLOT(SimpleGame()));
@@ -201,6 +202,25 @@
ui.Pages->setCurrentIndex(id);
}
+void HWForm::btnExitPressed()
+{
+ eggTimer.start();
+}
+
+void HWForm::btnExitClicked()
+{
+ if (eggTimer.elapsed() < 3000)
+ close();
+ else
+ {
+ QPushButton * btn = findChild("imageButt");
+ if (btn)
+ {
+ btn->setIcon(QIcon(":/res/bonus.png"));
+ }
+ }
+}
+
void HWForm::NewTeam()
{
editedTeam = new HWTeam("unnamed");
diff -r 812682c1ab62 -r f0b962214436 QTfrontend/hwform.h
--- a/QTfrontend/hwform.h Sun May 27 20:17:55 2007 +0000
+++ b/QTfrontend/hwform.h Tue May 29 21:55:45 2007 +0000
@@ -21,6 +21,7 @@
#include
#include
+#include
#include "netserver.h"
#include "game.h"
@@ -50,6 +51,8 @@
void GoToInfo();
void GoToPage(quint8 id);
void GoBack();
+ void btnExitPressed();
+ void btnExitClicked();
void NewTeam();
void EditTeam();
void TeamSave();
@@ -93,6 +96,7 @@
QStack PagesStack;
HWNetServer* pnetserver;
HWNetUdpServer* pUdpServer;
+ QTime eggTimer;
void AddStatText(const QString & msg);
void OnPageShown(quint8 id, quint8 lastid=0);
};
diff -r 812682c1ab62 -r f0b962214436 QTfrontend/mapContainer.cpp
--- a/QTfrontend/mapContainer.cpp Sun May 27 20:17:55 2007 +0000
+++ b/QTfrontend/mapContainer.cpp Tue May 29 21:55:45 2007 +0000
@@ -33,6 +33,7 @@
QWidget(parent), mainLayout(this)
{
imageButt=new QPushButton(this);
+ imageButt->setObjectName("imageButt");
imageButt->setFixedSize(256, 128);
imageButt->setFlat(true);
imageButt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);//QSizePolicy::Minimum, QSizePolicy::Minimum);
diff -r 812682c1ab62 -r f0b962214436 QTfrontend/res/bonus.png
Binary file QTfrontend/res/bonus.png has changed