Permalink
Browse files

Changed Damage Value button/text to just a button, added 'add custom …

…item' window prep. (not finished, code is there, not in the UI, doesn't work anyway)
  • Loading branch information...
1 parent 47f11c2 commit 4699aff936c8bc5f7c5c7ea3e107102bdb9b6f66 Kaikz committed May 21, 2011
View
Oops, something went wrong.
View
@@ -49,6 +49,7 @@
- (IBAction)makeSearchFieldFirstResponder:(id)sender;
- (IBAction)itemTableViewDoubleClicked:(id)sender;
- (IBAction)coloredHelp:(id)sender;
+- (IBAction)addCustomItemWindow:(id)sender;
@end
View
@@ -49,10 +49,11 @@ - (NSString *)windowNibName
}
- (IBAction)coloredHelp:(id)sender {
- IJDocument *InsideJobOwner = [[IJDocument alloc] init];
- if (![NSBundle loadNibNamed:@"ColoredItemInfo" owner:InsideJobOwner]) {
- NSLog(@"Error loading Nib for document!");
- }
+ [NSBundle loadNibNamed:@"ColoredItemInfo" owner:self];
+}
+
+- (IBAction)addCustomItemWindow:(id)sender {
+ [NSBundle loadNibNamed:@"AddItemView" owner:self];
}
- (void)windowControllerDidLoadNib:(NSWindowController *)windowController
View
@@ -0,0 +1,31 @@
+//
+// KIJAddItemView.h
+// InsideJob
+//
+// Created by Kaikz on 10/05/11.
+// Copyright 2011 Kaikz. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface KIJAddItemView : NSWindow {
+ IBOutlet NSButton *addCustomItemButton;
+ IBOutlet NSButton *selectImage;
+ IBOutlet NSTextField *itemIdField;
+ IBOutlet NSTextField *itemNameField;
+ IBOutlet NSImageView *imagePreview;
+ NSString *itemId;
+ NSString *name;
+}
+
+@property (nonatomic,retain) NSButton *addCustomItem;
+@property (nonatomic,retain) NSButton *selectImage;
+@property (nonatomic,retain) NSTextField *itemIdField;
+@property (nonatomic,retain) NSTextField *itemNameField;
+@property (nonatomic,retain) NSImageView *imagePreview;
+
+-(IBAction) selectItemImage;
+-(IBAction) addCustomItem;
+
+@end
View
@@ -0,0 +1,43 @@
+//
+// KIJAddItemView.m
+// InsideJob
+//
+// Created by Kaikz on 10/05/11.
+// Copyright 2011 Kaikz. All rights reserved.
+//
+
+#import "KIJAddItemView.h"
+
+
+@implementation KIJAddItemView
+
+-(IBAction) selectItemImage {
+ NSOpenPanel *imagePanel = [NSOpenPanel openPanel];
+ [imagePanel setCanChooseFiles:YES];
+ [imagePanel setCanChooseDirectories:NO];
+ [imagePanel setAllowsMultipleSelection:NO];
+ [imagePanel setResolvesAliases:YES];
+ int result = [imagePanel runModal];
+
+ if (result == NSOKButton){
+ NSArray *selectedImageURLArray = [imagePanel URLs];
+ NSString *imageURL = [selectedImageURLArray objectAtIndex:0];
+ }
+
+}
+
+-(IBAction) addCustomItem {
+ itemId = [itemIdField stringValue];
+ name = [itemNameField stringValue];
+ NSString *customItem = [NSString stringWithFormat:@"%@,%@",itemId,name];
+ NSString *itemList = [[NSBundle mainBundle] pathForResource:@"Items" ofType:@"csv"];
+ [customItem writeToFile:itemList atomically:NO encoding:NSUTF8StringEncoding error:nil];
+}
+
+
+- (void)awakeFromNib {
+ [self makeKeyAndOrderFront:nil];
+}
+
+
+@end
View
@@ -45,7 +45,7 @@
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">3</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
+ <string key="NSWindowRect">{{196, 240}, {482, 273}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Damage Values</string>
<string key="NSWindowClass">NSWindow</string>
@@ -70,7 +70,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{245, 127}, {229, 119}}</string>
+ <string key="NSFrame">{{245, 130}, {229, 119}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="197162229"/>
@@ -104,7 +104,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{10, 127}, {229, 119}}</string>
+ <string key="NSFrame">{{10, 130}, {229, 119}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="704498509"/>
@@ -126,7 +126,7 @@
<object class="NSTextField" id="197162229">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{3, 32}, {240, 90}}</string>
+ <string key="NSFrame">{{3, 35}, {240, 90}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="300043920"/>
@@ -164,7 +164,7 @@
<object class="NSTextField" id="300043920">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{245, 32}, {229, 90}}</string>
+ <string key="NSFrame">{{245, 35}, {229, 90}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="876788510"/>
@@ -182,10 +182,9 @@
<object class="NSTextField" id="876788510">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{15, -3}, {450, 17}}</string>
+ <string key="NSFrame">{{15, 0}, {450, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="868914221">
<int key="NSCellFlags">67239424</int>
@@ -202,7 +201,7 @@
</object>
</object>
</object>
- <string key="NSFrame">{{7, 11}, {480, 270}}</string>
+ <string key="NSFrame">{{7, 11}, {482, 273}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="70409215"/>
View
@@ -179,7 +179,7 @@
<string key="NSContents">Time:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="282841256"/>
- <object class="NSColor" key="NSBackgroundColor" id="911057983">
+ <object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
@@ -196,24 +196,6 @@
</object>
</object>
</object>
- <object class="NSTextField" id="125824267">
- <reference key="NSNextResponder" ref="129933696"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{157, 189}, {186, 14}}</string>
- <reference key="NSSuperview" ref="129933696"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="266516539"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="290825070">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
- <string key="NSContents">Damage Value Items (Wool/Dyes):</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="125824267"/>
- <reference key="NSBackgroundColor" ref="911057983"/>
- <reference key="NSTextColor" ref="756010081"/>
- </object>
- </object>
<object class="NSCustomView" id="39552254">
<reference key="NSNextResponder" ref="129933696"/>
<int key="NSvFlags">268</int>
@@ -247,7 +229,7 @@
<string key="NSFrame">{{379, 327}, {195, 22}}</string>
<reference key="NSSuperview" ref="129933696"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="125824267"/>
+ <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="68942551">
<int key="NSCellFlags">343014976</int>
@@ -527,7 +509,6 @@
<string key="NSFrame">{{1, 382}, {190, 15}}</string>
<reference key="NSSuperview" ref="747269195"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="747269195"/>
<string key="NSAction">_doScroller:</string>
@@ -544,22 +525,22 @@
<reference key="NSContentView" ref="1011181083"/>
<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
</object>
- <object class="NSButton" id="266516539">
+ <object class="NSButton" id="646327803">
<reference key="NSNextResponder" ref="129933696"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{345, 182}, {25, 25}}</string>
+ <string key="NSFrame">{{210, 178}, {163, 32}}</string>
<reference key="NSSuperview" ref="129933696"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="39552254"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="296117514">
+ <object class="NSButtonCell" key="NSCell" id="459150769">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
- <string key="NSContents"/>
+ <string key="NSContents">Damage Values...</string>
<reference key="NSSupport" ref="573263950"/>
- <reference key="NSControlView" ref="266516539"/>
- <int key="NSButtonFlags">-2038415105</int>
- <int key="NSButtonFlags2">161</int>
+ <reference key="NSControlView" ref="646327803"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
@@ -696,9 +677,9 @@
<object class="IBActionConnection" key="connection">
<string key="label">coloredHelp:</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="266516539"/>
+ <reference key="destination" ref="646327803"/>
</object>
- <int key="connectionID">47</int>
+ <int key="connectionID">52</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -750,8 +731,7 @@
<reference ref="39552254"/>
<reference ref="747269195"/>
<reference ref="626588983"/>
- <reference ref="125824267"/>
- <reference ref="266516539"/>
+ <reference ref="646327803"/>
</object>
<reference key="parent" ref="784126661"/>
</object>
@@ -905,32 +885,18 @@
<reference key="parent" ref="282841256"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">43</int>
- <reference key="object" ref="266516539"/>
+ <int key="objectID">50</int>
+ <reference key="object" ref="646327803"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="296117514"/>
+ <reference ref="459150769"/>
</object>
<reference key="parent" ref="129933696"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">44</int>
- <reference key="object" ref="296117514"/>
- <reference key="parent" ref="266516539"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">45</int>
- <reference key="object" ref="125824267"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="290825070"/>
- </object>
- <reference key="parent" ref="129933696"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">46</int>
- <reference key="object" ref="290825070"/>
- <reference key="parent" ref="125824267"/>
+ <int key="objectID">51</int>
+ <reference key="object" ref="459150769"/>
+ <reference key="parent" ref="646327803"/>
</object>
</object>
</object>
@@ -970,13 +936,10 @@
<string>4.IBAttributePlaceholdersKey</string>
<string>4.IBPluginDependency</string>
<string>4.IBViewBoundsToFrameTransform</string>
- <string>43.IBPluginDependency</string>
- <string>44.IBPluginDependency</string>
- <string>45.IBPluginDependency</string>
- <string>45.IBViewBoundsToFrameTransform</string>
- <string>46.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.IBViewBoundsToFrameTransform</string>
+ <string>50.IBPluginDependency</string>
+ <string>51.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>6.IBViewBoundsToFrameTransform</string>
<string>7.IBPluginDependency</string>
@@ -1031,16 +994,11 @@
<bytes key="NSTransformStruct">P4AAAL+AAABDMgAAw6wAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAABDBQAAw6qAAA</bytes>
+ <bytes key="NSTransformStruct">AUKcAABDioAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <object class="NSAffineTransform">
- <bytes key="NSTransformStruct">AUKcAABDioAAA</bytes>
- </object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
<bytes key="NSTransformStruct">AUKcAABCygAAA</bytes>
@@ -1068,7 +1026,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">47</int>
+ <int key="maxID">60</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1080,6 +1038,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>addCustomItemWindow:</string>
<string>coloredHelp:</string>
<string>itemTableViewDoubleClicked:</string>
<string>makeSearchFieldFirstResponder:</string>
@@ -1091,12 +1050,14 @@
<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>addCustomItemWindow:</string>
<string>coloredHelp:</string>
<string>itemTableViewDoubleClicked:</string>
<string>makeSearchFieldFirstResponder:</string>
@@ -1105,6 +1066,10 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBActionInfo">
+ <string key="name">addCustomItemWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
<string key="name">coloredHelp:</string>
<string key="candidateClassName">id</string>
</object>
Oops, something went wrong.

0 comments on commit 4699aff

Please sign in to comment.