Commits

Ivan Vučica committed 3677054 Draft

Switched to constraints-based auto layout to ensure that content remains centered in fullscreen. Renamed pellet's "identifier" to fix collision with NSView's identifier. Apparent bug in a future cat makes it not implicitly animate some properties. Switched SDKROOT.

  • Participants
  • Parent commits cba178b

Comments (0)

Files changed (7)

File SGBoardView.m

             NSPoint pt = { i, j };
             NSString * key = NSStringFromPoint(pt);
             [_pellets setValue:pellet forKey:key];
-            [pellet setIdentifier:key];
+            [pellet setPelletIdentifier:key];
             
             [pellet setPelletColor:rand()%MTPelletColorNumberOfColors];
             
     while ([searchQueue count] > 0) 
     {
         SGPelletView *currentPellet = [searchQueue objectAtIndex:0];
-        NSPoint pt = NSPointFromString(currentPellet.identifier);
+        NSPoint pt = NSPointFromString(currentPellet.pelletIdentifier);
         [returnValue addObject:currentPellet];
         
         SGPelletView * nextPellet;
                     [_pellets removeObjectForKey:pt3Str];
                     [_pellets setObject:p3 forKey:newPt3Str];
                     p3.layer.position = (CGPoint){p3.layer.position.x, newPt3.y * PXHEIGHT}; // automatically animates
-                    p3.identifier = newPt3Str;
+                    p3.pelletIdentifier = newPt3Str;
                     
                     p3.frame = (NSRect){ 
                         (NSPoint){p3.layer.position.x, newPt3.y * PXHEIGHT},
                         p3.frame.size
                     };
                     
+                    
+                    if([NSDocument instancesRespondToSelector:@selector(isDraft)])
+                    {
+                        // required on a certain future cat.
+                        CABasicAnimation* layerPositionAnimation = [CABasicAnimation animationWithKeyPath: @"position"];
+                        
+                        layerPositionAnimation.fromValue = [p3.layer.presentationLayer valueForKey:@"position"];
+                        layerPositionAnimation.toValue = [NSValue valueWithPoint:p3.layer.position];
+                        layerPositionAnimation.duration = 0.2;
+                        layerPositionAnimation.removedOnCompletion = YES;
+                        layerPositionAnimation.fillMode = kCAFillModeForwards;
+                        [p3.layer addAnimation:layerPositionAnimation forKey:@"position"];
+                    }
+
+                    
+                    
+                    
                     //[p3 performSelector:@selector(applyNewPosition:) withObject:NSStringFromPoint((NSPoint){p3.layer.position.x, newPt3.y * PXHEIGHT}) afterDelay:10];
                     
                     
                 // if by now the pellet is still kept in the dictionary,
                 // that means it was not replaced, yet it still must be
                 // removed.
-                if(p.identifier && [_pellets valueForKey:p.identifier] == p)
-                    [_pellets removeObjectForKey:p.identifier];
+                if(p.pelletIdentifier && [_pellets valueForKey:p.pelletIdentifier] == p)
+                    [_pellets removeObjectForKey:p.pelletIdentifier];
                 
                 
 
     }
 }
 
+-(NSSize)intrinsicContentSize
+{
+    return NSMakeSize(COUNTX*PXWIDTH, COUNTY*PXHEIGHT);
+}
+
+
 @end

File SGDocument.m

 {
     return YES;
 }
++(BOOL)usesUbiquitousStorage
+{
+    return YES;
+}
 @end

File SGDocument.xib

 <?xml version="1.0" encoding="UTF-8"?>
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
 	<data>
-		<int key="IBDocument.SystemTarget">1060</int>
-		<string key="IBDocument.SystemVersion">11E53</string>
-		<string key="IBDocument.InterfaceBuilderVersion">2182</string>
-		<string key="IBDocument.AppKitVersion">1138.47</string>
-		<string key="IBDocument.HIToolboxVersion">569.00</string>
+		<int key="IBDocument.SystemTarget">1080</int>
+		<string key="IBDocument.SystemVersion">12A178q</string>
+		<string key="IBDocument.InterfaceBuilderVersion">2507</string>
+		<string key="IBDocument.AppKitVersion">1166.3</string>
+		<string key="IBDocument.HIToolboxVersion">609.00</string>
 		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-			<string key="NS.object.0">2182</string>
