Skip to content

Commit

Permalink
Clean up HandleIcons()
Browse files Browse the repository at this point in the history
  • Loading branch information
nextghost committed Jul 11, 2021
1 parent ed55852 commit 7fe9def
Showing 1 changed file with 54 additions and 34 deletions.
88 changes: 54 additions & 34 deletions signus/src/signus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,40 +653,60 @@ void DoVisSetup() {

// Seznam ikon:

void HandleIcons(TEvent *e)
{
int rt = MainIcons->Handle(e);
if (rt) {
MainIcons->LightsOff();
switch (rt) {
case 1 : SelectNextUnit(FALSE);
break;
case 3 : TurnEnded = TRUE;
break;
case 4 : SelectedUnit->Center();
break;
case 5 : DoBriefingPlus();
break;
case 7 : DoMenu();
break;
case 8 : JukeboxSetup();
break;
case 9 : DoVisSetup();
break;
case 6 : if (TimeReserve == 1) TimeReserve = 0; else TimeReserve = 1;
MainIcons->Draw();
SelectedUnit->Select();
break;
case 10 : if (TimeReserve == 2) TimeReserve = 0; else TimeReserve = 2;
MainIcons->Draw();
SelectedUnit->Select();
break;
case 2 : if (TimeReserve == 3) TimeReserve = 0; else TimeReserve = 3;
MainIcons->Draw();
SelectedUnit->Select();
break;
}
}
void HandleIcons(TEvent *e) {
int rt = MainIcons->Handle(e);

if (!rt) {
return;
}

MainIcons->LightsOff();

switch (rt) {
case 1:
SelectNextUnit(FALSE);
break;

case 3:
TurnEnded = TRUE;
break;

case 4:
SelectedUnit->Center();
break;
case 5:
DoBriefingPlus();
break;

case 7:
DoMenu();
break;

case 8:
JukeboxSetup();
break;
case 9:
DoVisSetup();
break;

case 6:
TimeReserve = (TimeReserve == 1) ? 0 : 1;
MainIcons->Draw();
SelectedUnit->Select();
break;

case 10:
TimeReserve = (TimeReserve == 2) ? 0 : 2;
MainIcons->Draw();
SelectedUnit->Select();
break;

case 2:
TimeReserve = (TimeReserve == 3) ? 0 : 3;
MainIcons->Draw();
SelectedUnit->Select();
break;
}
}


Expand Down

0 comments on commit 7fe9def

Please sign in to comment.