-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathglobal.js
112 lines (85 loc) · 2.37 KB
/
global.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
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
function getRandomInt(min, max) {
return Math.random() * (max - min) + min;
}
var NoCacheHeaders = new Headers();
NoCacheHeaders.append('pragma', 'no-cache');
NoCacheHeaders.append('cache-control', 'no-cache');
function playRandomFrame(layer,frameRange){
let i=getRandomInt(frameRange[0],frameRange[1]);
layer.gotoAndPlay(i);
}
function stopRandomFrame(layer,frameRange){
let i=getRandomInt(frameRange[0],frameRange[1]);
layer.gotoAndStop(i);
}
function endAnim(){
stage.children[0].returnToIdle();
tableAnim("normal");
}
function anim(animationName){
stage.children[0].playAnim(animationName);
}
/////////////audience functions
function audience(audAnim){
stage.children[0].audienceSelector(audAnim);
}
function endAudience(){
stage.children[0].returnToIdleAudience();
}
///////////// table functions
function tableHide(){
stage.children[0].theTable.visible = false;
}
function tableShow(){
if (window.isTableHere == false){
stage.children[0].theTable.visible = false;
}else{
stage.children[0].theTable.visible = true;
}
}
function tableAnim(anim){
stage.children[0].theTable.gotoAndStop(anim);
}
///////////// alert functions
function endAlert(){
window.alertActive = false;
}
function pauseAlert(x){
if (x){
window.alertPaused = x;
console.log("notifications paused? : " + window.alertPaused);
}else{
if (window.alertPaused == false){
window.alertPaused = true;
console.log("notifications PAUSED");
}else{
window.alertPaused = false;
console.log("notifications RESUMED");
}
}
}
function startDono(){ //use this at beginning of dono animations if you want hat guy to hide
stage.children[0].donoMainHide();
}
function endDono(){ //use this at end of dono animations to show hat guy and continue
stage.children[0].returnToDono();
}
function skipDono(){ //use this to skip dono animation entirely
stage.children[0].skipDono();
}
//////////// curtain functions
function endCurtain(){
stage.children[0].curtainReset();
}
//////////// light functions
function light(lightAnim){
stage.children[0].lightSelector(lightAnim);
}
function endLight(){
stage.children[0].lightReset();
}
//// used for finding consistent frame based on the username for alertPerson thing
function frameFromUsername(username, maxFrame) {
let checksum = username.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0);
return Math.abs(checksum % maxFrame);
}