Commit dde8ce20 authored by edo9300's avatar edo9300

Merge remote-tracking branch 'refs/remotes/Fluorohydride/master'

parents bf279620 b5bae3aa
...@@ -3,7 +3,7 @@ A script engine for "yu-gi-oh!" and sample gui ...@@ -3,7 +3,7 @@ A script engine for "yu-gi-oh!" and sample gui
[中文说明](https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E) [中文说明](https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E)
###Keys: ### Keys:
* ESC: Minimize the window. * ESC: Minimize the window.
* A: Holding down this button will let the system stop at every timing. * A: Holding down this button will let the system stop at every timing.
* S: Holding down this button will let the system skip every timing. * S: Holding down this button will let the system skip every timing.
...@@ -11,25 +11,25 @@ A script engine for "yu-gi-oh!" and sample gui ...@@ -11,25 +11,25 @@ A script engine for "yu-gi-oh!" and sample gui
* F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials. * F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials.
* F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials. * F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials.
###Color in card list: ### Color in card list:
####Background: #### Background:
* White = your card, Grey = your opponent's card * White = your card, Grey = your opponent's card
####Text: #### Text:
Cards in deck, extra deck and banished zone: Cards in deck, extra deck and banished zone:
* Black = face-up, Blue = face-down * Black = face-up, Blue = face-down
Xyz materials: Xyz materials:
* Black = default, Blue = the owner of the xyz material is different from its controller * Black = default, Blue = the owner of the xyz material is different from its controller
###Sequence: ### Sequence:
* Monster Zone: 1~5, starting from the left hand side. * Monster Zone: 1~5, starting from the left hand side.
* Spell & Trap Zone: 1~5, starting from the left hand side. * Spell & Trap Zone: 1~5, starting from the left hand side.
* Field Zone: 6 * Field Zone: 6
* Pendulum Zone: 7~8, starting from the left hand side. * Pendulum Zone: 7~8, starting from the left hand side.
* The others: 1~n, starting from the bottom. * The others: 1~n, starting from the bottom.
###Deck edit page: ### Deck edit page:
* All numeric textboxs: They support >, =, <, >=, <= signs. * All numeric textboxs: They support >, =, <, >=, <= signs.
* Card name: Search card names and texts by default, $foo will only search foo in card names, and @foo will search cards of "foo" archetype(due to translation, card name contains "foo" does not mean that card is "foo" card). * Card name: Search card names and texts by default, $foo will only search foo in card names, and @foo will search cards of "foo" archetype(due to translation, card name contains "foo" does not mean that card is "foo" card).
......
...@@ -342,14 +342,20 @@ void Game::DrawMisc() { ...@@ -342,14 +342,20 @@ void Game::DrawMisc() {
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2); driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
} }
if(dField.pzone_act[0]) { if(dField.pzone_act[0]) {
im.setTranslation(vector3df((matManager.vFieldSzone[0][6][0].Pos.X + matManager.vFieldSzone[0][6][1].Pos.X) / 2, int seq = 0;
(matManager.vFieldSzone[0][6][0].Pos.Y + matManager.vFieldSzone[0][6][2].Pos.Y) / 2, 0.03f)); if(dField.szone[0][6] && dField.szone[0][6]->lscale)
seq = 6;
im.setTranslation(vector3df((matManager.vFieldSzone[0][seq][0].Pos.X + matManager.vFieldSzone[0][seq][1].Pos.X) / 2,
(matManager.vFieldSzone[0][seq][0].Pos.Y + matManager.vFieldSzone[0][seq][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im); driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2); driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
} }
if(dField.pzone_act[1]) { if(dField.pzone_act[1]) {
im.setTranslation(vector3df((matManager.vFieldSzone[0][7][0].Pos.X + matManager.vFieldSzone[0][7][1].Pos.X) / 2, int seq = 0;
(matManager.vFieldSzone[0][7][0].Pos.Y + matManager.vFieldSzone[0][7][2].Pos.Y) / 2, 0.03f)); if(dField.szone[1][6] && dField.szone[1][6]->lscale)
seq = 6;
im.setTranslation(vector3df((matManager.vFieldSzone[1][seq][0].Pos.X + matManager.vFieldSzone[1][seq][1].Pos.X) / 2,
(matManager.vFieldSzone[1][seq][0].Pos.Y + matManager.vFieldSzone[1][seq][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im); driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2); driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
} }
......
...@@ -1114,7 +1114,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1114,7 +1114,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.remove_act = true; mainGame->dField.remove_act = true;
else if (pcard->location == LOCATION_EXTRA) else if (pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true; mainGame->dField.extra_act = true;
else if (pcard->location == LOCATION_SZONE && pcard->sequence == 6) else if (pcard->location == LOCATION_SZONE && (pcard->sequence == 0 || pcard->sequence == 6) && pcard->lscale)
mainGame->dField.pzone_act[pcard->controler] = true; mainGame->dField.pzone_act[pcard->controler] = true;
} }
mainGame->dField.reposable_cards.clear(); mainGame->dField.reposable_cards.clear();
...@@ -1469,9 +1469,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1469,9 +1469,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.selected_field = 0; mainGame->dField.selected_field = 0;
unsigned char respbuf[64]; unsigned char respbuf[64];
int pzone = 0; int pzone = 0;
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE) if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE) {
mainGame->stHintMsg->setText(dataManager.GetSysString(569)); if (select_hint) {
else myswprintf(textBuffer, dataManager.GetSysString(569), dataManager.GetName(select_hint));
} else
myswprintf(textBuffer, dataManager.GetSysString(560));
select_hint = 0;
mainGame->stHintMsg->setText(textBuffer);
} else
mainGame->stHintMsg->setText(dataManager.GetSysString(570)); mainGame->stHintMsg->setText(dataManager.GetSysString(570));
mainGame->stHintMsg->setVisible(true); mainGame->stHintMsg->setVisible(true);
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && mainGame->chkAutoPos->isChecked()) { if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && mainGame->chkAutoPos->isChecked()) {
......
...@@ -1836,7 +1836,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1836,7 +1836,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"\n(%ls)", dataManager.GetName(mcard->alias)); myswprintf(formatBuffer, L"\n(%ls)", dataManager.GetName(mcard->alias));
str.append(formatBuffer); str.append(formatBuffer);
} }
if(mcard->location == LOCATION_SZONE && (mcard->sequence == 6 || mcard->sequence == 7)) { if(mcard->location == LOCATION_SZONE && mcard->lscale) {
myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale); myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale);
str.append(formatBuffer); str.append(formatBuffer);
} }
......
...@@ -1281,7 +1281,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) { ...@@ -1281,7 +1281,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
chatMsg[0].append(L"[System]: "); chatMsg[0].append(L"[System]: ");
break; break;
case 9: //error message case 9: //error message
chatMsg[0].append(L"[Script error:] "); chatMsg[0].append(L"[Script Error]: ");
break; break;
default: //from watcher or unknown default: //from watcher or unknown
if(player < 11 || player > 19) if(player < 11 || player > 19)
...@@ -1289,6 +1289,25 @@ void Game::AddChatMsg(wchar_t* msg, int player) { ...@@ -1289,6 +1289,25 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
} }
chatMsg[0].append(msg); chatMsg[0].append(msg);
} }
void Game::AddDebugMsg(char* msg)
{
if (enable_log & 0x1) {
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msg, wbuf);
mainGame->AddChatMsg(wbuf, 9);
}
if (enable_log & 0x2) {
FILE* fp = fopen("error.log", "at");
if (!fp)
return;
time_t nowtime = time(NULL);
struct tm *localedtime = localtime(&nowtime);
char timebuf[40];
strftime(timebuf, 40, "%Y-%m-%d %H:%M:%S", localedtime);
fprintf(fp, "[%s][Script Error]: %s\n", timebuf, msg);
fclose(fp);
}
}
void Game::ClearTextures() { void Game::ClearTextures() {
matManager.mCard.setTexture(0, 0); matManager.mCard.setTexture(0, 0);
imgCard->setImage(0); imgCard->setImage(0);
......
...@@ -112,6 +112,7 @@ public: ...@@ -112,6 +112,7 @@ public:
void SaveConfig(); void SaveConfig();
void ShowCardInfo(int code); void ShowCardInfo(int code);
void AddChatMsg(wchar_t* msg, int player); void AddChatMsg(wchar_t* msg, int player);
void AddDebugMsg(char* msgbuf);
void ClearTextures(); void ClearTextures();
void CloseDuelWindow(); void CloseDuelWindow();
void PlaySoundEffect(char* sound); void PlaySoundEffect(char* sound);
......
...@@ -23,7 +23,7 @@ Materials::Materials() { ...@@ -23,7 +23,7 @@ Materials::Materials() {
SetS3DVertex(vField, -1.0f, -4.0f, 9.0f, 4.0f, 0, 1, 0, 0, 1, 1); SetS3DVertex(vField, -1.0f, -4.0f, 9.0f, 4.0f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vFieldSpell, 1.2f, -3.2f, 6.7f, 3.2f, 0, 1, 0, 0, 1, 1); SetS3DVertex(vFieldSpell, 1.2f, -3.2f, 6.7f, 3.2f, 0, 1, 0, 0, 1, 1);
SetS3DVertex(vFieldSpell1, 1.2f, 0.8f, 6.7f, 3.2f, 0, 1, 0, 0.2f, 1, 0.63636f); SetS3DVertex(vFieldSpell1, 1.2f, 0.8f, 6.7f, 3.2f, 0, 1, 0, 0.2f, 1, 0.63636f);
SetS3DVertex(vFieldSpell2, 1.2f, -3.2f, 6.7f, -0.8f, 0, 1, 0, 0.63636f, 1, 0.2f); SetS3DVertex(vFieldSpell2, 1.2f, -3.2f, 6.7f, -0.8f, 0, 1, 1, 0.63636f, 0, 0.2f);
/* /*
//background grids //background grids
......
...@@ -864,17 +864,7 @@ int ReplayMode::MessageHandler(long fduel, int type) { ...@@ -864,17 +864,7 @@ int ReplayMode::MessageHandler(long fduel, int type) {
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
get_log_message(fduel, (byte*)msgbuf); get_log_message(fduel, (byte*)msgbuf);
if(enable_log == 1) { mainGame->AddDebugMsg(msgbuf);
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msgbuf, wbuf);
mainGame->AddChatMsg(wbuf, 9);
} else if(enable_log == 2) {
FILE* fp = fopen("error.log", "at");
if(!fp)
return 0;
fprintf(fp, "[Script error:] %s\n", msgbuf);
fclose(fp);
}
return 0; return 0;
} }
......
...@@ -1562,17 +1562,7 @@ int SingleDuel::MessageHandler(long fduel, int type) { ...@@ -1562,17 +1562,7 @@ int SingleDuel::MessageHandler(long fduel, int type) {
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
get_log_message(fduel, (byte*)msgbuf); get_log_message(fduel, (byte*)msgbuf);
if(enable_log == 1) { mainGame->AddDebugMsg(msgbuf);
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msgbuf, wbuf);
mainGame->AddChatMsg(wbuf, 9);
} else if(enable_log == 2) {
FILE* fp = fopen("error.log", "at");
if(!fp)
return 0;
fprintf(fp, "[Script error:] %s\n", msgbuf);
fclose(fp);
}
return 0; return 0;
} }
void SingleDuel::SingleTimer(evutil_socket_t fd, short events, void* arg) { void SingleDuel::SingleTimer(evutil_socket_t fd, short events, void* arg) {
......
...@@ -842,17 +842,7 @@ int SingleMode::MessageHandler(long fduel, int type) { ...@@ -842,17 +842,7 @@ int SingleMode::MessageHandler(long fduel, int type) {
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
get_log_message(fduel, (byte*)msgbuf); get_log_message(fduel, (byte*)msgbuf);
if(enable_log == 1) { mainGame->AddDebugMsg(msgbuf);
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msgbuf, wbuf);
mainGame->AddChatMsg(wbuf, 9);
} else if(enable_log == 2) {
FILE* fp = fopen("error.log", "at");
if(!fp)
return 0;
fprintf(fp, "[Script error:] %s\n", msgbuf);
fclose(fp);
}
return 0; return 0;
} }
......
...@@ -1675,17 +1675,7 @@ int TagDuel::MessageHandler(long fduel, int type) { ...@@ -1675,17 +1675,7 @@ int TagDuel::MessageHandler(long fduel, int type) {
return 0; return 0;
char msgbuf[1024]; char msgbuf[1024];
get_log_message(fduel, (byte*)msgbuf); get_log_message(fduel, (byte*)msgbuf);
if(enable_log == 1) { mainGame->AddDebugMsg(msgbuf);
wchar_t wbuf[1024];
BufferIO::DecodeUTF8(msgbuf, wbuf);
mainGame->AddChatMsg(wbuf, 9);
} else if(enable_log == 2) {
FILE* fp = fopen("error.log", "at");
if(!fp)
return 0;
fprintf(fp, "[Script error:] %s\n", msgbuf);
fclose(fp);
}
return 0; return 0;
} }
void TagDuel::TagTimer(evutil_socket_t fd, short events, void* arg) { void TagDuel::TagTimer(evutil_socket_t fd, short events, void* arg) {
......
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