+			<string key="NS.object.0">2507</string>
 		</object>
 		<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>IBNSLayoutConstraint</string>
+			<string>NSCustomObject</string>
 			<string>NSCustomView</string>
 			<string>NSTextField</string>
+			<string>NSTextFieldCell</string>
+			<string>NSView</string>
 			<string>NSWindowTemplate</string>
-			<string>NSView</string>
-			<string>NSTextFieldCell</string>
-			<string>NSCustomObject</string>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 			<object class="NSWindowTemplate" id="972006081">
 				<int key="NSWindowStyleMask">15</int>
 				<int key="NSWindowBacking">2</int>
-				<string key="NSWindowRect">{{335, 390}, {599, 542}}</string>
-				<int key="NSWTFlags">1954021376</int>
+				<string key="NSWindowRect">{{40, 133}, {600, 600}}</string>
+				<int key="NSWTFlags">1948778496</int>
 				<string key="NSWindowTitle">SameGame</string>
 				<string key="NSWindowClass">NSWindow</string>
 				<nil key="NSViewClass"/>
 				<nil key="NSUserInterfaceItemIdentifier"/>
+				<string key="NSWindowContentMinSize">{500, 600}</string>
 				<object class="NSView" key="NSWindowView" id="439893737">
 					<reference key="NSNextResponder"/>
 					<int key="NSvFlags">256</int>
 						<object class="NSCustomView" id="22355606">
 							<reference key="NSNextResponder" ref="439893737"/>
 							<int key="NSvFlags">301</int>
-							<string key="NSFrame">{{48, 45}, {509, 452}}</string>
+							<string key="NSFrame">{{50, 50}, {500, 500}}</string>
 							<reference key="NSSuperview" ref="439893737"/>
 							<reference key="NSWindow"/>
 							<reference key="NSNextKeyView" ref="763152060"/>
 							<bool key="NSViewIsLayerTreeHost">YES</bool>
-							<int key="NSViewLayerContentsRedrawPolicy">2</int>
+							<string key="NSHuggingPriority">{250, 250}</string>
+							<string key="NSAntiCompressionPriority">{1000, 1000}</string>
 							<string key="NSClassName">SGBoardView</string>
 						</object>
 						<object class="NSTextField" id="763152060">
 							<reference key="NSNextResponder" ref="439893737"/>
 							<int key="NSvFlags">265</int>
-							<string key="NSFrame">{{373, 480}, {209, 62}}</string>
+							<string key="NSFrame">{{344, 558}, {209, 62}}</string>
 							<reference key="NSSuperview" ref="439893737"/>
 							<reference key="NSWindow"/>
 							<bool key="NSViewIsLayerTreeHost">YES</bool>
-							<int key="NSViewLayerContentsRedrawPolicy">2</int>
 							<string key="NSReuseIdentifierKey">_NS:1505</string>
+							<string key="NSAntiCompressionPriority">{250, 750}</string>
 							<bool key="NSEnabled">YES</bool>
 							<object class="NSTextFieldCell" key="NSCell" id="1028721237">
-								<int key="NSCellFlags">67239424</int>
+								<int key="NSCellFlags">67186688</int>
 								<int key="NSCellFlags2">71303168</int>
 								<string key="NSContents">Score: 0</string>
 								<object class="NSFont" key="NSSupport">
 									<bytes key="NSWhite">MQA</bytes>
 								</object>
 							</object>
+							<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
 						</object>
 					</object>
-					<string key="NSFrameSize">{599, 542}</string>
+					<string key="NSFrameSize">{600, 600}</string>
 					<reference key="NSSuperview"/>
 					<reference key="NSWindow"/>
 					<reference key="NSNextKeyView" ref="22355606"/>
 					<bool key="NSViewIsLayerTreeHost">YES</bool>
-					<int key="NSViewLayerContentsRedrawPolicy">2</int>
+					<string key="NSHuggingPriority">{250, 250}</string>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
+				<string key="NSMinSize">{500, 622}</string>
 				<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
 				<int key="NSWindowCollectionBehavior">128</int>
 				<bool key="NSWindowIsRestorable">YES</bool>
 						<object class="NSMutableArray" key="children">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="22355606"/>
