improve Own Flipside handling
This commit is contained in:
@@ -20,6 +20,8 @@ MyCardsPixmapLabel::MyCardsPixmapLabel(QFrame* parent)
|
||||
frameOpacity = 0.0;
|
||||
opacityRaiseIntervall = 0.01;
|
||||
|
||||
isFlipside = FALSE;
|
||||
|
||||
timer = new QTimer;
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(nextFadeOutFrame()));
|
||||
|
||||
@@ -58,6 +60,13 @@ void MyCardsPixmapLabel::nextFadeOutFrame() {
|
||||
|
||||
}
|
||||
|
||||
void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipside) {
|
||||
|
||||
QLabel::setPixmap(pic);
|
||||
isFlipside = flipside;
|
||||
|
||||
}
|
||||
|
||||
void MyCardsPixmapLabel::paintEvent(QPaintEvent * event) {
|
||||
|
||||
QLabel::paintEvent(event);
|
||||
|
||||
@@ -25,18 +25,27 @@ public:
|
||||
|
||||
~MyCardsPixmapLabel();
|
||||
|
||||
qreal frameOpacity;
|
||||
qreal opacityRaiseIntervall;
|
||||
QTimer *timer;
|
||||
void setIsFlipside(bool theValue){ isFlipside = theValue;}
|
||||
bool getIsFlipside() const{ return isFlipside;}
|
||||
|
||||
bool fadeOutAction;
|
||||
void startFadeOut(int);
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
void setPixmap ( const QPixmap &, const bool );
|
||||
void nextFadeOutFrame();
|
||||
|
||||
private:
|
||||
|
||||
qreal frameOpacity;
|
||||
qreal opacityRaiseIntervall;
|
||||
QTimer *timer;
|
||||
|
||||
bool isFlipside;
|
||||
bool fadeOutAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -510,8 +510,21 @@ void mainWindowImpl::callSettingsDialog() {
|
||||
flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80)));
|
||||
}
|
||||
else { flipside->load(":/othercards/cards/othercards/flipside.png"); }
|
||||
pixmapLabel_card1b->repaint();
|
||||
|
||||
int i,j;
|
||||
|
||||
for (i=0; i<=4; i++ ) {
|
||||
if(boardCardsArray[i]->getIsFlipside()) {
|
||||
boardCardsArray[i]->setPixmap(*flipside, TRUE);
|
||||
}
|
||||
}
|
||||
for (i=1; i<=4; i++ ) {
|
||||
for ( j=0; j<=1; j++ ) {
|
||||
if (holeCardsArray[i][j]->getIsFlipside()) {
|
||||
holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,8 +584,8 @@ void mainWindowImpl::refreshAction() {
|
||||
groupBoxArray[i]->setDisabled(TRUE);
|
||||
QPixmap onePix(":/graphics/cards/1px.png");
|
||||
if(i != 0) {
|
||||
holeCardsArray[i][0]->setPixmap(onePix);
|
||||
holeCardsArray[i][1]->setPixmap(onePix);
|
||||
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
|
||||
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
|
||||
}
|
||||
|
||||
QColor c(199,199,199);
|
||||
@@ -709,15 +722,15 @@ void mainWindowImpl::dealHoleCards() {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||
if (debugMode) {
|
||||
tempCardsPixmapArray[j].load(":/othercards/cards/othercards/"+QString::number(tempCardsIntArray[j], 10)+".png");
|
||||
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j]);
|
||||
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j],FALSE);
|
||||
|
||||
}
|
||||
else holeCardsArray[i][j]->setPixmap(*flipside);
|
||||
else holeCardsArray[i][j]->setPixmap(*flipside, TRUE);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
holeCardsArray[i][j]->setPixmap(onePix);
|
||||
holeCardsArray[i][j]->setPixmap(onePix, FALSE);
|
||||
// holeCardsArray[i][j]->repaint();
|
||||
}
|
||||
|
||||
@@ -732,12 +745,12 @@ void mainWindowImpl::dealHoleCards() {
|
||||
if(actualHand->getPlayerArray()[0]->getMyActiveStatus()) {
|
||||
|
||||
tempCardsPixmapArray[i].load(":/mycards/cards/mycards/"+QString::number(tempCardsIntArray[i], 10)+".png");
|
||||
holeCardsArray[0][i]->setPixmap(tempCardsPixmapArray[i]);
|
||||
holeCardsArray[0][i]->setPixmap(tempCardsPixmapArray[i], FALSE);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
holeCardsArray[0][i]->setPixmap(onePix);
|
||||
holeCardsArray[0][i]->setPixmap(onePix, FALSE);
|
||||
// holeCardsArray[i][j]->repaint();
|
||||
}
|
||||
}
|
||||
@@ -750,14 +763,14 @@ void mainWindowImpl::dealFlopCards0() { dealFlopCards0Timer->start(dealCardsSpee
|
||||
|
||||
void mainWindowImpl::dealFlopCards1() {
|
||||
|
||||
boardCardsArray[0]->setPixmap(*flipside);
|
||||
boardCardsArray[0]->setPixmap(*flipside, TRUE);
|
||||
|
||||
dealFlopCards1Timer->start(dealCardsSpeed);
|
||||
}
|
||||
|
||||
void mainWindowImpl::dealFlopCards2() {
|
||||
|
||||
boardCardsArray[1]->setPixmap(*flipside);
|
||||
boardCardsArray[1]->setPixmap(*flipside, TRUE);
|
||||
|
||||
dealFlopCards2Timer->start(dealCardsSpeed);
|
||||
|
||||
@@ -766,7 +779,7 @@ void mainWindowImpl::dealFlopCards2() {
|
||||
void mainWindowImpl::dealFlopCards3() {
|
||||
|
||||
|
||||
boardCardsArray[2]->setPixmap(*flipside);
|
||||
boardCardsArray[2]->setPixmap(*flipside, TRUE);
|
||||
|
||||
dealFlopCards3Timer->start(dealCardsSpeed);
|
||||
|
||||
@@ -779,7 +792,7 @@ void mainWindowImpl::dealFlopCards4() {
|
||||
actualHand->getBoard()->getMyCards(tempBoardCardsArray);
|
||||
tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[0], 10)+".png");
|
||||
QPixmap card(tempCardsPixmap);
|
||||
boardCardsArray[0]->setPixmap(card);
|
||||
boardCardsArray[0]->setPixmap(card, FALSE);
|
||||
|
||||
dealFlopCards4Timer->start(dealCardsSpeed);
|
||||
}
|
||||
@@ -791,7 +804,7 @@ void mainWindowImpl::dealFlopCards5() {
|
||||
actualHand->getBoard()->getMyCards(tempBoardCardsArray);
|
||||
tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[1], 10)+".png");
|
||||
QPixmap card(tempCardsPixmap);
|
||||
boardCardsArray[1]->setPixmap(card);
|
||||
boardCardsArray[1]->setPixmap(card, FALSE);
|
||||
|
||||
dealFlopCards5Timer->start(dealCardsSpeed);
|
||||
|
||||
@@ -804,7 +817,7 @@ void mainWindowImpl::dealFlopCards6() {
|
||||
actualHand->getBoard()->getMyCards(tempBoardCardsArray);
|
||||
tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[2], 10)+".png");
|
||||
QPixmap card(tempCardsPixmap);
|
||||
boardCardsArray[2]->setPixmap(card);
|
||||
boardCardsArray[2]->setPixmap(card, FALSE);
|
||||
|
||||
// stable
|
||||
// wenn alle All In
|
||||
@@ -818,7 +831,7 @@ void mainWindowImpl::dealTurnCards0() { dealTurnCards0Timer->start(dealCardsSpee
|
||||
|
||||
void mainWindowImpl::dealTurnCards1() {
|
||||
|
||||
boardCardsArray[3]->setPixmap(*flipside);
|
||||
boardCardsArray[3]->setPixmap(*flipside, TRUE);
|
||||
dealTurnCards1Timer->start(dealCardsSpeed);
|
||||
|
||||
}
|
||||
@@ -830,7 +843,7 @@ void mainWindowImpl::dealTurnCards2() {
|
||||
actualHand->getBoard()->getMyCards(tempBoardCardsArray);
|
||||
tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[3], 10)+".png");
|
||||
QPixmap card(tempCardsPixmap);
|
||||
boardCardsArray[3]->setPixmap(card);
|
||||
boardCardsArray[3]->setPixmap(card, FALSE);
|
||||
|
||||
// stable
|
||||
// wenn alle All In
|
||||
@@ -844,7 +857,7 @@ void mainWindowImpl::dealRiverCards0() { dealRiverCards0Timer->start(dealCardsSp
|
||||
|
||||
void mainWindowImpl::dealRiverCards1() {
|
||||
|
||||
boardCardsArray[4]->setPixmap(*flipside);
|
||||
boardCardsArray[4]->setPixmap(*flipside, TRUE);
|
||||
// QTimer::singleShot(dealCardsSpeed, this, SLOT( dealRiverCards2() ));
|
||||
dealRiverCards1Timer->start(dealCardsSpeed);
|
||||
|
||||
@@ -857,7 +870,7 @@ void mainWindowImpl::dealRiverCards2() {
|
||||
actualHand->getBoard()->getMyCards(tempBoardCardsArray);
|
||||
tempCardsPixmap.load(":/othercards/cards/othercards/"+QString::number(tempBoardCardsArray[4], 10)+".png");
|
||||
QPixmap card(tempCardsPixmap);
|
||||
boardCardsArray[4]->setPixmap(card);
|
||||
boardCardsArray[4]->setPixmap(card, FALSE);
|
||||
|
||||
|
||||
// stable
|
||||
@@ -1253,7 +1266,7 @@ void mainWindowImpl::postRiverRunAnimation2() {
|
||||
if(actualHand->getPlayerArray()[i]->getMyActiveStatus() && actualHand->getPlayerArray()[i]->getMyAction() != 1) {
|
||||
|
||||
tempCardsPixmapArray[j].load(":/othercards/cards/othercards/"+QString::number(tempCardsIntArray[j], 10)+".png");
|
||||
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j]);
|
||||
holeCardsArray[i][j]->setPixmap(tempCardsPixmapArray[j], FALSE);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1438,7 +1451,7 @@ void mainWindowImpl::nextRoundCleanGui() {
|
||||
|
||||
// GUI bereinigen
|
||||
QPixmap onePix(":/graphics/cards/1px.png");
|
||||
for (i=0; i<5; i++ ) { boardCardsArray[i]->setPixmap(onePix); }
|
||||
for (i=0; i<5; i++ ) { boardCardsArray[i]->setPixmap(onePix, FALSE); }
|
||||
|
||||
QColor c(0,0,0);
|
||||
for(i=0; i<maxQuantityPlayers; i++) {
|
||||
|
||||
+126
-93
@@ -5,8 +5,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>515</width>
|
||||
<height>323</height>
|
||||
<width>580</width>
|
||||
<height>342</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
@@ -19,16 +19,6 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QStackedWidget" name="stackedWidget" >
|
||||
<property name="currentIndex" >
|
||||
@@ -187,65 +177,11 @@
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<string>Flipside of Cards</string>
|
||||
<item row="1" column="0" >
|
||||
<widget class="Line" name="line_5" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QLineEdit" name="lineEdit_OwnFlipsideFilename" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QRadioButton" name="radioButton_flipsideOwn" >
|
||||
<property name="text" >
|
||||
<string>Own Flipside Picture:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QRadioButton" name="radioButton_flipsideTux" >
|
||||
<property name="text" >
|
||||
<string>Default (Tux)</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<widget class="QPushButton" name="pushButton_openFlipsidePicture" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>27</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<size>
|
||||
<width>27</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="deck.qrc" >:/graphics/graphics/fileopen16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
@@ -261,30 +197,104 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_13" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Interface</string>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<string>Flipside of Cards</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_flipsideOwn" >
|
||||
<property name="text" >
|
||||
<string>Own Flipside Picture:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_OwnFlipsideFilename" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_openFlipsidePicture" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>27</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<size>
|
||||
<width>27</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="deck.qrc" >:/graphics/graphics/fileopen16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15" >
|
||||
<property name="text" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Nimbus Sans L'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: Best Quality with Image Ratio like </span><span style=" font-weight:600; font-style:italic;">Width=100, Height=140</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QRadioButton" name="radioButton_flipsideTux" >
|
||||
<property name="text" >
|
||||
<string>Default (Tux)</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="Line" name="line_5" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QCheckBox" name="checkBox_showIntro" >
|
||||
<item row="4" column="0" >
|
||||
<widget class="QCheckBox" name="checkBox_showFadeOutCardsAnimation" >
|
||||
<property name="text" >
|
||||
<string>Show Intro on Startup</string>
|
||||
<string>Show Fade-Out Animation for Non-Winning Cards</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -295,10 +305,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<widget class="QCheckBox" name="checkBox_showFadeOutCardsAnimation" >
|
||||
<item row="2" column="0" >
|
||||
<widget class="QCheckBox" name="checkBox_showIntro" >
|
||||
<property name="text" >
|
||||
<string>Show Fade-Out Animation for Non-Winning Cards</string>
|
||||
<string>Show Intro on Startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_13" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Interface</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -442,6 +465,16 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QListWidget" name="listWidget" >
|
||||
<property name="maximumSize" >
|
||||
|
||||
@@ -55,6 +55,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, const char *name)
|
||||
checkBox_showFadeOutCardsAnimation->setChecked(myConfig.readConfigInt("ShowFadeOutCardsAnimation", 1));
|
||||
radioButton_flipsideTux->setChecked(myConfig.readConfigInt("FlipsideTux", 1));
|
||||
radioButton_flipsideOwn->setChecked(myConfig.readConfigInt("FlipsideOwn", 0));
|
||||
if(radioButton_flipsideOwn->isChecked()) {
|
||||
lineEdit_OwnFlipsideFilename->setEnabled(TRUE);
|
||||
pushButton_openFlipsidePicture->setEnabled(TRUE);
|
||||
}
|
||||
lineEdit_OwnFlipsideFilename->setText(QString::fromStdString(myConfig.readConfigString("FlipsideOwnFile", "")));
|
||||
|
||||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
|
||||
@@ -104,8 +108,8 @@ void settingsDialogImpl::setFlipsidePicFileName()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select your Flipside Picture"),
|
||||
QDir::homePath(),
|
||||
tr("Images (*.png *.xpm *.jpg)"));
|
||||
tr("Images (*.png *.xpm)"));
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
lineEdit_OwnFlipsideFilename->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user