gui tweaks for autofold mode, new timeout message about autofold mode

This commit is contained in:
doitux
2011-12-20 22:11:23 +00:00
parent 6df1a9b93c
commit e3a30d571c
9 changed files with 148 additions and 31 deletions
+12 -17
View File
@@ -26,6 +26,8 @@
#include "mysetlabel.h"
#include "myavatarlabel.h"
#include "myactionbutton.h"
#include "mycashlabel.h"
#include "mynamelabel.h"
#include "mychancelabel.h"
#include "mytimeoutlabel.h"
#include "mymenubar.h"
@@ -248,16 +250,6 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
playerStarsArray[4][9]=label_Star49;
playerStarsArray[5][9]=label_Star59;
// buttonLabelArray init
buttonLabelArray[0] = textLabel_Button0;
buttonLabelArray[1] = textLabel_Button1;
@@ -281,6 +273,9 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
cashLabelArray[7] = textLabel_Cash7;
cashLabelArray[8] = textLabel_Cash8;
cashLabelArray[9] = textLabel_Cash9;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
cashLabelArray[i]->setMyW(this);
}
playerTipLabelArray[0] = label_playerTip0;
playerTipLabelArray[1] = label_playerTip1;
@@ -964,16 +959,17 @@ void gameTableImpl::refreshPlayerAvatar()
switch(getCurrentSeatState((*it_c))) {
case SEAT_ACTIVE: {
qDebug() << seatPlace << "AVATAR ACTIVE";
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace);
}
break;
case SEAT_AUTOFOLD: {
qDebug() << seatPlace << "AUTOFOLD";
qDebug() << seatPlace << "AVATAR AUTOFOLD";
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
}
break;
case SEAT_STAYONTABLE: {
qDebug() << seatPlace << "STAYONTABLE";
qDebug() << seatPlace << "AVATAR STAYONTABLE";
playerAvatarLabelArray[(*it_c)->getMyID()]->setPixmapAndCountry(avatarPic, countryString, seatPlace, TRUE);
}
break;
@@ -1074,23 +1070,22 @@ void gameTableImpl::refreshCash()
boost::shared_ptr<Game> currentGame = myStartWindow->getSession()->getCurrentGame();
bool transparent = true;
PlayerListConstIterator it_c;
PlayerList seatsList = currentGame->getSeatsList();
for (it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
QGraphicsOpacityEffect opacity;
opacity.setOpacity(0.8);
//check SeatStates and refresh
switch(getCurrentSeatState((*it_c))) {
case SEAT_ACTIVE: {
// qDebug() << (*it_c)->getMyID() << "CASH ACTIVE";
cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash()));
}
break;
case SEAT_AUTOFOLD: {
cashLabelArray[(*it_c)->getMyID()]->setGraphicsEffect(&opacity);
cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash()));
// qDebug() << (*it_c)->getMyID() << "CASH AUTOFOLD"; //TODO transparent
cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash()), transparent);
}
break;
case SEAT_STAYONTABLE: {
+3 -1
View File
@@ -39,6 +39,8 @@ class PlayerInterface;
class MyCardsPixmapLabel;
class MyAvatarLabel;
class MyTimeoutLabel;
class MyCashLabel;
class MyNameLabel;
class settingsDialogImpl;
class startWindowImpl;
@@ -381,7 +383,7 @@ private:
QWidget *userWidgetsArray[6];
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
MyCashLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS];
MySetLabel *setLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *actionLabelArray[MAX_NUMBER_OF_PLAYERS];
+48
View File
@@ -0,0 +1,48 @@
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
#include "mycashlabel.h"
#include "gametableimpl.h"
#include "gametablestylereader.h"
MyCashLabel::MyCashLabel(QGroupBox* parent)
: QLabel(parent), myW(0)
{
}
MyCashLabel::~MyCashLabel()
{
}
void MyCashLabel::setText ( const QString &t, bool trans)
{
QColor transColor;
transColor.setNamedColor("#"+myW->getMyGameTableStyle()->getPlayerCashTextColor());
QString red = QString::number(transColor.red());
QString green = QString::number(transColor.green());
QString blue = QString::number(transColor.blue());
if(trans) {
this->setStyleSheet("QLabel { "+ myW->getMyGameTableStyle()->getFont2String() +" font-size: "+myW->getMyGameTableStyle()->getPlayerCashLabelFontSize()+"px; font-weight: bold; color: rgba("+red+", "+green+", "+blue+", 80); }");
} else {
this->setStyleSheet("QLabel { "+ myW->getMyGameTableStyle()->getFont2String() +" font-size: "+myW->getMyGameTableStyle()->getPlayerCashLabelFontSize()+"px; font-weight: bold; color: #"+myW->getMyGameTableStyle()->getPlayerCashTextColor()+"; }");
}
QLabel::setText(t);
}
+49
View File
@@ -0,0 +1,49 @@
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
#ifndef MYCASHLABEL_H
#define MYCASHLABEL_H
#include <iostream>
#include <QtGui>
#include <QtCore>
class gameTableImpl;
class MyCashLabel : public QLabel
{
Q_OBJECT
public:
MyCashLabel(QGroupBox*);
~MyCashLabel();
void setMyW(gameTableImpl* theValue) {
myW = theValue;
}
public slots:
void setText ( const QString &, bool = false );
private:
QString myText;
gameTableImpl *myW;
};
#endif