-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtabs.js
More file actions
119 lines (111 loc) · 3.18 KB
/
Copy pathtabs.js
File metadata and controls
119 lines (111 loc) · 3.18 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
/*
*
* Mouse Pro
*
* Tabs.js
*/
(function (Display, Tabs) {
Tabs.tabs = [
{
label: 'Game',
shortName: 'game',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
},
{
label: 'Settings',
shortName: 'settings',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
},
{
label: 'Achievements',
shortName: 'achievements',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
},
{
label: 'Stats',
shortName: 'stats',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
},
{
label: 'Log',
shortName: 'log',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
},
{
label: 'Performance',
shortName: 'perfs',
saveableState: {
unlocked: false,
active: false
},
isActive: function() {
return this.saveableState.active;
},
isUnlocked: function() {
return this.saveableState.unlocked;
}
}
];
Tabs.unlock = function(shortName) {
let tab = Tabs.tab(shortName);
tab.saveableState.unlocked = true;
}
Tabs.tab = function(shortName) {
return Tabs.tabs.filter(t => t.shortName == shortName)[0];
}
Tabs.toggleActiveTabTo = function(shortName) {
Tabs.tabs.forEach((tab) => { tab.saveableState.active = false; });
Tabs.tab(shortName).saveableState.active = true;
}
Tabs.getActiveTab = function() {
let tab = Tabs.tabs.filter(t => t.isActive())[0];
if (tab == undefined) return '';
return tab.shortName;
}
Tabs.toggleActiveTabTo('game');
})(gameObjects.Display, gameObjects.Tabs);