Commit 2500d50a authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents 6aef8b12 3e2be30d
......@@ -579,7 +579,7 @@ void Game::DrawMisc() {
driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * partialLP / maxLP, 12, 986, 28), recti(0, fgColorPos * 16, 16, (fgColorPos + 1) * 16), 0, 0, true);
}
}
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / dInfo.start_lp, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / maxLP, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
}
if(lpframe) {
dInfo.lp[lpplayer] -= lpd;
......
......@@ -2390,7 +2390,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
mainGame->WaitFrameSignal(5);
}
if (panel_confirm.size() && !auto_watch_mode) {
if (panel_confirm.size() && mainGame->dInfo.player_type != 7 && !auto_watch_mode && ) {
std::sort(panel_confirm.begin(), panel_confirm.end(), ClientCard::client_card_sort);
mainGame->gMutex.lock();
mainGame->dField.selectable_cards = panel_confirm;
......
......@@ -111,10 +111,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case BUTTON_HOST_CONFIRM: {
bot_mode = false;
BufferIO::CopyWStr(mainGame->ebServerName->getText(), mainGame->gameConf.gamename, 20);
if(!NetServer::StartServer(mainGame->gameConf.serverport))
if(!NetServer::StartServer(mainGame->gameConf.serverport)) {
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
if(!DuelClient::StartClient(0x7f000001, mainGame->gameConf.serverport)) {
NetServer::StopServer();
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
mainGame->btnHostConfirm->setEnabled(false);
......@@ -154,6 +159,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case BUTTON_HP_READY: {
if(mainGame->cbCategorySelect->getSelected() == -1 || mainGame->cbDeckSelect->getSelected() == -1 ||
!deckManager.LoadDeck(mainGame->cbCategorySelect, mainGame->cbDeckSelect)) {
mainGame->gMutex.lock();
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1406));
mainGame->gMutex.unlock();
break;
}
UpdateDeck();
......@@ -308,10 +317,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
bot_mode = true;
#ifdef _WIN32
if(!NetServer::StartServer(mainGame->gameConf.serverport))
if(!NetServer::StartServer(mainGame->gameConf.serverport)) {
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
if(!DuelClient::StartClient(0x7f000001, mainGame->gameConf.serverport)) {
NetServer::StopServer();
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
STARTUPINFOW si;
......@@ -358,10 +372,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
execl("./bot", "bot", arg1, arg2, arg3, NULL);
exit(0);
} else {
if(!NetServer::StartServer(mainGame->gameConf.serverport))
if(!NetServer::StartServer(mainGame->gameConf.serverport)) {
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
if(!DuelClient::StartClient(0x7f000001, mainGame->gameConf.serverport)) {
NetServer::StopServer();
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1402));
break;
}
}
......@@ -596,7 +615,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
if(static_cast<irr::gui::IGUICheckBox*>(caller)->isChecked()) {
if(mainGame->cbCategorySelect->getSelected() == -1 || mainGame->cbDeckSelect->getSelected() == -1 ||
!deckManager.LoadDeck(mainGame->cbCategorySelect, mainGame->cbDeckSelect)) {
mainGame->gMutex.lock();
static_cast<irr::gui::IGUICheckBox*>(caller)->setChecked(false);
soundManager.PlaySoundEffect(SOUND_INFO);
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1406));
mainGame->gMutex.unlock();
break;
}
UpdateDeck();
......
This diff is collapsed.
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