Commit 358adb3c authored by mercury233's avatar mercury233 Committed by GitHub

Merge pull request #1948 from mercury233/patch-1

update command line parameters
parents f4ace22c 5a92cb1d
...@@ -94,19 +94,30 @@ int main(int argc, char* argv[]) { ...@@ -94,19 +94,30 @@ int main(int argc, char* argv[]) {
} else if(!strcmp(argv[i], "-k")) { // Keep on return } else if(!strcmp(argv[i], "-k")) { // Keep on return
exit_on_return = false; exit_on_return = false;
keep_on_return = true; keep_on_return = true;
} else if(!strcmp(argv[i], "-d")) { // Deck
if(i + 2 < argc) { // select deck
++i;
GetParameterW(ygo::mainGame->gameConf.lastdeck, &argv[i][0]);
continue;
} else { // open deck
exit_on_return = !keep_on_return;
if(i < argc) {
open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]);
}
ClickButton(ygo::mainGame->btnDeckEdit);
break;
}
} else if(!strcmp(argv[i], "-c")) { // Create host
exit_on_return = !keep_on_return;
ygo::mainGame->HideElement(ygo::mainGame->wMainMenu);
ClickButton(ygo::mainGame->btnHostConfirm);
break;
} else if(!strcmp(argv[i], "-j")) { // Join host } else if(!strcmp(argv[i], "-j")) { // Join host
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
ClickButton(ygo::mainGame->btnLanMode); ClickButton(ygo::mainGame->btnLanMode);
ClickButton(ygo::mainGame->btnJoinHost); ClickButton(ygo::mainGame->btnJoinHost);
break; break;
} else if(!strcmp(argv[i], "-d")) { // Deck
exit_on_return = !keep_on_return;
if(i < argc) {
open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]);
}
ClickButton(ygo::mainGame->btnDeckEdit);
break;
} else if(!strcmp(argv[i], "-r")) { // Replay } else if(!strcmp(argv[i], "-r")) { // Replay
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
if(i < argc) { if(i < argc) {
......
...@@ -57,8 +57,13 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -57,8 +57,13 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame->dInfo.clientname[0] = 0; mainGame->dInfo.clientname[0] = 0;
mainGame->dInfo.turn = 0; mainGame->dInfo.turn = 0;
if(!preload_script(pduel, fname2, slen)) { if(!preload_script(pduel, fname2, slen)) {
end_duel(pduel); wchar_t fname[256];
return 0; myswprintf(fname, L"./single/%ls", open_file_name);
slen = BufferIO::EncodeUTF8(fname, fname2);
if(!preload_script(pduel, fname2, slen)) {
end_duel(pduel);
return 0;
}
} }
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->HideElement(mainGame->wSinglePlay); mainGame->HideElement(mainGame->wSinglePlay);
......
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