+							<object class="IBNSLayoutConstraint" id="85906219">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">9</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="439893737"/>
+								<int key="secondAttribute">9</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">0.0</double>
+								</object>
+								<float key="priority">1000</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">5</int>
+								<float key="scoringTypeFloat">22</float>
+								<int key="contentType">2</int>
+							</object>
+							<object class="IBNSLayoutConstraint" id="953540380">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">5</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="439893737"/>
+								<int key="secondAttribute">5</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">50</double>
+								</object>
+								<float key="priority">1</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">9</int>
+								<float key="scoringTypeFloat">40</float>
+								<int key="contentType">3</int>
+							</object>
+							<object class="IBNSLayoutConstraint" id="663432200">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">3</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="439893737"/>
+								<int key="secondAttribute">3</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">50</double>
+								</object>
+								<float key="priority">1</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">9</int>
+								<float key="scoringTypeFloat">40</float>
+								<int key="contentType">3</int>
+							</object>
 							<reference ref="763152060"/>
+							<object class="IBNSLayoutConstraint" id="352711301">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">6</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="763152060"/>
+								<int key="secondAttribute">6</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">0.0</double>
+								</object>
+								<float key="priority">1000</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">6</int>
+								<float key="scoringTypeFloat">24</float>
+								<int key="contentType">2</int>
+							</object>
+							<object class="IBNSLayoutConstraint" id="379506867">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">10</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="439893737"/>
+								<int key="secondAttribute">10</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">0.0</double>
+								</object>
+								<float key="priority">1000</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">5</int>
+								<float key="scoringTypeFloat">22</float>
+								<int key="contentType">2</int>
+							</object>
+							<object class="IBNSLayoutConstraint" id="1041127111">
+								<reference key="firstItem" ref="22355606"/>
+								<int key="firstAttribute">3</int>
+								<int key="relation">0</int>
+								<reference key="secondItem" ref="763152060"/>
+								<int key="secondAttribute">4</int>
+								<float key="multiplier">1</float>
+								<object class="IBNSLayoutSymbolicConstant" key="constant">
+									<double key="value">8</double>
+								</object>
+								<float key="priority">1000</float>
+								<reference key="containingView" ref="439893737"/>
+								<int key="scoringType">6</int>
+								<float key="scoringTypeFloat">24</float>
+								<int key="contentType">3</int>
+							</object>
 						</object>
 						<reference key="parent" ref="972006081"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">534</int>
-						<reference key="object" ref="22355606"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-						</object>
-						<reference key="parent" ref="439893737"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">538</int>
 						<reference key="object" ref="763152060"/>
 						<object class="NSMutableArray" key="children">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="1028721237"/>
+							<object class="IBNSLayoutConstraint" id="986451955">
+								<reference key="firstItem" ref="763152060"/>
+								<int key="firstAttribute">7</int>
+								<int key="relation">0</int>
+								<nil key="secondItem"/>
+								<int key="secondAttribute">0</int>
+								<float key="multiplier">1</float>
+								<object class="IBLayoutConstant" key="constant">
+									<double key="value">203</double>
+								</object>
+								<float key="priority">1000</float>
+								<reference key="containingView" ref="763152060"/>
+								<int key="scoringType">3</int>
+								<float key="scoringTypeFloat">9</float>
+								<int key="contentType">1</int>
+							</object>
 						</object>
 						<reference key="parent" ref="439893737"/>
 					</object>
 						<reference key="object" ref="1028721237"/>
 						<reference key="parent" ref="763152060"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">544</int>
+						<reference key="object" ref="986451955"/>
+						<reference key="parent" ref="763152060"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">534</int>
+						<reference key="object" ref="22355606"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">971</int>
+						<reference key="object" ref="953540380"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">972</int>
+						<reference key="object" ref="663432200"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">970</int>
+						<reference key="object" ref="85906219"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1011</int>
+						<reference key="object" ref="352711301"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1121</int>
+						<reference key="object" ref="379506867"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1122</int>
+						<reference key="object" ref="1041127111"/>
+						<reference key="parent" ref="439893737"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
 					<string>-1.IBPluginDependency</string>
 					<string>-2.IBPluginDependency</string>
 					<string>-3.IBPluginDependency</string>
