Commit d73e7033 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro into mac-test

parents 71ac151f e271e2fb
......@@ -76,6 +76,13 @@ void ClientField::Clear() {
reposable_cards.clear();
attackable_cards.clear();
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;
grave_act = false;
remove_act = false;
......
......@@ -28,6 +28,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <locale.h>
#define SD_BOTH 2
#define SOCKET int
......
......@@ -294,6 +294,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->deckBuilder.result_string[0] = L'0';
mainGame->deckBuilder.result_string[1] = 0;
mainGame->deckBuilder.results.clear();
mainGame->deckBuilder.hovered_code = 0;
mainGame->deckBuilder.is_draging = false;
mainGame->deckBuilder.is_starting_dragging = false;
mainGame->deckBuilder.pre_mainc = deckManager.current_deck.main.size();
......@@ -554,6 +555,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
......@@ -777,6 +779,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnCreateHost->setEnabled(true);
mainGame->btnJoinHost->setEnabled(true);
mainGame->btnJoinCancel->setEnabled(true);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->ShowElement(mainGame->wLanWindow);
mainGame->gMutex.Unlock();
......
......@@ -115,6 +115,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
DuelClient::StopClient();
mainGame->dInfo.isStarted = false;
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->stTip->setVisible(false);
mainGame->wCardImg->setVisible(false);
mainGame->wInfos->setVisible(false);
mainGame->wPhase->setVisible(false);
......
......@@ -33,6 +33,9 @@ void ClickButton(irr::gui::IGUIElement* btn) {
}
int main(int argc, char* argv[]) {
#ifndef _WIN32
setlocale(LC_CTYPE, "UTF-8");
#endif
#ifdef _WIN32
#ifndef _DEBUG
wchar_t exepath[MAX_PATH];
......
......@@ -213,9 +213,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->btnReplayStep->setVisible(false);
mainGame->btnReplayUndo->setVisible(false);
mainGame->wPhase->setVisible(true);
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear();
mainGame->HideElement(mainGame->wReplay);
mainGame->device->setEventReceiver(&mainGame->dField);
......
......@@ -185,6 +185,7 @@ int ReplayMode::ReplayThread(void* param) {
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->ShowElement(mainGame->wReplay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock();
if(exit_on_return)
......@@ -195,9 +196,6 @@ int ReplayMode::ReplayThread(void* param) {
void ReplayMode::Restart(bool refresh) {
end_duel(pduel);
mainGame->dInfo.isStarted = false;
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear();
//mainGame->device->setEventReceiver(&mainGame->dField);
cur_replay.Rewind();
......
......@@ -78,9 +78,6 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame->stText->setText(L"");
mainGame->scrCardText->setVisible(false);
mainGame->wPhase->setVisible(true);
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear();
mainGame->dInfo.isFirst = true;
mainGame->dInfo.isStarted = true;
......@@ -112,6 +109,7 @@ int SingleMode::SinglePlayThread(void* param) {
mainGame->closeDoneSignal.Wait();
mainGame->gMutex.Lock();
mainGame->ShowElement(mainGame->wSinglePlay);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->gMutex.Unlock();
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