This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from ninjadev/post_release_fixes
Post release fixes
- Loading branch information
Showing
88 changed files
with
1,004 additions
and
928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,66 @@ | ||
// Copy this file, rename to name of state and add to StateManager | ||
function AchievementState(){ | ||
} | ||
function AchievementState() { | ||
}; | ||
|
||
AchievementState.prototype.init = function(){ | ||
this.elements = []; | ||
var source = $("#achievements-list-template").html(); | ||
this.template = Handlebars.compile(source); | ||
} | ||
AchievementState.prototype.init = function() { | ||
this.elements = []; | ||
var source = $("#achievements-list-template").html(); | ||
this.template = Handlebars.compile(source); | ||
|
||
AchievementState.prototype.pause = function(){ | ||
$('#wrapper').empty(); | ||
} | ||
this.achievement_data = new Achievements(); | ||
}; | ||
|
||
AchievementState.prototype.resume = function(){ | ||
AchievementState.prototype.pause = function() { | ||
$('#wrapper').empty().removeClass('achievements'); | ||
$('.back-button').off('click'); | ||
}; | ||
|
||
AchievementState.prototype.resume = function() { | ||
var achievements = this.getAchievements(); | ||
|
||
var html = this.template({achievements: achievements}); | ||
|
||
this.$achievement_template = $('.achievements.template').clone() | ||
.removeClass('template'); | ||
this.$achievement_template.html(html); | ||
$('#wrapper').addClass('achievements').append(this.$achievement_template); | ||
|
||
$('.back-button').on('click touchstart', function() { | ||
sm.changeState('menu'); | ||
}); | ||
}; | ||
|
||
AchievementState.prototype.render = function(ctx) { | ||
}; | ||
|
||
AchievementState.prototype.update = function() { | ||
if (KEYS[27]) { | ||
sm.changeState("menu"); | ||
} | ||
}; | ||
|
||
AchievementState.prototype.getAchievements = function() { | ||
var json_data = getCookie("cuteanimals_stats"); | ||
if (json_data === undefined) { | ||
return false; | ||
return [ | ||
{ | ||
name: "No achievements", | ||
description: "You should try the game, and come back later!", | ||
custom_image: "default" | ||
} | ||
]; | ||
} | ||
var data = JSON.parse(json_data); | ||
var uniqueNames = []; | ||
$.each(data.achievements, function(i, el){ | ||
if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); | ||
$.each(data.achievements, function(i, el) { | ||
if ($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); | ||
}); | ||
var achievement_data = new Achievements(); | ||
var achievements = []; | ||
for (var i=0;i<uniqueNames.length;i++) { | ||
achievements[i] = achievement_data.achievements[uniqueNames[i]]; | ||
for (var i = 0; i < uniqueNames.length; i++) { | ||
achievements[i] = this.achievement_data.achievements[uniqueNames[i]]; | ||
if (achievements[i].custom_image === undefined) { | ||
achievements[i].custom_image = uniqueNames[i]; | ||
} | ||
} | ||
var html = this.template({achievements: achievements}); | ||
console.log(achievements); | ||
console.log(html); | ||
|
||
this.achievement_template = $('.achievements.template').clone() | ||
.removeClass('template'); | ||
this.achievement_template.html(html); | ||
$('#wrapper').append(this.achievement_template); | ||
} | ||
|
||
AchievementState.prototype.render = function(ctx){ | ||
} | ||
|
||
AchievementState.prototype.update = function(){ | ||
if (KEYS[27]) { | ||
sm.changeState("menu"); | ||
} | ||
} | ||
return achievements; | ||
}; |
Oops, something went wrong.