+					<string>1011.IBPluginDependency</string>
+					<string>1121.IBPluginDependency</string>
+					<string>1122.IBPluginDependency</string>
+					<string>371.IBNSWindowAutoPositionCentersHorizontal</string>
+					<string>371.IBNSWindowAutoPositionCentersVertical</string>
 					<string>371.IBPluginDependency</string>
 					<string>371.IBWindowTemplateEditedContentRect</string>
 					<string>371.NSWindowTemplate.visibleAtLaunch</string>
 					<string>372.CustomClassName</string>
+					<string>372.IBNSViewMetadataConstraints</string>
 					<string>372.IBPluginDependency</string>
+					<string>534.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints</string>
 					<string>534.IBPluginDependency</string>
+					<string>538.IBNSViewMetadataConstraints</string>
+					<string>538.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints</string>
 					<string>538.IBPluginDependency</string>
 					<string>539.IBPluginDependency</string>
+					<string>544.IBPluginDependency</string>
+					<string>970.IBPluginDependency</string>
+					<string>971.IBPluginDependency</string>
+					<string>972.IBPluginDependency</string>
 				</object>
 				<object class="NSArray" key="dict.values">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<boolean value="NO"/>
+					<boolean value="NO"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{380, 396}, {480, 360}}</string>
+					<boolean value="YES"/>
+					<string>SGBackgroundView</string>
+					<object class="NSMutableArray">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<reference ref="85906219"/>
+						<reference ref="953540380"/>
+						<reference ref="663432200"/>
+						<reference ref="352711301"/>
+						<reference ref="379506867"/>
+						<reference ref="1041127111"/>
+					</object>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<boolean value="NO"/>
-					<string>SGBackgroundView</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<object class="NSArray">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<reference ref="986451955"/>
+					</object>
+					<boolean value="NO"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 				<reference key="dict.values" ref="0"/>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">543</int>
+			<int key="maxID">1122</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 				<bool key="EncodedWithXMLCoder">YES</bool>
 				<object class="IBPartialClassDescription">
+					<string key="className">NSDocument</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>printDocument:</string>
+							<string>revertDocumentToSaved:</string>
+							<string>runPageLayout:</string>
+							<string>saveDocument:</string>
+							<string>saveDocumentAs:</string>
+							<string>saveDocumentTo:</string>
+						</object>
+						<object class="NSArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>printDocument:</string>
+							<string>revertDocumentToSaved:</string>
+							<string>runPageLayout:</string>
+							<string>saveDocument:</string>
+							<string>saveDocumentAs:</string>
+							<string>saveDocumentTo:</string>
+						</object>
+						<object class="NSArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">printDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">revertDocumentToSaved:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">runPageLayout:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocumentAs:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocumentTo:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/NSDocument.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSLayoutConstraint</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">SGBackgroundView</string>
 					<string key="superclassName">NSView</string>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 		</object>
 		<int key="IBDocument.localizationMode">0</int>
 		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
-		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
-			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
-			<integer value="1060" key="NS.object.0"/>
-		</object>
 		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
 			<integer value="3000" key="NS.object.0"/>
 		</object>
 		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+		<bool key="IBDocument.UseAutolayout">YES</bool>
 	</data>
 </archive>

File SGPelletView.h

     NSImage * _stoneImage;
     MTPelletColor _pelletColor;
     BOOL _highlighted;
-    NSString *_identifier;
+    NSString *_pelletIdentifier;
     BOOL _alive;
 }
 @property (retain) NSImage * stoneImage;
 @property (assign) MTPelletColor pelletColor;
 @property (assign) BOOL highlighted;
-@property (retain) NSString * identifier;
+@property (retain) NSString * pelletIdentifier;
 @property (assign) BOOL alive;
 @end

File SGPelletView.m

 @implementation SGPelletView
 @synthesize stoneImage = _stoneImage;
 @synthesize pelletColor = _pelletColor;
