Commit 652f36ba authored by argon.sun's avatar argon.sun

recon

parent 96299d3a
...@@ -95,7 +95,6 @@ public: ...@@ -95,7 +95,6 @@ public:
void check_sel_sum_t(std::set<ClientCard*>& left, int acc); void check_sel_sum_t(std::set<ClientCard*>& left, int acc);
bool check_sum(std::set<ClientCard*>& testlist, std::set<ClientCard*>::iterator index, int acc, int count); bool check_sum(std::set<ClientCard*>& testlist, std::set<ClientCard*>::iterator index, int acc, int count);
irr::IrrlichtDevice* device;
irr::gui::IGUIElement* panel; irr::gui::IGUIElement* panel;
std::vector<int> ancard; std::vector<int> ancard;
int hovered_controler; int hovered_controler;
......
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
#include <stdio.h> #include <stdio.h>
namespace ygo { namespace ygo {
const wchar_t* DataManager::unknown_string = L"???"; const wchar_t* DataManager::unknown_string = L"???";
const wchar_t* DataManager::effect_strings[] = {
L"魔陷破坏", L"怪兽破坏", L"卡片除外", L"送去墓地", L"返回手牌", L"返回卡组", L"手牌破坏", L"卡组破坏",
L"抽卡辅助", L"卡组检索", L"卡片回收", L"表示形式", L"控制权 ", L"攻守变化", L"穿刺伤害", L"多次攻击",
L"攻击限制", L"直接攻击", L"特殊召唤", L"衍生物 ", L"种族相关", L"属性相关", L"LP伤害 ", L"LP回复 ",
L"破坏耐性", L"效果耐性", L"指示物 ", L"幸运 ", L"融合相关", L"同调相关", L"超量相关", L"效果无效"
};
wchar_t DataManager::strBuffer[2048]; wchar_t DataManager::strBuffer[2048];
bool DataManager::LoadDates(const char* file) { bool DataManager::LoadDates(const char* file) {
...@@ -18,6 +13,8 @@ bool DataManager::LoadDates(const char* file) { ...@@ -18,6 +13,8 @@ bool DataManager::LoadDates(const char* file) {
const char* sql = "select * from datas,texts where datas.id=texts.id"; const char* sql = "select * from datas,texts where datas.id=texts.id";
if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK) if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK)
return Error(pDB); return Error(pDB);
for(int i = 0; i < 2048; ++i)
_sysStrings[i] = 0;
CardDataC cd; CardDataC cd;
CardString cs; CardString cs;
for(int i = 0; i < 16; ++i) cs.desc[i] = 0; for(int i = 0; i < 16; ++i) cs.desc[i] = 0;
...@@ -160,10 +157,9 @@ const wchar_t* DataManager::GetDesc(int strCode) { ...@@ -160,10 +157,9 @@ const wchar_t* DataManager::GetDesc(int strCode) {
return unknown_string; return unknown_string;
} }
const wchar_t* DataManager::GetSysString(int code) { const wchar_t* DataManager::GetSysString(int code) {
auto csit = _sysStrings.find(code); if(code < 0 || code >= 2048 || _sysStrings[code] == 0)
if(csit == _sysStrings.end())
return unknown_string; return unknown_string;
return csit->second; return _sysStrings[code];
} }
const wchar_t* DataManager::GetVictoryString(int code) { const wchar_t* DataManager::GetVictoryString(int code) {
auto csit = _victoryStrings.find(code); auto csit = _victoryStrings.find(code);
......
...@@ -37,9 +37,10 @@ public: ...@@ -37,9 +37,10 @@ public:
std::unordered_map<unsigned int, CardDataC> _datas; std::unordered_map<unsigned int, CardDataC> _datas;
std::unordered_map<unsigned int, CardString> _strings; std::unordered_map<unsigned int, CardString> _strings;
std::unordered_map<unsigned int, wchar_t*> _sysStrings;
std::unordered_map<unsigned int, wchar_t*> _counterStrings; std::unordered_map<unsigned int, wchar_t*> _counterStrings;
std::unordered_map<unsigned int, wchar_t*> _victoryStrings; std::unordered_map<unsigned int, wchar_t*> _victoryStrings;
wchar_t* _sysStrings[2048];
wchar_t numStrings[256][4]; wchar_t numStrings[256][4];
wchar_t attBuffer[128]; wchar_t attBuffer[128];
wchar_t racBuffer[128]; wchar_t racBuffer[128];
...@@ -47,7 +48,6 @@ public: ...@@ -47,7 +48,6 @@ public:
static wchar_t strBuffer[2048]; static wchar_t strBuffer[2048];
static const wchar_t* unknown_string; static const wchar_t* unknown_string;
static const wchar_t* effect_strings[];
}; };
} }
......
...@@ -9,7 +9,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -9,7 +9,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
switch(event.EventType) { switch(event.EventType) {
case irr::EET_GUI_EVENT: { case irr::EET_GUI_EVENT: {
s32 id = event.GUIEvent.Caller->getID(); s32 id = event.GUIEvent.Caller->getID();
irr::gui::IGUIEnvironment* env = device->getGUIEnvironment(); irr::gui::IGUIEnvironment* env = mainGame->device->getGUIEnvironment();
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
case irr::gui::EGET_BUTTON_CLICKED: { case irr::gui::EGET_BUTTON_CLICKED: {
switch(id) { switch(id) {
...@@ -62,11 +62,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -62,11 +62,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame->wFilter->setVisible(false); mainGame->wFilter->setVisible(false);
mainGame->wCardImg->setVisible(false); mainGame->wCardImg->setVisible(false);
mainGame->wInfos->setVisible(false); mainGame->wInfos->setVisible(false);
mainGame->cbDeckSel->setSelected(mainGame->cbDBDecks->getSelected()); mainGame->PopupElement(mainGame->wMainMenu);
mainGame->PopupElement(mainGame->wModeSelection); mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->device->setEventReceiver(&mainGame->dField);
mainGame->imageManager.ClearTexture(); mainGame->imageManager.ClearTexture();
mainGame->scrFilter->setVisible(false); mainGame->scrFilter->setVisible(false);
wchar_t* p = mainGame->gameConf.lastdeck;
if(mainGame->cbDBDecks->getSelected() != -1) {
DataManager::CopyStr(mainGame->cbDBDecks->getItem(mainGame->cbDBDecks->getSelected()), p, 63);
}
break; break;
} }
case BUTTON_EFFECT_FILTER: { case BUTTON_EFFECT_FILTER: {
...@@ -289,7 +292,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -289,7 +292,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
me.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED; me.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED;
me.GUIEvent.Caller = mainGame->btnStartFilter; me.GUIEvent.Caller = mainGame->btnStartFilter;
me.GUIEvent.Element = mainGame->btnStartFilter; me.GUIEvent.Element = mainGame->btnStartFilter;
device->postEventFromUser(me); mainGame->device->postEventFromUser(me);
break; break;
} }
} }
...@@ -590,7 +593,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -590,7 +593,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
} }
SEvent e = event; SEvent e = event;
e.MouseInput.Event = irr::EMIE_MOUSE_MOVED; e.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
device->postEventFromUser(e); mainGame->device->postEventFromUser(e);
break; break;
} }
} }
...@@ -604,7 +607,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -604,7 +607,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break; break;
} }
case irr::KEY_ESCAPE: { case irr::KEY_ESCAPE: {
device->minimizeWindow(); mainGame->device->minimizeWindow();
break; break;
} }
} }
......
...@@ -35,7 +35,6 @@ public: ...@@ -35,7 +35,6 @@ public:
int dragy; int dragy;
code_pointer draging_pointer; code_pointer draging_pointer;
irr::IrrlichtDevice* device;
std::unordered_map<int, int>* filterList; std::unordered_map<int, int>* filterList;
std::vector<code_pointer> results; std::vector<code_pointer> results;
wchar_t result_string[8]; wchar_t result_string[8];
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
namespace ygo { namespace ygo {
void DeckManager::LoadLFList() { void DeckManager::LoadLFList() {
LFList cur; LFList* cur;
std::unordered_map<int, int>* curMap = 0;
FILE* fp = fopen("lflist.conf", "r"); FILE* fp = fopen("lflist.conf", "r");
char linebuf[256]; char linebuf[256];
wchar_t strBuffer[256]; wchar_t strBuffer[256];
...@@ -24,11 +23,13 @@ void DeckManager::LoadLFList() { ...@@ -24,11 +23,13 @@ void DeckManager::LoadLFList() {
if(linebuf[0] == '!') { if(linebuf[0] == '!') {
sa = DataManager::DecodeUTF8((const char*)(&linebuf[1]), strBuffer); sa = DataManager::DecodeUTF8((const char*)(&linebuf[1]), strBuffer);
while(strBuffer[sa - 1] == L'\r' || strBuffer[sa - 1] == L'\n' ) sa--; while(strBuffer[sa - 1] == L'\r' || strBuffer[sa - 1] == L'\n' ) sa--;
memcpy(cur.listName, (const void*)strBuffer, 40); LFList newlist;
cur.listName[sa] = 0; _lfList.push_back(newlist);
curMap = new std::unordered_map<int, int>; cur = &_lfList[_lfList.size() - 1];
cur.content = curMap; memcpy(cur->listName, (const void*)strBuffer, 40);
_lfList.push_back(cur); cur->listName[sa] = 0;
cur->content = new std::unordered_map<int, int>;
cur->hash = 0x7dfcee6a;
continue; continue;
} }
while(linebuf[p] != ' ' && linebuf[p] != '\t' && linebuf[p] != 0) p++; while(linebuf[p] != ' ' && linebuf[p] != '\t' && linebuf[p] != 0) p++;
...@@ -43,13 +44,16 @@ void DeckManager::LoadLFList() { ...@@ -43,13 +44,16 @@ void DeckManager::LoadLFList() {
while(linebuf[p] != ' ' && linebuf[p] != '\t' && linebuf[p] != 0) p++; while(linebuf[p] != ' ' && linebuf[p] != '\t' && linebuf[p] != 0) p++;
linebuf[p] = 0; linebuf[p] = 0;
count = atoi(&linebuf[sa]); count = atoi(&linebuf[sa]);
(*curMap)[code] = count; (*cur->content)[code] = count;
cur->hash = cur->hash ^ ((code<<18) | (code>>14)) ^ ((code<<(27+count)) | (code>>(5-count)));
} }
fclose(fp); fclose(fp);
} }
myswprintf(cur.listName, L"无限制"); LFList nolimit;
cur.content = new std::unordered_map<int, int>; myswprintf(nolimit.listName, L"无限制");
_lfList.push_back(cur); nolimit.hash = 0;
nolimit.content = new std::unordered_map<int, int>;
_lfList.push_back(nolimit);
} }
bool DeckManager::CheckLFList(Deck& deck, int lfindex) { bool DeckManager::CheckLFList(Deck& deck, int lfindex) {
std::unordered_map<int, int> ccount; std::unordered_map<int, int> ccount;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace ygo { namespace ygo {
struct LFList { struct LFList {
unsigned int hash;
wchar_t listName[20]; wchar_t listName[20];
std::unordered_map<int, int>* content; std::unordered_map<int, int>* content;
}; };
......
...@@ -404,6 +404,7 @@ void Game::DrawGUI() { ...@@ -404,6 +404,7 @@ void Game::DrawGUI() {
for(int i = 0; i < 5; ++i) for(int i = 0; i < 5; ++i)
btnCardSelect[i]->setDrawImage(true); btnCardSelect[i]->setDrawImage(true);
} }
env->setFocus(guiFading);
} else } else
guiFading->setRelativePosition(irr::core::recti(fadingUL, fadingLR)); guiFading->setRelativePosition(irr::core::recti(fadingUL, fadingLR));
} }
...@@ -430,6 +431,8 @@ void Game::DrawGUI() { ...@@ -430,6 +431,8 @@ void Game::DrawGUI() {
for(int i = 0; i < 5; ++i) for(int i = 0; i < 5; ++i)
btnCardSelect[i]->setDrawImage(true); btnCardSelect[i]->setDrawImage(true);
} }
if(guiNext)
ShowElement(guiNext);
} else } else
guiFading->setRelativePosition(irr::core::recti(fadingUL, fadingLR)); guiFading->setRelativePosition(irr::core::recti(fadingUL, fadingLR));
} }
...@@ -547,7 +550,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) { ...@@ -547,7 +550,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
win->setRelativePosition(irr::core::recti(center.X, center.Y, 0, 0)); win->setRelativePosition(irr::core::recti(center.X, center.Y, 0, 0));
win->setVisible(true); win->setVisible(true);
} }
void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) { void Game::HideElement(irr::gui::IGUIElement * win, bool set_action, irr::gui::IGUIElement* next) {
if(fadingFrame || !win->isVisible()) if(fadingFrame || !win->isVisible())
return; return;
fadingSize = win->getRelativePosition(); fadingSize = win->getRelativePosition();
...@@ -560,6 +563,7 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) { ...@@ -560,6 +563,7 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) {
fadingFrame = 10; fadingFrame = 10;
autoFadeoutFrame = 0; autoFadeoutFrame = 0;
signalAction = set_action; signalAction = set_action;
guiNext = next;
if(win == wPosSelect) { if(win == wPosSelect) {
btnPSAU->setDrawImage(false); btnPSAU->setDrawImage(false);
btnPSAD->setDrawImage(false); btnPSAD->setDrawImage(false);
......
...@@ -10,131 +10,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -10,131 +10,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
switch(event.EventType) { switch(event.EventType) {
case irr::EET_GUI_EVENT: { case irr::EET_GUI_EVENT: {
s32 id = event.GUIEvent.Caller->getID(); s32 id = event.GUIEvent.Caller->getID();
irr::gui::IGUIEnvironment* env = device->getGUIEnvironment(); irr::gui::IGUIEnvironment* env = mainGame->device->getGUIEnvironment();
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
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->lstLog->clear(); mainGame->lstLog->clear();
mainGame->logParam.clear(); mainGame->logParam.clear();
break; break;
} }
case BUTTON_MODE_EXIT: {
mainGame->netManager.CancelHost();
mainGame->device->closeDevice();
break;
}
case BUTTON_LAN_START_SERVER: {
if(mainGame->cbDeckSel->getSelected() == -1)
break;
if(!mainGame->deckManager.LoadDeck(mainGame->cbDeckSel->getItem(mainGame->cbDeckSel->getSelected()))) {
mainGame->stModeStatus->setText(L"无效卡组");
break;
}
if(!mainGame->chkNoCheckDeck->isChecked()
&& !mainGame->deckManager.CheckLFList(mainGame->deckManager.deckhost, mainGame->cbLFlist->getSelected())) {
mainGame->stModeStatus->setText(L"无效卡组或者卡组不符合禁卡表规范");
break;
}
if(_wtoi(mainGame->ebStartLP->getText()) == 0)
mainGame->ebStartLP->setText(L"8000");
if(_wtoi(mainGame->ebStartHand->getText()) == 0)
mainGame->ebStartLP->setText(L"5");
if(_wtoi(mainGame->ebDrawCount->getText()) == 0)
mainGame->ebStartLP->setText(L"1");
if(mainGame->netManager.CreateHost(mainGame->cbIPList->getSelected())) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanCancelServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
mainGame->stModeStatus->setText(L"等待连接...");
}
break;
}
case BUTTON_LAN_CANCEL_SERVER: {
mainGame->netManager.CancelHost();
mainGame->stModeStatus->setText(L"");
break;
}
case BUTTON_LAN_REFRESH: {
if(mainGame->netManager.RefreshHost(mainGame->cbIPList->getSelected())) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
}
break;
}
case BUTTON_LAN_CONNECT: {
if(mainGame->cbDeckSel->getSelected() == -1)
break;
if(!mainGame->deckManager.LoadDeck(mainGame->cbDeckSel->getItem(mainGame->cbDeckSel->getSelected()))) {
mainGame->stModeStatus->setText(L"无效卡组");
break;
}
if(mainGame->netManager.JoinHost()) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
mainGame->stModeStatus->setText(L"连接中...");
}
break;
}
case BUTTON_DECK_EDIT: {
if(mainGame->cbDeckSel->getSelected() == -1)
break;
if(!mainGame->deckManager.LoadDeck(mainGame->cbDeckSel->getItem(mainGame->cbDeckSel->getSelected()))) {
mainGame->stModeStatus->setText(L"无法载入卡组");
break;
}
mainGame->HideElement(mainGame->wModeSelection);
mainGame->is_building = true;
mainGame->wInfos->setVisible(true);
mainGame->wCardImg->setVisible(true);
mainGame->wDeckEdit->setVisible(true);
mainGame->wFilter->setVisible(true);
mainGame->deckBuilder.filterList = mainGame->deckManager._lfList[mainGame->cbLFlist->getSelected()].content;;
mainGame->cbDBLFList->setSelected(mainGame->cbLFlist->getSelected());
mainGame->device->setEventReceiver(&mainGame->deckBuilder);
mainGame->cbCardType->setSelected(0);
mainGame->cbCardType2->setSelected(0);
mainGame->cbAttribute->setSelected(0);
mainGame->cbRace->setSelected(0);
mainGame->ebAttack->setText(L"");
mainGame->ebDefence->setText(L"");
mainGame->ebStar->setText(L"");
mainGame->cbCardType2->setEnabled(false);
mainGame->cbAttribute->setEnabled(false);
mainGame->cbRace->setEnabled(false);
mainGame->ebAttack->setEnabled(false);
mainGame->ebDefence->setEnabled(false);
mainGame->ebStar->setEnabled(false);
mainGame->deckBuilder.filter_effect = 0;
mainGame->deckBuilder.result_string[0] = L'0';
mainGame->deckBuilder.result_string[1] = 0;
mainGame->deckBuilder.results.clear();
mainGame->deckBuilder.is_draging = false;
mainGame->cbDBDecks->setSelected(mainGame->cbDeckSel->getSelected());
for(int i = 0; i < 32; ++i)
mainGame->chkCategory[i]->setChecked(false);
break;
}
case BUTTON_LOAD_REPLAY: {
if(mainGame->lstReplayList->getSelected() == -1)
break;
if(!mainGame->lastReplay.OpenReplay(mainGame->lstReplayList->getListItem(mainGame->lstReplayList->getSelected()))) {
mainGame->stModeStatus->setText(L"录像损坏或丢失,无法播放");
break;
}
mainGame->stModeStatus->setText(L"");
Thread::NewThread(Game::ReplayThread, &mainGame->dInfo);
break;
}
case BUTTON_REPLAY_START: { case BUTTON_REPLAY_START: {
if(!mainGame->dField.is_replaying) if(!mainGame->dField.is_replaying)
break; break;
...@@ -751,23 +635,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -751,23 +635,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
case irr::gui::EGET_LISTBOX_CHANGED: { case irr::gui::EGET_LISTBOX_CHANGED: {
switch(id) { switch(id) {
case LISTBOX_SERVER_LIST: {
if(mainGame->lstServerList->getSelected() == -1)
break;
HostInfo& hi = mainGame->netManager.hosts[mainGame->lstServerList->getSelected()];
myswprintf(formatBuffer, L"%d.%d.%d.%d", hi.address & 0xff, (hi.address >> 8) & 0xff, (hi.address >> 16) & 0xff, (hi.address >> 24) & 0xff);
mainGame->ebJoinIP->setText(formatBuffer);
myswprintf(formatBuffer, L"%d", hi.port);
mainGame->ebJoinPort->setText(formatBuffer);
break;
}
case LISTBOX_LOG: {
int sel = mainGame->lstLog->getSelected();
if(sel != -1 && mainGame->logParam.size() >= sel && mainGame->logParam[sel]) {
mainGame->ShowCardInfo(mainGame->logParam[sel]);
}
break;
}
} }
break; break;
} }
...@@ -807,27 +675,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -807,27 +675,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
} }
case irr::gui::EGET_TAB_CHANGED: {
switch(id) {
case TAB_MODES: {
if(mainGame->wModes->getActiveTab() == 1) {
if(mainGame->is_refreshing || mainGame->netManager.is_creating_host)
break;
if(mainGame->netManager.RefreshHost(mainGame->cbIPList->getSelected())) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
}
} else if(mainGame->wModes->getActiveTab() == 2) {
mainGame->RefreshReplay();
}
break;
}
}
break;
}
case irr::gui::EGET_EDITBOX_CHANGED: { case irr::gui::EGET_EDITBOX_CHANGED: {
switch(id) { switch(id) {
case EDITBOX_ANCARD: { case EDITBOX_ANCARD: {
...@@ -1455,7 +1302,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1455,7 +1302,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break; break;
} }
case irr::KEY_ESCAPE: { case irr::KEY_ESCAPE: {
device->minimizeWindow(); mainGame->device->minimizeWindow();
break; break;
} }
} }
...@@ -1624,11 +1471,11 @@ void ClientField::ShowMenu(int flag, int x, int y) { ...@@ -1624,11 +1471,11 @@ void ClientField::ShowMenu(int flag, int x, int y) {
} else mainGame->btnSSet->setVisible(false); } else mainGame->btnSSet->setVisible(false);
if(flag & COMMAND_REPOS) { if(flag & COMMAND_REPOS) {
if(clicked_card->position & POS_FACEDOWN) if(clicked_card->position & POS_FACEDOWN)
mainGame->btnRepos->setText(L"反转召唤"); mainGame->btnRepos->setText(mainGame->dataManager.GetSysString(1154));
else if(clicked_card->position & POS_ATTACK) else if(clicked_card->position & POS_ATTACK)
mainGame->btnRepos->setText(L"守备表示"); mainGame->btnRepos->setText(mainGame->dataManager.GetSysString(1155));
else else
mainGame->btnRepos->setText(L"攻击表示"); mainGame->btnRepos->setText(mainGame->dataManager.GetSysString(1156));
mainGame->btnRepos->setVisible(true); mainGame->btnRepos->setVisible(true);
mainGame->btnRepos->setRelativePosition(position2di(1, height)); mainGame->btnRepos->setRelativePosition(position2di(1, height));
height += 21; height += 21;
......
...@@ -9,12 +9,10 @@ namespace ygo { ...@@ -9,12 +9,10 @@ namespace ygo {
class EventHandler : public irr::IEventReceiver { class EventHandler : public irr::IEventReceiver {
public: public:
EventHandler(irr::IrrlichtDevice* dev);
virtual bool OnEvent(const irr::SEvent& event); virtual bool OnEvent(const irr::SEvent& event);
void GetHoverField(int x, int y); void GetHoverField(int x, int y);
void ShowMenu(int flag, int x, int y); void ShowMenu(int flag, int x, int y);
irr::IrrlichtDevice* device;
irr::gui::IGUIElement* panel; irr::gui::IGUIElement* panel;
int hovered_controler; int hovered_controler;
int hovered_location; int hovered_location;
......
This diff is collapsed.
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "client_card.h" #include "client_card.h"
#include "client_field.h" #include "client_field.h"
#include "deck_con.h" #include "deck_con.h"
#include "menu_handler.h"
#include "network.h" #include "network.h"
#include "deck_manager.h" #include "deck_manager.h"
#include "replay.h" #include "replay.h"
...@@ -17,6 +18,18 @@ ...@@ -17,6 +18,18 @@
namespace ygo { namespace ygo {
struct Config {
unsigned short antialias;
unsigned short serverport;
wchar_t lastip[20];
wchar_t lastport[10];
wchar_t nickname[20];
wchar_t gamename[20];
wchar_t lastdeck[64];
wchar_t textfont[256];
wchar_t numfont[256];
};
struct DuelInfo { struct DuelInfo {
bool isStarted; bool isStarted;
bool is_shuffling; bool is_shuffling;
...@@ -67,7 +80,7 @@ public: ...@@ -67,7 +80,7 @@ public:
void DrawGUI(); void DrawGUI();
void DrawSpec(); void DrawSpec();
void ShowElement(irr::gui::IGUIElement* element, int autoframe = 0); void ShowElement(irr::gui::IGUIElement* element, int autoframe = 0);
void HideElement(irr::gui::IGUIElement* element, bool set_action = false); void HideElement(irr::gui::IGUIElement* element, bool set_action = false, irr::gui::IGUIElement* next = 0);
void PopupElement(irr::gui::IGUIElement* element, int hideframe = 0); void PopupElement(irr::gui::IGUIElement* element, int hideframe = 0);
void WaitFrameSignal(int frame); void WaitFrameSignal(int frame);
void DrawThumb(int code, position2di pos, std::unordered_map<int, int>* lflist); void DrawThumb(int code, position2di pos, std::unordered_map<int, int>* lflist);
...@@ -119,6 +132,7 @@ public: ...@@ -119,6 +132,7 @@ public:
Signal localMessage; Signal localMessage;
Signal localResponse; Signal localResponse;
Signal localAction; Signal localAction;
Config gameConf;
NetManager netManager; NetManager netManager;
DataManager dataManager; DataManager dataManager;
ImageManager imageManager; ImageManager imageManager;
...@@ -133,6 +147,7 @@ public: ...@@ -133,6 +147,7 @@ public:
bool isFadein; bool isFadein;
bool signalAction; bool signalAction;
irr::gui::IGUIElement* guiFading; irr::gui::IGUIElement* guiFading;
irr::gui::IGUIElement* guiNext;
int fadingFrame; int fadingFrame;
irr::core::recti fadingSize; irr::core::recti fadingSize;
irr::core::vector2di fadingUL; irr::core::vector2di fadingUL;
...@@ -161,6 +176,7 @@ public: ...@@ -161,6 +176,7 @@ public:
DuelInfo dInfo; DuelInfo dInfo;
ClientField dField; ClientField dField;
DeckBuilder deckBuilder; DeckBuilder deckBuilder;
MenuHandler menuHandler;
irr::IrrlichtDevice* device; irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver; irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr; irr::scene::ISceneManager* smgr;
...@@ -193,10 +209,23 @@ public: ...@@ -193,10 +209,23 @@ public:
irr::gui::IGUIButton* btnClearLog; irr::gui::IGUIButton* btnClearLog;
irr::gui::IGUIButton* btnSaveLog; irr::gui::IGUIButton* btnSaveLog;
//main menu //main menu
irr::gui::IGUIWindow* wModeSelection; irr::gui::IGUIWindow* wMainMenu;
irr::gui::IGUITabControl* wModes; irr::gui::IGUIButton* btnLanMode;
irr::gui::IGUIButton* btnLanStartServer; irr::gui::IGUIButton* btnServerMode;
irr::gui::IGUIButton* btnLanCancelServer; irr::gui::IGUIButton* btnReplayMode;
irr::gui::IGUIButton* btnTestMode;
irr::gui::IGUIButton* btnDeckEdit;
irr::gui::IGUIButton* btnModeExit;
irr::gui::IGUIWindow* wLanWindow;
irr::gui::IGUIEditBox* ebNickName;
irr::gui::IGUIListBox* lstHostList;
irr::gui::IGUIEditBox* ebJoinIP;
irr::gui::IGUIEditBox* ebJoinPort;
irr::gui::IGUIEditBox* ebJoinPass;
irr::gui::IGUIButton* btnJoinHost;
irr::gui::IGUIButton* btnJoinCancel;
irr::gui::IGUIButton* btnCreateHost;
irr::gui::IGUIWindow* wHostWindow;
irr::gui::IGUIEditBox* ebStartLP; irr::gui::IGUIEditBox* ebStartLP;
irr::gui::IGUIEditBox* ebStartHand; irr::gui::IGUIEditBox* ebStartHand;
irr::gui::IGUIEditBox* ebDrawCount; irr::gui::IGUIEditBox* ebDrawCount;
...@@ -210,21 +239,12 @@ public: ...@@ -210,21 +239,12 @@ public:
irr::gui::IGUICheckBox* chkNoShufflePlayer; irr::gui::IGUICheckBox* chkNoShufflePlayer;
irr::gui::IGUICheckBox* chkAttackFT; irr::gui::IGUICheckBox* chkAttackFT;
irr::gui::IGUICheckBox* chkNoChainHint; irr::gui::IGUICheckBox* chkNoChainHint;
irr::gui::IGUIListBox* lstServerList;
irr::gui::IGUIButton* btnRefreshList;
irr::gui::IGUIEditBox* ebJoinIP;
irr::gui::IGUIEditBox* ebJoinPort;
irr::gui::IGUIEditBox* ebJoinPass;
irr::gui::IGUICheckBox* chkStOnly;
irr::gui::IGUIButton* btnLanConnect;
irr::gui::IGUIListBox* lstReplayList; irr::gui::IGUIListBox* lstReplayList;
irr::gui::IGUIButton* btnLoadReplay; irr::gui::IGUIButton* btnLoadReplay;
irr::gui::IGUIEditBox* ebUsername; irr::gui::IGUIEditBox* ebUsername;
irr::gui::IGUIComboBox* cbDeckSel; irr::gui::IGUIComboBox* cbDeckSel;
irr::gui::IGUIButton* btnDeckEdit;
irr::gui::IGUIStaticText* stModeStatus; irr::gui::IGUIStaticText* stModeStatus;
irr::gui::IGUIComboBox* cbIPList; irr::gui::IGUIComboBox* cbIPList;
irr::gui::IGUIButton* btnModeExit;
//message //message
irr::gui::IGUIWindow* wMessage; irr::gui::IGUIWindow* wMessage;
irr::gui::IGUIStaticText* stMessage; irr::gui::IGUIStaticText* stMessage;
...@@ -345,73 +365,71 @@ extern Game* mainGame; ...@@ -345,73 +365,71 @@ extern Game* mainGame;
#define COMMAND_ATTACK 0x0040 #define COMMAND_ATTACK 0x0040
#define COMMAND_LIST 0x0080 #define COMMAND_LIST 0x0080
#define TAB_MODES 50 #define BUTTON_LAN_MODE 100
#define BUTTON_SAVE_LOG 100 #define BUTTON_SERVER_MODE 101
#define BUTTON_CLEAR_LOG 101 #define BUTTON_REPLAY_MODE 102
#define LISTBOX_LOG 102 #define BUTTON_TEST_MODE 103
#define COMBOBOX_IPADDR 109 #define BUTTON_DECK_EDIT 104
#define BUTTON_LAN_START_SERVER 110 #define BUTTON_MODE_EXIT 105
#define BUTTON_LAN_CANCEL_SERVER 111 #define LISTBOX_LAN_HOST 110
#define BUTTON_LAN_CONNECT 112 #define BUTTON_JOIN_HOST 111
#define BUTTON_LAN_REFRESH 113 #define BUTTON_JOIN_CANCEL 112
#define BUTTON_LOAD_REPLAY 114 #define BUTTON_CREATE_HOST 113
#define BUTTON_DECK_EDIT 115 #define BUTTON_MSG_OK 150
#define BUTTON_MODE_EXIT 116 #define BUTTON_YES 151
#define LISTBOX_SERVER_LIST 117 #define BUTTON_NO 152
#define LISTBOX_REPLAY_LIST 118 #define BUTTON_POS_AU 160
#define BUTTON_MSG_OK 120 #define BUTTON_POS_AD 161
#define BUTTON_YES 121 #define BUTTON_POS_DU 162
#define BUTTON_NO 122 #define BUTTON_POS_DD 163
#define BUTTON_POS_AU 130 #define BUTTON_OPTION_PREV 170
#define BUTTON_POS_AD 131 #define BUTTON_OPTION_NEXT 171
#define BUTTON_POS_DU 132 #define BUTTON_OPTION_OK 172
#define BUTTON_POS_DD 133 #define BUTTON_CARD_0 180
#define BUTTON_OPTION_PREV 140 #define BUTTON_CARD_1 181
#define BUTTON_OPTION_NEXT 141 #define BUTTON_CARD_2 182
#define BUTTON_OPTION_OK 142 #define BUTTON_CARD_3 183
#define BUTTON_CARD_0 150 #define BUTTON_CARD_4 184
#define BUTTON_CARD_1 151 #define SCROLL_CARD_SELECT 185
#define BUTTON_CARD_2 152 #define BUTTON_CARD_SEL_OK 186
#define BUTTON_CARD_3 153 #define BUTTON_CMD_ACTIVATE 190
#define BUTTON_CARD_4 154 #define BUTTON_CMD_SUMMON 191
#define SCROLL_CARD_SELECT 155 #define BUTTON_CMD_SPSUMMON 192
#define BUTTON_CARD_SEL_OK 156 #define BUTTON_CMD_MSET 193
#define BUTTON_CMD_ACTIVATE 160 #define BUTTON_CMD_SSET 194
#define BUTTON_CMD_SUMMON 161 #define BUTTON_CMD_REPOS 195
#define BUTTON_CMD_SPSUMMON 162 #define BUTTON_CMD_ATTACK 196
#define BUTTON_CMD_MSET 163 #define BUTTON_CMD_SHOWLIST 197
#define BUTTON_CMD_SSET 164 #define BUTTON_ANNUMBER_OK 200
#define BUTTON_CMD_REPOS 165 #define BUTTON_ANCARD_OK 201
#define BUTTON_CMD_ATTACK 166 #define EDITBOX_ANCARD 202
#define BUTTON_CMD_SHOWLIST 167 #define LISTBOX_ANCARD 203
#define BUTTON_ANNUMBER_OK 170 #define CHECK_ATTRIBUTE 204
#define BUTTON_ANCARD_OK 171 #define CHECK_RACE 205
#define EDITBOX_ANCARD 172 #define BUTTON_BP 210
#define LISTBOX_ANCARD 173 #define BUTTON_M2 211
#define CHECK_ATTRIBUTE 174 #define BUTTON_EP 212
#define CHECK_RACE 175 #define BUTTON_CLEAR_LOG 220
#define BUTTON_BP 180 #define LISTBOX_LOG 221
#define BUTTON_M2 181 #define BUTTON_CATEGORY_OK 250
#define BUTTON_EP 182 #define COMBOBOX_DBLFLIST 251
#define BUTTON_CATEGORY_OK 200 #define COMBOBOX_DBDECKS 252
#define COMBOBOX_DBLFLIST 201 #define BUTTON_CLEAR_DECK 253
#define COMBOBOX_DBDECKS 202 #define BUTTON_SAVE_DECK 254
#define BUTTON_CLEAR_DECK 203 #define BUTTON_SAVE_DECK_AS 255
#define BUTTON_SAVE_DECK 204 #define BUTTON_DBEXIT 256
#define BUTTON_SAVE_DECK_AS 205 #define BUTTON_SORT_DECK 257
#define BUTTON_DBEXIT 206 #define COMBOBOX_MAINTYPE 260
#define BUTTON_SORT_DECK 207 #define BUTTON_EFFECT_FILTER 261
#define COMBOBOX_MAINTYPE 210 #define BUTTON_START_FILTER 262
#define BUTTON_EFFECT_FILTER 211 #define BUTTON_RESULT_FILTER 263
#define BUTTON_START_FILTER 212 #define SCROLL_FILTER 264
#define BUTTON_RESULT_FILTER 213 #define SCROLL_KEYWORD 265
#define SCROLL_FILTER 214 #define BUTTON_REPLAY_START 270
#define SCROLL_KEYWORD 215 #define BUTTON_REPLAY_PAUSE 271
#define BUTTON_REPLAY_START 220 #define BUTTON_REPLAY_STEP 272
#define BUTTON_REPLAY_PAUSE 221 #define BUTTON_REPLAY_EXIT 273
#define BUTTON_REPLAY_STEP 222 #define BUTTON_REPLAY_SWAP 274
#define BUTTON_REPLAY_EXIT 223 #define BUTTON_REPLAY_SAVE 280
#define BUTTON_REPLAY_SWAP 224 #define BUTTON_REPLAY_CANCEL 281
#define BUTTON_REPLAY_SAVE 230
#define BUTTON_REPLAY_CANCEL 231
#endif // GAME_H #endif // GAME_H
...@@ -347,7 +347,6 @@ int Game::EngineThread(void* pd) { ...@@ -347,7 +347,6 @@ int Game::EngineThread(void* pd) {
mainGame->stName->setText(L""); mainGame->stName->setText(L"");
mainGame->stDataInfo->setText(L""); mainGame->stDataInfo->setText(L"");
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->ShowElement(mainGame->wModeSelection);
mainGame->imageManager.ClearTexture(); mainGame->imageManager.ClearTexture();
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} }
...@@ -1066,7 +1065,6 @@ int Game::RecvThread(void* pd) { ...@@ -1066,7 +1065,6 @@ int Game::RecvThread(void* pd) {
mainGame->stName->setText(L""); mainGame->stName->setText(L"");
mainGame->stDataInfo->setText(L""); mainGame->stDataInfo->setText(L"");
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->ShowElement(mainGame->wModeSelection);
mainGame->imageManager.ClearTexture(); mainGame->imageManager.ClearTexture();
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} }
...@@ -3021,7 +3019,6 @@ int Game::ReplayThread(void* pd) { ...@@ -3021,7 +3019,6 @@ int Game::ReplayThread(void* pd) {
mainGame->stInfo->setText(L""); mainGame->stInfo->setText(L"");
mainGame->stDataInfo->setText(L""); mainGame->stDataInfo->setText(L"");
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->lstServerList->clear();
mainGame->stModeStatus->setText(L""); mainGame->stModeStatus->setText(L"");
mainGame->btnReplayStart->setVisible(false); mainGame->btnReplayStart->setVisible(false);
mainGame->btnReplayPause->setVisible(true); mainGame->btnReplayPause->setVisible(true);
...@@ -3029,12 +3026,6 @@ int Game::ReplayThread(void* pd) { ...@@ -3029,12 +3026,6 @@ int Game::ReplayThread(void* pd) {
mainGame->dInfo.engLen = 0; mainGame->dInfo.engLen = 0;
mainGame->dInfo.msgLen = 0; mainGame->dInfo.msgLen = 0;
mainGame->dInfo.is_local_host = false; mainGame->dInfo.is_local_host = false;
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
mainGame->HideElement(mainGame->wModeSelection);
mainGame->dField.panel = 0; mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0; mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0; mainGame->dField.clicked_card = 0;
...@@ -3122,7 +3113,6 @@ int Game::ReplayThread(void* pd) { ...@@ -3122,7 +3113,6 @@ int Game::ReplayThread(void* pd) {
mainGame->stName->setText(L""); mainGame->stName->setText(L"");
mainGame->stDataInfo->setText(L""); mainGame->stDataInfo->setText(L"");
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->ShowElement(mainGame->wModeSelection);
mainGame->imageManager.ClearTexture(); mainGame->imageManager.ClearTexture();
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} }
......
...@@ -184,16 +184,6 @@ int NetManager::BroadcastServer(void* np) { ...@@ -184,16 +184,6 @@ int NetManager::BroadcastServer(void* np) {
net->is_creating_host = false; net->is_creating_host = false;
shutdown(net->sBHost, SD_BOTH); shutdown(net->sBHost, SD_BOTH);
closesocket(net->sBHost); closesocket(net->sBHost);
if(!mainGame->is_closing) {
mainGame->gMutex.Lock();
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanCancelServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
mainGame->gMutex.Unlock();
}
return 0; return 0;
} }
int NetManager::BroadcastClient(void* np) { int NetManager::BroadcastClient(void* np) {
...@@ -209,7 +199,6 @@ int NetManager::BroadcastClient(void* np) { ...@@ -209,7 +199,6 @@ int NetManager::BroadcastClient(void* np) {
FD_ZERO(&fds); FD_ZERO(&fds);
FD_SET(net->sBClient, &fds); FD_SET(net->sBClient, &fds);
sendto(net->sBClient, (const char*)&net->hReq, sizeof(HostRequest), 0, (sockaddr*)&sockTo, sizeof(sockaddr)); sendto(net->sBClient, (const char*)&net->hReq, sizeof(HostRequest), 0, (sockaddr*)&sockTo, sizeof(sockaddr));
mainGame->lstServerList->clear();
mainGame->is_refreshing = true; mainGame->is_refreshing = true;
int result = select(0, &fds, 0, 0, &tv); int result = select(0, &fds, 0, 0, &tv);
std::set<int> addrset; std::set<int> addrset;
...@@ -236,14 +225,7 @@ int NetManager::BroadcastClient(void* np) { ...@@ -236,14 +225,7 @@ int NetManager::BroadcastClient(void* np) {
&& it->start_lp == 8000 && it->start_hand == 5 && it->draw_count == 1) && it->start_lp == 8000 && it->start_hand == 5 && it->draw_count == 1)
mode = L"标准设定"; mode = L"标准设定";
else mode = L"自定义设定"; else mode = L"自定义设定";
myswprintf(tbuf, L"[%ls][%ls]%ls", mode, it->lflist, it->name);
mainGame->lstServerList->addItem(tbuf);
} }
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->is_refreshing = false; mainGame->is_refreshing = false;
closesocket(net->sBClient); closesocket(net->sBClient);
...@@ -343,7 +325,7 @@ int NetManager::ListenThread(void* np) { ...@@ -343,7 +325,7 @@ int NetManager::ListenThread(void* np) {
mainGame->dInfo.engLen = 0; mainGame->dInfo.engLen = 0;
mainGame->dInfo.msgLen = 0; mainGame->dInfo.msgLen = 0;
mainGame->dField.Clear(); mainGame->dField.Clear();
mainGame->HideElement(mainGame->wModeSelection);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->WaitFrameSignal(10); mainGame->WaitFrameSignal(10);
closesocket(net->sBHost); closesocket(net->sBHost);
...@@ -363,18 +345,13 @@ int NetManager::JoinThread(void* adr) { ...@@ -363,18 +345,13 @@ int NetManager::JoinThread(void* adr) {
if(connect(pnet->sRemote, (sockaddr*)&server, sizeof(sockaddr)) == SOCKET_ERROR) { if(connect(pnet->sRemote, (sockaddr*)&server, sizeof(sockaddr)) == SOCKET_ERROR) {
closesocket(pnet->sRemote); closesocket(pnet->sRemote);
if(!mainGame->is_closing) { if(!mainGame->is_closing) {
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
mainGame->stModeStatus->setText(L"无法连接至主机"); mainGame->stModeStatus->setText(L"无法连接至主机");
} }
return 0; return 0;
} }
char* pbuf = pnet->send_buf; char* pbuf = pnet->send_buf;
NetManager::WriteInt16(pbuf, PROTO_VERSION); NetManager::WriteInt16(pbuf, PROTO_VERSION);
NetManager::WriteInt16(pbuf, mainGame->chkStOnly->isChecked() ? 1 : 0); NetManager::WriteInt16(pbuf, 1);
const wchar_t* pname = mainGame->ebJoinPass->getText(); const wchar_t* pname = mainGame->ebJoinPass->getText();
int i = 0; int i = 0;
while(pname[i] != 0 && i < 19) while(pname[i] != 0 && i < 19)
...@@ -401,11 +378,6 @@ int NetManager::JoinThread(void* adr) { ...@@ -401,11 +378,6 @@ int NetManager::JoinThread(void* adr) {
if(result == SOCKET_ERROR || pnet->recv_buf[0] != 0) { if(result == SOCKET_ERROR || pnet->recv_buf[0] != 0) {
closesocket(pnet->sRemote); closesocket(pnet->sRemote);
if(!mainGame->is_closing) { if(!mainGame->is_closing) {
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
if(result == SOCKET_ERROR) if(result == SOCKET_ERROR)
mainGame->stModeStatus->setText(L"网络连接发生错误"); mainGame->stModeStatus->setText(L"网络连接发生错误");
else if(pnet->recv_buf[0] == 0x1) { else if(pnet->recv_buf[0] == 0x1) {
...@@ -438,18 +410,11 @@ int NetManager::JoinThread(void* adr) { ...@@ -438,18 +410,11 @@ int NetManager::JoinThread(void* adr) {
mainGame->stInfo->setText(L""); mainGame->stInfo->setText(L"");
mainGame->stDataInfo->setText(L""); mainGame->stDataInfo->setText(L"");
mainGame->stText->setText(L""); mainGame->stText->setText(L"");
mainGame->lstServerList->clear();
mainGame->stModeStatus->setText(L""); mainGame->stModeStatus->setText(L"");
mainGame->dInfo.engLen = 0; mainGame->dInfo.engLen = 0;
mainGame->dInfo.msgLen = 0; mainGame->dInfo.msgLen = 0;
mainGame->dInfo.is_local_host = false; mainGame->dInfo.is_local_host = false;
mainGame->dField.Clear(); mainGame->dField.Clear();
mainGame->btnLanStartServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(true);
mainGame->btnRefreshList->setEnabled(true);
mainGame->btnLoadReplay->setEnabled(true);
mainGame->btnDeckEdit->setEnabled(true);
mainGame->HideElement(mainGame->wModeSelection);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
mainGame->WaitFrameSignal(10); mainGame->WaitFrameSignal(10);
Thread::NewThread(Game::RecvThread, &mainGame->dInfo); Thread::NewThread(Game::RecvThread, &mainGame->dInfo);
......
...@@ -132,6 +132,65 @@ ...@@ -132,6 +132,65 @@
!system 1071 反转 !system 1071 反转
!system 1072 卡通 !system 1072 卡通
!system 1073 超量 !system 1073 超量
#GUI
!system 1100 魔陷破坏
!system 1101 怪兽破坏
!system 1102 卡片除外
!system 1103 送去墓地
!system 1104 返回手牌
!system 1105 返回卡组
!system 1106 手牌破坏
!system 1107 卡组破坏
!system 1108 抽卡辅助
!system 1109 卡组检索
!system 1110 卡片回收
!system 1111 表示形式
!system 1112 控制权
!system 1113 攻守变化
!system 1114 穿刺伤害"
!system 1115 多次攻击
!system 1116 攻击限制
!system 1117 直接攻击
!system 1118 特殊召唤
!system 1119 衍生物
!system 1120 种族相关
!system 1121 属性相关
!system 1122 LP伤害
!system 1123 LP回复
!system 1124 破坏耐性
!system 1125 效果耐性
!system 1126 指示物
!system 1127 幸运
!system 1128 融合相关
!system 1129 同调相关
!system 1130 超量相关
!system 1131 效果无效
#actions
!system 1150 发动
!system 1151 召唤
!system 1152 特殊召唤
!system 1153 放置
!system 1154 反转召唤
!system 1155 守备表示
!system 1156 攻击表示
!system 1157 攻击
!system 1158 查看列表
#menu
!system 1200 局域网模式
!system 1201 ???
!system 1202 观看录像
!system 1203 ???
!system 1204 编辑卡组
!system 1210 退出
!system 1211 确定
!system 1212 取消
!system 1213
!system 1214
!system 1220 昵称:
!system 1221 主机信息:
!system 1222 主机密码:
!system 1223 加入游戏
!system 1224 建立主机
#vistory reason #vistory reason
!victory 0x1 LP变成0 !victory 0x1 LP变成0
!victory 0x2 没有卡可抽 !victory 0x2 没有卡可抽
......
#config file #config file
#nickname & gamename should be less than 20 characters #nickname & gamename should be less than 20 characters
nickname = Player antialias = 2
nickname = Player1
gamename = Game gamename = Game
lastdeck = infernity
textfont = c:/windows/fonts/simsun.ttc textfont = c:/windows/fonts/simsun.ttc
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arial.ttf
servport = 7911 serverport = 7911
defaultip = 127.0.0.1 lastip = 127.0.0.1
defaultport = 7911 lastport = 7911
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