Commit 62357ac3 authored by nanahira's avatar nanahira

updatedef

parent 679567da
...@@ -2046,7 +2046,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2046,7 +2046,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#ifdef _WIN32 #ifdef YGOPRO_USE_IRRKLANG
case SCROLL_VOLUME: { case SCROLL_VOLUME: {
mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100; mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100;
mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100; mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100;
......
...@@ -283,6 +283,7 @@ bool Game::Initialize() { ...@@ -283,6 +283,7 @@ bool Game::Initialize() {
chkAutoSearch = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, CHECKBOX_AUTO_SEARCH, dataManager.GetSysString(1358)); chkAutoSearch = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, CHECKBOX_AUTO_SEARCH, dataManager.GetSysString(1358));
chkAutoSearch->setChecked(gameConf.auto_search_limit >= 0); chkAutoSearch->setChecked(gameConf.auto_search_limit >= 0);
posY += 30; posY += 30;
#ifdef YGOPRO_USE_IRRKLANG
chkEnableSound = env->addCheckBox(gameConf.enable_sound, rect<s32>(posX, posY, posX + 120, posY + 25), tabSystem, -1, dataManager.GetSysString(1279)); chkEnableSound = env->addCheckBox(gameConf.enable_sound, rect<s32>(posX, posY, posX + 120, posY + 25), tabSystem, -1, dataManager.GetSysString(1279));
chkEnableSound->setChecked(gameConf.enable_sound); chkEnableSound->setChecked(gameConf.enable_sound);
scrSoundVolume = env->addScrollBar(true, rect<s32>(posX + 126, posY + 4, posX + 260, posY + 21), tabSystem, SCROLL_VOLUME); scrSoundVolume = env->addScrollBar(true, rect<s32>(posX + 126, posY + 4, posX + 260, posY + 21), tabSystem, SCROLL_VOLUME);
...@@ -303,6 +304,7 @@ bool Game::Initialize() { ...@@ -303,6 +304,7 @@ bool Game::Initialize() {
posY += 30; posY += 30;
chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1281)); chkMusicMode = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1281));
chkMusicMode->setChecked(gameConf.music_mode != 0); chkMusicMode->setChecked(gameConf.music_mode != 0);
#endif
// //
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L""); wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false); wHand->getCloseButton()->setVisible(false);
...@@ -678,12 +680,6 @@ bool Game::Initialize() { ...@@ -678,12 +680,6 @@ bool Game::Initialize() {
chkEnableMusic->setEnabled(false); chkEnableMusic->setEnabled(false);
chkMusicMode->setEnabled(false); chkMusicMode->setEnabled(false);
} }
#else
chkEnableSound->setChecked(false);
chkEnableSound->setEnabled(false);
chkEnableMusic->setChecked(false);
chkEnableMusic->setEnabled(false);
chkMusicMode->setEnabled(false);
#endif #endif
hideChat = false; hideChat = false;
hideChatTimer = 0; hideChatTimer = 0;
...@@ -995,6 +991,7 @@ void Game::RefreshBGMList() { ...@@ -995,6 +991,7 @@ void Game::RefreshBGMList() {
RefershBGMDir(L"lose/", BGM_LOSE); RefershBGMDir(L"lose/", BGM_LOSE);
} }
void Game::RefershBGMDir(std::wstring path, int scene) { void Game::RefershBGMDir(std::wstring path, int scene) {
#ifdef YGOPRO_USE_IRRKLANG
#ifdef _WIN32 #ifdef _WIN32
WIN32_FIND_DATAW fdataw; WIN32_FIND_DATAW fdataw;
std::wstring search = L"./sound/BGM/" + path + L"*.mp3"; std::wstring search = L"./sound/BGM/" + path + L"*.mp3";
...@@ -1024,6 +1021,7 @@ void Game::RefershBGMDir(std::wstring path, int scene) { ...@@ -1024,6 +1021,7 @@ void Game::RefershBGMDir(std::wstring path, int scene) {
} }
closedir(dir); closedir(dir);
#endif #endif
#endif
} }
void Game::RefreshBot() { void Game::RefreshBot() {
if(!gameConf.enable_bot_mode) if(!gameConf.enable_bot_mode)
...@@ -1242,6 +1240,7 @@ void Game::SaveConfig() { ...@@ -1242,6 +1240,7 @@ void Game::SaveConfig() {
fprintf(fp, "#auto_search_limit >= 0: Start search automatically when the user enters N chars\n"); fprintf(fp, "#auto_search_limit >= 0: Start search automatically when the user enters N chars\n");
fprintf(fp, "auto_search_limit = %d\n", gameConf.auto_search_limit); fprintf(fp, "auto_search_limit = %d\n", gameConf.auto_search_limit);
fprintf(fp, "ignore_deck_changes = %d\n", ((mainGame->chkIgnoreDeckChanges->isChecked()) ? 1 : 0)); fprintf(fp, "ignore_deck_changes = %d\n", ((mainGame->chkIgnoreDeckChanges->isChecked()) ? 1 : 0));
#ifdef YGOPRO_USE_IRRKLANG
fprintf(fp, "enable_sound = %d\n", ((mainGame->chkEnableSound->isChecked()) ? 1 : 0)); fprintf(fp, "enable_sound = %d\n", ((mainGame->chkEnableSound->isChecked()) ? 1 : 0));
fprintf(fp, "enable_music = %d\n", ((mainGame->chkEnableMusic->isChecked()) ? 1 : 0)); fprintf(fp, "enable_music = %d\n", ((mainGame->chkEnableMusic->isChecked()) ? 1 : 0));
fprintf(fp, "#Volume of sound and music, between 0 and 100\n"); fprintf(fp, "#Volume of sound and music, between 0 and 100\n");
...@@ -1252,6 +1251,7 @@ void Game::SaveConfig() { ...@@ -1252,6 +1251,7 @@ void Game::SaveConfig() {
if(vol < 0) vol = 0; else if(vol > 100) vol = 100; if(vol < 0) vol = 0; else if(vol > 100) vol = 100;
fprintf(fp, "music_volume = %d\n", vol); fprintf(fp, "music_volume = %d\n", vol);
fprintf(fp, "music_mode = %d\n", ((mainGame->chkMusicMode->isChecked()) ? 1 : 0)); fprintf(fp, "music_mode = %d\n", ((mainGame->chkMusicMode->isChecked()) ? 1 : 0));
#endif
fprintf(fp, "default_ot = %d\n", gameConf.defaultOT); fprintf(fp, "default_ot = %d\n", gameConf.defaultOT);
fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode); fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode);
fclose(fp); fclose(fp);
......
...@@ -244,11 +244,13 @@ public: ...@@ -244,11 +244,13 @@ public:
irr::gui::IGUICheckBox* chkHideHintButton; irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUICheckBox* chkIgnoreDeckChanges; irr::gui::IGUICheckBox* chkIgnoreDeckChanges;
irr::gui::IGUICheckBox* chkAutoSearch; irr::gui::IGUICheckBox* chkAutoSearch;
#ifdef YGOPRO_USE_IRRKLANG
irr::gui::IGUICheckBox* chkEnableSound; irr::gui::IGUICheckBox* chkEnableSound;
irr::gui::IGUICheckBox* chkEnableMusic; irr::gui::IGUICheckBox* chkEnableMusic;
irr::gui::IGUIScrollBar* scrSoundVolume; irr::gui::IGUIScrollBar* scrSoundVolume;
irr::gui::IGUIScrollBar* scrMusicVolume; irr::gui::IGUIScrollBar* scrMusicVolume;
irr::gui::IGUICheckBox* chkMusicMode; irr::gui::IGUICheckBox* chkMusicMode;
#endif
//main menu //main menu
irr::gui::IGUIWindow* wMainMenu; irr::gui::IGUIWindow* wMainMenu;
irr::gui::IGUIButton* btnLanMode; irr::gui::IGUIButton* btnLanMode;
...@@ -468,7 +470,7 @@ public: ...@@ -468,7 +470,7 @@ public:
irr::gui::IGUIButton* btnCancelOrFinish; irr::gui::IGUIButton* btnCancelOrFinish;
//soundEngine //soundEngine
#ifdef _WIN32 #ifdef YGOPRO_USE_IRRKLANG
irrklang::ISoundEngine* engineSound; irrklang::ISoundEngine* engineSound;
irrklang::ISoundEngine* engineMusic; irrklang::ISoundEngine* engineMusic;
irrklang::ISound* soundBGM; irrklang::ISound* soundBGM;
......
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