diff --git a/ChangeLog b/ChangeLog index 50cd5577..a8b4417a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-04-04 version 0.4: + +- feature: settings menu (to do a lot of settings and save preferences) +- feature: set player names and avatars for computer opponents +- feature: switch to fullscreen mode +- feature: cards animation (show winning hand, flip cards) +- feature: set you own card-flipside picture +- feature: log-window and log-files +- feature: start-stop button (for break between hands) +- feature: game-speed slider (for changing speed during game) +- feature: graphical handranking overview +- feature: keyboard shortcuts (e.g. for human player action) +- change: now you can play against up to 6 opponents +- change: complete new gui (gfx by tranberry) +- change: complete new engine design +- bugfix: a lot of bugfixes + + 2006-10-16 version 0.3: - change: some changes on game-speed and game-rhythm. game-speed delay near 0 is possible ;) diff --git a/src/engine/local_engine/cardsvalue.cpp b/src/engine/local_engine/cardsvalue.cpp index 0f652685..05be20a4 100755 --- a/src/engine/local_engine/cardsvalue.cpp +++ b/src/engine/local_engine/cardsvalue.cpp @@ -311,7 +311,7 @@ int array[7][3]; for(j2=0; j2<4; j2++) { position[j2] = array[j1+j2][2]; } - position[4] = array[j1][2]; + position[4] = array[0][2]; } return 700000000+array[j1][1]*1000000+array[0][1]*10000; } @@ -328,7 +328,7 @@ int array[7][3]; for(j4=j3+1; j4<7; j4++) { for(j5=j4+1; j5<7; j5++) { // Straight - if((array[j1][1]-1 == array[j2][1] || array[j1][1]-9 == array[j2][1] ) && array[j2][1]-1 == array[j3][1] && array[j3][1]-1 == array[j4][1] && array[j4][1]-1 == array[j5][1]) { + if(array[j1][1]-1 == array[j2][1] && array[j2][1]-1 == array[j3][1] && array[j3][1]-1 == array[j4][1] && array[j4][1]-1 == array[j5][1]) { if(position) { // Position-Array fuellen position[0] = array[j1][2]; @@ -337,9 +337,7 @@ int array[7][3]; position[3] = array[j4][2]; position[4] = array[j5][2]; } - // h�ste Karte der Straight ermitteln - if(array[j1][1]-9 == array[j2][1]) return 400000000+array[j2][1]*1000000; - else return 400000000+array[j1][1]*1000000; + return 400000000+array[j1][1]*1000000; } // Full House if((array[j1][1] == array[j2][1] && array[j1][1] == array[j3][1] && array[j4][1] == array[j5][1]) || (array[j3][1] == array[j4][1] && array[j3][1] == array[j5][1] && array[j1][1] == array[j2][1])) { @@ -362,6 +360,29 @@ int array[7][3]; } } + // auf Straight-Spezialfall ( 5 4 3 2 A ) testen + for(j1=0; j1<7; j1++) { + for(j2=j1+1; j2<7; j2++) { + for(j3=j2+1; j3<7; j3++) { + for(j4=j3+1; j4<7; j4++) { + for(j5=j4+1; j5<7; j5++) { + if(array[j1][1]-9 == array[j2][1] && array[j2][1]-1 == array[j3][1] && array[j3][1]-1 == array[j4][1] && array[j4][1]-1 == array[j5][1]) { + if(position) { + // Position-Array fuellen + position[0] = array[j1][2]; + position[1] = array[j2][2]; + position[2] = array[j3][2]; + position[3] = array[j4][2]; + position[4] = array[j5][2]; + } + return 400000000+array[j2][1]*1000000; + } + } + } + } + } + } + // auf Drilling (Klasse 3) testen for(j1=0; j1<5; j1++) { if(array[j1][1] == array[j1+1][1] && array[j1][1] == array[j1+2][1]) { diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 051ed173..2e37023d 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -63,6 +63,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe tempBoardArray[i] = cardsArray[i]; tempPlayerAndBoardArray[i+2] = cardsArray[i]; } + + k = 0; myBoard->setMyCards(tempBoardArray); for(i=0; i wenn nur noch einer nicht-folded dann gleich den Pot verteilen activePlayersCounter = 0; @@ -205,10 +207,12 @@ void LocalHand::switchRounds() { myGui->refreshSet(); actualRound = 4; } - // prfen der All In Kondition // fr All In Prozedur mssen mindestens zwei aktive Player vorhanden sein else { + +// cout << "activplayerscounter: " << activePlayersCounter << " | allInPlayersCounter: " << allInPlayersCounter << " | " << endl; + // 1) wenn alle All In if(allInPlayersCounter == activePlayersCounter) { allInCondition = 1; @@ -232,6 +236,8 @@ void LocalHand::switchRounds() { break; default: {} } +// cout << "tempHighestSet: " << tempHighestSet << "playerArray[i]->getMySet(): " << playerArray[i]->getMySet() << endl; + if(playerArray[i]->getMySet() >= tempHighestSet) { allInCondition = 1; } diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 426b346f..b77a2a4c 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -25,6 +25,14 @@ using namespace std; LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0) { + +// for statistic development +// if(myID==0) { +// myActiveStatus=0; +// myCash=0; +// } + //////////////////////////// + // myBestHandPosition mit -1 initialisieren int i; for(i=0; i<5; i++) { @@ -50,13 +58,14 @@ LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::strin int interval = 7; int count = 4; - int tempArray[4]; + int *tempArray = new int[count]; myTool.getRandNumber(0, 2*interval, count, tempArray, 0); for(i=0; igetPreflop()->getHighestSet(); @@ -161,19 +170,22 @@ void LocalPlayer::preflopEngine() { } // Verhaeltnis Set / Cash für raise - if(myCash/individualHighestSet < 10) { - myNiveau[2] += (10-myCash/individualHighestSet)/2; + if(myCash/individualHighestSet < 11) { + myNiveau[2] += (11-myCash/individualHighestSet)/2; } // cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl; - // Aggresivität des humanPlayers auslesen + // Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist ! int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0); // cout << aggValue << " "; - myNiveau[0] -= aggValue; - myNiveau[2] -= aggValue; + + if(actualHand->getPlayerArray()[0]->getMyActiveStatus()) { + myNiveau[0] -= aggValue; + myNiveau[2] -= aggValue; + } // cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; @@ -195,7 +207,13 @@ void LocalPlayer::preflopEngine() { } // nur call else { - myAction = 3; + // all in bei knappem call + if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } else { + myAction = 3; + } } // Standard-Raise-Routine @@ -222,10 +240,19 @@ void LocalPlayer::preflopEngine() { } else { // call - if(myOdds >= myNiveau[0] || (mySet >= actualHand->getPreflop()->getHighestSet()/2 && myOdds >= myNiveau[0]-5)) { + if(myOdds >= myNiveau[0] || (mySet >= actualHand->getPreflop()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) { // bigBlind --> check if(myButton == 3 && mySet == actualHand->getPreflop()->getHighestSet()) myAction = 2; - else myAction = 3; + else { + // all in bei knappem call + if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } + else { + myAction = 3; + } + } } // fold else { @@ -245,7 +272,14 @@ void LocalPlayer::preflopEngine() { // Gegner raisen ebenfalls -> call if(actualHand->getPreflop()->getHighestSet() >= 12*actualHand->getSmallBlind()) { - myAction = 3; + // all in bei knappem call + if(myCash-actualHand->getPreflop()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } + else { + myAction = 3; + } } // Standard-Raise-Routine else { @@ -293,17 +327,19 @@ void LocalPlayer::flopEngine() { // 2. Check -- Bet myNiveau[1] = 54 + myDude4 - 6*(players - 2); // 3. Call -- Raise - myNiveau[2] = 67 + myDude4 - 6*(players - 2); + myNiveau[2] = 69 + myDude4 - 7*(players - 2); // eigenes mögliches highestSet int individualHighestSet = actualHand->getFlop()->getHighestSet(); if(individualHighestSet > myCash) individualHighestSet = myCash; - // Aggresivität des humanPlayers auslesen + // Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0); - for(i=0; i<3; i++) { - myNiveau[i] -= aggValue; + if(actualHand->getPlayerArray()[0]->getMyActiveStatus()) { + for(i=0; i<3; i++) { + myNiveau[i] -= aggValue; + } } // Check-Bluff generieren @@ -320,8 +356,8 @@ void LocalPlayer::flopEngine() { } // Verhaeltnis Set / Cash für raise - if(myCash/individualHighestSet < 10) { - myNiveau[2] += (10-myCash/individualHighestSet)/2; + if(myCash/individualHighestSet < 11) { + myNiveau[2] += (11-myCash/individualHighestSet)/2; } // raise (bei hohem Niveau) @@ -336,7 +372,13 @@ void LocalPlayer::flopEngine() { } // nur call else { - myAction = 3; + // all in bei knappem call + if(myCash-actualHand->getFlop()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } else { + myAction = 3; + } } // Standard-Raise-Routine @@ -777,13 +819,15 @@ void LocalPlayer::turnEngine() { // 2. Check -- Bet myNiveau[1] = 54 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; // 3. Call -- Raise - myNiveau[2] = 66 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; -// Aggresivität des humanPlayers auslesen + // Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0); - for(i=0; i<3; i++) { - myNiveau[i] -= aggValue; + if(actualHand->getPlayerArray()[0]->getMyActiveStatus()) { + for(i=0; i<3; i++) { + myNiveau[i] -= aggValue; + } } // cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; @@ -807,8 +851,8 @@ void LocalPlayer::turnEngine() { } // Verhaeltnis Set / Cash für raise - if(myCash/individualHighestSet < 10) { - myNiveau[2] += (10-myCash/individualHighestSet)/2; + if(myCash/individualHighestSet < 11) { + myNiveau[2] += (11-myCash/individualHighestSet)/2; } // raise (bei hohem Niveau) @@ -823,7 +867,13 @@ void LocalPlayer::turnEngine() { } // nur call else { - myAction = 3; + // all in bei knappem call + if(myCash-actualHand->getTurn()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } else { + myAction = 3; + } } // Standard-Raise-Routine @@ -974,6 +1024,8 @@ void LocalPlayer::turnEngine() { // cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl; +// cout << "myAction: " << myAction << endl; + evaluation(bet, raise); } @@ -1014,13 +1066,15 @@ void LocalPlayer::riverEngine() { // 2. Check -- Bet myNiveau[1] = 54 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; // 3. Call -- Raise - myNiveau[2] = 66 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; + myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActualQuantityPlayers() - 2)*/; - // Aggresivität des humanPlayers auslesen + // Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*21.0); - for(i=0; i<3; i++) { - myNiveau[i] -= aggValue; + if(actualHand->getPlayerArray()[0]->getMyActiveStatus()) { + for(i=0; i<3; i++) { + myNiveau[i] -= aggValue; + } } // cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl; @@ -1040,8 +1094,8 @@ void LocalPlayer::riverEngine() { } // Verhaeltnis Set / Cash für raise - if(myCash/individualHighestSet < 10) { - myNiveau[2] += (10-myCash/individualHighestSet)/2; + if(myCash/individualHighestSet < 11) { + myNiveau[2] += (11-myCash/individualHighestSet)/2; } // raise (bei hohem Niveau) @@ -1055,7 +1109,13 @@ void LocalPlayer::riverEngine() { } // nur call else { - myAction = 3; + // all in bei knappem call + if(myCash-actualHand->getRiver()->getHighestSet() <= (myCash*1)/5) { + raise = myCash; + myAction = 5; + } else { + myAction = 3; + } } } // Standard-Raise-Routine @@ -1218,6 +1278,7 @@ void LocalPlayer::evaluation(int bet, int raise) { default: cout << "ERROR - wrong init of actualRound" << endl; } +// cout << "myAction(evaluation): " << myAction << endl; switch(myAction) { // none case 0: {} @@ -1230,12 +1291,14 @@ void LocalPlayer::evaluation(int bet, int raise) { break; // call case 3: { +// cout << "evaluation(call) - highestSet = " << highestSet << endl; // all in - if(highestSet >= myCash) { - mySet += myCash; - myCash = 0; - myAction = 6; - } + if(highestSet >= myCash + mySet) { + mySet += myCash; + myCash = 0; + myAction = 6; +// cout << "evaluation(call) - mySet: " << mySet << endl; + } // sonst else { myCash = myCash - highestSet + mySet; @@ -1262,11 +1325,13 @@ void LocalPlayer::evaluation(int bet, int raise) { break; // raise case 5: { +// cout << "evaluation(raise) - highestSet = " << highestSet << " - raise: " << raise << endl; // all in if(highestSet + raise >= myCash) { mySet += myCash; myCash = 0; myAction = 6; +// cout << "evaluation(raise) - mySet: " << mySet << endl; if(mySet > highestSet) highestSet = mySet; } // sonst @@ -1283,6 +1348,8 @@ void LocalPlayer::evaluation(int bet, int raise) { default: {} } +// cout << "highestSet(ende evaluation): " << highestSet << endl; + switch(actualHand->getActualRound()) { case 0: actualHand->getPreflop()->setHighestSet(highestSet); break; diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index 4196bce9..0e4a18c3 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -48,6 +48,9 @@ public: void setMyDude(const int& theValue) { myDude = theValue; } int getMyDude() const { return myDude; } + void setMyDude4(const int& theValue) { myDude4 = theValue; } + int getMyDude4() const { return myDude4; } + void setMyName(const std::string& theValue) { myName = theValue; } std::string getMyName() const { return myName; } diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index dad88029..3ba9edef 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -35,6 +35,9 @@ public: virtual void setMyDude(const int& theValue) =0; virtual int getMyDude() const =0; + virtual void setMyDude4(const int& theValue) =0; + virtual int getMyDude4() const =0; + virtual void setMyName(const std::string& theValue) =0; virtual std::string getMyName() const =0; diff --git a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp index 1fc17b76..b5b3874f 100644 --- a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp +++ b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp @@ -42,7 +42,7 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent) myServerProfilesFile = myConfig.readConfigString("DataDir")+"serverprofiles.xml"; //Anlegen wenn noch nicht existiert! - QFile serverProfilesfile(QString::fromStdString(myServerProfilesFile)); + QFile serverProfilesfile(QString::fromUtf8(myServerProfilesFile.c_str())); if(!serverProfilesfile.exists()) { @@ -89,7 +89,7 @@ void joinNetworkGameDialogImpl::fillServerProfileList() { TiXmlDocument doc(myServerProfilesFile); if(!doc.LoadFile()) { QMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -108,7 +108,7 @@ void joinNetworkGameDialogImpl::fillServerProfileList() { int tempInt = 0; profile->QueryIntAttribute("IsIpv6", &tempInt ); if( tempInt == 1 ) { isIpv6 = "yes"; } - item->setData(3, 0, QString::fromStdString(isIpv6)); + item->setData(3, 0, QString::fromUtf8(isIpv6.c_str())); treeWidget->addTopLevelItem(item); } @@ -128,7 +128,7 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int column) TiXmlDocument doc(myServerProfilesFile); if(!doc.LoadFile()) { QMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -136,11 +136,11 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int column) TiXmlElement* profile = docHandle.FirstChild( "PokerTH" ).FirstChild( "ServerProfiles" ).FirstChild( item->data(0,0).toString().toStdString() ).ToElement(); if ( profile ) { - lineEdit_profileName->setText(QString::fromStdString(profile->Attribute("Name"))); - lineEdit_ipAddress->setText(QString::fromStdString(profile->Attribute("Address"))); - lineEdit_password->setText(QString::fromStdString(profile->Attribute("Password"))); - spinBox_port->setValue(QString::fromStdString(profile->Attribute("Port")).toInt(&toIntTrue, 10)); - checkBox_ipv6->setChecked(QString::fromStdString(profile->Attribute("IsIpv6")).toInt(&toIntTrue, 10)); + lineEdit_profileName->setText(QString::fromUtf8(profile->Attribute("Name"))); + lineEdit_ipAddress->setText(QString::fromUtf8(profile->Attribute("Address"))); + lineEdit_password->setText(QString::fromUtf8(profile->Attribute("Password"))); + spinBox_port->setValue(QString::fromUtf8(profile->Attribute("Port")).toInt(&toIntTrue, 10)); + checkBox_ipv6->setChecked(QString::fromUtf8(profile->Attribute("IsIpv6")).toInt(&toIntTrue, 10)); } @@ -154,7 +154,7 @@ void joinNetworkGameDialogImpl::saveServerProfile() { TiXmlDocument doc(myServerProfilesFile); if(!doc.LoadFile()) { QMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } TiXmlHandle docHandle( &doc ); @@ -210,7 +210,7 @@ void joinNetworkGameDialogImpl::saveServerProfile() { QMessageBox::Close); } if(!doc.SaveFile()) { QMessageBox::warning(this, tr("Save Server-Profile-File Error"), - tr("Could not save server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } fillServerProfileList(); @@ -221,7 +221,7 @@ void joinNetworkGameDialogImpl::deleteServerProfile() { TiXmlDocument doc(myServerProfilesFile); if(!doc.LoadFile()) { QMessageBox::warning(this, tr("Load Server-Profile-File Error"), - tr("Could not load server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } else { @@ -232,7 +232,7 @@ void joinNetworkGameDialogImpl::deleteServerProfile() { if ( profile ) { profile->Parent()->RemoveChild(profile); } if(!doc.SaveFile()) { QMessageBox::warning(this, tr("Save Server-Profile-File Error"), - tr("Could not save server-profiles-file:\n"+QString::fromStdString(myServerProfilesFile).toAscii()), + tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()), QMessageBox::Close); } //Liste Füllen diff --git a/src/gui/qt/log/log.cpp b/src/gui/qt/log/log.cpp index 4d43923c..a48fe5d7 100644 --- a/src/gui/qt/log/log.cpp +++ b/src/gui/qt/log/log.cpp @@ -28,12 +28,12 @@ Log::Log(mainWindowImpl* w) : myW(w) myW->setLog(this); myConfig = new ConfigFile; - if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))).exists()) { + if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())).exists()) { #ifdef _WIN32 - myLogDir = new QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))); + myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())); #else - myLogDir = new QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))); + myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())); #endif myLogFile = new QFile(myLogDir->absolutePath()+"/pokerth-log-"+QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss")+".html"); @@ -45,6 +45,9 @@ Log::Log(mainWindowImpl* w) : myW(w) myLogFile->open( QIODevice::WriteOnly ); QTextStream stream( myLogFile ); stream << "\n"; + stream << "\n"; + stream << ""; + stream << "\n"; stream << "\n"; stream << "\n"; stream << "

Log-File for PokerTH Session started on "+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"

\n"; @@ -95,7 +98,7 @@ void Log::logPlayerActionMsg(string playerName, int action, int setValue) { int i; QString msg; - msg = QString::fromStdString(playerName); + msg = QString::fromUtf8(playerName.c_str()); switch (action) { @@ -160,12 +163,12 @@ void Log::logNewGameHandMsg(int gameID, int handID) { if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 1) { if(k==1) { stream << ", "; } k=1; - stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$"; + stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$"; } else { if(k==1) { stream << ", "; } k=1; - stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$"; + stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$"; } } } @@ -177,12 +180,12 @@ void Log::logNewGameHandMsg(int gameID, int handID) { if(myW->getActualHand()->getPlayerArray()[i]->getMyButton() == 3) { if(k==1) { stream << ", "; } k=1; - stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash(),10)+"$"; + stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$"; } else { if(k==1) { stream << ", "; } k=1; - stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[i]->getMyName())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$"; + stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(myW->getActualHand()->getPlayerArray()[i]->getMyCash()+myW->getActualHand()->getPlayerArray()[i]->getMySet(),10)+"$"; } } } @@ -202,9 +205,9 @@ void Log::logNewGameHandMsg(int gameID, int handID) { // cout << (i+myW->getActualHand()->getDealerPosition()+j)%5 << endl; switch (myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyButton()) { - case 2 : stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$), "; + case 2 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$), "; break; - case 3 : stream << QString::fromStdString(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$)"; + case 3 : stream << QString::fromUtf8(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMyName().c_str())+" ("+QString::number(myW->getActualHand()->getPlayerArray()[(i+myW->getActualHand()->getDealerPosition()+j)%myW->getMaxQuantityPlayers()]->getMySet(),10)+"$)"; break; default :; } @@ -228,12 +231,12 @@ void Log::logPlayerWinsMsg(int playerID, int pot) { for(i=0; i<=linesInFile; i++) { stream.readLine(); } // if (cardsValueInt != -1) { -// myW->textBrowser_Log->append(QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$ with "+translateCardsValueCode(cardsValueInt).at(0)+"!!! "); -// stream << "
"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"; +// myW->textBrowser_Log->append(QString::fromUtf8(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$ with "+translateCardsValueCode(cardsValueInt).at(0)+"!!! "); +// stream << "
"+QString::fromUtf8(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"; // } // else { - myW->textBrowser_Log->append(QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!! "); - stream << "
"+QString::fromStdString(myW->getActualHand()->getPlayerArray()[playerID]->getMyName())+" wins "+QString::number(pot,10)+"$!!!

\n"; + myW->textBrowser_Log->append(QString::fromUtf8(myW->getActualHand()->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!! "); + stream << "
"+QString::fromUtf8(myW->getActualHand()->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!!

