-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainController.h
70 lines (67 loc) · 1.01 KB
/
mainController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
void menuMtx();
void menuTests();
void controllerMtx();
void controllerTests();
void about();
// CLEAR ARROWS
void mainClr()
{
for(int i = 8; i < 15; i += 2)
{
pos(55, i);
cout<<" ";
pos(27, i);
cout<<" ";
}
}
// FUNC TO CONTROL THE MENU
void mainController()
{
int x2 = 27, x1 = 55, y = 8, key, choice = 1;
pos(x1, y);
cout<<"*";
pos(x2, y);
cout<<"*";
while(true)
{
key=_getch();
if((key == 72) && (y > 8))
{
y-=2;
choice--;
mainClr();
}
if((key == 80) && (y < 14))
{
y+=2;
choice++;
mainClr();
}
if((choice==1) && (key==13))
{
mainClr();
menuMtx();
controllerMtx();
}
if((choice==2) && (key==13))
{
mainClr();
menuTests();
controllerTests();
}
if((choice==3) && (key==13))
{
about();
}
if((choice==4) && (key==13))
{
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0);
}
mainClr();
pos(x1, y);
cout<<"*";
pos(x2, y);
cout<<"*";
}
}