Commit c213a063 authored by edo9300's avatar edo9300

Added SpectatorSwap

parent fa16a06a
...@@ -568,6 +568,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -568,6 +568,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->dInfo.player_type = 7; mainGame->dInfo.player_type = 7;
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350)); mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350));
mainGame->btnLeaveGame->setVisible(true); mainGame->btnLeaveGame->setVisible(true);
mainGame->btnSpectatorSwap->setVisible(true);
} }
if(selftype != 1) { if(selftype != 1) {
BufferIO::CopyWStr(mainGame->stHostPrepDuelist[0]->getText(), mainGame->dInfo.hostname, 20); BufferIO::CopyWStr(mainGame->stHostPrepDuelist[0]->getText(), mainGame->dInfo.hostname, 20);
...@@ -581,6 +582,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -581,6 +582,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->dInfo.player_type = 7; mainGame->dInfo.player_type = 7;
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350)); mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350));
mainGame->btnLeaveGame->setVisible(true); mainGame->btnLeaveGame->setVisible(true);
mainGame->btnSpectatorSwap->setVisible(true);
} }
if(selftype > 1 && selftype < 4) { if(selftype > 1 && selftype < 4) {
BufferIO::CopyWStr(mainGame->stHostPrepDuelist[2]->getText(), mainGame->dInfo.hostname, 20); BufferIO::CopyWStr(mainGame->stHostPrepDuelist[2]->getText(), mainGame->dInfo.hostname, 20);
...@@ -604,6 +606,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -604,6 +606,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
if(mainGame->dInfo.player_type < 7) if(mainGame->dInfo.player_type < 7)
mainGame->btnLeaveGame->setVisible(false); mainGame->btnLeaveGame->setVisible(false);
mainGame->btnSpectatorSwap->setVisible(false);
mainGame->btnChainIgnore->setVisible(false); mainGame->btnChainIgnore->setVisible(false);
mainGame->btnChainAlways->setVisible(false); mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false); mainGame->btnChainWhenAvail->setVisible(false);
......
...@@ -82,9 +82,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -82,9 +82,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case BUTTON_REPLAY_SWAP: { case BUTTON_REPLAY_SWAP: {
if(!mainGame->dInfo.isReplay) if(mainGame->dInfo.isReplay)
break; ReplayMode::SwapField();
ReplayMode::SwapField(); else if (mainGame->dInfo.player_type != 7)
mainGame->dField.ReplaySwap();
break; break;
} }
case BUTTON_REPLAY_UNDO: { case BUTTON_REPLAY_UNDO: {
......
...@@ -604,6 +604,9 @@ bool Game::Initialize() { ...@@ -604,6 +604,9 @@ bool Game::Initialize() {
wChat->setDrawTitlebar(false); wChat->setDrawTitlebar(false);
wChat->setVisible(false); wChat->setVisible(false);
ebChatInput = env->addEditBox(L"", rect<s32>(3, 2, 710, 22), true, wChat, EDITBOX_CHAT); ebChatInput = env->addEditBox(L"", rect<s32>(3, 2, 710, 22), true, wChat, EDITBOX_CHAT);
//swap
btnSpectatorSwap = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap->setVisible(false);
//chain buttons //chain buttons
btnChainIgnore = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292)); btnChainIgnore = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainAlways = env->addButton(rect<s32>(205, 140, 295, 175), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293)); btnChainAlways = env->addButton(rect<s32>(205, 140, 295, 175), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
......
...@@ -447,6 +447,8 @@ public: ...@@ -447,6 +447,8 @@ public:
//soundEngine //soundEngine
irrklang::ISoundEngine* engineSound; irrklang::ISoundEngine* engineSound;
irrklang::ISoundEngine* engineMusic; irrklang::ISoundEngine* engineMusic;
//swap
irr::gui::IGUIButton* btnSpectatorSwap;
//chain control //chain control
irr::gui::IGUIButton* btnChainIgnore; irr::gui::IGUIButton* btnChainIgnore;
irr::gui::IGUIButton* btnChainAlways; irr::gui::IGUIButton* btnChainAlways;
......
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