-@synthesize identifier = _identifier;
+@synthesize pelletIdentifier = _pelletIdentifier;
 @synthesize alive = _alive;
 -(id)initWithFrame:(NSRect)frame
 {
 
     self.pelletColor = [aDecoder decodeIntForKey:@"pelletColor"];
     self.highlighted = [aDecoder decodeBoolForKey:@"highlighted"];
-    self.identifier = [aDecoder decodeObjectForKey:@"identifier"];
+    self.pelletIdentifier = [aDecoder decodeObjectForKey:@"pelletIdentifier"];
     self.alive = [aDecoder decodeBoolForKey:@"alive"];
 
     return self;
     }
     
     self.stoneImage = nil;
-    self.identifier = nil;
+    self.pelletIdentifier = nil;
     
     [super dealloc];
 }
 -(void)setHighlighted:(BOOL)highlighted
 {
     CALayer * layer = self.layer;
+    
     if(highlighted)
         layer.opacity = 0.3;    
     else
         layer.opacity = 1.0;
-
+    
+    if([NSDocument instancesRespondToSelector:@selector(isDraft)])
+    {
+        // required on a certain future cat.
+        CABasicAnimation* layerOpacityAnimation = [CABasicAnimation animationWithKeyPath: @"opacity"];
+        
+        layerOpacityAnimation.fromValue = [layer.presentationLayer valueForKey:@"opacity"];
+        if(highlighted)
+        {
+            layerOpacityAnimation.toValue = [NSNumber numberWithFloat:0.3];
+        }
+        else
+        {
+            layerOpacityAnimation.toValue = [NSNumber numberWithFloat:1.0];
+        }
+        layerOpacityAnimation.duration = 0.2;
+        layerOpacityAnimation.removedOnCompletion = YES;
+        layerOpacityAnimation.fillMode = kCAFillModeForwards;
+        [layer addAnimation:layerOpacityAnimation forKey:@"opacity"];
+    }
+    
     _highlighted = highlighted;    
 }
 
     [super encodeWithCoder:aCoder];
     [aCoder encodeInt:self.pelletColor forKey:@"pelletColor"];
     [aCoder encodeBool:self.highlighted forKey:@"highlighted"];
-    [aCoder encodeObject:self.identifier forKey:@"identifier"];
+    [aCoder encodeObject:self.pelletIdentifier forKey:@"pelletIdentifier"];
     [aCoder encodeBool:self.alive forKey:@"alive"];
 }
 

File SameGame-Info.plist

 			<string>Icon</string>
 			<key>CFBundleTypeName</key>
 			<string>SameGame</string>
-			<key>CFBundleTypeRole</key>
-			<string>Editor</string>
 			<key>CFBundleTypeOSTypes</key>
 			<array>
 				<string>????</string>
 			</array>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
 			<key>NSDocumentClass</key>
 			<string>SGDocument</string>
 		</dict>

File SameGame.xcodeproj/project.pbxproj

 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 45;
+	objectVersion = 46;
 	objects = {
 
 /* Begin PBXBuildFile section */
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+		7F034DEB1584D67A008E5058 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
 		7F94F82E156263BC002DEE9B /* button.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = button.wav; path = Resources/button.wav; sourceTree = "<group>"; };
 		7F94F82F156263BC002DEE9B /* ok.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ok.wav; path = Resources/ok.wav; sourceTree = "<group>"; };
 		7F94F83215626B65002DEE9B /* SGBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGBackgroundView.h; sourceTree = "<group>"; };
 		29B97314FDCFA39411CA2CEA /* MatchThree */ = {
 			isa = PBXGroup;
 			children = (
+				7F034DEB1584D67A008E5058 /* GameKit.framework */,
 				7F94F83815627035002DEE9B /* Icon.icns */,
 				080E96DDFE201D6D7F000001 /* Classes */,
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
 			isa = PBXProject;
 			attributes = {
 				CLASSPREFIX = SG;
+				LastUpgradeCheck = 0440;
 				ORGANIZATIONNAME = Hindarium;
 			};
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SameGame" */;
-			compatibilityVersion = "Xcode 3.1";
+			compatibilityVersion = "Xcode 3.2";
 			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = NO;
 				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_MODEL_TUNING = G5;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
-				PREBINDING = NO;
-				SDKROOT = macosx10.6;
+				SDKROOT = macosx;
 			};
 			name = Debug;
 		};
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				PREBINDING = NO;
-				SDKROOT = macosx10.6;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
+				SDKROOT = macosx;
 			};
 			name = Release;
 		};