-
Notifications
You must be signed in to change notification settings - Fork 0
/
VN_SCENE_EMOTE.java
119 lines (96 loc) · 3.26 KB
/
VN_SCENE_EMOTE.java
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
package VN;
import java.io.IOException;
import java.util.ArrayList;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JLayeredPane;
/*
0-2 dot dot dot
3-SpeechBubble
4-
*/
public class VN_SCENE_EMOTE extends Thread {
ArrayList<VN_IMAGE> EMOTE_IMG_LIST = new ArrayList<VN_IMAGE>();
JLayeredPane LP;
String argument = "NOTHING";
VN_SCENE_MANAGER VSM;
VN_SCENE_EMOTE(JLayeredPane JLP,VN_SCENE_MANAGER vsm) throws IOException{
LP = JLP;
VSM = vsm;
for(int i = 0;i<3; i++) EMOTE_IMG_LIST.add(new VN_IMAGE("Emoticon_Idea"));
EMOTE_IMG_LIST.add(new VN_IMAGE("Emoticon_Balloon_N"));
for(int i = 0; i<EMOTE_IMG_LIST.size();i++) {
EMOTE_IMG_LIST.get(i).getLabel().setVisible(false);
LP.add(EMOTE_IMG_LIST.get(i).getLabel());
}
}
public void run() {
try {
task();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedAudioFileException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LineUnavailableException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
synchronized public void task() throws InterruptedException, UnsupportedAudioFileException, IOException, LineUnavailableException {
while (true) {
switch(argument) {
case "RIGHTTHINK":
EMOTE_IMG_LIST.get(3).getLabel().setBounds(1405,275,255 , 198);
EMOTE_IMG_LIST.get(3).getLabel().setVisible(true);
sleep(100);
for(int i = 0;i<3; i++) {
EMOTE_IMG_LIST.get(i).getLabel().setBounds(1420+i*65, 350,39 , 39);
EMOTE_IMG_LIST.get(i).getLabel().setVisible(true);
VSM.frame.AUDIO_LIST.add(new VN_Audio("UI_Bubble",false));
sleep(400);
}
for(int i = 0; i<4;i++) EMOTE_IMG_LIST.get(i).getLabel().setVisible(false);
wait();
break;
case "LEFTTHINK":
EMOTE_IMG_LIST.get(3).getLabel().setBounds(305,275,255 , 198);
EMOTE_IMG_LIST.get(3).getLabel().setVisible(true);
sleep(100);
for(int i = 0;i<3; i++) {
EMOTE_IMG_LIST.get(i).getLabel().setBounds(350+i*65, 350,39 , 39);
EMOTE_IMG_LIST.get(i).getLabel().setVisible(true);
VSM.frame.AUDIO_LIST.add(new VN_Audio("UI_Bubble",false));
sleep(400);
}
for(int i = 0; i<4;i++) EMOTE_IMG_LIST.get(i).getLabel().setVisible(false);
wait();
break;
case "MIDZOOMTHINK":
EMOTE_IMG_LIST.get(3).getLabel().setBounds(875,275,255 , 198);
EMOTE_IMG_LIST.get(3).getLabel().setVisible(true);
sleep(100);
for(int i = 0;i<3; i++) {
EMOTE_IMG_LIST.get(i).getLabel().setBounds(925+i*65, 350,39 , 39);
EMOTE_IMG_LIST.get(i).getLabel().setVisible(true);
VSM.frame.AUDIO_LIST.add(new VN_Audio("UI_Bubble",false));
sleep(400);
}
for(int i = 0; i<4;i++) EMOTE_IMG_LIST.get(i).getLabel().setVisible(false);
wait();
break;
case "NOTHING":
wait();
break;
}
}
}
synchronized public void notification(String s) {
argument = s;
notify();
}
}