1364 hwnet = new HWNewNet(); |
1364 hwnet = new HWNewNet(); |
1365 |
1365 |
1366 GoToPage(ID_PAGE_CONNECTING); |
1366 GoToPage(ID_PAGE_CONNECTING); |
1367 |
1367 |
1368 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection); |
1368 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()), Qt::QueuedConnection); |
|
1369 connect(hwnet, SIGNAL(AskForOfficialServerDemo()), this, SLOT(PlayOfficialServerDemo()), Qt::QueuedConnection); |
1369 connect(hwnet, SIGNAL(redirected(quint16)), this, SLOT(NetRedirected(quint16)), Qt::QueuedConnection); |
1370 connect(hwnet, SIGNAL(redirected(quint16)), this, SLOT(NetRedirected(quint16)), Qt::QueuedConnection); |
1370 connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection); |
1371 connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection); |
1371 connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection); |
1372 connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection); |
1372 connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection); |
1373 connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection); |
1373 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection); |
1374 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection); |
1922 connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection); |
1923 connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection); |
1923 connect(hwnet, SIGNAL(Warning(const QString&)), game, SLOT(FromNetWarning(const QString&)), Qt::QueuedConnection); |
1924 connect(hwnet, SIGNAL(Warning(const QString&)), game, SLOT(FromNetWarning(const QString&)), Qt::QueuedConnection); |
1924 connect(hwnet, SIGNAL(Error(const QString&)), game, SLOT(FromNetError(const QString&)), Qt::QueuedConnection); |
1925 connect(hwnet, SIGNAL(Error(const QString&)), game, SLOT(FromNetError(const QString&)), Qt::QueuedConnection); |
1925 |
1926 |
1926 game->StartNet(); |
1927 game->StartNet(); |
|
1928 } |
|
1929 |
|
1930 void HWForm::PlayOfficialServerDemo() |
|
1931 { |
|
1932 // go back in pages to prevent user from being stuck on certain pages |
|
1933 if(ui.Pages->currentIndex() == ID_PAGE_GAMESTATS || |
|
1934 ui.Pages->currentIndex() == ID_PAGE_INGAME) |
|
1935 GoBack(); |
|
1936 |
|
1937 QString ammo; |
|
1938 ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData( |
|
1939 ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() |
|
1940 ).toString(); |
|
1941 |
|
1942 CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); |
|
1943 |
|
1944 game->PlayOfficialServerDemo(); |
1927 } |
1945 } |
1928 |
1946 |
1929 void HWForm::closeEvent(QCloseEvent *event) |
1947 void HWForm::closeEvent(QCloseEvent *event) |
1930 { |
1948 { |
1931 config->SaveOptions(); |
1949 config->SaveOptions(); |