-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfirmationPage.pde
More file actions
125 lines (113 loc) · 2.64 KB
/
ConfirmationPage.pde
File metadata and controls
125 lines (113 loc) · 2.64 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
class ConfirmationPage{
boolean hide;
Label sorry, unlocked, selection;
Button okay,okay2;
BackButton back;
boolean previous;
int state;
Port port;
int leftX = 100;
int rightX = 400;
int ySpace= 75;
int yMarg = 90;
int opacity =0;
ConfirmationPage(){
hide=true;
sorry= new Label(110,10,580,80,20,"Sorry that is not the pin you previously used. \n For help please visit the main office.",25);
unlocked=new Label(110,10,580,80,20,"Port unlocked!"+ "\n" +"Please retreive your phone and close the door.",25);
back=new BackButton(10,50);
okay=new Button(700,10,100,80,15,"OK",50);
okay2=new Button(width/2-100,150,200,100,30,"OK",50);
selection=new Label(110,10,580,80,20,"You have selected port . \n Please open the door and place your phone inside.",25);
//for(int i=0; i<4; i++){
// mapPorts[i]=new Port(leftX,yMarg+i*ySpace,i+1);
// //ports[i].hide();
//}
//for(int i=4; i<8; i++){
// mapPorts[i]=new Port(rightX,yMarg+(i-4)*ySpace,i+1);
// //ports[i].hide();
//}
}
void run(){
if(!hide){
if(opacity<255)
opacity+=fadeSpeed;
strokeWeight(0);
fill(229,229,229,opacity);
rect(0,0,800,480);
switch(state){
case 0:
showUnlocked();
break;
case 1:
showSorry();
break;
case 2:
selection.changeText("You have selected port "+port.num+". \n Please open the door and place your phone inside.");
showSelection();
break;
default:
showUnlocked();
break;
}
}
if(okay.clicked){
hide();
mouseX=0;
mouseY=0;
delay(100);
slideshow.show();
okay.resetClicked();
}
if(back.clicked){
mouseX=0;
mouseY=0;
if(state==1){
pinPage.show(false,port);
hide();
}
else if(state==2){
pinPage.show(true,port);
hide();
}
back.resetClicked();
}
if(okay2.clicked){
mouseX=0;
mouseY=0;
hide();
delay(100);
slideshow.show();
okay2.resetClicked();
}
}
void showUnlocked(){
unlocked.fadeIn();
okay.fadeIn();
for(Port p:ports){
p.mapPort(port.num);
}
}
void showSorry(){
sorry.fadeIn();
back.fadeIn();
okay2.fadeIn();
}
void showSelection(){
selection.fadeIn();
back.fadeIn();
okay.fadeIn();
for(Port p:ports){
p.mapPort(port.num);
}
}
void hide(){
opacity=0;
hide=true;
}
void show(int n, Port p){
port=p;
hide=false;
state=n;
}
}