Commit 263ca88a authored by nanahira's avatar nanahira

merge

parents 67562b12 a5ab7da1
...@@ -719,11 +719,22 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -719,11 +719,22 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
wchar_t timetext[80]; wchar_t timetext[80];
mbstowcs(timetext, timebuf, size); mbstowcs(timetext, timebuf, size);
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
if(!mainGame->chkAutoSaveReplay->isChecked()) {
mainGame->wReplaySave->setText(dataManager.GetSysString(1340)); mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave); mainGame->PopupElement(mainGame->wReplaySave);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->replaySignal.Reset(); mainGame->replaySignal.Reset();
mainGame->replaySignal.Wait(); mainGame->replaySignal.Wait();
}
else {
mainGame->actionParam = 1;
wchar_t msgbuf[256];
myswprintf(msgbuf, dataManager.GetSysString(1376), timetext);
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->textFont, msgbuf);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam || !is_host) { if(mainGame->actionParam || !is_host) {
char* prep = pdata; char* prep = pdata;
Replay new_replay; Replay new_replay;
......
...@@ -305,7 +305,10 @@ bool Game::Initialize() { ...@@ -305,7 +305,10 @@ bool Game::Initialize() {
posY += 30; posY += 30;
chkQuickAnimation = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, CHECKBOX_QUICK_ANIMATION, dataManager.GetSysString(1299)); chkQuickAnimation = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, CHECKBOX_QUICK_ANIMATION, dataManager.GetSysString(1299));
chkQuickAnimation->setChecked(gameConf.quick_animation != 0); chkQuickAnimation->setChecked(gameConf.quick_animation != 0);
elmTabHelperLast = chkQuickAnimation; posY += 30;
chkAutoSaveReplay = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1375));
chkAutoSaveReplay->setChecked(gameConf.auto_save_replay != 0);
elmTabHelperLast = chkAutoSaveReplay;
//system //system
irr::gui::IGUITab* _tabSystem = wInfos->addTab(dataManager.GetSysString(1273)); irr::gui::IGUITab* _tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
_tabSystem->setRelativePosition(recti(16, 49, 299, 362)); _tabSystem->setRelativePosition(recti(16, 49, 299, 362));
...@@ -1216,6 +1219,7 @@ void Game::LoadConfig() { ...@@ -1216,6 +1219,7 @@ void Game::LoadConfig() {
gameConf.defaultOT = 1; gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 1; gameConf.enable_bot_mode = 1;
gameConf.quick_animation = 0; gameConf.quick_animation = 0;
gameConf.auto_save_replay = 0;
gameConf.enable_sound = true; gameConf.enable_sound = true;
gameConf.sound_volume = 0.5; gameConf.sound_volume = 0.5;
gameConf.enable_music = true; gameConf.enable_music = true;
...@@ -1304,6 +1308,8 @@ void Game::LoadConfig() { ...@@ -1304,6 +1308,8 @@ void Game::LoadConfig() {
gameConf.window_height = atoi(valbuf); gameConf.window_height = atoi(valbuf);
} else if(!strcmp(strbuf, "resize_popup_menu")) { } else if(!strcmp(strbuf, "resize_popup_menu")) {
gameConf.resize_popup_menu = atoi(valbuf) > 0; gameConf.resize_popup_menu = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "auto_save_replay")) {
gameConf.auto_save_replay = atoi(valbuf);
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_IRRKLANG
} else if(!strcmp(strbuf, "enable_sound")) { } else if(!strcmp(strbuf, "enable_sound")) {
gameConf.enable_sound = atoi(valbuf) > 0; gameConf.enable_sound = atoi(valbuf) > 0;
...@@ -1418,6 +1424,8 @@ void Game::LoadConfig() { ...@@ -1418,6 +1424,8 @@ void Game::LoadConfig() {
gameConf.window_height = atoi(valbuf); gameConf.window_height = atoi(valbuf);
} else if(!strcmp(strbuf, "resize_popup_menu")) { } else if(!strcmp(strbuf, "resize_popup_menu")) {
gameConf.resize_popup_menu = atoi(valbuf) > 0; gameConf.resize_popup_menu = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "auto_save_replay")) {
gameConf.auto_save_replay = atoi(valbuf);
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_IRRKLANG
} else if(!strcmp(strbuf, "enable_sound")) { } else if(!strcmp(strbuf, "enable_sound")) {
gameConf.enable_sound = atoi(valbuf) > 0; gameConf.enable_sound = atoi(valbuf) > 0;
...@@ -1538,6 +1546,7 @@ void Game::SaveConfig() { ...@@ -1538,6 +1546,7 @@ void Game::SaveConfig() {
fprintf(fp, "window_width = %d\n", gameConf.window_width); fprintf(fp, "window_width = %d\n", gameConf.window_width);
fprintf(fp, "window_height = %d\n", gameConf.window_height); fprintf(fp, "window_height = %d\n", gameConf.window_height);
fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0); fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0);
fprintf(fp, "auto_save_replay = %d\n", (chkAutoSaveReplay->isChecked() ? 1 : 0));
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_IRRKLANG
fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0)); fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0));
fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0)); fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0));
......
...@@ -46,10 +46,14 @@ struct Config { ...@@ -46,10 +46,14 @@ struct Config {
int defaultOT; int defaultOT;
int enable_bot_mode; int enable_bot_mode;
int quick_animation; int quick_animation;
<<<<<<< HEAD
bool window_maximized; bool window_maximized;
int window_width; int window_width;
int window_height; int window_height;
bool resize_popup_menu; bool resize_popup_menu;
=======
int auto_save_replay;
>>>>>>> a5ab7da15d69d9d2f622551c053ae64081f9e1d4
bool enable_sound; bool enable_sound;
bool enable_music; bool enable_music;
double sound_volume; double sound_volume;
...@@ -292,9 +296,13 @@ public: ...@@ -292,9 +296,13 @@ public:
irr::gui::IGUICheckBox* chkAutoChain; irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain; irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkQuickAnimation; irr::gui::IGUICheckBox* chkQuickAnimation;
<<<<<<< HEAD
irr::gui::IGUIWindow* tabSystem; irr::gui::IGUIWindow* tabSystem;
irr::gui::IGUIElement* elmTabSystemLast; irr::gui::IGUIElement* elmTabSystemLast;
irr::gui::IGUIScrollBar* scrTabSystem; irr::gui::IGUIScrollBar* scrTabSystem;
=======
irr::gui::IGUICheckBox* chkAutoSaveReplay;
>>>>>>> a5ab7da15d69d9d2f622551c053ae64081f9e1d4
irr::gui::IGUICheckBox* chkHideSetname; irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideHintButton; irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUICheckBox* chkIgnoreDeckChanges; irr::gui::IGUICheckBox* chkIgnoreDeckChanges;
......
...@@ -140,11 +140,21 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -140,11 +140,21 @@ int SingleMode::SinglePlayThread(void* param) {
wchar_t timetext[80]; wchar_t timetext[80];
mbstowcs(timetext, timebuf, size); mbstowcs(timetext, timebuf, size);
mainGame->ebRSName->setText(timetext); mainGame->ebRSName->setText(timetext);
if(!mainGame->chkAutoSaveReplay->isChecked()) {
mainGame->wReplaySave->setText(dataManager.GetSysString(1340)); mainGame->wReplaySave->setText(dataManager.GetSysString(1340));
mainGame->PopupElement(mainGame->wReplaySave); mainGame->PopupElement(mainGame->wReplaySave);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->replaySignal.Reset(); mainGame->replaySignal.Reset();
mainGame->replaySignal.Wait(); mainGame->replaySignal.Wait();
} else {
mainGame->actionParam = 1;
wchar_t msgbuf[256];
myswprintf(msgbuf, dataManager.GetSysString(1376), timetext);
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->textFont, msgbuf);
mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.Unlock();
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam) if(mainGame->actionParam)
last_replay.SaveReplay(mainGame->ebRSName->getText()); last_replay.SaveReplay(mainGame->ebRSName->getText());
end_duel(pduel); end_duel(pduel);
......
...@@ -404,6 +404,8 @@ ...@@ -404,6 +404,8 @@
!system 1372 守备↑ !system 1372 守备↑
!system 1373 名称↓ !system 1373 名称↓
!system 1374 连接标记 !system 1374 连接标记
!system 1375 自动保存录像
!system 1376 录像已自动保存为%ls.yrp
!system 1377 使用多个关键词搜索卡片 !system 1377 使用多个关键词搜索卡片
!system 1380 人机模式 !system 1380 人机模式
!system 1381 残局模式 !system 1381 残局模式
......
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