Commit 8e3b935e authored by mercury233's avatar mercury233

Merge branch 'Spectator-Swap' of https://github.com/edo9300/ygopro into fh

parents b5e42900 e34f02b1
......@@ -285,6 +285,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnSideOK->setVisible(true);
if(mainGame->dInfo.player_type < 7)
mainGame->btnLeaveGame->setVisible(false);
mainGame->btnSpectatorSwap->setVisible(false);
mainGame->btnChainIgnore->setVisible(false);
mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false);
......@@ -473,6 +474,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->dInfo.player_type = 7;
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350));
mainGame->btnLeaveGame->setVisible(true);
mainGame->btnSpectatorSwap->setVisible(true);
}
if(selftype != 1) {
BufferIO::CopyWStr(mainGame->stHostPrepDuelist[0]->getText(), mainGame->dInfo.hostname, 20);
......@@ -486,6 +488,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->dInfo.player_type = 7;
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1350));
mainGame->btnLeaveGame->setVisible(true);
mainGame->btnSpectatorSwap->setVisible(true);
}
if(selftype > 1 && selftype < 4) {
BufferIO::CopyWStr(mainGame->stHostPrepDuelist[2]->getText(), mainGame->dInfo.hostname, 20);
......@@ -509,6 +512,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->gMutex.Lock();
if(mainGame->dInfo.player_type < 7)
mainGame->btnLeaveGame->setVisible(false);
mainGame->btnSpectatorSwap->setVisible(false);
mainGame->btnChainIgnore->setVisible(false);
mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false);
......
......@@ -82,9 +82,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break;
}
case BUTTON_REPLAY_SWAP: {
if(!mainGame->dInfo.isReplay)
break;
if(mainGame->dInfo.isReplay)
ReplayMode::SwapField();
else if (mainGame->dInfo.player_type == 7)
mainGame->dField.ReplaySwap();
break;
}
case BUTTON_REPLAY_UNDO: {
......
......@@ -568,6 +568,9 @@ bool Game::Initialize() {
wChat->setDrawTitlebar(false);
wChat->setVisible(false);
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
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));
......@@ -1203,6 +1206,7 @@ void Game::CloseDuelWindow() {
stHintMsg->setVisible(false);
btnSideOK->setVisible(false);
btnLeaveGame->setVisible(false);
btnSpectatorSwap->setVisible(false);
btnChainIgnore->setVisible(false);
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
......
......@@ -410,6 +410,8 @@ public:
irr::gui::IGUIButton* btnReplaySwap;
//surrender/leave
irr::gui::IGUIButton* btnLeaveGame;
//swap
irr::gui::IGUIButton* btnSpectatorSwap;
//chain control
irr::gui::IGUIButton* btnChainIgnore;
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