Commit 4e0f675a authored by edo9300's avatar edo9300

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

parents f0793439 06153523
......@@ -166,12 +166,10 @@ void ClientCard::UpdateInfo(char* buf) {
}
void ClientCard::ClearTarget() {
for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit) {
if(is_showtarget)
(*cit)->is_showtarget = false;
(*cit)->ownerTarget.erase(this);
}
for(auto cit = ownerTarget.begin(); cit != ownerTarget.end(); ++cit) {
if(is_showtarget)
(*cit)->is_showtarget = false;
(*cit)->cardTarget.erase(this);
}
......
......@@ -252,7 +252,7 @@ const wchar_t* DataManager::FormatRace(int race) {
wchar_t* p = racBuffer;
unsigned filter = 1;
int i = 1020;
for(; filter != 0x1000000; filter <<= 1, ++i) {
for(; filter != 0x2000000; filter <<= 1, ++i) {
if(race & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|';
......@@ -269,7 +269,7 @@ const wchar_t* DataManager::FormatType(int type) {
wchar_t* p = tpBuffer;
unsigned filter = 1;
int i = 1050;
for(; filter != 0x2000000; filter <<= 1, ++i) {
for(; filter != 0x4000000; filter <<= 1, ++i) {
if(type & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|';
......
......@@ -350,6 +350,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame->cbCardType2->addItem(dataManager.GetSysString(1063), TYPE_MONSTER + TYPE_SYNCHRO);
mainGame->cbCardType2->addItem(dataManager.GetSysString(1073), TYPE_MONSTER + TYPE_XYZ);
mainGame->cbCardType2->addItem(dataManager.GetSysString(1074), TYPE_MONSTER + TYPE_PENDULUM);
mainGame->cbCardType2->addItem(dataManager.GetSysString(1075), TYPE_MONSTER + TYPE_SPSUMMON);
myswprintf(normaltuner, L"%ls|%ls", dataManager.GetSysString(1054), dataManager.GetSysString(1062));
mainGame->cbCardType2->addItem(normaltuner, TYPE_MONSTER + TYPE_NORMAL + TYPE_TUNER);
myswprintf(normalpen, L"%ls|%ls", dataManager.GetSysString(1054), dataManager.GetSysString(1074));
......
......@@ -1469,6 +1469,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.selected_field = 0;
unsigned char respbuf[64];
int pzone = 0;
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE)
mainGame->stHintMsg->setText(dataManager.GetSysString(569));
else
mainGame->stHintMsg->setText(dataManager.GetSysString(570));
mainGame->stHintMsg->setVisible(true);
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && mainGame->chkAutoPos->isChecked()) {
unsigned int filter;
if (mainGame->dField.selectable_field & 0x1f) {
......@@ -2755,10 +2760,17 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* pc1 = mainGame->dField.GetCard(c1, l1, s1);
ClientCard* pc2 = mainGame->dField.GetCard(c2, l2, s2);
if(mainGame->dInfo.isReplay && mainGame->dInfo.isReplaySkiping) {
if(pc1->equipTarget)
pc1->equipTarget->equipped.erase(pc1);
pc1->equipTarget = pc2;
pc2->equipped.insert(pc1);
} else {
mainGame->gMutex.Lock();
if(pc1->equipTarget) {
pc1->is_showequip = false;
pc1->equipTarget->is_showequip = false;
pc1->equipTarget->equipped.erase(pc1);
}
pc1->equipTarget = pc2;
pc2->equipped.insert(pc1);
if (mainGame->dField.hovered_card == pc1)
......@@ -3094,7 +3106,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
mainGame->dField.announce_count = BufferIO::ReadInt8(pbuf);
int available = BufferIO::ReadInt32(pbuf);
for(int i = 0, filter = 0x1; i < 24; ++i, filter <<= 1) {
for(int i = 0, filter = 0x1; i < 25; ++i, filter <<= 1) {
mainGame->chkRace[i]->setChecked(false);
if(filter & available)
mainGame->chkRace[i]->setVisible(true);
......
......@@ -914,7 +914,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case CHECK_RACE: {
int rac = 0, filter = 0x1, count = 0;
for(int i = 0; i < 24; ++i, filter <<= 1) {
for(int i = 0; i < 25; ++i, filter <<= 1) {
if(mainGame->chkRace[i]->isChecked()) {
rac |= filter;
count++;
......
......@@ -409,11 +409,11 @@ bool Game::Initialize() {
for(int filter = 0x1, i = 0; i < 7; filter <<= 1, ++i)
chkAttribute[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 80, 25 + (i / 4) * 25, 90 + (i % 4) * 80, 50 + (i / 4) * 25),
wANAttribute, CHECK_ATTRIBUTE, dataManager.FormatAttribute(filter));
//announce attribute
wANRace = env->addWindow(rect<s32>(480, 200, 850, 385), false, dataManager.GetSysString(563));
//announce race
wANRace = env->addWindow(rect<s32>(480, 200, 850, 410), false, dataManager.GetSysString(563));
wANRace->getCloseButton()->setVisible(false);
wANRace->setVisible(false);
for(int filter = 0x1, i = 0; i < 24; filter <<= 1, ++i)
for(int filter = 0x1, i = 0; i < 25; filter <<= 1, ++i)
chkRace[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 90, 25 + (i / 4) * 25, 100 + (i % 4) * 90, 50 + (i / 4) * 25),
wANRace, CHECK_RACE, dataManager.FormatRace(filter));
//selection hint
......@@ -502,7 +502,7 @@ bool Game::Initialize() {
cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 190, 60 + 75 / 6), wFilter, COMBOBOX_OTHER_FILT);
cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x1000000; filter <<= 1)
for(int filter = 0x1; filter != 0x2000000; filter <<= 1)
cbRace->addItem(dataManager.FormatRace(filter), filter);
stAttack = env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter);
ebAttack = env->addEditBox(L"", rect<s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter);
......
......@@ -349,7 +349,7 @@ public:
irr::gui::IGUICheckBox* chkAttribute[7];
//announce race
irr::gui::IGUIWindow* wANRace;
irr::gui::IGUICheckBox* chkRace[24];
irr::gui::IGUICheckBox* chkRace[25];
//cmd menu
irr::gui::IGUIWindow* wCmdMenu;
irr::gui::IGUIButton* btnActivate;
......
......@@ -33,6 +33,13 @@ void ClickButton(irr::gui::IGUIElement* btn) {
}
int main(int argc, char* argv[]) {
#ifdef _WIN32
wchar_t exepath[MAX_PATH];
GetModuleFileNameW(NULL, exepath, MAX_PATH);
wchar_t* p = wcsrchr(exepath, '\\');
*p = '\0';
SetCurrentDirectoryW(exepath);
#endif //_WIN32
#ifdef _WIN32
WORD wVersionRequested;
WSADATA wsaData;
......
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