Commit fbf10697 authored by mercury233's avatar mercury233

fix

parent c052813b
...@@ -76,6 +76,13 @@ void ClientField::Clear() { ...@@ -76,6 +76,13 @@ void ClientField::Clear() {
reposable_cards.clear(); reposable_cards.clear();
attackable_cards.clear(); attackable_cards.clear();
disabled_field = 0; disabled_field = 0;
panel = 0;
hovered_card = 0;
clicked_card = 0;
highlighting_card = 0;
hovered_controler = 0;
hovered_location = 0;
hovered_sequence = 0;
deck_act = false; deck_act = false;
grave_act = false; grave_act = false;
remove_act = false; remove_act = false;
......
...@@ -554,6 +554,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -554,6 +554,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnCreateHost->setEnabled(true); mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true); mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->ShowElement(mainGame->wLanWindow); mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
...@@ -777,6 +778,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -777,6 +778,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnCreateHost->setEnabled(true); mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true); mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->ShowElement(mainGame->wLanWindow); mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
......
...@@ -115,6 +115,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -115,6 +115,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient::StopClient(); DuelClient::StopClient();
mainGame->dInfo.isStarted = false; mainGame->dInfo.isStarted = false;
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->stTip->setVisible(false);
mainGame->wCardImg->setVisible(false); mainGame->wCardImg->setVisible(false);
mainGame->wInfos->setVisible(false); mainGame->wInfos->setVisible(false);
mainGame->wPhase->setVisible(false); mainGame->wPhase->setVisible(false);
......
...@@ -213,9 +213,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -213,9 +213,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->btnReplayStep->setVisible(false); mainGame->btnReplayStep->setVisible(false);
mainGame->btnReplayUndo->setVisible(false); mainGame->btnReplayUndo->setVisible(false);
mainGame->wPhase->setVisible(true); mainGame->wPhase->setVisible(true);
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear(); mainGame->dField.Clear();
mainGame->HideElement(mainGame->wReplay); mainGame->HideElement(mainGame->wReplay);
mainGame->device->setEventReceiver(&mainGame->dField); mainGame->device->setEventReceiver(&mainGame->dField);
......
...@@ -185,6 +185,7 @@ int ReplayMode::ReplayThread(void* param) { ...@@ -185,6 +185,7 @@ int ReplayMode::ReplayThread(void* param) {
mainGame->closeDoneSignal.Wait(); mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->ShowElement(mainGame->wReplay); mainGame->ShowElement(mainGame->wReplay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
if(exit_on_return) if(exit_on_return)
...@@ -195,9 +196,6 @@ int ReplayMode::ReplayThread(void* param) { ...@@ -195,9 +196,6 @@ int ReplayMode::ReplayThread(void* param) {
void ReplayMode::Restart(bool refresh) { void ReplayMode::Restart(bool refresh) {
end_duel(pduel); end_duel(pduel);
mainGame->dInfo.isStarted = false; mainGame->dInfo.isStarted = false;
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear(); mainGame->dField.Clear();
//mainGame->device->setEventReceiver(&mainGame->dField); //mainGame->device->setEventReceiver(&mainGame->dField);
cur_replay.Rewind(); cur_replay.Rewind();
......
...@@ -78,9 +78,6 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -78,9 +78,6 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->scrCardText->setVisible(false); mainGame->scrCardText->setVisible(false);
mainGame->wPhase->setVisible(true); mainGame->wPhase->setVisible(true);
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear(); mainGame->dField.Clear();
mainGame->dInfo.isFirst = true; mainGame->dInfo.isFirst = true;
mainGame->dInfo.isStarted = true; mainGame->dInfo.isStarted = true;
...@@ -112,6 +109,7 @@ int SingleMode::SinglePlayThread(void* param) { ...@@ -112,6 +109,7 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame->closeDoneSignal.Wait(); mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->ShowElement(mainGame->wSinglePlay); mainGame->ShowElement(mainGame->wSinglePlay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
if(exit_on_return) if(exit_on_return)
......
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