Merge pull request #162 from lioncash/tas-dlg

Simplify boolean toggling in the TASInputDlg.
This commit is contained in:
Pierre Bourdon 2014-03-13 02:09:32 +01:00
commit 450bde27bb
1 changed files with 24 additions and 61 deletions

View File

@ -933,99 +933,62 @@ void TASInputDlg::SetTurbo(wxMouseEvent& event)
{ {
case ID_A: case ID_A:
placeholder = wx_a_button; placeholder = wx_a_button;
A_turbo = !A_turbo;
if (A_turbo)
A_turbo = false;
else
A_turbo = true;
break; break;
case ID_B: case ID_B:
placeholder = wx_b_button; placeholder = wx_b_button;
if (B_turbo) B_turbo = !B_turbo;
B_turbo = false;
else
B_turbo = true;
break; break;
case ID_X: case ID_X:
placeholder = wx_x_button; placeholder = wx_x_button;
if (X_turbo) X_turbo = !X_turbo;
X_turbo = false;
else
X_turbo = true;
break; break;
case ID_Y: case ID_Y:
placeholder = wx_y_button; placeholder = wx_y_button;
if (Y_turbo) Y_turbo = !Y_turbo;
Y_turbo = false;
else
Y_turbo = true;
break; break;
case ID_Z: case ID_Z:
placeholder = wx_z_button; placeholder = wx_z_button;
if (Z_turbo) Z_turbo = !Z_turbo;
Z_turbo = false;
else
Z_turbo = true;
break; break;
case ID_L: case ID_L:
placeholder = wx_l_button; placeholder = wx_l_button;
if (L_turbo) L_turbo = !L_turbo;
L_turbo = false;
else
L_turbo = true;
break; break;
case ID_R: case ID_R:
placeholder = wx_r_button; placeholder = wx_r_button;
if (R_turbo) R_turbo = !R_turbo;
R_turbo = false;
else
R_turbo = true;
break; break;
case ID_START: case ID_START:
placeholder = wx_start_button; placeholder = wx_start_button;
if (START_turbo) START_turbo = !START_turbo;
START_turbo = false;
else
START_turbo = true;
break; break;
case ID_UP: case ID_UP:
placeholder = wx_up_button; placeholder = wx_up_button;
if (DU_turbo) DU_turbo = !DU_turbo;
DU_turbo = false;
else
DU_turbo = true;
break; break;
case ID_DOWN: case ID_DOWN:
placeholder = wx_down_button; placeholder = wx_down_button;
if (DD_turbo) DD_turbo = !DD_turbo;
DD_turbo = false;
else
DD_turbo = true;
break; break;
case ID_LEFT: case ID_LEFT:
placeholder = wx_left_button; placeholder = wx_left_button;
if (DL_turbo) DL_turbo = !DL_turbo;
DL_turbo = false;
else
DL_turbo = true;
break; break;
case ID_RIGHT: case ID_RIGHT:
placeholder = wx_right_button; placeholder = wx_right_button;
if (DR_turbo) DR_turbo = !DR_turbo;
DR_turbo = false;
else
DR_turbo = true;
break; break;
default: default:
return; return;