set minimum gui speed to prevent gui lags in fast internet games
This commit is contained in:
@@ -687,6 +687,10 @@ void gameTableImpl::initGui(int speed)
|
|||||||
userWidgetsArray[i]->show();
|
userWidgetsArray[i]->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set minimum gui speed to prevent gui lags on fast inet games
|
||||||
|
if( myStartWindow->getSession()->isNetworkClientRunning() ) { horizontalSlider_speed->setMinimum(speed); }
|
||||||
|
else { horizontalSlider_speed->setMinimum(1); }
|
||||||
|
|
||||||
//set speeds for local game and for first network game
|
//set speeds for local game and for first network game
|
||||||
if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) {
|
if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) {
|
||||||
|
|
||||||
|
|||||||
@@ -521,8 +521,12 @@ ClientThread::InitGame()
|
|||||||
if (GetPlayerDataList().size() != (unsigned)GetStartData().numberOfPlayers)
|
if (GetPlayerDataList().size() != (unsigned)GetStartData().numberOfPlayers)
|
||||||
throw ClientException(__FILE__, __LINE__, ERR_NET_INVALID_PLAYER_COUNT, 0);
|
throw ClientException(__FILE__, __LINE__, ERR_NET_INVALID_PLAYER_COUNT, 0);
|
||||||
m_game.reset(new Game(&m_gui, factory, GetPlayerDataList(), GetGameData(), GetStartData(), m_curGameNum++));
|
m_game.reset(new Game(&m_gui, factory, GetPlayerDataList(), GetGameData(), GetStartData(), m_curGameNum++));
|
||||||
// Initialize GUI speed.
|
// Initialize Minimum GUI speed.
|
||||||
GetGui().initGui(GetGameData().guiSpeed);
|
int minimumGuiSpeed = 1;
|
||||||
|
if(GetGameData().delayBetweenHandsSec < 11) {
|
||||||
|
minimumGuiSpeed = 12-GetGameData().delayBetweenHandsSec;
|
||||||
|
}
|
||||||
|
GetGui().initGui(minimumGuiSpeed);
|
||||||
// Signal start of game to GUI.
|
// Signal start of game to GUI.
|
||||||
GetCallback().SignalNetClientGameStart(m_game);
|
GetCallback().SignalNetClientGameStart(m_game);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user