Commit d66ac49f authored by DailyShana's avatar DailyShana

fix selecting place manually

parent 1bf74487
......@@ -45,9 +45,9 @@ public:
size_t selected_option;
ClientCard* attacker;
ClientCard* attack_target;
int disabled_field;
int selectable_field;
int selected_field;
unsigned int disabled_field;
unsigned int selectable_field;
unsigned int selected_field;
int select_min;
int select_max;
int must_select_count;
......
......@@ -105,54 +105,54 @@ void Game::DrawBackGround() {
//select field
if(dInfo.curMsg == MSG_SELECT_PLACE || dInfo.curMsg == MSG_SELECT_DISFIELD) {
float cv[4] = {0.0f, 0.0f, 1.0f, 1.0f};
int filter = 0x1;
unsigned int filter = 0x1;
for (int i = 0; i < 5; ++i, filter <<= 1) {
if ((dField.selectable_field & filter) > 0)
if (dField.selectable_field & filter)
DrawSelectionLine(&matManager.vFields[16 + i * 4], !(dField.selected_field & filter), 2, cv);
}
filter = 0x100;
for (int i = 0; i < 8; ++i, filter <<= 1) {
if ((dField.selectable_field & filter) > 0)
if (dField.selectable_field & filter)
DrawSelectionLine(&matManager.vFields[36 + i * 4], !(dField.selected_field & filter), 2, cv);
}
filter = 0x10000;
for (int i = 0; i < 5; ++i, filter <<= 1) {
if ((dField.selectable_field & filter) > 0)
if (dField.selectable_field & filter)
DrawSelectionLine(&matManager.vFields[84 + i * 4], !(dField.selected_field & filter), 2, cv);
}
filter = 0x1000000;
for (int i = 0; i < 8; ++i, filter <<= 1) {
if ((dField.selectable_field & filter) > 0)
if (dField.selectable_field & filter)
DrawSelectionLine(&matManager.vFields[104 + i * 4], !(dField.selected_field & filter), 2, cv);
}
}
//disabled field
{
/*float cv[4] = {0.0f, 0.0f, 1.0f, 1.0f};*/
int filter = 0x1;
unsigned int filter = 0x1;
for (int i = 0; i < 5; ++i, filter <<= 1) {
if ((dField.disabled_field & filter) > 0) {
if (dField.disabled_field & filter) {
driver->draw3DLine(matManager.vFields[16 + i * 4].Pos, matManager.vFields[16 + i * 4 + 3].Pos, 0xffffffff);
driver->draw3DLine(matManager.vFields[16 + i * 4 + 1].Pos, matManager.vFields[16 + i * 4 + 2].Pos, 0xffffffff);
}
}
filter = 0x100;
for (int i = 0; i < 8; ++i, filter <<= 1) {
if ((dField.disabled_field & filter) > 0) {
if (dField.disabled_field & filter) {
driver->draw3DLine(matManager.vFields[36 + i * 4].Pos, matManager.vFields[36 + i * 4 + 3].Pos, 0xffffffff);
driver->draw3DLine(matManager.vFields[36 + i * 4 + 1].Pos, matManager.vFields[36 + i * 4 + 2].Pos, 0xffffffff);
}
}
filter = 0x10000;
for (int i = 0; i < 5; ++i, filter <<= 1) {
if ((dField.disabled_field & filter) > 0) {
if (dField.disabled_field & filter) {
driver->draw3DLine(matManager.vFields[84 + i * 4].Pos, matManager.vFields[84 + i * 4 + 3].Pos, 0xffffffff);
driver->draw3DLine(matManager.vFields[84 + i * 4 + 1].Pos, matManager.vFields[84 + i * 4 + 2].Pos, 0xffffffff);
}
}
filter = 0x1000000;
for (int i = 0; i < 8; ++i, filter <<= 1) {
if ((dField.disabled_field & filter) > 0) {
if (dField.disabled_field & filter) {
driver->draw3DLine(matManager.vFields[104 + i * 4].Pos, matManager.vFields[104 + i * 4 + 3].Pos, 0xffffffff);
driver->draw3DLine(matManager.vFields[104 + i * 4 + 1].Pos, matManager.vFields[104 + i * 4 + 2].Pos, 0xffffffff);
}
......
......@@ -1273,7 +1273,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
unsigned char respbuf[64];
int pzone = 0;
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && mainGame->chkAutoPos->isChecked()) {
int filter;
unsigned int filter;
if (mainGame->dField.selectable_field & 0x1f) {
respbuf[0] = mainGame->dInfo.isFirst ? 0 : 1;
respbuf[1] = 0x4;
......
......@@ -1107,9 +1107,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case MSG_SELECT_DISFIELD: {
if (!(hovered_location & LOCATION_ONFIELD) || hovered_sequence == 5)
break;
int flag = 1 << (hovered_sequence + (hovered_controler << 4) + ((hovered_location == LOCATION_MZONE) ? 0 : 8));
if ((flag & selectable_field) > 0) {
if ((flag & selected_field) > 0) {
unsigned int flag = 1 << (hovered_sequence + (hovered_controler << 4) + ((hovered_location == LOCATION_MZONE) ? 0 : 8));
if (flag & selectable_field) {
if (flag & selected_field) {
selected_field &= ~flag;
select_min++;
} else {
......
Subproject commit 27e0668f9071f58638f4ed50cffdf12f33f59c7b
Subproject commit 62ab0c81d4bd57521148e911776675f084faa785
Subproject commit 57337f33ecce0ae02a05a861ca7fe77e2c52bac2
Subproject commit 16ce4895cf02438eb598d351fff6ec3f1e94b0ea
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