Commit eb9bebcc authored by nanahira's avatar nanahira

Merge branch 'server' into 2pick

parents a60e0a94 e97885f0
......@@ -30,7 +30,6 @@
/Magic*
/pics
/Printer
/script
/ygopro-*
/*-Cards
......
......@@ -11,15 +11,8 @@ addons:
- libsqlite3-dev
before_install:
- git submodule update --init --recursive
- wget 'http://www.lua.org/ftp/lua-5.3.4.tar.gz'
- tar zxf lua-5.3.4.tar.gz
- cd lua-5.3.4
- make linux test
- sudo make install
- cd ..
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-linux.tar.gz | tar zfx -
- wget -O - https://www.lua.org/ftp/lua-5.3.4.tar.gz | tar zfx -; cd lua-5.3.4; sudo make linux install; cd ..
script:
- ./premake5 gmake
- cd build
......
version: '{build}'
skip_tags: true
install:
- git submodule update --init --recursive
......@@ -25,9 +27,6 @@ install:
# let premake happy
- xcopy /E premake\* .
# patch lua
# - patch -p0 < lua\lua.patch
# premake
- premake5 vs2015
......@@ -40,72 +39,23 @@ build:
after_build:
- ps: move bin\release\ygopro.exe .
- git clone https://github.com/Smile-DK/ygopro-svrelease
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-server/archive/master.zip ; exit 0"
- 7z x ygopro-server-master.zip
- mv -f ygopro-server-master ygopro-server
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://nodejs.org/dist/v9.1.0/node-v9.1.0-win-x64.zip ; exit 0"
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/MicrosoftArchive/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip ; exit 0"
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/archive/master.zip ; exit 0"
- 7z x windbot-master.zip
- cd windbot-master
- msbuild /property:Configuration=Release /property:OutDir=../ygopro-server/windbot
- cd ../ygopro-server
- mkdir ygopro
- cd ygopro
- mkdir replay
- mv -f ../../gframe .
- mv -f ../../ocgcore .
- mv -f ../../premake .
- mv -f ../../event .
- mv -f ../../lua .
- mv -f ../../sqlite3 .
- mv -f ../../script .
- mv -f ../../cards.cdb .
- mv -f ../../textures .
- mv -f ../../premake4.lua .
- mv -f ../../premake5.lua .
- mv -f ../../lflist.conf .
- mv -f ../../strings.conf .
- mv -f ../../system.conf .
- cp -rf ../../ygopro.exe .
- mv -f ../../premake5.exe .
- cd ..
- mkdir redis
- cd redis
- cp -rf ../../Redis-x64-3.2.100.zip .
- 7z x Redis-x64-3.2.100.zip
- rm -rf Redis-x64-3.2.100.zip
- cd ..
- cp -rf ygopro/cards.cdb windbot
- cp -rf config_build config
- cp -rf ../node-v9.1.0-win-x64.zip .
- 7z x node-v9.1.0-win-x64.zip
- rm -rf node-v9.1.0-win-x64.zip
- cp -rf node-v9.1.0-win-x64/* .
- rm -rf node-v9.1.0-win-x64
- npm install
- npm install pm2@latest -g
- npm install ws
- npm install redis
- 7z a -mx9 -xr!.git* ../ygopro-server.7z ./*
- cd ..
test: off
artifacts:
- path: ygopro.exe
name: ygopro
- path: ygopro-server.7z
name: ygopro-server
name: ygopro server mode
deploy:
release: win
description: 'Automatic build commit $(APPVEYOR_REPO_COMMIT) $(APPVEYOR_REPO_COMMIT_TIMESTAMP)'
provider: GitHub
force_update: true
auth_token:
secure: EQ9miMjfX/QAoBvgc6D+JLmHatLyxOEKZ/uo68QijxWW5Gp4MzB/pOH9+u2GlDVO
on:
branch: server
cache:
- premake-5.0.0-alpha12-windows.zip
......@@ -114,5 +64,3 @@ cache:
- irrlicht-1.8.4.zip
- lua-5.3.4.tar.gz
- sqlite-amalgamation-3210000.zip
- Redis-x64-3.2.100.zip
No preview for this file type
......@@ -177,6 +177,46 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break;
}
case BUTTON_RENAME_DECK: {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->wRenameDeck->setText(dataManager.GetSysString(1367));
mainGame->ebREName->setText(mainGame->cbDBDecks->getItem(sel));
mainGame->PopupElement(mainGame->wRenameDeck);
mainGame->gMutex.Unlock();
prev_operation = id;
prev_sel = sel;
break;
}
case BUTTON_RENAME_DECK_SAVE: {
mainGame->HideElement(mainGame->wRenameDeck);
if(prev_operation == BUTTON_RENAME_DECK) {
wchar_t newname[256];
BufferIO::CopyWStr(mainGame->ebREName->getText(), newname, 256);
if(mywcsncasecmp(newname + wcslen(newname) - 4, L"", 4)) {
myswprintf(newname, L"%ls", mainGame->ebREName->getText());
}
if(DeckManager::RenameDeck(mainGame->cbDBDecks->getItem(prev_sel), newname)) {
mainGame->RefreshDeck(mainGame->cbDBDecks);
mainGame->cbDBDecks->setSelected(prev_sel);
mainGame->stACMessage->setText(dataManager.GetSysString(1366));
mainGame->PopupElement(mainGame->wACMessage, 20);
} else {
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1365));
}
}
prev_operation = 0;
prev_sel = -1;
break;
}
case BUTTON_RENAME_DECK_CANCEL: {
mainGame->HideElement(mainGame->wRenameDeck);
prev_operation = 0;
prev_sel = -1;
break;
}
case BUTTON_DELETE_DECK: {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
......@@ -777,7 +817,7 @@ void DeckBuilder::FilterCards() {
results.clear();
const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = BufferIO::GetVal(pstr);
if (dataManager.GetData(trycode, 0)) {
if(dataManager.GetData(trycode, 0)) {
auto ptr = dataManager.GetCodePointer(trycode); // verified by GetData()
results.push_back(ptr);
mainGame->scrFilter->setVisible(false);
......@@ -791,16 +831,14 @@ void DeckBuilder::FilterCards() {
size_t element_start = 0;
while (1) {
size_t element_end = str.find_first_of(L' ', element_start);
if (element_end == std::wstring::npos) {
if (element_end == std::wstring::npos)
break;
}
size_t length = element_end - element_start;
if(length > 0) {
query_elements.push_back(str.substr(element_start, length));
element_start = element_end + 1;
} else {
} else
element_start++;
}
}
query_elements.push_back(str.substr(element_start));
std::unordered_map<std::wstring, unsigned int> set_code_map;
......@@ -817,73 +855,72 @@ void DeckBuilder::FilterCards() {
query_elements.erase(*elements_track_iterator);
}
auto strpointer = dataManager._strings.begin();
for (code_pointer ptr = dataManager._datas.begin(); ptr != dataManager._datas.end(); ++ptr, ++strpointer) {
for(code_pointer ptr = dataManager._datas.begin(); ptr != dataManager._datas.end(); ++ptr, ++strpointer) {
const CardDataC& data = ptr->second;
const CardString& text = strpointer->second;
if (data.type & TYPE_TOKEN)
if(data.type & TYPE_TOKEN)
continue;
switch (filter_type) {
switch(filter_type) {
case 1: {
if (!(data.type & TYPE_MONSTER) || (data.type & filter_type2) != filter_type2)
if(!(data.type & TYPE_MONSTER) || (data.type & filter_type2) != filter_type2)
continue;
if (filter_race && data.race != filter_race)
if(filter_race && data.race != filter_race)
continue;
if (filter_attrib && data.attribute != filter_attrib)
if(filter_attrib && data.attribute != filter_attrib)
continue;
if (filter_atktype) {
if ((filter_atktype == 1 && data.attack != filter_atk) || (filter_atktype == 2 && data.attack < filter_atk)
|| (filter_atktype == 3 && data.attack <= filter_atk) || (filter_atktype == 4 && (data.attack > filter_atk || data.attack < 0))
|| (filter_atktype == 5 && (data.attack >= filter_atk || data.attack < 0)) || (filter_atktype == 6 && data.attack != -2))
if(filter_atktype) {
if((filter_atktype == 1 && data.attack != filter_atk) || (filter_atktype == 2 && data.attack < filter_atk)
|| (filter_atktype == 3 && data.attack <= filter_atk) || (filter_atktype == 4 && (data.attack > filter_atk || data.attack < 0))
|| (filter_atktype == 5 && (data.attack >= filter_atk || data.attack < 0)) || (filter_atktype == 6 && data.attack != -2))
continue;
}
if(filter_deftype) {
if((filter_deftype == 1 && data.defense != filter_def) || (filter_deftype == 2 && data.defense < filter_def)
|| (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2)
|| (data.type & TYPE_LINK))
|| (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2)
|| (data.type & TYPE_LINK))
continue;
}
if (filter_lvtype) {
if ((filter_lvtype == 1 && data.level != filter_lv) || (filter_lvtype == 2 && data.level < filter_lv)
|| (filter_lvtype == 3 && data.level <= filter_lv) || (filter_lvtype == 4 && data.level > filter_lv)
|| (filter_lvtype == 5 && data.level >= filter_lv) || filter_lvtype == 6)
if(filter_lvtype) {
if((filter_lvtype == 1 && data.level != filter_lv) || (filter_lvtype == 2 && data.level < filter_lv)
|| (filter_lvtype == 3 && data.level <= filter_lv) || (filter_lvtype == 4 && data.level > filter_lv)
|| (filter_lvtype == 5 && data.level >= filter_lv) || filter_lvtype == 6)
continue;
}
if(filter_scltype) {
if((filter_scltype == 1 && data.lscale != filter_scl) || (filter_scltype == 2 && data.lscale < filter_scl)
|| (filter_scltype == 3 && data.lscale <= filter_scl) || (filter_scltype == 4 && (data.lscale > filter_scl || data.lscale == 0))
|| (filter_scltype == 5 && (data.lscale >= filter_scl || data.lscale == 0)) || filter_scltype == 6
|| !(data.type & TYPE_PENDULUM))
|| (filter_scltype == 3 && data.lscale <= filter_scl) || (filter_scltype == 4 && (data.lscale > filter_scl || data.lscale == 0))
|| (filter_scltype == 5 && (data.lscale >= filter_scl || data.lscale == 0)) || filter_scltype == 6
|| !(data.type & TYPE_PENDULUM))
continue;
}
break;
}
case 2: {
if (!(data.type & TYPE_SPELL))
if(!(data.type & TYPE_SPELL))
continue;
if (filter_type2 && data.type != filter_type2)
if(filter_type2 && data.type != filter_type2)
continue;
break;
}
case 3: {
if (!(data.type & TYPE_TRAP))
if(!(data.type & TYPE_TRAP))
continue;
if (filter_type2 && data.type != filter_type2)
if(filter_type2 && data.type != filter_type2)
continue;
break;
}
}
if (filter_effect && !(data.category & filter_effect))
if(filter_effect && !(data.category & filter_effect))
continue;
if(filter_marks && (data.link_marker & filter_marks)!= filter_marks)
continue;
if(filter_lm) {
if(filter_lm <= 3 && (!filterList->count(ptr->first) || (*filterList)[ptr->first] != filter_lm - 1))
continue;
if (filter_lm == 4 && data.ot != 1)
if(filter_lm == 4 && data.ot != 1)
continue;
if (filter_lm == 5 && data.ot != 2)
if(filter_lm == 5 && data.ot != 2)
continue;
if(filter_lm == 6 && data.ot != 3)
continue;
......@@ -912,19 +949,17 @@ void DeckBuilder::FilterCards() {
}
}
}
if (is_target) {
if (is_target)
results.push_back(ptr);
} else {
else
continue;
}
}
myswprintf(result_string, L"%d", results.size());
if (results.size() > 7) {
if(results.size() > 7) {
mainGame->scrFilter->setVisible(true);
mainGame->scrFilter->setMax(results.size() - 7);
mainGame->scrFilter->setPos(0);
}
else {
} else {
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
}
......
......@@ -90,6 +90,23 @@ void DeckManager::LoadLFList() {
nolimit.content = new std::unordered_map<int, int>;
_lfList.push_back(nolimit);
}
bool DeckManager::RenameDeck(const wchar_t* oldname, const wchar_t* newname) {
wchar_t oldfname[256];
wchar_t newfname[256];
myswprintf(oldfname, L"./deck/%ls.ydk", oldname);
myswprintf(newfname, L"./deck/%ls.ydk", newname);
#ifdef WIN32
BOOL result = MoveFileW(oldfname, newfname);
return !!result;
#else
char oldfilefn[256];
char newfilefn[256];
BufferIO::EncodeUTF8(oldfname, oldfilefn);
BufferIO::EncodeUTF8(newfname, newfilefn);
int result = rename(oldfilefn, newfilefn);
return result == 0;
#endif
}
wchar_t* DeckManager::GetLFListName(int lfhash) {
for(size_t i = 0; i < _lfList.size(); ++i) {
if(_lfList[i].hash == (unsigned int)lfhash) {
......@@ -298,4 +315,28 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) {
return result == 0;
#endif
}
const wchar_t* DeckManager::GetMainFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d )", deckManager.current_deck.main.size(), GetTypeCount(deckManager.current_deck.main, TYPE_MONSTER), GetTypeCount(deckManager.current_deck.main, TYPE_SPELL), GetTypeCount(deckManager.current_deck.main, TYPE_TRAP));
wchar_t* result = DeckFormatBuffer;
return result;
}
const wchar_t* DeckManager::GetExtraFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d / %d )", deckManager.current_deck.extra.size(), GetTypeCount(deckManager.current_deck.extra, TYPE_FUSION), GetTypeCount(deckManager.current_deck.extra, TYPE_SYNCHRO), GetTypeCount(deckManager.current_deck.extra, TYPE_XYZ), GetTypeCount(deckManager.current_deck.extra, TYPE_LINK));
wchar_t* result = DeckFormatBuffer;
return result;
}
const wchar_t* DeckManager::GetSideFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d / %d )", deckManager.current_deck.side.size(), GetTypeCount(deckManager.current_deck.side, TYPE_MONSTER), GetTypeCount(deckManager.current_deck.side, TYPE_SPELL), GetTypeCount(deckManager.current_deck.side, TYPE_TRAP), GetTypeCount(deckManager.current_deck.side, TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK));
wchar_t* result = DeckFormatBuffer;
return result;
}
int DeckManager::GetTypeCount(std::vector<code_pointer> list, unsigned int ctype) {
int res = 0;
for(size_t i = 0; i < list.size(); ++i) {
code_pointer cur = list[i];
if(cur->second.type & ctype)
res++;
}
return res;
}
}
......@@ -44,6 +44,12 @@ public:
bool LoadDeck(const wchar_t* file);
bool SaveDeck(Deck& deck, const wchar_t* name);
bool DeleteDeck(Deck& deck, const wchar_t* name);
static bool RenameDeck(const wchar_t* oldname, const wchar_t* newname);
wchar_t DeckFormatBuffer[128];
const wchar_t* GetMainFormatString();
const wchar_t* GetSideFormatString();
const wchar_t* GetExtraFormatString();
int GetTypeCount(std::vector<code_pointer> list, unsigned int ctype);
};
extern DeckManager deckManager;
......
......@@ -1111,10 +1111,10 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
void Game::DrawDeckBd() {
wchar_t textBuffer[64];
//main deck
driver->draw2DRectangle(Resize(310, 137, 410, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 136, 410, 157));
DrawShadowText(textFont, dataManager.GetSysString(1330), Resize(315, 137, 410, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.main.size()], Resize(380, 138, 440, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 137, 510, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 136, 510, 157));
DrawShadowText(textFont, dataManager.GetSysString(1330), Resize(315, 137, 510, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetMainFormatString(), Resize(380, 138, 540, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 160, 797, 436), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 159, 797, 436));
int lx;
......@@ -1132,10 +1132,10 @@ void Game::DrawDeckBd() {
driver->draw2DRectangleOutline(Resize(313 + (i % lx) * dx, 163 + (i / lx) * 68, 359 + (i % lx) * dx, 228 + (i / lx) * 68));
}
//extra deck
driver->draw2DRectangle(Resize(310, 440, 410, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 439, 410, 460));
DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 410, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.extra.size()], Resize(380, 441, 440, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 440, 510, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 439, 510, 460));
DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 510, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetExtraFormatString(), Resize(380, 441, 540, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 463, 797, 533), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 462, 797, 533));
if(deckManager.current_deck.extra.size() <= 10)
......@@ -1147,10 +1147,10 @@ void Game::DrawDeckBd() {
driver->draw2DRectangleOutline(Resize(313 + i * dx, 465, 359 + i * dx, 531));
}
//side deck
driver->draw2DRectangle(Resize(310, 537, 410, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 536, 410, 557));
DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 410, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.side.size()], Resize(380, 538, 440, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 537, 510, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 536, 510, 557));
DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 510, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetSideFormatString(), Resize(380, 538, 540, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 560, 797, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 559, 797, 630));
if(deckManager.current_deck.side.size() <= 10)
......
......@@ -662,6 +662,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainAlways->setVisible(false);
mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false);
if(!mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
mainGame->dInfo.isReplaySkiping = false;
mainGame->stMessage->setText(dataManager.GetSysString(1500));
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
......@@ -929,7 +931,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int type = BufferIO::ReadInt8(pbuf);
/*int player = */BufferIO::ReadInt8(pbuf);
int data = BufferIO::ReadInt32(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
switch (type) {
case HINT_EVENT: {
......@@ -1059,6 +1061,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_WIN: {
mainGame->dInfo.isFinished = true;
if(!mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.isReplaySkiping = false;
mainGame->gMutex.Lock();
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
}
int player = BufferIO::ReadInt8(pbuf);
int type = BufferIO::ReadInt8(pbuf);
mainGame->showcarddif = 110;
......@@ -1465,7 +1473,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_SELECT_UNSELECT_CARD: {
/*int selecting_player = */BufferIO::ReadInt8(pbuf);
bool buttonok = BufferIO::ReadInt8(pbuf);
bool buttonok = !!BufferIO::ReadInt8(pbuf);
mainGame->dField.select_cancelable = BufferIO::ReadInt8(pbuf);
mainGame->dField.select_min = BufferIO::ReadInt8(pbuf);
mainGame->dField.select_max = BufferIO::ReadInt8(pbuf);
......@@ -1928,7 +1936,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (code != 0)
pcard->SetCode(code);
}
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_REVEAL);
myswprintf(textBuffer, dataManager.GetSysString(207), count);
......@@ -1968,7 +1976,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (code != 0)
pcard->SetCode(code);
}
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_REVEAL);
myswprintf(textBuffer, dataManager.GetSysString(207), count);
......@@ -2001,7 +2009,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
std::vector<ClientCard*> field_confirm;
std::vector<ClientCard*> panel_confirm;
ClientCard* pcard;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pbuf += count * 7;
return true;
}
......@@ -2105,7 +2113,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(mainGame->dField.deck[player].size() < 2)
return true;
bool rev = mainGame->dField.deck_reversed;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mainGame->dField.deck_reversed = false;
if(rev) {
for (size_t i = 0; i < mainGame->dField.deck[player].size(); ++i)
......@@ -2117,7 +2125,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.deck[player][i]->code = 0;
mainGame->dField.deck[player][i]->is_reversed = false;
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_SHUFFLE);
for (int i = 0; i < 5; ++i) {
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) {
......@@ -2142,7 +2150,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_SHUFFLE_HAND: {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int count = BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
if(count > 1)
soundManager.PlaySoundEffect(SOUND_SHUFFLE);
mainGame->WaitFrameSignal(5);
......@@ -2171,7 +2179,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
for (auto cit = mainGame->dField.hand[player].begin(); cit != mainGame->dField.hand[player].end(); ++cit)
(*cit)->SetCode(BufferIO::ReadInt32(pbuf));
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
for (auto cit = mainGame->dField.hand[player].begin(); cit != mainGame->dField.hand[player].end(); ++cit) {
(*cit)->is_hovered = false;
mainGame->dField.MoveCard(*cit, 5);
......@@ -2185,7 +2193,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int count = BufferIO::ReadInt8(pbuf);
if((mainGame->dField.extra[player].size() - mainGame->dField.extra_p_count[player]) < 2)
return true;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
if(count > 1)
soundManager.PlaySoundEffect(SOUND_SHUFFLE);
for (int i = 0; i < 5; ++i) {
......@@ -2215,7 +2223,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_SWAP_GRAVE_DECK: {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dField.grave[player].swap(mainGame->dField.deck[player]);
for (auto cit = mainGame->dField.grave[player].begin(); cit != mainGame->dField.grave[player].end(); ++cit)
(*cit)->location = LOCATION_GRAVE;
......@@ -2259,7 +2267,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_REVERSE_DECK: {
mainGame->dField.deck_reversed = !mainGame->dField.deck_reversed;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
for(size_t i = 0; i < mainGame->dField.deck[0].size(); ++i)
mainGame->dField.MoveCard(mainGame->dField.deck[0][i], 10);
for(size_t i = 0; i < mainGame->dField.deck[1].size(); ++i)
......@@ -2293,14 +2301,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt8(pbuf);
mc[i] = mainGame->dField.mzone[c][s];
mc[i]->SetCode(0);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mc[i]->dPos = irr::core::vector3df((3.95f - mc[i]->curPos.X) / 10, 0, 0.05f);
mc[i]->dRot = irr::core::vector3df(0, 0, 0);
mc[i]->is_moving = true;
mc[i]->aniFrame = 10;
}
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
if(!mainGame->dInfo.isReplaySkiping)
mainGame->WaitFrameSignal(20);
for (int i = 0; i < count; ++i) {
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
......@@ -2316,7 +2324,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
swp->sequence = ps;
}
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_SHUFFLE);
for (int i = 0; i < count; ++i) {
mainGame->dField.MoveCard(mc[i], 10);
......@@ -2358,7 +2366,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else
mainGame->dInfo.tag_player[1] = !mainGame->dInfo.tag_player[1];
}
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_NEXT_TURN);
mainGame->showcardcode = 10;
mainGame->showcarddif = 30;
......@@ -2406,7 +2414,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
mainGame->btnPhaseStatus->setPressed(true);
mainGame->btnPhaseStatus->setVisible(true);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_PHASE);
mainGame->showcard = 101;
mainGame->WaitFrameSignal(40);
......@@ -2425,7 +2433,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int cs = BufferIO::ReadInt8(pbuf);
int cp = BufferIO::ReadInt8(pbuf);
int reason = BufferIO::ReadInt32(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
if(cl & LOCATION_REMOVED && pl != cl)
soundManager.PlaySoundEffect(SOUND_BANISHED);
else if(reason & REASON_DESTROY && pl != cl)
......@@ -2435,7 +2443,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* pcard = new ClientCard();
pcard->position = cp;
pcard->SetCode(code);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->dField.AddCard(pcard, cc, cl, cs);
mainGame->gMutex.Unlock();
......@@ -2452,7 +2460,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->ClearTarget();
for(auto eqit = pcard->equipped.begin(); eqit != pcard->equipped.end(); ++eqit)
(*eqit)->equipTarget = 0;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mainGame->dField.FadeCard(pcard, 5, 20);
mainGame->WaitFrameSignal(20);
mainGame->gMutex.Lock();
......@@ -2484,7 +2492,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_showequip = false;
pcard->is_showtarget = false;
pcard->is_showchaintarget = false;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dField.RemoveCard(pc, pl, ps);
pcard->position = cp;
mainGame->dField.AddCard(pcard, cc, cl, cs);
......@@ -2536,7 +2544,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_showtarget = false;
pcard->is_showchaintarget = false;
ClientCard* olcard = mainGame->dField.GetCard(cc, cl & 0x7f, cs);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dField.RemoveCard(pc, pl, ps);
olcard->overlayed.push_back(pcard);
mainGame->dField.overlay_cards.insert(pcard);
......@@ -2565,7 +2573,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} else if (!(cl & 0x80)) {
ClientCard* olcard = mainGame->dField.GetCard(pc, pl & 0x7f, ps);
ClientCard* pcard = olcard->overlayed[pp];
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
olcard->overlayed.erase(olcard->overlayed.begin() + pcard->sequence);
pcard->overlayTarget = 0;
pcard->position = cp;
......@@ -2595,7 +2603,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* olcard1 = mainGame->dField.GetCard(pc, pl & 0x7f, ps);
ClientCard* pcard = olcard1->overlayed[pp];
ClientCard* olcard2 = mainGame->dField.GetCard(cc, cl & 0x7f, cs);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
olcard1->overlayed.erase(olcard1->overlayed.begin() + pcard->sequence);
olcard2->overlayed.push_back(pcard);
pcard->sequence = olcard2->overlayed.size() - 1;
......@@ -2638,7 +2646,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (code != 0 && pcard->code != code)
pcard->SetCode(code);
pcard->position = cp;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
myswprintf(event_string, dataManager.GetSysString(1600));
mainGame->dField.MoveCard(pcard, 10);
mainGame->WaitFrameSignal(11);
......@@ -2651,7 +2659,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
if(!mainGame->dInfo.isReplaySkiping)
soundManager.PlaySoundEffect(SOUND_SET);
myswprintf(event_string, dataManager.GetSysString(1601));
return true;
......@@ -2670,7 +2678,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(event_string, dataManager.GetSysString(1602));
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->dField.RemoveCard(c1, l1, s1);
mainGame->dField.RemoveCard(c2, l2, s2);
......@@ -2705,7 +2713,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_SUMMON);
myswprintf(event_string, dataManager.GetSysString(1603), dataManager.GetName(code));
mainGame->showcardcode = code;
......@@ -2728,7 +2736,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int cl = */BufferIO::ReadInt8(pbuf);
/*int cs = */BufferIO::ReadInt8(pbuf);
/*int cp = */BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
CardData cd;
if(dataManager.GetData(code, &cd) && (cd.type & TYPE_TOKEN))
soundManager.PlaySoundEffect(SOUND_TOKEN);
......@@ -2757,7 +2765,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* pcard = mainGame->dField.GetCard(cc, cl, cs);
pcard->SetCode(code);
pcard->position = cp;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
soundManager.PlaySoundEffect(SOUND_FILP);
myswprintf(event_string, dataManager.GetSysString(1607), dataManager.GetName(code));
mainGame->dField.MoveCard(pcard, 10);
......@@ -2787,7 +2795,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int cs = BufferIO::ReadInt8(pbuf);
int desc = BufferIO::ReadInt32(pbuf);
/*int ct = */BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_ACTIVATE);
ClientCard* pcard = mainGame->dField.GetCard(pcc, pcl, pcs, subs);
......@@ -2828,7 +2836,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_CHAINED: {
int ct = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
myswprintf(event_string, dataManager.GetSysString(1609), dataManager.GetName(mainGame->dField.current_chain.code));
mainGame->gMutex.Lock();
......@@ -2841,7 +2849,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_CHAIN_SOLVING: {
int ct = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
if (mainGame->dField.chains.size() > 1) {
if (mainGame->dField.last_chain)
......@@ -2872,7 +2880,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_CHAIN_NEGATED:
case MSG_CHAIN_DISABLED: {
int ct = BufferIO::ReadInt8(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
mainGame->showcardcode = mainGame->dField.chains[ct - 1].code;
mainGame->showcarddif = 0;
mainGame->showcard = 3;
......@@ -2887,7 +2895,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_RANDOM_SELECTED: {
/*int player = */BufferIO::ReadInt8(pbuf);
int count = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pbuf += count * 4;
return true;
}
......@@ -2912,7 +2920,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_BECOME_TARGET: {
//soundManager.PlaySoundEffect(SOUND_TARGET);
int count = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pbuf += count * 4;
return true;
}
......@@ -2950,7 +2958,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(!mainGame->dField.deck_reversed || code)
pcard->SetCode(code & 0x7fffffff);
}
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
for (int i = 0; i < count; ++i) {
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1);
mainGame->dField.deck[player].erase(mainGame->dField.deck[player].end() - 1);
......@@ -2980,7 +2988,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int final = mainGame->dInfo.lp[player] - val;
if (final < 0)
final = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.lp[player] = final;
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
......@@ -3009,7 +3017,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf);
int final = mainGame->dInfo.lp[player] + val;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.lp[player] = final;
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
......@@ -3045,7 +3053,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt8(pbuf);
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
if(pc1->equipTarget)
pc1->equipTarget->equipped.erase(pc1);
pc1->equipTarget = pc2;
......@@ -3071,7 +3079,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case MSG_LPUPDATE: {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
int val = BufferIO::ReadInt32(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.lp[player] = val;
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
......@@ -3092,7 +3100,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int s1 = BufferIO::ReadInt8(pbuf);
BufferIO::ReadInt8(pbuf);
ClientCard* pc = mainGame->dField.GetCard(c1, l1, s1);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pc->equipTarget->equipped.erase(pc);
pc->equipTarget = 0;
} else {
......@@ -3118,7 +3126,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt8(pbuf);
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pc1->cardTarget.insert(pc2);
pc2->ownerTarget.insert(pc1);
} else {
......@@ -3144,7 +3152,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
BufferIO::ReadInt8(pbuf);
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
pc1->cardTarget.erase(pc2);
pc2->ownerTarget.erase(pc1);
} else {
......@@ -3165,7 +3173,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int final = mainGame->dInfo.lp[player] - cost;
if (final < 0)
final = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(mainGame->dInfo.isReplaySkiping) {
mainGame->dInfo.lp[player] = final;
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
return true;
......@@ -3196,7 +3204,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if (pc->counters.count(type))
pc->counters[type] += count;
else pc->counters[type] = count;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_COUNTER_ADD);
myswprintf(textBuffer, dataManager.GetSysString(1617), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
......@@ -3219,7 +3227,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pc->counters[type] -= count;
if (pc->counters[type] <= 0)
pc->counters.erase(type);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_COUNTER_REMOVE);
myswprintf(textBuffer, dataManager.GetSysString(1618), dataManager.GetName(pc->code), count, dataManager.GetCounterName(type));
......@@ -3242,7 +3250,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int ld = BufferIO::ReadInt8(pbuf);
int sd = BufferIO::ReadInt8(pbuf);
BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
float sy;
if (ld != 0) {
......@@ -3298,7 +3306,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int datk = BufferIO::ReadInt32(pbuf);
int ddef = BufferIO::ReadInt32(pbuf);
/*int dd = */BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
ClientCard* pcard = mainGame->dField.GetCard(ca, la, sa);
......@@ -3354,7 +3362,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf++ = L']';
}
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_COIN);
mainGame->gMutex.Lock();
......@@ -3378,7 +3386,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
*pwbuf++ = L']';
}
*pwbuf = 0;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
soundManager.PlaySoundEffect(SOUND_DICE);
mainGame->gMutex.Lock();
......@@ -3392,7 +3400,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_ROCK_PAPER_SCISSORS: {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
mainGame->gMutex.Lock();
mainGame->PopupElement(mainGame->wHand);
......@@ -3401,7 +3409,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case MSG_HAND_RES: {
int res = BufferIO::ReadInt8(pbuf);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
mainGame->stHintMsg->setVisible(false);
int res1 = (res & 0x3) - 1;
......@@ -3533,7 +3541,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(chtype == CHINT_TURN) {
if(value == 0)
return true;
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping)
if(mainGame->dInfo.isReplaySkiping)
return true;
if(pcard->location & LOCATION_ONFIELD)
pcard->is_highlighting = true;
......@@ -3573,7 +3581,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
size_t pcount = (size_t)BufferIO::ReadInt8(pbuf);
size_t hcount = (size_t)BufferIO::ReadInt8(pbuf);
int topcode = BufferIO::ReadInt32(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) {
if(player == 0) (*cit)->dPos.Y = 0.4f;
else (*cit)->dPos.Y = -0.6f;
......@@ -3598,7 +3606,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(5);
}
//
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
if(!mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Lock();
if(mainGame->dField.deck[player].size() > mcount) {
while(mainGame->dField.deck[player].size() > mcount) {
......@@ -3646,10 +3654,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
mainGame->dField.extra_p_count[player] = pcount;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
if(!mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Unlock();
//
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
if(!mainGame->dInfo.isReplaySkiping) {
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ++cit) {
ClientCard* pcard = *cit;
mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot);
......
......@@ -1680,6 +1680,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break;
}
case irr::KEY_KEY_Z: {
if(!mainGame->dInfo.isReplay && !mainGame->HasFocus(EGUIET_EDIT_BOX)) {
mainGame->dInfo.isReplaySkiping = event.KeyInput.PressedDown;
if(mainGame->dInfo.isStarted && !mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
}
}
break;
}
case irr::KEY_F1:
case irr::KEY_F2:
case irr::KEY_F3:
......
......@@ -540,11 +540,21 @@ bool Game::Initialize() {
btnSideSort->setVisible(false);
btnSideReload = env->addButton(rect<s32>(440, 100, 500, 130), 0, BUTTON_SIDE_RELOAD, dataManager.GetSysString(1309));
btnSideReload->setVisible(false);
btnRenameDeck = env->addButton(rect<s32>(170, 99, 220, 120), wDeckEdit, BUTTON_RENAME_DECK, dataManager.GetSysString(1362));
//
scrFilter = env->addScrollBar(false, recti(999, 161, 1019, 629), 0, SCROLL_FILTER);
scrFilter->setLargeStep(10);
scrFilter->setSmallStep(1);
scrFilter->setVisible(false);
//rename deck
wRenameDeck = env->addWindow(rect<s32>(510, 200, 820, 320), false, dataManager.GetSysString(1367));
wRenameDeck->getCloseButton()->setVisible(false);
wRenameDeck->setVisible(false);
env->addStaticText(dataManager.GetSysString(1368), rect<s32>(20, 25, 290, 45), false, false, wRenameDeck);
ebREName = env->addEditBox(L"", rect<s32>(20, 50, 290, 70), true, wRenameDeck, -1);
ebREName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnREYes = env->addButton(rect<s32>(70, 80, 140, 105), wRenameDeck, BUTTON_RENAME_DECK_SAVE, dataManager.GetSysString(1341));
btnRENo = env->addButton(rect<s32>(170, 80, 240, 105), wRenameDeck, BUTTON_RENAME_DECK_CANCEL, dataManager.GetSysString(1212));
//sort type
wSort = env->addStaticText(L"", rect<s32>(930, 132, 1020, 156), true, false, 0, -1, true);
cbSortType = env->addComboBox(rect<s32>(10, 2, 85, 22), wSort, COMBOBOX_SORTTYPE);
......@@ -1728,6 +1738,7 @@ void Game::OnResize() {
btnSideSort->setRelativePosition(Resize(375, 100, 435, 130));
btnSideReload->setRelativePosition(Resize(440, 100, 500, 130));
btnDeleteDeck->setRelativePosition(Resize(225, 95, 290, 120));
btnRenameDeck->setRelativePosition(Resize(170, 99, 220, 120));
wLanWindow->setRelativePosition(ResizeWin(220, 100, 800, 520));
wCreateHost->setRelativePosition(ResizeWin(320, 100, 700, 520));
......@@ -1749,7 +1760,7 @@ void Game::OnResize() {
wANRace->setRelativePosition(ResizeWin(480, 200, 850, 410));
wReplaySave->setRelativePosition(ResizeWin(510, 200, 820, 320));
stHintMsg->setRelativePosition(ResizeWin(500, 60, 820, 90));
//sound / music volume bar
scrSoundVolume->setRelativePosition(recti(20 + 126, 200 + 4, 20 + (300 * xScale) - 40, 200 + 21));
scrMusicVolume->setRelativePosition(recti(20 + 126, 230 + 4, 20 + (300 * xScale) - 40, 230 + 21));
......
......@@ -464,6 +464,12 @@ public:
irr::gui::IGUIStaticText* stStar;
irr::gui::IGUIStaticText* stSearch;
irr::gui::IGUIStaticText* stScale;
irr::gui::IGUIButton* btnRenameDeck;
//deck rename
irr::gui::IGUIWindow* wRenameDeck;
irr::gui::IGUIEditBox* ebREName;
irr::gui::IGUIButton* btnREYes;
irr::gui::IGUIButton* btnRENo;
//filter
irr::gui::IGUIStaticText* wFilter;
irr::gui::IGUIScrollBar* scrFilter;
......@@ -675,6 +681,10 @@ extern HostInfo game_info;
#define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381
#define BUTTON_RENAME_DECK 386
#define BUTTON_RENAME_DECK_SAVE 387
#define BUTTON_RENAME_DECK_CANCEL 388
#define TEXTURE_DUEL 0
#define TEXTURE_DECK 1
#define TEXTURE_MENU 2
......
......@@ -60,7 +60,7 @@ bool ImageManager::Initial() {
if(!tBackGround_deck)
tBackGround_deck = GetRandomImage(TEXTURE_DUEL);
if(!tBackGround_deck)
tBackGround_deck = tBackGround;
tBackGround_deck = tBackGround;
tField[0] = driver->getTexture("textures/field2.png");
tFieldTransparent[0] = driver->getTexture("textures/field-transparent2.png");
tField[1] = driver->getTexture("textures/field3.png");
......
......@@ -378,6 +378,9 @@
!system 1363 是否删除这个录像?
!system 1364 重命名录像
!system 1365 重命名失败,可能存在同名文件
!system 1366 重命名成功
!system 1367 重命名卡组
!system 1368 卡组文件:
!system 1370 星数↑
!system 1371 攻击↑
!system 1372 守备↑
......
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