Browse Source

Minor fix + cleanup.

preble 13 years ago
parent
commit
10ca73f649
3 changed files with 5 additions and 4 deletions
  1. BIN
      DataValuesV110Transparent.png
  2. 1 2
      IJInventoryView.m
  3. 4 2
      IJInventoryWindowController.m

BIN
DataValuesV110Transparent.png


+ 1 - 2
IJInventoryView.m

@@ -147,7 +147,6 @@ const static CGFloat cellOffset = 40;
 
 - (void)setItems:(NSArray *)theItems
 {
-	NSLog(@"%s", __PRETTY_FUNCTION__);
 	[items autorelease];
 	[theItems retain];
 	items = theItems;
@@ -312,7 +311,7 @@ const static CGFloat cellOffset = 40;
 }
 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
 {
-	NSLog(@"%s operation=%d", __PRETTY_FUNCTION__, sender.draggingSourceOperationMask);
+	//NSLog(@"%s operation=%d", __PRETTY_FUNCTION__, sender.draggingSourceOperationMask);
 	
 	int index = [self itemIndexForPoint:[self convertPoint:[sender draggingLocation] fromView:nil]];
 	

+ 4 - 2
IJInventoryWindowController.m

@@ -303,7 +303,6 @@
 
 - (void)inventoryView:(IJInventoryView *)theInventoryView selectedItemAtIndex:(int)itemIndex
 {
-	NSLog(@"%s index=%d", _cmd, itemIndex);
 	// Show the properties window for this item.
 	IJInventoryItem *lastItem = propertiesViewController.item;
 	
@@ -314,8 +313,12 @@
 	
 	NSArray *items = [self itemArrayForInventoryView:theInventoryView slotOffset:nil];
 	IJInventoryItem *item = [items objectAtIndex:itemIndex];
+	//NSLog(@"%s index=%d item=%@", _cmd, itemIndex, item);
 	if (item.itemId == 0 || lastItem == item)
 	{
+		// Perhaps caused by a bug, but it seems to be possible for the window to not be invisible at this point,
+		// so we will set the alpha value here to be sure.
+		[propertiesWindow setAlphaValue:0.0];
 		propertiesViewController.item = nil;
 		return; // can't show info on nothing
 	}
@@ -400,7 +403,6 @@
 }
 - (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
 {
-	// TODO: Change this, because the row will not correspond once we support sorting.
 	NSNumber *itemId = [filteredItemIds objectAtIndex:row];
 	
 	if ([tableColumn.identifier isEqual:@"itemId"])