-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtool-settings.html
145 lines (125 loc) · 5.14 KB
/
tool-settings.html
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<html>
<head>
<script type="text/javascript" src="akihabara/gbox.js"></script>
<script type="text/javascript" src="akihabara/help.js"></script>
<style>
body *{font-size:17px;font-family: Georgia, "Times New Roman", Times, serif;}
H1 { font-size:20px; text-align:right}
H2 { font-size:20px;line-height:0px; }
.settingsbox { border:1px solid black;padding:10px;margin:0px 0px 10px 0px; border-radius: 5px;-moz-border-radius: 5px; -webkit-border-radius: 5px; -moz-box-shadow:0 0 5px #000000; -webkit-box-shadow:0 0 5px #000000; box-shadow:0 0 5px #000000;}
.settingsbox P { font-size:15px }
.settingsbox P * { font-size:15px }
.settingsbox UL { list-style-type: none; padding: 5px;margin: 0; }
.settingsbox LI { line-height:40px; font-size:15px }
.settingsbox .keymap { position:absolute;left:150px; width:180px;border:0px; padding:5px }
.gameboxkeyboard { background-color:#debebe }
.gameboxaudio { background-color:#debebe }
.gameboxexperimental { background-color:#fecede }
.gameboxsave { background-color:#debebe }
</style>
<title>Akihabara setup</title>
</head>
<body onkeyup="keycustomized(event)" onload="loaddata()">
<h1>Akihabara setup</h1>
<div class="settingsbox gameboxkeyboard">
<h2>Gamebox keyboard setup</h2>
<p>These settings will be used by any Gamebox game hosted by this domain. Click a box and press a key to customize.</p>
<ul>
<li> Up <input class="keymap" id="keyup" READONLY onclick="customizekey({key:'up',input:'keyup'})"></li>
<li> Down <input class="keymap" id="keydown" READONLY onclick="customizekey({key:'down',input:'keydown'})"></li>
<li> Left <input class="keymap" id="keyleft" READONLY onclick="customizekey({key:'left',input:'keyleft'})"></li>
<li> Right <input class="keymap" id="keyright" READONLY onclick="customizekey({key:'right',input:'keyright'})"></li>
<li> A Button <input class="keymap" id="keya" READONLY onclick="customizekey({key:'a',input:'keya'})"></li>
<li> B Button <input class="keymap" id="keyb" READONLY onclick="customizekey({key:'b',input:'keyb'})"></li>
<li> C Button <input class="keymap" id="keyc" READONLY onclick="customizekey({key:'c',input:'keyc'})"></li>
</ul>
</div>
<div class="settingsbox gameboxaudio">
<h2>Gamebox audio setup</h2>
<p>These settings will be used by any Gamebox game hosted by this domain. <b>Audio is still in beta</b> and is available only on <b>Opera</b> and <b>Firefox</b> browsers.</p>
<ul>
<li><input type="checkbox" id="noaudio" onclick="checkflag(this)"> Disable audio</li>
</ul>
</div>
<div class="settingsbox gameboxexperimental">
<h2>Gamebox experimental</h2>
<p>This checkbox enables misc experimental features <b>that are really unstable</b>. Use at yout own risk!</p>
<ul>
<li><input type="checkbox" id="experimental" onclick="checkflag(this)"> Enable experimental features</li>
</ul>
<p><i>Experimental features are: iPad with 3.6 firmware, iPhone with 4.x betas (single channel mode) and all other audio-enabled devices (untested)</i></p>
</div>
<div class="settingsbox gameboxsave">
<input type="button" onclick="resetdefaults()" value="Reset default settings">
<input type="button" onclick="savesettings()" value="Save settings">
</div>
</body>
<script>
var defaults={
keymap:help.cloneObject(gbox._keymap),
flags:help.cloneObject(gbox._flags)
};
var customizing=null;
function pjq(id) { return document.getElementById(id) };
function keyidtostring(id) {
var strkey="";
switch (id) {
case 38: { strkey="Up arrow"; break }
case 40: { strkey="Down arrow"; break }
case 37: { strkey="Left arrow"; break }
case 39: { strkey="Right arrow"; break }
default: {
if (((id>64)&&(id<133))||((id>47)&&(id<58))) strkey=String.fromCharCode(id);
}
}
return "key "+id+(strkey?" ("+strkey+")":"");
}
function updatescreen() {
pjq("keyup").value=keyidtostring(gbox._keymap["up"]);
pjq("keydown").value=keyidtostring(gbox._keymap["down"]);
pjq("keyleft").value=keyidtostring(gbox._keymap["left"]);
pjq("keyright").value=keyidtostring(gbox._keymap["right"]);
pjq("keya").value=keyidtostring(gbox._keymap["a"]);
pjq("keyb").value=keyidtostring(gbox._keymap["b"]);
pjq("keyc").value=keyidtostring(gbox._keymap["c"]);
for (var i in gbox._flags)
pjq(i).checked=gbox._flags[i];
}
function checkflag(t) {
gbox._flags[t.id]=(t.checked?true:false);
}
function loaddata() {
gbox._loadsettings();
updatescreen();
}
function customizekey(p) {
cancelcustomize();
customizing=p;
pjq(customizing.input).style.backgroundColor="#cefede";
}
function cancelcustomize() {
if (customizing) {
pjq(customizing.input).style.backgroundColor="";
updatescreen();
customizing=null;
}
}
function keycustomized(e) {
if (customizing) {
gbox._keymap[customizing.key]=(e.fake||window.event?e.keyCode:e.which);
cancelcustomize();
}
}
function resetdefaults() {
if (confirm("Revert to default configuration?")) {
gbox._keymap=help.cloneObject(defaults.keymap);
gbox._flags=help.cloneObject(defaults.flags);
updatescreen();
}
}
function savesettings() {
gbox._savesettings();
alert("Settings saved succesfully.");
}
</script>
</html>