adds style version number to check if style is outdated

This commit is contained in:
doitux
2009-04-09 23:57:25 +00:00
parent aef82cef0e
commit 5f8d2d18e7
6 changed files with 30 additions and 19 deletions
@@ -3,6 +3,7 @@
<TableStyle>
<StyleDescription value="danuxi table design (1024x600 fixed)" /> <!-- This string will be shown in settings/game table style list -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<PokerTHStyleFileVersion value="1" />
<Preview value="preview.png" />
<IfFixedWindowSize value="1" /> <!-- value [1,0] 1 = fixed window size, 0 = resizeable window -->
<FixedWindowWidth value="1024" />
@@ -3,6 +3,7 @@
<TableStyle>
<StyleDescription value="PokerTH default table style" /><!-- This string will be shown in settings/game table style list -->
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <!-- This string will be shown in error message if there is a problem with the style -->
<PokerTHStyleFileVersion value="1" /> <!-- This number matches the current PokerTH internal version that is supported, you should not change it unless PokerTH tells you to update the style -->
<Preview value="preview.png" /> <!-- This preview picture will be shown in settings/game table style if this style is selected. The value should contain a filename of the preview picture which have to be stored in the same folder as this xml file. -->
<!-- Windows Settings -->
+2
View File
@@ -35,6 +35,8 @@
#define POKERTH_BETA_REVISION 0
#define POKERTH_BETA_RELEASE_STRING "0.7-beta1"
#define PokerTH_STYLE_FILE_VERSION 1
enum ServerNetworkMode {
NETWORK_MODE_TCP = 1,
NETWORK_MODE_SCTP = 2,
+12 -16
View File
@@ -1285,10 +1285,6 @@ void gameTableImpl::provideMyActions(int mode) {
Game *currentGame = myStartWindow->getSession()->getCurrentGame();
HandInterface *currentHand = currentGame->getCurrentHand();
// cout << "provideMyActions get myAction" << currentHand->getSeatsList()->front()->getMyAction() << endl;
// cout << "provideMyActions get mySet" << currentGame->getSeatsList()->front()->getMySet() << endl;
// cout << "provideMyActions get HighestSet" << currentHand->getCurrentBeRo()->getHighestSet() << endl;
//really disabled buttons if human player is fold/all-in or ... and not called from dealberocards
if(/*pushButton_BetRaise->isCheckable() && */mode != 0 && (currentHand->getSeatsList()->front()->getMyAction() == PLAYER_ACTION_ALLIN || currentHand->getSeatsList()->front()->getMyAction() == PLAYER_ACTION_FOLD || (currentGame->getSeatsList()->front()->getMySet() == currentHand->getCurrentBeRo()->getHighestSet() && (currentGame->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_NONE)))) {
@@ -1408,9 +1404,9 @@ void gameTableImpl::provideMyActions(int mode) {
//if value changed on bet/raise button --> uncheck to prevent unwanted actions
QString lastBetValueString = lastPushButtonBetRaiseString.section(" ",1 ,1);
QString lastBetValueString = lastPushButtonBetRaiseString;
int index = lastBetValueString.indexOf("$");
lastBetValueString.remove(index,1);
lastBetValueString.remove(0, index+1);
bool ok;
int lastBetValue = lastBetValueString.toInt(&ok,10);
@@ -1582,9 +1578,9 @@ int gameTableImpl::getMyCallAmount() {
int gameTableImpl::getBetRaisePushButtonValue() {
QString betValueString = pushButton_BetRaise->text().section(" ",1 ,1);
QString betValueString = pushButton_BetRaise->text();
int index = betValueString.indexOf("$");
betValueString.remove(index,1);
betValueString.remove(0, index+1);
bool ok;
int betValue = betValueString.toInt(&ok,10);
@@ -3161,16 +3157,16 @@ void gameTableImpl::refreshActionButtonFKeyIndicator(bool clear)
}
else {
if(myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ){
pushButton_AllIn->setFKeyText("F4");
pushButton_BetRaise->setFKeyText("F3");
pushButton_CallCheck->setFKeyText("F2");
pushButton_Fold->setFKeyText("F1");
if(!pushButton_AllIn->text().isEmpty()) pushButton_AllIn->setFKeyText("F4");
if(!pushButton_BetRaise->text().isEmpty()) pushButton_BetRaise->setFKeyText("F3");
if(!pushButton_CallCheck->text().isEmpty()) pushButton_CallCheck->setFKeyText("F2");
if(!pushButton_Fold->text().isEmpty()) pushButton_Fold->setFKeyText("F1");
}
else {
pushButton_AllIn->setFKeyText("F1");
pushButton_BetRaise->setFKeyText("F2");
pushButton_CallCheck->setFKeyText("F3");
pushButton_Fold->setFKeyText("F4");
if(!pushButton_AllIn->text().isEmpty()) pushButton_AllIn->setFKeyText("F1");
if(!pushButton_BetRaise->text().isEmpty()) pushButton_BetRaise->setFKeyText("F2");
if(!pushButton_CallCheck->text().isEmpty()) pushButton_CallCheck->setFKeyText("F3");
if(!pushButton_Fold->text().isEmpty()) pushButton_Fold->setFKeyText("F4");
}
}
}
+13 -3
View File
@@ -107,6 +107,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
// INFOS
if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); }
else if(itemsList->ValueStr() == "StyleMaintainerEMail") { StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); }
else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") { PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str()); }
// WINDOWS SETTINGS
else if (itemsList->ValueStr() == "IfFixedWindowSize") { IfFixedWindowSize = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "FixedWindowWidth") { FixedWindowWidth = QString::fromUtf8(tempString1.c_str()); }
@@ -233,6 +234,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
// INFOS
if(StyleDescription == "") { leftItems << "StyleDescription"; }
if(PokerTHStyleFileVersion == "") { leftItems << "PokerTHStyleFileVersion"; }
// WINDOWS SETTINGS
if(IfFixedWindowSize == "") { leftItems << "IfFixedWindowSize"; }
if(FixedWindowWidth == "") { leftItems << "FixedWindowWidth"; }
@@ -433,8 +435,16 @@ void GameTableStyleReader::readStyleFile(QString file) {
//if one or more items are left show detailed error message
if(!leftItems.isEmpty() && myW != 0) showLeftItemsErrorMessage(StyleDescription, leftItems, StyleMaintainerEMail);
//if one or more pictures where not found show detailed error message
if(!itemPicsLeft.isEmpty() && myW != 0) showItemPicsLeftErrorMessage(StyleDescription, itemPicsLeft, StyleMaintainerEMail);
else {
//if one or more pictures where not found show detailed error message
if(!itemPicsLeft.isEmpty() && myW != 0) showItemPicsLeftErrorMessage(StyleDescription, itemPicsLeft, StyleMaintainerEMail);
//check for style file version
if(!PokerTHStyleFileVersion.isEmpty() && PokerTHStyleFileVersion.toInt() != PokerTH_STYLE_FILE_VERSION) {
QMessageBox::warning(myW, tr("Game Table Style Error"),
tr("Selected game table style \"%1\" seems to be outdated. \n The current PokerTH game table style version is \"%2\", but this style has version \"%3\" set. \n\nPlease contact the game table style builder %4.").arg(StyleDescription).arg(PokerTH_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(StyleMaintainerEMail),
QMessageBox::Ok);
}
}
}
else { qDebug() << "could not load game table style file: " << tinyFileName.c_str(); }
}
@@ -444,7 +454,7 @@ void GameTableStyleReader::showLeftItemsErrorMessage(QString style, QStringList
QString items = failedItems.join(", ");
QMessageBox::warning(myW, tr("Game Table Style Error"),
tr("Current game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of \"%2\" is/are left. \n\nPlease contact the game table style builder %3.").arg(style).arg(items).arg(email),
tr("Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of \"%2\" is/are left. \n\nPlease contact the game table style builder %3.").arg(style).arg(items).arg(email),
QMessageBox::Ok);
}
+1
View File
@@ -112,6 +112,7 @@ private:
// INFOS
QString StyleDescription;
QString StyleMaintainerEMail;
QString PokerTHStyleFileVersion;
// WINDOWS SETTINGS
QString IfFixedWindowSize;
QString FixedWindowWidth;