diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 263a136..e1eeda2 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -13,7 +13,7 @@ YES - + YES @@ -503,103 +503,6 @@ 256 YES - - - 268 - {{17, 375}, {167, 26}} - - YES - - -2076049856 - 2048 - - LucidaGrande - 13 - 1044 - - - 109199615 - 129 - - - 400 - 75 - - - World 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - 1 - - - YES - - OtherViews - - YES - - - - World 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - 2 - - - - - World 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - 3 - - - - - World 4 - - 1048576 - 2147483647 - - - _popUpItemAction: - 4 - - - - - World 5 - - 1048576 - 2147483647 - - - _popUpItemAction: - 5 - - - - - - 1 - YES - YES - 2 - - 274 @@ -613,7 +516,7 @@ 4352 - {551, 342} + {551, 328} YES @@ -663,7 +566,11 @@ 337772096 2048 Text Cell - + + LucidaGrande + 13 + 1044 + 6 @@ -812,7 +719,7 @@ YES - + id 42 10 @@ -825,12 +732,12 @@ - + 337772096 -2147481600 Text Cell - + YES @@ -889,7 +796,7 @@ damage - 46 + 149 10 3.4028234663852886e+38 @@ -986,7 +893,7 @@ 0 - {{1, 17}, {551, 342}} + {{1, 17}, {551, 328}} @@ -1007,7 +914,6 @@ -2147483392 {{1, 325}, {441, 15}} - YES 1 _doScroller: @@ -1029,10 +935,10 @@ - {{-1, -1}, {553, 360}} + {{-1, -1}, {553, 346}} - 690 + 562 @@ -1040,19 +946,19 @@ QSAAAEEgAABBmAAAQZgAAA - + 266 - {{186, 381}, {348, 14}} + {{211, 392}, {332, 14}} YES - + 68288064 71435264 Status - - + + 6 System controlColor @@ -1061,6 +967,167 @@ + + + 268 + {{53, 353}, {85, 19}} + + YES + + -1804468671 + 272761856 + + + + YES + + YES + allowsFloats + formatterBehavior + locale + negativeInfinitySymbol + nilSymbol + numberStyle + positiveInfinitySymbol + + + YES + + + + -∞ + + + +∞ + + + #,##0.### + #,##0.### + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + YES + NO + YES + + + YES + + 6 + System + textBackgroundColor + + + + 6 + System + textColor + + + + + + + 268 + {{8, 355}, {40, 14}} + + YES + + 68288064 + 71435264 + Time: + + + + + + + + + 12 + {{0, 378}, {551, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 268 + {{11, 387}, {195, 25}} + + YES + + 67239424 + 0 + + LucidaGrande + 13 + 16 + + + + YES + + World 1 + 1 + YES + 0 + + + 2 + 2 + 0 + + + 3 + 3 + 0 + + + 4 + 4 + 0 + + + 5 + 5 + 0 + + + 2 + + {551, 419} @@ -1321,22 +1388,6 @@ 580 - - - worldPopup - - - - 583 - - - - worldSelectionChanged: - - - - 584 - inventoryWindowController @@ -1349,10 +1400,50 @@ statusTextField - + 593 + + + worldSelectionControl + + + + 603 + + + + worldSelectionChanged: + + + + 604 + + + + initialFirstResponder + + + + 605 + + + + value: worldTime + + + + + + value: worldTime + value + worldTime + 2 + + + 607 + @@ -1720,8 +1811,11 @@ YES - - + + + + + @@ -1763,52 +1857,6 @@ - - 536 - - - YES - - - - - - 537 - - - YES - - - - - - 538 - - - YES - - - - - - - - - - 539 - - - - - 540 - - - - - 541 - - - 565 @@ -1840,7 +1888,7 @@ - + @@ -1923,52 +1971,98 @@ - - 585 - - - - - 586 - - - 587 - + YES - + 588 - + YES - + - + 589 - - + + 591 - + YES - + 592 - - + + + + + 594 + + + YES + + + + + + 595 + + + YES + + + + + + 596 + + + + + 597 + + + YES + + + + + + 598 + + + + + 599 + + + + + 600 + + + YES + + + + + + 601 + + @@ -2070,14 +2164,6 @@ 5.IBPluginDependency 5.ImportedFromIB2 533.IBPluginDependency - 536.IBPluginDependency - 536.IBViewBoundsToFrameTransform - 537.IBPluginDependency - 538.IBEditorWindowLastContentRect - 538.IBPluginDependency - 539.IBPluginDependency - 540.IBPluginDependency - 541.IBPluginDependency 56.IBPluginDependency 56.ImportedFromIB2 565.IBPluginDependency @@ -2101,13 +2187,27 @@ 582.IBNumberFormatterBehaviorMetadataKey 582.IBNumberFormatterLocalizesFormatMetadataKey 582.IBPluginDependency - 585.IBPluginDependency - 586.IBPluginDependency 589.IBNumberFormatterBehaviorMetadataKey 589.IBNumberFormatterLocalizesFormatMetadataKey 589.IBPluginDependency 591.IBPluginDependency + 591.IBViewBoundsToFrameTransform 592.IBPluginDependency + 594.IBAttributePlaceholdersKey + 594.IBPluginDependency + 594.IBViewBoundsToFrameTransform + 595.IBPluginDependency + 596.IBNumberFormatterBehaviorMetadataKey + 596.IBNumberFormatterLocalizesFormatMetadataKey + 596.IBPluginDependency + 597.IBPluginDependency + 597.IBViewBoundsToFrameTransform + 598.IBPluginDependency + 599.IBPluginDependency + 600.IBPluginDependency + 600.IBViewBoundsToFrameTransform + 601.IBPluginDependency + 601.IBSegmentedControlInspectorSelectedSegmentMetadataKey 74.IBPluginDependency 74.ImportedFromIB2 75.IBPluginDependency @@ -2207,9 +2307,9 @@ {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{161, 134}, {551, 419}} + {{191, 193}, {551, 419}} com.apple.InterfaceBuilder.CocoaPlugin - {{161, 134}, {551, 419}} + {{191, 193}, {551, 419}} {{33, 99}, {480, 360}} {3.40282e+38, 3.40282e+38} @@ -2222,16 +2322,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABBiAAAw8oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - {{167, 432}, {167, 103}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2254,14 +2344,43 @@ com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDOgAAw8SAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + 0-24,000. 0 is dawn, 12,000 is dusk. + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCPAAAw72AAA + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBiAAAw60AAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDiYAAw82AAA + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2295,7 +2414,7 @@ - 593 + 607 @@ -2320,13 +2439,13 @@ YES outlineView statusTextField - worldPopup + worldSelectionControl YES NSOutlineView NSTextField - NSPopUpButton + NSSegmentedControl @@ -2335,7 +2454,7 @@ YES outlineView statusTextField - worldPopup + worldSelectionControl YES @@ -2348,8 +2467,8 @@ NSTextField - worldPopup - NSPopUpButton + worldSelectionControl + NSSegmentedControl @@ -2431,6 +2550,14 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + NSBrowser NSControl @@ -2439,22 +2566,6 @@ AppKit.framework/Headers/NSBrowser.h - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - NSCell NSObject @@ -2586,14 +2697,6 @@ AppKit.framework/Headers/NSMenuItem.h - - NSMenuItemCell - NSButtonCell - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItemCell.h - - NSMovieView NSView @@ -2856,22 +2959,6 @@ NSTableView - - NSPopUpButton - NSButton - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButton.h - - - - NSPopUpButtonCell - NSMenuItemCell - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButtonCell.h - - NSResponder @@ -2903,6 +2990,22 @@ AppKit.framework/Headers/NSScroller.h + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + NSTableColumn NSObject diff --git a/IJInventoryWindowController.h b/IJInventoryWindowController.h index 7c169fc..a8760ea 100644 --- a/IJInventoryWindowController.h +++ b/IJInventoryWindowController.h @@ -15,7 +15,7 @@ NSArray *inventory; NSOutlineView *outlineView; - NSPopUpButton *worldPopup; + NSSegmentedControl *worldSelectionControl; NSTextField *statusTextField; NSArray *rootItems; @@ -28,9 +28,11 @@ } @property (nonatomic, assign) IBOutlet NSOutlineView *outlineView; -@property (nonatomic, assign) IBOutlet NSPopUpButton *worldPopup; +@property (nonatomic, assign) IBOutlet NSSegmentedControl *worldSelectionControl; @property (nonatomic, assign) IBOutlet NSTextField *statusTextField; +@property (nonatomic, retain) NSNumber *worldTime; + - (IBAction)worldSelectionChanged:(id)sender; @end diff --git a/IJInventoryWindowController.m b/IJInventoryWindowController.m index 7bd3eda..8efbe25 100644 --- a/IJInventoryWindowController.m +++ b/IJInventoryWindowController.m @@ -14,7 +14,7 @@ @implementation IJInventoryWindowController @synthesize outlineView; -@synthesize worldPopup; +@synthesize worldSelectionControl; @synthesize statusTextField; - (void)awakeFromNib @@ -62,10 +62,14 @@ return; } + [self willChangeValueForKey:@"worldTime"]; + [level release]; level = [[IJMinecraftLevel nbtContainerWithData:fileData] retain]; inventory = [[level inventory] retain]; + [self didChangeValueForKey:@"worldTime"]; + // Add placeholder inventory items: for (int i = 0; i < IJInventorySlotQuickLast + 1 - IJInventorySlotQuickFirst; i++) @@ -157,13 +161,13 @@ - (IBAction)worldSelectionChanged:(id)sender { - int worldIndex = [[worldPopup selectedItem] tag]; + int worldIndex = [worldSelectionControl selectedSegment] + 1; [self loadWorldAtIndex:worldIndex]; } - (void)saveDocument:(id)sender { - int worldIndex = [[worldPopup selectedItem] tag]; + int worldIndex = [worldSelectionControl selectedSegment] + 1; [self saveToWorldAtIndex:worldIndex]; } @@ -186,6 +190,18 @@ return YES; } +- (NSNumber *)worldTime +{ + return [level worldTimeContainer].numberValue; +} +- (void)setWorldTime:(NSNumber *)number +{ + [self willChangeValueForKey:@"worldTime"]; + [level worldTimeContainer].numberValue = number; + [self didChangeValueForKey:@"worldTime"]; + [self markDirty]; +} + #pragma mark - #pragma mark Inventory Outline View diff --git a/IJItemPickerWindowController.h b/IJItemPickerWindowController.h index 99000a2..5e2a7a8 100644 --- a/IJItemPickerWindowController.h +++ b/IJItemPickerWindowController.h @@ -11,11 +11,13 @@ @interface IJItemPickerWindowController : NSWindowController { void(^completionBlock)(uint16_t itemId); + NSSearchField *searchField; NSTableView *tableView; NSArray *allItemIds; NSArray *filteredItemIds; } @property (nonatomic, assign) IBOutlet NSTableView *tableView; +@property (nonatomic, assign) IBOutlet NSSearchField *searchField; + (IJItemPickerWindowController *)sharedController; diff --git a/IJItemPickerWindowController.m b/IJItemPickerWindowController.m index 7b46835..cae1c52 100644 --- a/IJItemPickerWindowController.m +++ b/IJItemPickerWindowController.m @@ -11,7 +11,7 @@ @implementation IJItemPickerWindowController -@synthesize tableView; +@synthesize tableView, searchField; + (IJItemPickerWindowController *)sharedController { @@ -38,6 +38,8 @@ { [self showWindow:nil]; + [searchField becomeFirstResponder]; + [completionBlock autorelease]; completionBlock = [theBlock copy]; diff --git a/IJMinecraftLevel.h b/IJMinecraftLevel.h index 7e4e2d4..9ff66a4 100644 --- a/IJMinecraftLevel.h +++ b/IJMinecraftLevel.h @@ -14,6 +14,7 @@ } @property (nonatomic, copy) NSArray *inventory; // Array of IJInventoryItem objects. +@property (nonatomic, readonly) NBTContainer *worldTimeContainer; + (NSString *)pathForWorldAtIndex:(int)worldIndex; + (NSString *)pathForLevelDatAtIndex:(int)worldIndex; diff --git a/IJMinecraftLevel.m b/IJMinecraftLevel.m index 1ae8cf6..d2a310a 100644 --- a/IJMinecraftLevel.m +++ b/IJMinecraftLevel.m @@ -69,6 +69,11 @@ inventoryList.children = newChildren; } +- (NBTContainer *)worldTimeContainer +{ + return [[self childNamed:@"Data"] childNamed:@"Time"]; +} + #pragma mark - #pragma mark Helpers diff --git a/ItemPicker.xib b/ItemPicker.xib index da878cb..fa21856 100644 --- a/ItemPicker.xib +++ b/ItemPicker.xib @@ -175,7 +175,7 @@ 3 MC4zMzMzMzI5ODU2AA - + 6 System headerTextColor @@ -203,7 +203,7 @@ YES - + name 191 10 @@ -219,9 +219,9 @@ headerColor - + - + 337772096 2048 Text Cell @@ -378,6 +378,14 @@ 24 + + + searchField + + + + 28 + @@ -466,7 +474,7 @@ YES - + @@ -486,17 +494,17 @@ 26 - + YES - + 27 - - + + @@ -551,7 +559,7 @@ - 27 + 28 @@ -592,14 +600,35 @@ - tableView - NSTableView + YES + + YES + searchField + tableView + + + YES + NSSearchField + NSTableView + - tableView - - tableView - NSTableView + YES + + YES + searchField + tableView + + + YES + + searchField + NSSearchField + + + tableView + NSTableView +