forked from preble/InsideJob
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Kaikz
committed
May 21, 2011
1 parent
47f11c2
commit 4699aff
Showing
12 changed files
with
10,689 additions
and
846 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.