Skip to content

Commit

Permalink
Added Xcode 4 "File" templates both for iOS and Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Apr 7, 2011
1 parent 5daa2a9 commit ec5c265
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 1 deletion.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ People/companies who were/are contributing code to cocos2d for iPhone (alphabeti
CCLabelTTF with alignment works OK on Mac. patch.
* Derek van Vliet (http://http://getsetgames.com/)
Added fix to make JPEG images work correctly in iOS4
* Dmitriy Vakhania
Added Xcode4 File templates
* Dominique Bongard:
patches for CocosDenshion
Scheduler fires Timer the 1st time with dt=0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version 1.0-rc2 - XX-Apr-2011
. [FIX] Scheduler: Fixed possible crash when unscheduling a sibling
. [FIX] Templates: Xcode 3 templates fixed. Removed unused files in cocos2d lib. Added missing files from TouchJSON
. [FIX] Templates: ARMv6 devices uses "none" autorotation to improve speed
. [FIX] Templates: Added Xcode 4 "File" templates both for iOS and Mac OS X
. [FIX] TextureAtlas: Render "static" VBO batches between 6~10 % faster (issue #1150)

version 1.0-rc - 29-Mar-2011
Expand Down
15 changes: 14 additions & 1 deletion install-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ check_dst_dir(){
if [[ -d $DST_DIR ]]; then
if [[ $force ]]; then
echo "removing old libraries: ${DST_DIR}"
rm -rf $DST_DIR
rm -rf "$DST_DIR"
else
echo "templates already installed. To force a re-install use the '-f' parameter"
exit 1
Expand Down Expand Up @@ -288,6 +288,19 @@ copy_xcode4_project_templates(){
copy_files LICENSE_Box2D.txt "$LIBS_DIR"

echo done!


# Move File Templates to correct position
DST_DIR="$HOME/Library/Developer/Xcode/Templates/File Templates/cocos2d/"
OLD_DIR="$HOME/Library/Developer/Xcode/Templates/cocos2d/"

print_template_banner "Installing CCNode file templates..."

check_dst_dir

mv -f "$OLD_DIR""/CCNode class.xctemplate" "$DST_DIR"

echo done!
}

# copy Xcode4 templates
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocos2DSubclass___ {

}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import "___FILEBASENAME___.h"


@implementation ___FILEBASENAMEASIDENTIFIER___

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocos2DSubclass___ {

}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import "___FILEBASENAME___.h"


@implementation ___FILEBASENAMEASIDENTIFIER___

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocos2DSubclass___ {

}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
//

#import "___FILEBASENAME___.h"


@implementation ___FILEBASENAMEASIDENTIFIER___

@end
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowedTypes</key>
<array>
<string>public.objective-c-source</string>
</array>
<key>DefaultCompletionName</key>
<string>MyCocos2DClass</string>
<key>Description</key>
<string>An Objective-C class, with a header that includes the &lt;Foundation/Foundation.h&gt; and &quot;cocos2d.h&quot; headers.</string>
<key>Kind</key>
<string>Xcode.IDEKit.TextSubstitutionFileTemplateKind</string>
<key>MainTemplateFile</key>
<string>___FILEBASENAME___.m</string>
<key>Options</key>
<array>
<dict>
<key>Default</key>
<string>CCNode</string>
<key>Description</key>
<string>What class to subclass in the new file</string>
<key>Identifier</key>
<string>cocos2DSubclass</string>
<key>Name</key>
<string>Subclass of</string>
<key>Required</key>
<string>YES</string>
<key>Type</key>
<string>combo</string>
<key>Values</key>
<array>
<string>CCNode</string>
<string>CCLayer</string>
<string>CCSprite</string>
</array>
</dict>
</array>
<key>Platforms</key>
<array>
<string>com.apple.platform.iphoneos</string>
<string>com.apple.platform.macosx</string>
</array>
<key>SortOrder</key>
<string>1</string>
<key>Summary</key>
<string>An Objective-C class with a header</string>
</dict>
</plist>

0 comments on commit ec5c265

Please sign in to comment.