Skip to content

Commit

Permalink
Merge branch 'Development'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgmeyer committed Feb 6, 2014
2 parents 464e1ae + 9789d4e commit c1a6e30
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ CraftyGenerator.prototype.projectfiles = function projectfiles() {

this.copy('src/libs/crafty/_crafty.js', 'app/src/libs/crafty/crafty.js');
this.copy('src/libs/crafty/_crafty.min.js', 'app/src/libs/crafty/crafty.min.js');

this.copy('src/libs/craftydebug/_craftyDebug.js', 'app/src/libs/craftydebug/craftyDebug.js');
this.copy('src/libs/craftydebug/panels/_assets.js', 'app/src/libs/craftydebug/panels/assets.js');
this.copy('src/libs/craftydebug/panels/_entities.js', 'app/src/libs/craftydebug/panels/entities.js');
};

CraftyGenerator.prototype.gruntfileJSON = function gruntfile() {
Expand Down
7 changes: 6 additions & 1 deletion app/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<script src="src/bower_components/backbone/backbone.js"></script>
<script src="src/bower_components/requirejs-jquery/parts/require.js"></script>
<script src="src/game.js"></script>

<!-- These are debugging libraries and can be removed if you don't want the debugger. -->
<script src="src/libs/CraftyDebug/craftyDebug.js"></script>
<script src="src/libs/CraftyDebug/panels/assets.js"></script>
<script src="src/libs/CraftyDebug/panels/entities.js"></script>
<script type="text/javascript">
gameContainer = {
env : 'dev',
Expand All @@ -34,7 +39,7 @@
sc = [], // container for backbone scene elements
infc = [] // container for backbone interface elements

Crafty.modules({ 'crafty-debug-bar': 'DEV' }, function () {
$(document).ready(function () {
Crafty.debugBar.show();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/_sprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Sprites = Backbone.Model.extend({
},
/**
* Create Crafty sprites from images object
* Pass key if You want create only one choosen sprite.
* Pass key if You want create only one chosen sprite.
*
* @param string key - sprite definition key
*/
Expand Down
149 changes: 149 additions & 0 deletions app/templates/src/libs/CraftyDebug/_craftyDebug.js

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions app/templates/src/libs/CraftyDebug/panels/_assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
(function(){

var styles = '#crafty-debug #assets-box{position: fixed;left: 110px;bottom: 35px;height: 200px;border: 1px solid #2F2F2F;display: none;background-color: white;border-bottom: 0px;padding-right: 10px;}\n'+
'#crafty-debug #assets-box .list{height: 165px;width: 200px; float:left}\n'+
'#crafty-debug #assets-box .list ul{color: #2F2F2F; height: 150px;width: 195px;overflow-y: scroll;padding-left: 5px;list-style-type: none;padding-right: 10px;font-size: 11px;margin-top: 0px;padding-top: 5px;}\n'+
'#crafty-debug #assets-box .list ul li a{padding: 3px 0px 3px 0px;border-bottom: 1px dashed #BBB;color: #2F2F2F; display:block; text-decoration: none}\n'
;
var assetsBox = '<div id="assets-box" class="panel-box">'+
'<div class="content">'+
'<div class="list">'+
'<div class="header">ASSETS<div class="separator"></div></div>'+
'<ul id="assets-box-list"></ul>'+
'</div>'+
'</div>'+
'</div>';

/*********** Renders ***********/

Crafty.debugBar.renders['renderAssetsList'] = function(e) {
$('#crafty-debug #assets-box .list ul#assets-box-list').append('<li>'+e.key+'</li>');
};

/*********** Events ***********/

$('#crafty-debug ul.menu li.assets').live('click',function(){
if ($('#assets-box').is(':visible')) {
$('#assets-box').hide();
} else {
$('.panel-box').hide();
$('#assets-box').show();
}
});

Crafty.bind('NewAsset', function(e){
Crafty.debugBar.renders['renderAssetsList'](e);
});

/*********** Register Panel ***********/

Crafty.debugBar.registerPanel({
'name' : 'Assets',
'description' : 'Game assets',
'styles': styles,
'panelBox' : assetsBox,
});

})();
303 changes: 303 additions & 0 deletions app/templates/src/libs/CraftyDebug/panels/_entities.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.2.0 - 02-06-2014

* Removing the use of Crafty.modules as the community module page has been sunsetted.
* Referenced local copies of CraftyDebug.js.

v0.1.3 - 10-18-2013

* Fixing typo in minification packaging.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-crafty",
"version": "0.1.3",
"version": "0.2.0",
"description": "A Crafty.js generator for Yeoman. Provides Craft.js scaffolding based on CraftyBoilerplate (https://github.com/ahilles107/CraftyBoilerplate)",
"keywords": [
"yeoman-generator",
Expand Down

0 comments on commit c1a6e30

Please sign in to comment.