This commit is contained in:
@@ -50,6 +50,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
{
|
{
|
||||||
// Schriftart laden
|
// Schriftart laden
|
||||||
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/n019003l.pfb");
|
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/n019003l.pfb");
|
||||||
|
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/c059013l.pfb");
|
||||||
|
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/andybold.ttf");
|
||||||
|
|
||||||
QFont tmpFont("Nimbus Sans L",9);
|
QFont tmpFont("Nimbus Sans L",9);
|
||||||
QApplication::setFont(tmpFont);
|
QApplication::setFont(tmpFont);
|
||||||
|
|
||||||
@@ -65,6 +68,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
startSplashFrameNo = 0;
|
||||||
|
|
||||||
//Toolbox verstecken?
|
//Toolbox verstecken?
|
||||||
if (!myConfig->readConfigInt("ShowToolBox", 1)) { groupBox_tools->hide(); }
|
if (!myConfig->readConfigInt("ShowToolBox", 1)) { groupBox_tools->hide(); }
|
||||||
@@ -99,7 +103,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
userWidgetsArray[i]->setPalette(tempPalette);
|
userWidgetsArray[i]->setPalette(tempPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Timer Objekt erstellen
|
//Timer Objekte erstellen
|
||||||
dealFlopCards0Timer = new QTimer(this);
|
dealFlopCards0Timer = new QTimer(this);
|
||||||
dealFlopCards1Timer = new QTimer(this);
|
dealFlopCards1Timer = new QTimer(this);
|
||||||
dealFlopCards2Timer = new QTimer(this);
|
dealFlopCards2Timer = new QTimer(this);
|
||||||
@@ -132,6 +136,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
potDistributeTimer = new QTimer(this);
|
potDistributeTimer = new QTimer(this);
|
||||||
postRiverRunAnimation6Timer = new QTimer(this);
|
postRiverRunAnimation6Timer = new QTimer(this);
|
||||||
|
|
||||||
|
startSplashAnimationTimer = new QTimer(this);
|
||||||
|
|
||||||
|
|
||||||
dealFlopCards0Timer->setSingleShot(TRUE);
|
dealFlopCards0Timer->setSingleShot(TRUE);
|
||||||
dealFlopCards1Timer->setSingleShot(TRUE);
|
dealFlopCards1Timer->setSingleShot(TRUE);
|
||||||
dealFlopCards2Timer->setSingleShot(TRUE);
|
dealFlopCards2Timer->setSingleShot(TRUE);
|
||||||
@@ -261,6 +268,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
|
|||||||
connect(potDistributeTimer, SIGNAL(timeout()), this, SLOT(postRiverRunAnimation5()));
|
connect(potDistributeTimer, SIGNAL(timeout()), this, SLOT(postRiverRunAnimation5()));
|
||||||
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
|
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
|
||||||
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
||||||
|
|
||||||
|
connect(startSplashAnimationTimer, SIGNAL(timeout()), this, SLOT( startSplashNextFrame() ));
|
||||||
|
|
||||||
connect( actionNewGame, SIGNAL( activated() ), this, SLOT( callNewGameDialog() ) );
|
connect( actionNewGame, SIGNAL( activated() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( actionAboutPokerth, SIGNAL( activated() ), this, SLOT( callAboutPokerthDialog() ) );
|
connect( actionAboutPokerth, SIGNAL( activated() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||||
@@ -1245,6 +1254,12 @@ void mainWindowImpl::postRiverRunAnimation6() {
|
|||||||
postRiverRunAnimation6Timer->start(newRoundSpeed);
|
postRiverRunAnimation6Timer->start(newRoundSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindowImpl::startSplashNextFrame() {
|
||||||
|
|
||||||
|
++startSplashFrameNo;
|
||||||
|
update();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindowImpl::startNewHand() {
|
void mainWindowImpl::startNewHand() {
|
||||||
|
|
||||||
@@ -1384,17 +1399,18 @@ void mainWindowImpl::breakButtonClicked() {
|
|||||||
|
|
||||||
void mainWindowImpl::paintStartSplash() {
|
void mainWindowImpl::paintStartSplash() {
|
||||||
|
|
||||||
StartSplash *mySplash = new StartSplash(this->geometry());
|
// std::cout << this->geometry().x() << this->geometry().y() << "\n";
|
||||||
|
|
||||||
mySplash->setGeometry(0,0,400,250);
|
/*
|
||||||
mySplash->setWindowFlags(Qt::SplashScreen);
|
StartSplash *mySplash = new StartSplash(this);
|
||||||
mySplash->show();
|
|
||||||
|
mySplash->show();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
// cout << event->key() << endl;
|
cout << event->key() << endl;
|
||||||
|
|
||||||
|
|
||||||
if (event->key() == 16777265) { switchToolBox(); }
|
if (event->key() == 16777265) { switchToolBox(); }
|
||||||
@@ -1409,6 +1425,14 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindowImpl::paintEvent(QPaintEvent* event) {
|
||||||
|
QMainWindow::paintEvent(event);
|
||||||
|
StartSplash startSplashPainter(this);
|
||||||
|
startSplashPainter.setFrameNo(startSplashFrameNo);
|
||||||
|
/* do your overlay painting here */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void mainWindowImpl::switchToolBox() {
|
void mainWindowImpl::switchToolBox() {
|
||||||
|
|
||||||
if (groupBox_tools->isHidden()) { groupBox_tools->show(); }
|
if (groupBox_tools->isHidden()) { groupBox_tools->show(); }
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ public slots:
|
|||||||
void postRiverRunAnimation5();
|
void postRiverRunAnimation5();
|
||||||
void postRiverRunAnimation6();
|
void postRiverRunAnimation6();
|
||||||
|
|
||||||
|
void startSplashNextFrame();
|
||||||
|
|
||||||
void handSwitchRounds();
|
void handSwitchRounds();
|
||||||
|
|
||||||
void startNewHand();
|
void startNewHand();
|
||||||
@@ -148,8 +150,9 @@ public slots:
|
|||||||
void breakButtonClicked();
|
void breakButtonClicked();
|
||||||
|
|
||||||
void keyPressEvent ( QKeyEvent * event );
|
void keyPressEvent ( QKeyEvent * event );
|
||||||
|
void paintEvent(QPaintEvent* event);
|
||||||
|
|
||||||
void switchToolBox();
|
void switchToolBox();
|
||||||
|
|
||||||
void paintStartSplash();
|
void paintStartSplash();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -193,6 +196,9 @@ private:
|
|||||||
QTimer *postRiverRunAnimation3Timer;
|
QTimer *postRiverRunAnimation3Timer;
|
||||||
QTimer *postRiverRunAnimation5Timer;
|
QTimer *postRiverRunAnimation5Timer;
|
||||||
QTimer *postRiverRunAnimation6Timer;
|
QTimer *postRiverRunAnimation6Timer;
|
||||||
|
|
||||||
|
QTimer *startSplashAnimationTimer;
|
||||||
|
|
||||||
|
|
||||||
QWidget *userWidgetsArray[8];
|
QWidget *userWidgetsArray[8];
|
||||||
QLabel *buttonLabelArray[5];
|
QLabel *buttonLabelArray[5];
|
||||||
@@ -207,6 +213,7 @@ private:
|
|||||||
int maxQuantityPlayers;
|
int maxQuantityPlayers;
|
||||||
|
|
||||||
int distributePotAnimCounter;
|
int distributePotAnimCounter;
|
||||||
|
int startSplashFrameNo;
|
||||||
|
|
||||||
//Speed
|
//Speed
|
||||||
int guiGameSpeed;
|
int guiGameSpeed;
|
||||||
|
|||||||
@@ -19,19 +19,13 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "startsplash.h"
|
#include "startsplash.h"
|
||||||
|
|
||||||
StartSplash::StartSplash(const QRect &rect)
|
StartSplash::StartSplash(QMainWindow *parent)
|
||||||
: QWidget(), parentsGeo(rect)
|
: QPainter()
|
||||||
{
|
{
|
||||||
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/c059013l.pfb");
|
|
||||||
QFontDatabase::addApplicationFont ("src/gui/qt/fonts/andybold.ttf");
|
|
||||||
|
|
||||||
frameNo = 52;
|
|
||||||
opacityCounter = 13;
|
opacityCounter = 13;
|
||||||
opacity = 1.0;
|
opacity = 1.0;
|
||||||
|
|
||||||
QTimer *timer = new QTimer;
|
|
||||||
connect(timer, SIGNAL(timeout()), this, SLOT(nextAnimationFrame()));
|
|
||||||
timer->start(40);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,25 +33,18 @@ StartSplash::~StartSplash()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartSplash::nextAnimationFrame() {
|
void StartSplash::aanimateStartSplash() {
|
||||||
|
|
||||||
++frameNo;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartSplash::paintEvent(QPaintEvent * event) {
|
|
||||||
|
|
||||||
QPainter painter(this);
|
|
||||||
QFont welcomeFont("Century Schoolbook L",29);
|
QFont welcomeFont("Century Schoolbook L",29);
|
||||||
QFont haveFont("Andy MT",30);
|
QFont haveFont("Andy MT",30);
|
||||||
QPixmap logo(":/graphics/graphics/logo-140-100.png");
|
QPixmap logo(":/graphics/graphics/logo-140-100.png");
|
||||||
|
|
||||||
if(frameNo >= 52 && frameNo < 65) {
|
if(frameNo >= 52 && frameNo < 65) {
|
||||||
|
|
||||||
painter.setBrush(QColor(40,80,46));
|
setBrush(QColor(40,80,46));
|
||||||
painter.drawRect(0,0,399,249);
|
drawRect(0,0,399,249);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if(frameNo >= 65 && frameNo < 68) {
|
if(frameNo >= 65 && frameNo < 68) {
|
||||||
|
|
||||||
painter.setBrush(QColor(40,80,46));
|
painter.setBrush(QColor(40,80,46));
|
||||||
@@ -236,7 +223,13 @@ void StartSplash::paintEvent(QPaintEvent * event) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(frameNo >= 260 ) { this->hide(); }
|
if(frameNo >= 260 ) { this->hide(); }*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void StartSplash::mousePressEvent ( QMouseEvent * event ) {
|
||||||
|
|
||||||
|
if(event) this->hide();
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
class StartSplash : public QWidget
|
class StartSplash : public QPainter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
StartSplash(const QRect&);
|
StartSplash(QMainWindow *parent = 0);
|
||||||
|
|
||||||
~StartSplash();
|
~StartSplash();
|
||||||
|
|
||||||
@@ -29,14 +29,8 @@ public:
|
|||||||
int opacityCounter;
|
int opacityCounter;
|
||||||
qreal opacity;
|
qreal opacity;
|
||||||
|
|
||||||
QRect parentsGeo;
|
void aanimateStartSplash();
|
||||||
|
void setFrameNo(int frameNumber) { frameNo = frameNumber+51; }
|
||||||
void paintEvent(QPaintEvent * event);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
void nextAnimationFrame();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user