|
@@ -14,7 +14,6 @@
|
|
|
#import "MAAttachedWindow.h"
|
|
|
|
|
|
@interface IJInventoryWindowController ()
|
|
|
-- (void)removePropertiesWindow;
|
|
|
@end
|
|
|
|
|
|
@implementation IJInventoryWindowController
|
|
@@ -200,6 +199,13 @@
|
|
|
#pragma mark -
|
|
|
#pragma mark Actions
|
|
|
|
|
|
+- (IBAction)menuSelectWorld:(id)sender
|
|
|
+{
|
|
|
+ int worldIndex = [sender tag];
|
|
|
+ [self loadWorldAtIndex:worldIndex];
|
|
|
+ [worldSelectionControl setSelectedSegment:worldIndex - 1];
|
|
|
+}
|
|
|
+
|
|
|
- (IBAction)worldSelectionChanged:(id)sender
|
|
|
{
|
|
|
int worldIndex = [worldSelectionControl selectedSegment] + 1;
|
|
@@ -301,8 +307,6 @@
|
|
|
// Show the properties window for this item.
|
|
|
IJInventoryItem *lastItem = propertiesViewController.item;
|
|
|
|
|
|
- //[self removePropertiesWindow];
|
|
|
-
|
|
|
NSPoint itemLocationInView = [theInventoryView pointForItemAtIndex:itemIndex];
|
|
|
NSPoint point = [theInventoryView convertPoint:itemLocationInView toView:nil];
|
|
|
point.x += 16 + 8;
|
|
@@ -435,35 +439,11 @@
|
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
-#pragma mark
|
|
|
-
|
|
|
-- (void)reloadInventoryViewForItem:(IJInventoryItem *)item
|
|
|
-{
|
|
|
- if ([normalInventory containsObject:item])
|
|
|
- [inventoryView reloadItemAtIndex:[normalInventory indexOfObject:item]];
|
|
|
- else if ([quickInventory containsObject:item])
|
|
|
- [quickView reloadItemAtIndex:[quickInventory indexOfObject:item]];
|
|
|
- else if ([armorInventory containsObject:item])
|
|
|
- [armorView reloadItemAtIndex:[armorInventory indexOfObject:item]];
|
|
|
-}
|
|
|
+#pragma mark NSWindowDelegate
|
|
|
|
|
|
-- (void)removePropertiesWindow
|
|
|
+- (void)windowWillClose:(NSNotification *)notification
|
|
|
{
|
|
|
- if (observerObject)
|
|
|
- {
|
|
|
- [propertiesViewController commitEditing];
|
|
|
- [[NSNotificationCenter defaultCenter] removeObserver:observerObject];
|
|
|
- observerObject = nil;
|
|
|
-
|
|
|
- [self reloadInventoryViewForItem:propertiesViewController.item];
|
|
|
-
|
|
|
- [self.window removeChildWindow:propertiesWindow];
|
|
|
- [propertiesWindow orderOut:nil];
|
|
|
- //[propertiesWindow release];
|
|
|
- propertiesWindow = nil;
|
|
|
- propertiesViewController.item = nil;
|
|
|
- }
|
|
|
+ [NSApp terminate:nil];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@end
|