Commit 041373ab authored by salix5's avatar salix5

Merge pull request #1605 from DailyShana/patch-2

fix -j argument
parents 3966279c f9b921e0
...@@ -70,6 +70,8 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) { ...@@ -70,6 +70,8 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
mainGame->btnJoinHost->setEnabled(true); mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(!mainGame->wLanWindow->isVisible())
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400));
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} }
...@@ -138,6 +140,8 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) { ...@@ -138,6 +140,8 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame->btnJoinHost->setEnabled(true); mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(!mainGame->wLanWindow->isVisible())
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1400));
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} else if(connect_state == 0x7) { } else if(connect_state == 0x7) {
......
...@@ -34,9 +34,7 @@ int main(int argc, char* argv[]) { ...@@ -34,9 +34,7 @@ int main(int argc, char* argv[]) {
event.EventType = irr::EET_GUI_EVENT; event.EventType = irr::EET_GUI_EVENT;
event.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED; event.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED;
if(!strcmp(argv[i], "-j")) { if(!strcmp(argv[i], "-j")) {
event.GUIEvent.Caller = ygo::mainGame->btnLanMode; ygo::mainGame->HideElement(ygo::mainGame->wMainMenu);
ygo::mainGame->device->postEventFromUser(event);
//TODO: wait for wLanWindow show. if network connection faster than wLanWindow, wLanWindow will still show on duel scene.
event.GUIEvent.Caller = ygo::mainGame->btnJoinHost; event.GUIEvent.Caller = ygo::mainGame->btnJoinHost;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
} else if(!strcmp(argv[i], "-d")) { } else if(!strcmp(argv[i], "-d")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment