Commit 27e06722 authored by mercury233's avatar mercury233 Committed by GitHub

add RACE_ILLUSION, RACES_COUNT (#2494)

parent da8bfaf2
......@@ -279,7 +279,7 @@ const wchar_t* DataManager::FormatRace(int race) {
wchar_t* p = racBuffer;
unsigned filter = 1;
int i = 1020;
for(; filter != 0x2000000; filter <<= 1, ++i) {
for(; filter < (1 << RACES_COUNT); filter <<= 1, ++i) {
if(race & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|';
......
......@@ -3522,7 +3522,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 < 25; ++i, filter <<= 1) {
for(int i = 0, filter = 0x1; i < RACES_COUNT; ++i, filter <<= 1) {
mainGame->chkRace[i]->setChecked(false);
if(filter & available)
mainGame->chkRace[i]->setVisible(true);
......
......@@ -837,7 +837,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case CHECK_RACE: {
int rac = 0, filter = 0x1, count = 0;
for(int i = 0; i < 25; ++i, filter <<= 1) {
for(int i = 0; i < RACES_COUNT; ++i, filter <<= 1) {
if(mainGame->chkRace[i]->isChecked()) {
rac |= filter;
count++;
......
......@@ -583,7 +583,7 @@ bool Game::Initialize() {
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 < 25; filter <<= 1, ++i)
for(int filter = 0x1, i = 0; i < RACES_COUNT; 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
......@@ -720,7 +720,7 @@ bool Game::Initialize() {
cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 190, 60 + 75 / 6), wFilter, COMBOBOX_RACE);
cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x2000000; filter <<= 1)
for(int filter = 0x1; filter < (1 << RACES_COUNT); 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, EDITBOX_INPUTS);
......
......@@ -456,7 +456,7 @@ public:
irr::gui::IGUICheckBox* chkAttribute[7];
//announce race
irr::gui::IGUIWindow* wANRace;
irr::gui::IGUICheckBox* chkRace[25];
irr::gui::IGUICheckBox* chkRace[RACES_COUNT];
//cmd menu
irr::gui::IGUIWindow* wCmdMenu;
irr::gui::IGUIButton* btnActivate;
......
......@@ -181,6 +181,7 @@
!system 1042 创造神
!system 1043 幻龙
!system 1044 电子界
!system 1045 幻想魔
!system 1050 怪兽
!system 1051 魔法
!system 1052 陷阱
......
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