Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix credits and about parchment behavior

  • Loading branch information...
commit fb9b7bf869ac497a6767f9b3e8ad3f2943615a67 1 parent fcfb59c
@glecollinet glecollinet authored
Showing with 11 additions and 12 deletions.
  1. +4 −0 client/js/app.js
  2. +7 −12 client/js/main.js
View
4 client/js/app.js
@@ -352,7 +352,9 @@ define(['jquery', 'storage'], function($, Storage) {
if(this.game.started) {
$('#parchment').removeClass().addClass('credits');
+
$('body').toggleClass('credits');
+
if(!this.game.player) {
$('body').toggleClass('death');
}
@@ -402,6 +404,7 @@ define(['jquery', 'storage'], function($, Storage) {
closeInGameCredits: function() {
$('body').removeClass('credits');
+ $('#parchment').removeClass('credits');
if(!this.game.player) {
$('body').addClass('death');
}
@@ -409,6 +412,7 @@ define(['jquery', 'storage'], function($, Storage) {
closeInGameAbout: function() {
$('body').removeClass('about');
+ $('#parchment').removeClass('about');
if(!this.game.player) {
$('body').addClass('death');
}
View
19 client/js/main.js
@@ -21,15 +21,6 @@ define(['jquery', 'app'], function($, App) {
app.toggleAbout();
}
});
-
- $('#credits').click(function(e) {
- app.toggleCredits();
- e.stopPropagation();
- });
-
- $('#about').click(function() {
- app.toggleAbout();
- });
$('.barbutton').click(function() {
$(this).toggleClass('active');
@@ -235,13 +226,12 @@ define(['jquery', 'app'], function($, App) {
$('body').unbind('click');
$('body').click(function(event) {
- if(game.started && !game.renderer.mobile && game.player) {
- game.click();
- }
+ var hasClosedParchment = false;
if($('#parchment').hasClass('credits')) {
if(game.started) {
app.closeInGameCredits();
+ hasClosedParchment = true;
} else {
app.toggleCredits();
}
@@ -250,10 +240,15 @@ define(['jquery', 'app'], function($, App) {
if($('#parchment').hasClass('about')) {
if(game.started) {
app.closeInGameAbout();
+ hasClosedParchment = true;
} else {
app.toggleAbout();
}
}
+
+ if(game.started && !game.renderer.mobile && game.player && !hasClosedParchment) {
+ game.click();
+ }
});
$('#respawn').click(function(event) {
Please sign in to comment.
Something went wrong with that request. Please try again.