mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Add debug setting to start local game on startup (#5408)
* new properties * refactor * start local game on startup * disable autoconnect
This commit is contained in:
parent
bb4214e28a
commit
8a427955e7
4 changed files with 26 additions and 1 deletions
|
|
@ -223,6 +223,11 @@ void MainWindow::actSinglePlayer()
|
|||
if (!ok)
|
||||
return;
|
||||
|
||||
startLocalGame(numberPlayers);
|
||||
}
|
||||
|
||||
void MainWindow::startLocalGame(int numberPlayers)
|
||||
{
|
||||
aConnect->setEnabled(false);
|
||||
aRegister->setEnabled(false);
|
||||
aForgotPassword->setEnabled(false);
|
||||
|
|
@ -881,6 +886,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
|
||||
void MainWindow::startupConfigCheck()
|
||||
{
|
||||
if (SettingsCache::instance().debug().getLocalGameOnStartup()) {
|
||||
startLocalGame(SettingsCache::instance().debug().getLocalGamePlayerCount());
|
||||
}
|
||||
|
||||
if (SettingsCache::instance().getCheckUpdatesOnStartup()) {
|
||||
actCheckClientUpdates();
|
||||
}
|
||||
|
|
@ -1021,7 +1030,8 @@ void MainWindow::changeEvent(QEvent *event)
|
|||
if (!connectTo.isEmpty()) {
|
||||
qDebug() << "Command line connect to " << connectTo;
|
||||
client->connectToServer(connectTo.host(), connectTo.port(), connectTo.userName(), connectTo.password());
|
||||
} else if (SettingsCache::instance().servers().getAutoConnect()) {
|
||||
} else if (SettingsCache::instance().servers().getAutoConnect() &&
|
||||
!SettingsCache::instance().debug().getLocalGameOnStartup()) {
|
||||
qDebug() << "Attempting auto-connect...";
|
||||
DlgConnect dlg(this);
|
||||
client->connectToServer(dlg.getHost(), static_cast<unsigned int>(dlg.getPort()), dlg.getPlayerName(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue