GetScreenWidth() / 2 - type_f_size - BUTTON_DRAW_OFFSET &&
GetTouchX() <= GetScreenWidth() / 2 - BUTTON_DRAW_OFFSET &&
GetTouchY() <= font_size) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case BUTTON_TYPE_J:
GetTouchX() <=
GetScreenWidth() / 2 + BUTTON_DRAW_OFFSET + type_j_size &&
GetTouchY() <= font_size) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case BUTTON_TYPE_A:
GetTouchX() <= GetScreenWidth() / 2 - BUTTON_DRAW_OFFSET &&
GetTouchY() >= font_size + BUTTON_DRAW_OFFSET &&
GetTouchY() <= font_size * 2 + BUTTON_DRAW_OFFSET) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case BUTTON_TYPE_L:
GetScreenWidth() / 2 + BUTTON_DRAW_OFFSET + type_l_size &&
GetTouchY() >= font_size + BUTTON_DRAW_OFFSET &&
GetTouchY() <= font_size * 2 + BUTTON_DRAW_OFFSET) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
default:
switch (GetKeyPressed()) {
case KEY_F:
if (button_type == BUTTON_TYPE_F) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case KEY_J:
if (button_type == BUTTON_TYPE_J) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case KEY_A:
if (button_type == BUTTON_TYPE_A) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
case KEY_L:
if (button_type == BUTTON_TYPE_L) {
- *walker_hack_success = true;
- button_type = BUTTON_TYPE_SIZE;
+ on_success();
}
break;
default:
type_a_size = MeasureText("A", font_size);
type_l_size = MeasureText("L", font_size);
}
+
+void WalkerHackScreen::on_success() {
+ *walker_hack_success = true;
+ button_type = BUTTON_TYPE_SIZE;
+ timer = -1.0F;
+}