-
Notifications
You must be signed in to change notification settings - Fork 0
/
getText.js
35 lines (32 loc) · 896 Bytes
/
getText.js
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
function getText(msg){
if (currText != null){
document.getElementById(currText).style.display = 'none';
}
currText = msg;
text = true;
showText();
}
function showText(){
if(fight){
currBG = 'textBackgroundFight';
document.getElementById(currBG).style.display='block';
}
else{
currBG = 'textBackgroundConversation';
document.getElementById(currBG).style.display='block';
}
document.getElementById(currText).style.display='block';
}
function getOptions(msg){
options = true;
optionMsg = msg;
showOptions();
}
function showOptions(){
document.getElementById(optionMsg).style.display='block';
window.addEventListener("keydown", function (e) {
if (fight && !options && e.keyCode == 13) {
document.getElementById(optionMsg).style.display='none';
}
});
}