\n"; // } myLogFile->close(); @@ -384,13 +387,13 @@ void Log::logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int default: {} } - myW->textBrowser_Log->append(QString::fromStdString(playerName)+" "+QString::fromStdString(showHas)+" \""+tempHandName+"\""); - stream << QString::fromStdString(playerName)+" "+QString::fromStdString(showHas)+" [ "+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"] - "+tempHandName+"
\n"; + myW->textBrowser_Log->append(QString::fromUtf8(playerName.c_str())+" "+QString::fromUtf8(showHas.c_str())+" \""+tempHandName+"\""); + stream << QString::fromUtf8(playerName.c_str())+" "+QString::fromUtf8(showHas.c_str())+" [ "+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"] - "+tempHandName+"
\n"; } else { - myW->textBrowser_Log->append(QString::fromStdString(playerName)+" "+QString::fromStdString(showHas)+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]"); - stream << QString::fromStdString(playerName)+" "+QString::fromStdString(showHas)+" ["+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"]"+"
\n"; + myW->textBrowser_Log->append(QString::fromUtf8(playerName.c_str())+" "+QString::fromUtf8(showHas.c_str())+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]"); + stream << QString::fromUtf8(playerName.c_str())+" "+QString::fromUtf8(showHas.c_str())+" ["+translateCardCode(card1).at(0)+""+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+""+translateCardCode(card2).at(1)+"]"+"
\n"; } myLogFile->close(); diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index 5b45723c..d1d79ad0 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -1347,6 +1347,9 @@ + + true + 40 @@ -1356,6 +1359,15 @@ + + + + 240 + 240 + 240 + + + @@ -1365,6 +1377,33 @@ + + + + 255 + 255 + 255 + + + + + + + 240 + 240 + 240 + + + + + + + 255 + 255 + 255 + + + @@ -1383,8 +1422,35 @@ + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + 240 + 240 + 240 + + + @@ -1394,6 +1460,33 @@ + + + + 255 + 255 + 255 + + + + + + + 240 + 240 + 240 + + + + + + + 255 + 255 + 255 + + + @@ -1412,8 +1505,35 @@ + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + 131 + 153 + 86 + + + @@ -1423,12 +1543,39 @@ + + + + 131 + 153 + 86 + + + + + + + 131 + 153 + 86 + + + + + + + 131 + 153 + 86 + + + - 128 - 128 - 128 + 131 + 153 + 86 @@ -1441,6 +1588,24 @@ + + + + 131 + 153 + 86 + + + + + + + 131 + 153 + 86 + + + diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index eefad2ca..55d752f9 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -58,19 +58,25 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) { int i; + //for statistic development + for(i=0; i<15; i++) { + statisticArray[i] = 0; + } + //////////////////////////// + myConfig = new ConfigFile; // Resourcen abladen QFile preflopValuesFile(":data/resources/data/preflopValues"); - QFile preflopValuesFileDest(QString::fromStdString(myConfig->readConfigString("DataDir")+"preflopValues")); + QFile preflopValuesFileDest(QString::fromUtf8(myConfig->readConfigString("DataDir").c_str())+QString("preflopValues")); // if(!preflopValuesFileDest.exists()) { - preflopValuesFile.copy(QString::fromStdString(myConfig->readConfigString("DataDir")+"preflopValues")); + preflopValuesFile.copy(QString::fromUtf8(myConfig->readConfigString("DataDir").c_str())+QString("preflopValues")); // } QFile flopValuesFile(":data/resources/data/flopValues"); - QFile flopValuesFileDest(QString::fromStdString(myConfig->readConfigString("DataDir")+"flopValues")); + QFile flopValuesFileDest(QString::fromUtf8(myConfig->readConfigString("DataDir").c_str())+QString("flopValues")); // if(!flopValuesFileDest.exists()) { - flopValuesFile.copy(QString::fromStdString(myConfig->readConfigString("DataDir")+"flopValues")); + flopValuesFile.copy(QString::fromUtf8(myConfig->readConfigString("DataDir").c_str())+QString("flopValues")); // } // Schriftart laden und für Dialoge setzen @@ -196,7 +202,7 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) flipside = new QPixmap(":/cards/resources/graphics/cards/flipside.png"); if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") { - QPixmap tmpFlipside(QString::fromStdString(myConfig->readConfigString("FlipsideOwnFile"))); + QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80))); } else { flipside->load(":/cards/resources/graphics/cards/flipside.png"); } @@ -727,7 +733,7 @@ void mainWindowImpl::callSettingsDialog() { //Flipside refresh if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") { - QPixmap tmpFlipside(QString::fromStdString(myConfig->readConfigString("FlipsideOwnFile"))); + QPixmap tmpFlipside(QString::fromUtf8(myConfig->readConfigString("FlipsideOwnFile").c_str())); flipside = new QPixmap(tmpFlipside.scaled(QSize(57, 80))); } else { flipside->load(":/cards/resources/graphics/cards/flipside.png"); } @@ -805,7 +811,7 @@ void mainWindowImpl::refreshPlayerName() { int i; for (i=0; igetPlayerArray()[i]->getMyActiveStatus()) { - playerNameLabelArray[i]->setText(QString::fromStdString(actualHand->getPlayerArray()[i]->getMyName())); + playerNameLabelArray[i]->setText(QString::fromUtf8(actualHand->getPlayerArray()[i]->getMyName().c_str())); } else { playerNameLabelArray[i]->setText(""); @@ -828,7 +834,7 @@ void mainWindowImpl::refreshPlayerAvatar() { playerAvatarLabelArray[0]->setPixmap(QPixmap(":/guiv2/resources/guiv2/genereticAvatar.png")); } else { - playerAvatarLabelArray[0]->setPixmap(QString::fromStdString(actualHand->getPlayerArray()[0]->getMyAvatar())); + playerAvatarLabelArray[0]->setPixmap(QString::fromUtf8(actualHand->getPlayerArray()[0]->getMyAvatar().c_str())); } } else { @@ -836,7 +842,7 @@ void mainWindowImpl::refreshPlayerAvatar() { playerAvatarLabelArray[i]->setPixmap(QPixmap(":/guiv2/resources/guiv2/genereticAvatar.png")); } else { - playerAvatarLabelArray[i]->setPixmap(QString::fromStdString(actualHand->getPlayerArray()[i]->getMyAvatar())); + playerAvatarLabelArray[i]->setPixmap(QString::fromUtf8(actualHand->getPlayerArray()[i]->getMyAvatar().c_str())); } } } @@ -1005,7 +1011,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) { void mainWindowImpl::highlightRoundLabel(string tempround) { - QString round (QString::fromStdString(tempround)); + QString round (QString::fromUtf8(tempround.c_str())); // für PostRiverRun (alte Runden stehen lassen) if(round != "") { @@ -1840,16 +1846,31 @@ void mainWindowImpl::postRiverRunAnimation5() { void mainWindowImpl::postRiverRunAnimation6() { int i; + refreshCash(); refreshPot(); // wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen int playersPositiveCashCounter = 0; for (i=0; igetStartQuantityPlayers(); i++) { +// cout << "player 0 cash: " << actualHand->getPlayerArray()[0]->getMyCash() - if (actualHand->getPlayerArray()[i]->getMyCash() > 0) playersPositiveCashCounter++; + if (actualHand->getPlayerArray()[i]->getMyCash() > 0) + playersPositiveCashCounter++; } if (playersPositiveCashCounter==1) { + +// for (i=0; igetStartQuantityPlayers(); i++) { +// // cout << "player 0 cash: " << actualHand->getPlayerArray()[0]->getMyCash() +// if (actualHand->getPlayerArray()[i]->getMyCash() > 0) { +// (statisticArray[actualHand->getPlayerArray()[i]->getMyDude4()+7])++; +// } +// } + +// for(i=0; i<15; i++) { +// cout << i-7 << ": " << statisticArray[i] << " | "; +// } +// cout << endl; callNewGameDialog(); //Bei Cancel nichts machen!!! diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 3587dc90..47cf6725 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -308,6 +308,9 @@ private: QColor inactive; QColor highlight; + // statistic testing + int statisticArray[15]; + friend class GuiWrapper; }; diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 958726ac..edd11f72 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -137,7 +137,7 @@ <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> +<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> true @@ -608,6 +608,13 @@ p, li { white-space: pre-wrap; } 6 + + + + Qt::Horizontal + + + @@ -620,6 +627,90 @@ p, li { white-space: pre-wrap; } 5 + + + + + + + 0 + + + 0 + + + + + + + + + 27 + 23 + + + + + 27 + 23 + + + + :/graphics/resources/graphics/fileopen16.png + + + + + + + + + Opponent 5: + + + + + + + Avatar: + + + + + + + 0 + + + 0 + + + + + + + + + 27 + 23 + + + + + 27 + 23 + + + + :/graphics/resources/graphics/fileopen16.png + + + + + + + + @@ -652,6 +743,149 @@ p, li { white-space: pre-wrap; } + + + + Opponent 3: + + + + + + + + + + 0 + + + 0 + + + + + + + + + 27 + 23 + + + + + 27 + 23 + + + + :/graphics/resources/graphics/fileopen16.png + + + + + + + + + + + + Avatar: + + + + + + + Avatar: + + + + + + + Opponent 2: + + + + + + + Avatar: + + + + + + + Opponent 6: + + + + + + + Avatar: + + + + + + + Opponent 1: + + + + + + + Opponent 4: + + + + + + + Avatar: + + + + + + + + + + 0 + + + 0 + + + + + + + + + 27 + 23 + + + + + 27 + 23 + + + + :/graphics/resources/graphics/fileopen16.png + + + + + @@ -684,259 +918,12 @@ p, li { white-space: pre-wrap; } - - - - 0 - - - 0 - - - - - - - - - 27 - 23 - - - - - 27 - 23 - - - - :/graphics/resources/graphics/fileopen16.png - - - - - - - - - 0 - - - 0 - - - - - - - - - 27 - 23 - - - - - 27 - 23 - - - - :/graphics/resources/graphics/fileopen16.png - - - - - - - - - 0 - - - 0 - - - - - - - - - 27 - 23 - - - - - 27 - 23 - - - - :/graphics/resources/graphics/fileopen16.png - - - - - - - - - 0 - - - 0 - - - - - - - - - 27 - 23 - - - - - 27 - 23 - - - - :/graphics/resources/graphics/fileopen16.png - - - - - - - - - Avatar: - - - - - - - Avatar: - - - - - - - Avatar: - - - - - - - Avatar: - - - - - - - Avatar: - - - - - - - Avatar: - - - - - - - - - - - - - - - - - - - - - - Opponent 2: - - - - - - - Opponent 3: - - - - - - - Opponent 4: - - - - - - - Opponent 1: - - - - - - - Opponent 5: - - - - - - - Opponent 6: - - - - - - - Qt::Vertical - - - - 295 - 51 - - - - - - - - Qt::Horizontal - - - @@ -996,6 +983,19 @@ p, li { white-space: pre-wrap; } + + + + Qt::Vertical + + + + 295 + 51 + + + + @@ -1009,6 +1009,16 @@ p, li { white-space: pre-wrap; } + + + + <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=50, height=50.</span></p></body></html> + + + @@ -1206,6 +1216,57 @@ p, li { white-space: pre-wrap; } listWidget + checkBox_showIntro + checkBox_showLeftToolbox + checkBox_showRightToolbox + checkBox_showStatusbarMessages + checkBox_showFadeOutCardsAnimation + checkBox_showFlipCardsAnimation + radioButton_flipsideTux + radioButton_flipsideOwn + lineEdit_OwnFlipsideFilename + pushButton_openFlipsidePicture + spinBox_quantityPlayers + spinBox_startCash + spinBox_smallBlind + spinBox_handsBeforeRaiseSmallBlind + spinBox_gameSpeed + comboBox_engineVersion + checkBox_pauseBetweenHands + checkBox_showGameSettingsDialogOnNewGame + spinBox_netQuantityPlayers + spinBox_netStartCash + spinBox_netSmallBlind + spinBox_netHandsBeforeRaiseSmallBlind + spinBox_netGameSpeed + comboBox_netEngineVersion + spinBox_serverPort + lineEdit_serverPassword + checkBox_useIpv6 + lineEdit_humanPlayerName + lineEdit_humanPlayerAvatar + pushButton_openAvatarFile0 + lineEdit_Opponent1Name + lineEdit_Opponent1Avatar + pushButton_openAvatarFile1 + lineEdit_Opponent2Name + lineEdit_Opponent2Avatar + pushButton_openAvatarFile2 + lineEdit_Opponent3Name + lineEdit_Opponent3Avatar + pushButton_openAvatarFile3 + lineEdit_Opponent4Name + lineEdit_Opponent4Avatar + pushButton_openAvatarFile4 + lineEdit_Opponent5Name + lineEdit_Opponent5Avatar + pushButton_openAvatarFile5 + lineEdit_Opponent6Name + lineEdit_Opponent6Avatar + pushButton_openAvatarFile6 + lineEdit_logDir + pushButton_openLogDir + spinBox_logStoreDuration buttonBox diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index ccb0bd90..38b389bb 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -38,20 +38,20 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent) ConfigFile myConfig; //Player Nicks - lineEdit_humanPlayerName->setText(QString::fromStdString(myConfig.readConfigString("MyName"))); - lineEdit_humanPlayerAvatar->setText(QString::fromStdString(myConfig.readConfigString("MyAvatar"))); - lineEdit_Opponent1Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent1Name"))); - lineEdit_Opponent1Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent1Avatar"))); - lineEdit_Opponent2Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent2Name"))); - lineEdit_Opponent2Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent2Avatar"))); - lineEdit_Opponent3Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent3Name"))); - lineEdit_Opponent3Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent3Avatar"))); - lineEdit_Opponent4Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent4Name"))); - lineEdit_Opponent4Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent4Avatar"))); - lineEdit_Opponent5Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent5Name"))); - lineEdit_Opponent5Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent5Avatar"))); - lineEdit_Opponent6Name->setText(QString::fromStdString(myConfig.readConfigString("Opponent6Name"))); - lineEdit_Opponent6Avatar->setText(QString::fromStdString(myConfig.readConfigString("Opponent6Avatar"))); + lineEdit_humanPlayerName->setText(QString::fromUtf8(myConfig.readConfigString("MyName").c_str())); + lineEdit_humanPlayerAvatar->setText(QString::fromUtf8(myConfig.readConfigString("MyAvatar").c_str())); + lineEdit_Opponent1Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent1Name").c_str())); + lineEdit_Opponent1Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent1Avatar").c_str())); + lineEdit_Opponent2Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent2Name").c_str())); + lineEdit_Opponent2Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent2Avatar").c_str())); + lineEdit_Opponent3Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent3Name").c_str())); + lineEdit_Opponent3Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent3Avatar").c_str())); + lineEdit_Opponent4Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent4Name").c_str())); + lineEdit_Opponent4Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent4Avatar").c_str())); + lineEdit_Opponent5Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent5Name").c_str())); + lineEdit_Opponent5Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent5Avatar").c_str())); + lineEdit_Opponent6Name->setText(QString::fromUtf8(myConfig.readConfigString("Opponent6Name").c_str())); + lineEdit_Opponent6Avatar->setText(QString::fromUtf8(myConfig.readConfigString("Opponent6Avatar").c_str())); //Local Game Settings spinBox_quantityPlayers->setValue(myConfig.readConfigInt("NumberOfPlayers")); @@ -71,7 +71,7 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent) spinBox_netGameSpeed->setValue(myConfig.readConfigInt("NetGameSpeed")); comboBox_netEngineVersion->setCurrentIndex(myConfig.readConfigInt("NetEngineVersion")); spinBox_serverPort->setValue(myConfig.readConfigInt("ServerPort")); - lineEdit_serverPassword->setText(QString::fromStdString(myConfig.readConfigString("ServerPassword"))); + lineEdit_serverPassword->setText(QString::fromUtf8(myConfig.readConfigString("ServerPassword").c_str())); checkBox_useIpv6->setChecked(myConfig.readConfigInt("ServerUseIpv6")); @@ -88,10 +88,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent) lineEdit_OwnFlipsideFilename->setEnabled(TRUE); pushButton_openFlipsidePicture->setEnabled(TRUE); } - lineEdit_OwnFlipsideFilename->setText(QString::fromStdString(myConfig.readConfigString("FlipsideOwnFile"))); + lineEdit_OwnFlipsideFilename->setText(QString::fromUtf8(myConfig.readConfigString("FlipsideOwnFile").c_str())); //Log - lineEdit_logDir->setText(QString::fromStdString(myConfig.readConfigString("LogDir"))); + lineEdit_logDir->setText(QString::fromUtf8(myConfig.readConfigString("LogDir").c_str())); spinBox_logStoreDuration->setValue(myConfig.readConfigInt("LogStoreDuration")); connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) ); diff --git a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp index 4c5a9b5a..dc42e234 100644 --- a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp +++ b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.cpp @@ -44,7 +44,7 @@ void startNetworkGameDialogImpl::cancel() { void startNetworkGameDialogImpl::addConnectedPlayer(std::string playerName) { QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget,0); - item->setData(0, 0, QString::fromStdString(playerName)); + item->setData(0, 0, QString::fromUtf8(playerName.c_str())); } void startNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {