Browse Source

Clean up CheckStoreBtn

pull/93/head
Anders Jenbo 7 years ago
parent
commit
6dcf737c17
  1. 85
      Source/stores.cpp

85
Source/stores.cpp

@ -3039,75 +3039,58 @@ void STextEnter()
void CheckStoreBtn() void CheckStoreBtn()
{ {
BOOLEAN v0; // sf int y;
//unsigned char v1; // of
int v2; // eax
int *v3; // ecx
if (qtextflag) { if (qtextflag) {
qtextflag = FALSE; qtextflag = FALSE;
if (leveltype == DTYPE_TOWN) if (leveltype == DTYPE_TOWN)
sfx_stop(); sfx_stop();
} else if (stextsel != -1 && MouseY >= 32 && MouseY <= 320) { } else if (stextsel != -1 && MouseY >= 32 && MouseY <= 320) {
if (stextsize) { if (!stextsize) {
//v1 = __OFSUB__(MouseX, 24); if (MouseX < 344 || MouseX > 616)
v0 = MouseX - 24 < 0; return;
} else { } else {
//v1 = __OFSUB__(MouseX, 344); if (MouseX < 3 || MouseX > 616)
v0 = MouseX - 344 < 0; return;
} }
if (!v0 && MouseX <= 616) { //if (!(v0 ^ v1) && MouseX <= 616) { y = (MouseY - 32) / 12;
v2 = (MouseY - 32) / 12; if (stextscrl && MouseX > 600) {
if (stextscrl && MouseX > 600) { if (y == 4) {
if (v2 == 4) { if (stextscrlubtn <= 0) {
if (stextscrlubtn <= 0) { STextUp();
STextUp(); stextscrlubtn = 10;
stextscrlubtn = 10; } else {
return;
}
--stextscrlubtn; --stextscrlubtn;
} }
if (v2 == 20) { }
if (stextscrldbtn > 0) { if (y == 20) {
--stextscrldbtn; if (stextscrldbtn <= 0) {
} else { STextDown();
STextDown(); stextscrldbtn = 10;
stextscrldbtn = 10; } else {
} --stextscrldbtn;
}
} else if (v2 >= 5) {
if (v2 >= 23)
v2 = 22;
if (stextscrl) {
if (v2 < 21) {
v3 = &stext[v2]._ssel;
if (!*v3) {
if (stext[v2 - 2]._ssel) {
v2 -= 2;
} else if (*(v3 - 39)) {
--v2;
}
}
}
} }
if (stext[v2]._ssel || stextscrl && v2 == 22) { }
stextsel = v2; } else if (y >= 5) {
STextEnter(); if (y >= 23)
y = 22;
if (stextscrl && y < 21 && !stext[y]._ssel) {
if (stext[y - 2]._ssel) {
y -= 2;
} else if (stext[y - 1]._ssel) {
--y;
} }
} }
if (stext[y]._ssel || stextscrl && y == 22) {
stextsel = y;
STextEnter();
}
} }
} }
} }
// 646D00: using guessed type char qtextflag;
// 6A09E0: using guessed type char stextsize;
// 6A8A28: using guessed type int stextsel;
// 6A8A2C: using guessed type char stextscrldbtn;
// 6AA704: using guessed type char stextscrlubtn;
void ReleaseStoreBtn() void ReleaseStoreBtn()
{ {
stextscrlubtn = -1; stextscrlubtn = -1;
stextscrldbtn = -1; stextscrldbtn = -1;
} }
// 6A8A2C: using guessed type char stextscrldbtn;
// 6AA704: using guessed type char stextscrlubtn;

Loading…
Cancel
Save