Commit f9e04b9c authored by Unicorn369's avatar Unicorn369 Committed by fallenstardust

查缺补漏

parent 4c8c139b
...@@ -703,7 +703,6 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -703,7 +703,6 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CLOSE_DECKMANAGER: { case BUTTON_CLOSE_DECKMANAGER: {
mainGame->HideElement(mainGame->wDeckManage); mainGame->HideElement(mainGame->wDeckManage);
break; break;
} }
...@@ -1143,7 +1142,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -1143,7 +1142,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if(!is_draging) { if(!is_draging) {
if(hovered_pos == 0 || hovered_seq == -1) if(hovered_pos == 0 || hovered_seq == -1)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::CARD_PICK); mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::CARD_DROP);
if(hovered_pos == 1) { if(hovered_pos == 1) {
pop_main(hovered_seq); pop_main(hovered_seq);
} else if(hovered_pos == 2) { } else if(hovered_pos == 2) {
...@@ -1160,6 +1159,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -1160,6 +1159,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
push_side(pointer); push_side(pointer);
} }
} else { } else {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::CARD_PICK);
if(click_pos == 1) { if(click_pos == 1) {
push_side(draging_pointer); push_side(draging_pointer);
} else if(click_pos == 2) { } else if(click_pos == 2) {
......
...@@ -2658,12 +2658,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2658,12 +2658,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_SET: { case MSG_SET: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SET);
/*int code = */BufferIO::ReadInt32(pbuf); /*int code = */BufferIO::ReadInt32(pbuf);
/*int cc = mainGame->LocalPlayer*/(BufferIO::ReadInt8(pbuf)); /*int cc = mainGame->LocalPlayer*/(BufferIO::ReadInt8(pbuf));
/*int cl = */BufferIO::ReadInt8(pbuf); /*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf); /*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf); /*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplaySkiping)
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SET);
myswprintf(event_string, dataManager.GetSysString(1601)); myswprintf(event_string, dataManager.GetSysString(1601));
return true; return true;
} }
...@@ -2716,9 +2717,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2716,9 +2717,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int cl = */BufferIO::ReadInt8(pbuf); /*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf); /*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf); /*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->soundManager->PlayChant(code))
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SUMMON);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) { if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->soundManager->PlayChant(code))
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SUMMON);
myswprintf(event_string, dataManager.GetSysString(1603), dataManager.GetName(code)); myswprintf(event_string, dataManager.GetSysString(1603), dataManager.GetName(code));
mainGame->showcardcode = code; mainGame->showcardcode = code;
mainGame->showcarddif = 0; mainGame->showcarddif = 0;
...@@ -2791,7 +2792,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2791,7 +2792,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_CHAINING: { case MSG_CHAINING: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::ACTIVATE);
unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf); unsigned int code = (unsigned int)BufferIO::ReadInt32(pbuf);
int pcc = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int pcc = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int pcl = BufferIO::ReadInt8(pbuf); int pcl = BufferIO::ReadInt8(pbuf);
...@@ -2804,6 +2804,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2804,6 +2804,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int ct = */BufferIO::ReadInt8(pbuf); /*int ct = */BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::ACTIVATE);
ClientCard* pcard = mainGame->dField.GetCard(pcc, pcl, pcs, subs); ClientCard* pcard = mainGame->dField.GetCard(pcc, pcl, pcs, subs);
if(pcard->code != code) { if(pcard->code != code) {
pcard->code = code; pcard->code = code;
...@@ -2897,6 +2898,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2897,6 +2898,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_CHAIN_DISABLED: { case MSG_CHAIN_DISABLED: {
int ct = BufferIO::ReadInt8(pbuf); int ct = BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) { if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::NEGATE);
mainGame->showcardcode = mainGame->dField.chains[ct - 1].code; mainGame->showcardcode = mainGame->dField.chains[ct - 1].code;
mainGame->showcarddif = 0; mainGame->showcarddif = 0;
mainGame->showcard = 3; mainGame->showcard = 3;
...@@ -3007,7 +3009,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3007,7 +3009,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_DAMAGE: { case MSG_DAMAGE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DAMAGE);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf); int val = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] - val; int final = mainGame->dInfo.lp[player] - val;
...@@ -3018,6 +3019,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3018,6 +3019,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true; return true;
} }
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DAMAGE);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10; mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
if (player == 0) if (player == 0)
myswprintf(event_string, dataManager.GetSysString(1613), val); myswprintf(event_string, dataManager.GetSysString(1613), val);
...@@ -3038,7 +3040,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3038,7 +3040,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_RECOVER: { case MSG_RECOVER: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::RECOVER);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf); int val = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] + val; int final = mainGame->dInfo.lp[player] + val;
...@@ -3047,6 +3048,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3047,6 +3048,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true; return true;
} }
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::RECOVER);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10; mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
if (player == 0) if (player == 0)
myswprintf(event_string, dataManager.GetSysString(1615), val); myswprintf(event_string, dataManager.GetSysString(1615), val);
...@@ -3192,7 +3194,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3192,7 +3194,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
break; break;
} }
case MSG_PAY_LPCOST: { case MSG_PAY_LPCOST: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DAMAGE);
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int cost = BufferIO::ReadInt32(pbuf); int cost = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] - cost; int final = mainGame->dInfo.lp[player] - cost;
...@@ -3203,6 +3204,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3203,6 +3204,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true; return true;
} }
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DAMAGE);
mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10; mainGame->lpd = (mainGame->dInfo.lp[player] - final) / 10;
mainGame->lpccolor = 0xff0000ff; mainGame->lpccolor = 0xff0000ff;
mainGame->lpplayer = player; mainGame->lpplayer = player;
...@@ -3219,7 +3221,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3219,7 +3221,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_ADD_COUNTER: { case MSG_ADD_COUNTER: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COUNTER_ADD);
int type = BufferIO::ReadInt16(pbuf); int type = BufferIO::ReadInt16(pbuf);
int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l = BufferIO::ReadInt8(pbuf); int l = BufferIO::ReadInt8(pbuf);
...@@ -3231,6 +3232,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3231,6 +3232,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else pc->counters[type] = count; else pc->counters[type] = count;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COUNTER_ADD);
myswprintf(textBuffer, dataManager.GetSysString(1617), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type)); myswprintf(textBuffer, dataManager.GetSysString(1617), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true; pc->is_highlighting = true;
mainGame->gMutex.lock(); mainGame->gMutex.lock();
...@@ -3242,7 +3244,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3242,7 +3244,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_REMOVE_COUNTER: { case MSG_REMOVE_COUNTER: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COUNTER_REMOVE);
int type = BufferIO::ReadInt16(pbuf); int type = BufferIO::ReadInt16(pbuf);
int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int l = BufferIO::ReadInt8(pbuf); int l = BufferIO::ReadInt8(pbuf);
...@@ -3254,6 +3255,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3254,6 +3255,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc->counters.erase(type); pc->counters.erase(type);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COUNTER_REMOVE);
myswprintf(textBuffer, dataManager.GetSysString(1618), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type)); myswprintf(textBuffer, dataManager.GetSysString(1618), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
pc->is_highlighting = true; pc->is_highlighting = true;
mainGame->gMutex.lock(); mainGame->gMutex.lock();
...@@ -3374,7 +3376,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3374,7 +3376,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_TOSS_COIN: { case MSG_TOSS_COIN: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COIN);
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); /*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
wchar_t* pwbuf = textBuffer; wchar_t* pwbuf = textBuffer;
...@@ -3388,6 +3389,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3388,6 +3389,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0; *pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::COIN);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->stACMessage->setText(textBuffer); mainGame->stACMessage->setText(textBuffer);
...@@ -3397,7 +3399,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3397,7 +3399,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
return true; return true;
} }
case MSG_TOSS_DICE: { case MSG_TOSS_DICE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DICE);
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); /*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf); int count = BufferIO::ReadInt8(pbuf);
wchar_t* pwbuf = textBuffer; wchar_t* pwbuf = textBuffer;
...@@ -3411,6 +3412,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3411,6 +3412,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf = 0; *pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
return true; return true;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::DICE);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->stACMessage->setText(textBuffer); mainGame->stACMessage->setText(textBuffer);
......
...@@ -57,9 +57,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -57,9 +57,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_REPLAY_START: { case BUTTON_REPLAY_START: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(!mainGame->dInfo.isReplay) if(!mainGame->dInfo.isReplay)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->btnReplayStart->setVisible(false); mainGame->btnReplayStart->setVisible(false);
mainGame->btnReplayPause->setVisible(true); mainGame->btnReplayPause->setVisible(true);
mainGame->btnReplayStep->setVisible(false); mainGame->btnReplayStep->setVisible(false);
...@@ -68,9 +68,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -68,9 +68,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_REPLAY_PAUSE: { case BUTTON_REPLAY_PAUSE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(!mainGame->dInfo.isReplay) if(!mainGame->dInfo.isReplay)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->btnReplayStart->setVisible(true); mainGame->btnReplayStart->setVisible(true);
mainGame->btnReplayPause->setVisible(false); mainGame->btnReplayPause->setVisible(false);
mainGame->btnReplayStep->setVisible(true); mainGame->btnReplayStep->setVisible(true);
...@@ -79,16 +79,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -79,16 +79,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_REPLAY_STEP: { case BUTTON_REPLAY_STEP: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(!mainGame->dInfo.isReplay) if(!mainGame->dInfo.isReplay)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
ReplayMode::Pause(false, true); ReplayMode::Pause(false, true);
break; break;
} }
case BUTTON_REPLAY_EXIT: { case BUTTON_REPLAY_EXIT: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(!mainGame->dInfo.isReplay) if(!mainGame->dInfo.isReplay)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
ReplayMode::StopReplay(); ReplayMode::StopReplay();
break; break;
} }
...@@ -101,16 +101,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -101,16 +101,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_REPLAY_UNDO: { case BUTTON_REPLAY_UNDO: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(!mainGame->dInfo.isReplay) if(!mainGame->dInfo.isReplay)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
ReplayMode::Undo(); ReplayMode::Undo();
break; break;
} }
case BUTTON_REPLAY_SAVE: { case BUTTON_REPLAY_SAVE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(mainGame->ebRSName->getText()[0] == 0) if(mainGame->ebRSName->getText()[0] == 0)
break; break;
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->actionParam = 1; mainGame->actionParam = 1;
mainGame->HideElement(mainGame->wReplaySave); mainGame->HideElement(mainGame->wReplaySave);
mainGame->replaySignal.Set(); mainGame->replaySignal.Set();
...@@ -124,7 +124,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -124,7 +124,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_LEAVE_GAME: { case BUTTON_LEAVE_GAME: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::EQUIP); mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if(mainGame->dInfo.isSingleMode) { if(mainGame->dInfo.isSingleMode) {
mainGame->singleSignal.SetNoWait(true); mainGame->singleSignal.SetNoWait(true);
SingleMode::StopPlay(false); SingleMode::StopPlay(false);
...@@ -272,25 +272,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -272,25 +272,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_POS_AU: { case BUTTON_POS_AU: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
DuelClient::SetResponseI(POS_FACEUP_ATTACK); DuelClient::SetResponseI(POS_FACEUP_ATTACK);
mainGame->HideElement(mainGame->wPosSelect, true); mainGame->HideElement(mainGame->wPosSelect, true);
break; break;
} }
case BUTTON_POS_AD: { case BUTTON_POS_AD: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
DuelClient::SetResponseI(POS_FACEDOWN_ATTACK); DuelClient::SetResponseI(POS_FACEDOWN_ATTACK);
mainGame->HideElement(mainGame->wPosSelect, true); mainGame->HideElement(mainGame->wPosSelect, true);
break; break;
} }
case BUTTON_POS_DU: { case BUTTON_POS_DU: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
DuelClient::SetResponseI(POS_FACEUP_DEFENSE); DuelClient::SetResponseI(POS_FACEUP_DEFENSE);
mainGame->HideElement(mainGame->wPosSelect, true); mainGame->HideElement(mainGame->wPosSelect, true);
break; break;
} }
case BUTTON_POS_DD: { case BUTTON_POS_DD: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
DuelClient::SetResponseI(POS_FACEDOWN_DEFENSE); DuelClient::SetResponseI(POS_FACEDOWN_DEFENSE);
mainGame->HideElement(mainGame->wPosSelect, true); mainGame->HideElement(mainGame->wPosSelect, true);
break; break;
...@@ -370,7 +366,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -370,7 +366,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CMD_SHUFFLE: { case BUTTON_CMD_SHUFFLE: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SHUFFLE);
mainGame->btnShuffle->setVisible(false); mainGame->btnShuffle->setVisible(false);
DuelClient::SetResponseI(8); DuelClient::SetResponseI(8);
DuelClient::SendResponse(); DuelClient::SendResponse();
...@@ -568,7 +563,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -568,7 +563,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CMD_SHOWLIST: { case BUTTON_CMD_SHOWLIST: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->wCmdMenu->setVisible(false); mainGame->wCmdMenu->setVisible(false);
selectable_cards.clear(); selectable_cards.clear();
wchar_t formatBuffer[2048]; wchar_t formatBuffer[2048];
...@@ -796,7 +790,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -796,7 +790,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CARD_SEL_OK: { case BUTTON_CARD_SEL_OK: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->stCardListTip->setVisible(false); mainGame->stCardListTip->setVisible(false);
if(mainGame->dInfo.isReplay) { if(mainGame->dInfo.isReplay) {
mainGame->HideElement(mainGame->wCardSelect); mainGame->HideElement(mainGame->wCardSelect);
...@@ -826,7 +819,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -826,7 +819,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_CARD_DISP_OK: { case BUTTON_CARD_DISP_OK: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->HideElement(mainGame->wCardDisplay); mainGame->HideElement(mainGame->wCardDisplay);
break; break;
} }
...@@ -1821,6 +1813,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1821,6 +1813,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case irr::gui::EGET_BUTTON_CLICKED: { case irr::gui::EGET_BUTTON_CLICKED: {
switch(id) { switch(id) {
case BUTTON_CLEAR_LOG: { case BUTTON_CLEAR_LOG: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
mainGame->lstLog->clear(); mainGame->lstLog->clear();
mainGame->logParam.clear(); mainGame->logParam.clear();
return true; return true;
......
...@@ -1163,6 +1163,7 @@ void Game::MainLoop() { ...@@ -1163,6 +1163,7 @@ void Game::MainLoop() {
driver->enableMaterial2D(false); driver->enableMaterial2D(false);
#else #else
} else { } else {
soundManager->PlayBGM(SoundManager::BGM::MENU);
DrawBackImage(imageManager.tBackGround_menu); DrawBackImage(imageManager.tBackGround_menu);
} }
DrawGUI(); DrawGUI();
...@@ -1231,7 +1232,6 @@ void Game::MainLoop() { ...@@ -1231,7 +1232,6 @@ void Game::MainLoop() {
usleep(500000); usleep(500000);
#endif #endif
SaveConfig(); SaveConfig();
//delete soundEffectPlayer;
usleep(500000); usleep(500000);
// device->drop(); // device->drop();
} }
......
...@@ -56,7 +56,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -56,7 +56,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
case irr::gui::EGET_BUTTON_CLICKED: { case irr::gui::EGET_BUTTON_CLICKED: {
if(id < 110) if(id < 110)
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::INFO); mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::SOUND_MENU);
else else
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON); mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
switch(id) { switch(id) {
......
...@@ -60,11 +60,7 @@ void SoundManager::RefreshChantsList() { ...@@ -60,11 +60,7 @@ void SoundManager::RefreshChantsList() {
ChantsList[code] = Utils::ToUTF8IfNeeded(file); ChantsList[code] = Utils::ToUTF8IfNeeded(file);
} }
catch (std::exception& e) { catch (std::exception& e) {
char buf[1040]; Utils::Deletefile(Utils::ToUTF8IfNeeded(TEXT("./sound/chants/") + file));
auto fileName = Utils::ToUTF8IfNeeded(TEXT("./sound/chants/") + file);
sprintf(buf, "[文件名只能为卡片ID]: %s", fileName.c_str());
Utils::Deletefile(fileName);
mainGame->ErrorLog(buf);
} }
} }
} }
...@@ -80,6 +76,7 @@ void SoundManager::PlaySoundEffect(SFX sound) { ...@@ -80,6 +76,7 @@ void SoundManager::PlaySoundEffect(SFX sound) {
{DESTROYED, "./sound/destroyed.wav"}, {DESTROYED, "./sound/destroyed.wav"},
{BANISHED, "./sound/banished.wav"}, {BANISHED, "./sound/banished.wav"},
{TOKEN, "./sound/token.wav"}, {TOKEN, "./sound/token.wav"},
{NEGATE, "./sound/negate.wav"},
{ATTACK, "./sound/attack.wav"}, {ATTACK, "./sound/attack.wav"},
{DIRECT_ATTACK, "./sound/directattack.wav"}, {DIRECT_ATTACK, "./sound/directattack.wav"},
{DRAW, "./sound/draw.wav"}, {DRAW, "./sound/draw.wav"},
...@@ -92,6 +89,7 @@ void SoundManager::PlaySoundEffect(SFX sound) { ...@@ -92,6 +89,7 @@ void SoundManager::PlaySoundEffect(SFX sound) {
{DICE, "./sound/diceroll.wav"}, {DICE, "./sound/diceroll.wav"},
{NEXT_TURN, "./sound/nextturn.wav"}, {NEXT_TURN, "./sound/nextturn.wav"},
{PHASE, "./sound/phase.wav"}, {PHASE, "./sound/phase.wav"},
{SOUND_MENU, "./sound/menu.wav"},
{BUTTON, "./sound/button.wav"}, {BUTTON, "./sound/button.wav"},
{INFO, "./sound/info.wav"}, {INFO, "./sound/info.wav"},
{QUESTION, "./sound/question.wav"}, {QUESTION, "./sound/question.wav"},
...@@ -105,25 +103,25 @@ void SoundManager::PlaySoundEffect(SFX sound) { ...@@ -105,25 +103,25 @@ void SoundManager::PlaySoundEffect(SFX sound) {
} }
void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) { void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
if(element == mainGame->wMessage) { if(element == mainGame->wMessage) {
PlaySoundEffect(SoundManager::SFX::INFO); PlaySoundEffect(INFO);
} else if(element == mainGame->wQuery) { } else if(element == mainGame->wQuery) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wSurrender) { } else if(element == mainGame->wSurrender) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wOptions) { } else if(element == mainGame->wOptions) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wANAttribute) { } else if(element == mainGame->wANAttribute) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wANCard) { } else if(element == mainGame->wANCard) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wANNumber) { } else if(element == mainGame->wANNumber) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wANRace) { } else if(element == mainGame->wANRace) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wReplaySave) { } else if(element == mainGame->wReplaySave) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} else if(element == mainGame->wFTSelect) { } else if(element == mainGame->wFTSelect) {
PlaySoundEffect(SoundManager::SFX::QUESTION); PlaySoundEffect(QUESTION);
} }
} }
void SoundManager::PlayMusic(const std::string& song, bool loop) { void SoundManager::PlayMusic(const std::string& song, bool loop) {
......
...@@ -20,6 +20,7 @@ public: ...@@ -20,6 +20,7 @@ public:
DESTROYED, DESTROYED,
BANISHED, BANISHED,
TOKEN, TOKEN,
NEGATE,
ATTACK, ATTACK,
DIRECT_ATTACK, DIRECT_ATTACK,
DRAW, DRAW,
...@@ -32,6 +33,7 @@ public: ...@@ -32,6 +33,7 @@ public:
DICE, DICE,
NEXT_TURN, NEXT_TURN,
PHASE, PHASE,
SOUND_MENU,
BUTTON, BUTTON,
INFO, INFO,
QUESTION, QUESTION,
......
...@@ -172,6 +172,7 @@ namespace ygo { ...@@ -172,6 +172,7 @@ namespace ygo {
res.push_back(name.c_str()); res.push_back(name.c_str());
} }
}); });
std::sort(res.begin(), res.end());
return res; return res;
} }
void Utils::FindfolderFiles(IrrArchiveHelper& archive, const path_string& path, const std::function<bool(int, path_string, bool, void*)>& cb, void* payload) { void Utils::FindfolderFiles(IrrArchiveHelper& archive, const path_string& path, const std::function<bool(int, path_string, bool, void*)>& cb, void* payload) {
......
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