diff --git a/NOTES b/NOTES index 235669a..83adf04 100644 --- a/NOTES +++ b/NOTES @@ -1,6 +1,3 @@ -// Before launch -// TODO: Hide cheaters - // After launch // TODO: No local storage on IE - why? // TODO: Do something about background-size failure on IE. diff --git a/main.css b/main.css index 1859ff0..6cf2dc2 100644 --- a/main.css +++ b/main.css @@ -1,5 +1,7 @@ - +body { + height: 100%; +} thead.mid { border-top: solid 1px grey; @@ -122,3 +124,14 @@ tr { height: 15px; } body.iOS div.hint { visibility: visible; } + +div#paused { + display: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + font-size: 160px; + opacity: 0.5; +} \ No newline at end of file diff --git a/main.html b/main.html index 4cff0f0..f42939c 100644 --- a/main.html +++ b/main.html @@ -8,10 +8,10 @@ + content="initial-scale=1.0, + maximum-scale=1.0, + minimum-scale=1.0, + user-scalable=0" /> @@ -186,6 +186,9 @@
+ +

PAUSED
+ diff --git a/main.js b/main.js index fa0a1b1..6395bbb 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,6 @@ function timeGetTime() { function StartTimer() { if (!timerid) { lasttick = timeGetTime(); - //timerid = setInterval(Timer1Timer, 100); timerid = setTimeout(Timer1Timer, 100); } } @@ -1113,43 +1112,50 @@ function ToDna(s) { } function FormKeyDown(e) { - if (e.which == 2) { // ^B - Brag('brag'); - //Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name'))); - } + var key = String.fromCharCode(e.which); - if (e.which == 4) { // ^D + if (key === 'd') { alert("Your character's genome is " + ToDna(game.dna + "")); } - if (e.which == 7) { // ^G - game.guild = InputBox('Choose a guild.\r\rMake sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', game.guild); - Brag("guild"); + if (game.isonline) { + if (key === 'b') { + Brag('brag'); + //Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name'))); + } + + if (key === 'g') { + game.guild = InputBox('Choose a guild.\r\rMake sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', game.guild); + Brag("guild"); + } + + if (key === 'm') { + game.motto = InputBox('Declare your motto!', game.motto); + Brag('motto'); + } } - if (e.which == 13) { // ^M - game.motto = InputBox('Declare your motto!', game.motto); - Brag('motto'); - } - - if (e.which == 16) { // ^P - if (timerid) + if (key === 'p') { + if (timerid) { + $('#paused').css('display', 'block'); StopTimer(); - else + } else { + $('#paused').css('display', ''); StartTimer(); + } } - if (e.which == 17) { // ^Q + if (key === 'q') { quit(); } - if (e.which == 19) { // ^S + if (key === 's') { SaveGame(); - alert(JSON.stringify(game).length); + alert('Saved (' + JSON.stringify(game).length + ' bytes).'); } /* - if (e.which == 20) { // ^T + if (key === 't') { TaskBar.reposition(TaskBar.Max()); } */