Commit 1df90853 authored by nekrozar's avatar nekrozar Committed by DailyShana

add race Cybers (#1935)

parent de663cd0
...@@ -250,7 +250,7 @@ const wchar_t* DataManager::FormatRace(int race) { ...@@ -250,7 +250,7 @@ const wchar_t* DataManager::FormatRace(int race) {
wchar_t* p = racBuffer; wchar_t* p = racBuffer;
unsigned filter = 1; unsigned filter = 1;
int i = 1020; int i = 1020;
for(; filter != 0x1000000; filter <<= 1, ++i) { for(; filter != 0x2000000; filter <<= 1, ++i) {
if(race & filter) { if(race & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16); BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|'; *p = L'|';
......
...@@ -2906,7 +2906,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2906,7 +2906,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
/*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); /*int player = */mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
mainGame->dField.announce_count = BufferIO::ReadInt8(pbuf); mainGame->dField.announce_count = BufferIO::ReadInt8(pbuf);
int available = BufferIO::ReadInt32(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); mainGame->chkRace[i]->setChecked(false);
if(filter & available) if(filter & available)
mainGame->chkRace[i]->setVisible(true); mainGame->chkRace[i]->setVisible(true);
...@@ -3221,7 +3221,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3221,7 +3221,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ClientCard* ccard = mainGame->dField.hand[p][seq]; ClientCard* ccard = mainGame->dField.hand[p][seq];
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true); mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
} }
val = BufferIO::ReadInt8(pbuf); val = BufferIO::ReadInt8(pbuf);
for(int seq = 0; seq < val; ++seq) { for(int seq = 0; seq < val; ++seq) {
ClientCard* ccard = new ClientCard; ClientCard* ccard = new ClientCard;
......
...@@ -869,7 +869,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -869,7 +869,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
case CHECK_RACE: { case CHECK_RACE: {
int rac = 0, filter = 0x1, count = 0; 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()) { if(mainGame->chkRace[i]->isChecked()) {
rac |= filter; rac |= filter;
count++; count++;
...@@ -959,7 +959,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -959,7 +959,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->stCardPos[i]->setBackgroundColor(0xffffff00); mainGame->stCardPos[i]->setBackgroundColor(0xffffff00);
else if(selectable_cards[i + pos]->overlayTarget->controler) else if(selectable_cards[i + pos]->overlayTarget->controler)
mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stCardPos[i]->setBackgroundColor(0xffffffff); mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
} else if(selectable_cards[i + pos]->location == LOCATION_DECK || selectable_cards[i + pos]->location == LOCATION_EXTRA || selectable_cards[i + pos]->location == LOCATION_REMOVED) { } else if(selectable_cards[i + pos]->location == LOCATION_DECK || selectable_cards[i + pos]->location == LOCATION_EXTRA || selectable_cards[i + pos]->location == LOCATION_REMOVED) {
if(selectable_cards[i + pos]->position & POS_FACEDOWN) if(selectable_cards[i + pos]->position & POS_FACEDOWN)
...@@ -968,14 +968,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -968,14 +968,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->stCardPos[i]->setBackgroundColor(0xffffff00); mainGame->stCardPos[i]->setBackgroundColor(0xffffff00);
else if(selectable_cards[i + pos]->controler) else if(selectable_cards[i + pos]->controler)
mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stCardPos[i]->setBackgroundColor(0xffffffff); mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
} else { } else {
if(selectable_cards[i + pos]->is_selected) if(selectable_cards[i + pos]->is_selected)
mainGame->stCardPos[i]->setBackgroundColor(0xffffff00); mainGame->stCardPos[i]->setBackgroundColor(0xffffff00);
else if(selectable_cards[i + pos]->controler) else if(selectable_cards[i + pos]->controler)
mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stCardPos[i]->setBackgroundColor(0xffffffff); mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
} }
} }
...@@ -1006,19 +1006,19 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1006,19 +1006,19 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
// BackgroundColor: controller of the xyz monster // BackgroundColor: controller of the xyz monster
if(display_cards[i + pos]->overlayTarget->controler) if(display_cards[i + pos]->overlayTarget->controler)
mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff); mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff);
} else if(display_cards[i + pos]->location == LOCATION_EXTRA || display_cards[i + pos]->location == LOCATION_REMOVED) { } else if(display_cards[i + pos]->location == LOCATION_EXTRA || display_cards[i + pos]->location == LOCATION_REMOVED) {
if(display_cards[i + pos]->position & POS_FACEDOWN) if(display_cards[i + pos]->position & POS_FACEDOWN)
mainGame->stDisplayPos[i]->setOverrideColor(0xff0000ff); mainGame->stDisplayPos[i]->setOverrideColor(0xff0000ff);
if(display_cards[i + pos]->controler) if(display_cards[i + pos]->controler)
mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff); mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff);
} else { } else {
if(display_cards[i + pos]->controler) if(display_cards[i + pos]->controler)
mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0); mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0);
else else
mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff); mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff);
} }
} }
...@@ -1859,7 +1859,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1859,7 +1859,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->chain_when_avail = false; mainGame->chain_when_avail = false;
UpdateChainButtons(); UpdateChainButtons();
} }
break; break;
} }
default: default:
break; break;
......
...@@ -365,11 +365,11 @@ bool Game::Initialize() { ...@@ -365,11 +365,11 @@ bool Game::Initialize() {
for(int filter = 0x1, i = 0; i < 7; filter <<= 1, ++i) 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), 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)); wANAttribute, CHECK_ATTRIBUTE, dataManager.FormatAttribute(filter));
//announce attribute //announce race
wANRace = env->addWindow(rect<s32>(480, 200, 850, 385), false, dataManager.GetSysString(563)); wANRace = env->addWindow(rect<s32>(480, 200, 850, 385), false, dataManager.GetSysString(563));
wANRace->getCloseButton()->setVisible(false); wANRace->getCloseButton()->setVisible(false);
wANRace->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), 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)); wANRace, CHECK_RACE, dataManager.FormatRace(filter));
//selection hint //selection hint
...@@ -458,7 +458,7 @@ bool Game::Initialize() { ...@@ -458,7 +458,7 @@ bool Game::Initialize() {
cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 190, 60 + 75 / 6), wFilter, -1); cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 190, 60 + 75 / 6), wFilter, -1);
cbRace->setMaxSelectionRows(10); cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0); 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); cbRace->addItem(dataManager.FormatRace(filter), filter);
env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter); 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); ebAttack = env->addEditBox(L"", rect<s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter);
......
...@@ -322,7 +322,7 @@ public: ...@@ -322,7 +322,7 @@ public:
irr::gui::IGUICheckBox* chkAttribute[7]; irr::gui::IGUICheckBox* chkAttribute[7];
//announce race //announce race
irr::gui::IGUIWindow* wANRace; irr::gui::IGUIWindow* wANRace;
irr::gui::IGUICheckBox* chkRace[24]; irr::gui::IGUICheckBox* chkRace[25];
//cmd menu //cmd menu
irr::gui::IGUIWindow* wCmdMenu; irr::gui::IGUIWindow* wCmdMenu;
irr::gui::IGUIButton* btnActivate; irr::gui::IGUIButton* btnActivate;
......
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