Minor fix + cleanup.

This commit is contained in:
preble 2010-10-10 18:09:18 -04:00
parent e3e071a157
commit 10ca73f649
3 changed files with 5 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -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]];

View File

@ -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"])