Commit d619f487 authored by IMJoyJ's avatar IMJoyJ Committed by nanahira

Improve replay playing behavior in auto watch mode (#18)

parent ad025c77
......@@ -80,6 +80,7 @@
.vscode
core*
/bak/
/.vs
/bug.txt
/output
/temp
......@@ -90,3 +91,6 @@ core*
/*.bat
/*.sh
/*.sql
/patch.exe.manifest
/patch.exe
/diff.exe
......@@ -62,4 +62,4 @@ Xyz materials:
* textures: Other image files.
* deck: .ydk deck files.
* replay: .yrp replay files.
* expansions: *.cdb will be loaded as extra databases.
* expansions: *.cdb will be loaded as extra databases.
\ No newline at end of file
......@@ -984,7 +984,7 @@ void Game::DrawSpec() {
break;
}
}
if (auto_watch_mode && showcardcode < 8 && showcardcode > 0) {
if (auto_watch_mode && showcardp < 8 && showcardp > 0 && showcardcode > 100) {
mainGame->ShowCardInfo(showcardcode);
}
}
......
......@@ -3033,8 +3033,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
if (auto_watch_mode) {
int code = mainGame->dField.chains[ct - 1].chain_card->code;
if (code > 0)
mainGame->ShowCardInfo(code);
mainGame->ShowCardInfo(code);
}
mainGame->dField.last_chain = false;
return true;
......@@ -3106,7 +3105,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int s = BufferIO::ReadInt8(pbuf);
/*int ss = */BufferIO::ReadInt8(pbuf);
ClientCard* pcard = mainGame->dField.GetCard(c, l, s);
if (auto_watch_mode && i == 0 && pcard->code > 0 ) {
if (auto_watch_mode && i == 0) {
mainGame->ShowCardInfo(pcard->code);
}
pcard->is_highlighting = true;
......
......@@ -238,7 +238,13 @@ void ReplayMode::EndDuel() {
mainGame->HideElement(mainGame->wCardSelect);
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.unlock();
mainGame->actionSignal.Wait();
if(auto_watch_mode) {
mainGame->actionSignal.Wait(2000);
mainGame->device->closeDevice();
}
else {
mainGame->actionSignal.Wait();
}
mainGame->gMutex.lock();
mainGame->dInfo.isStarted = false;
mainGame->dInfo.isFinished = true;
......
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