OSDN Git Service

HMSlotItemLevelViewをslotItemIDをセットするだけで良いように変更
authormasakih <masakih@users.sourceforge.jp>
Sun, 17 Apr 2016 13:17:16 +0000 (22:17 +0900)
committermasakih <masakih@users.sourceforge.jp>
Sun, 17 Apr 2016 13:17:16 +0000 (22:17 +0900)
KCD/HMShipDetailViewController.m
KCD/HMSlotItemLevelView.h
KCD/HMSlotItemLevelView.m
KCD/ja.lproj/HMShipDetailViewController.xib

index 50887a8..89d5e6a 100644 (file)
        [self.guardEscapedView setFrameOrigin:NSZeroPoint];
        [self.view addSubview:self.guardEscapedView];
        
-       [self.slot00Field bind:@"slotItemID"
-                                 toObject:self.shipController
-                          withKeyPath:@"selection.slot_0"
-                                  options:nil];
-       [self.slot01Field bind:@"slotItemID"
-                                 toObject:self.shipController
-                          withKeyPath:@"selection.slot_1"
-                                  options:nil];
-       [self.slot02Field bind:@"slotItemID"
-                                 toObject:self.shipController
-                          withKeyPath:@"selection.slot_2"
-                                  options:nil];
-       [self.slot03Field bind:@"slotItemID"
-                                 toObject:self.shipController
-                          withKeyPath:@"selection.slot_3"
-                                  options:nil];
 }
 
 - (NSManagedObjectContext *)managedObjectContext
index 62adf6b..282a195 100644 (file)
@@ -10,6 +10,4 @@
 
 @interface HMSlotItemLevelView : NSTextField
 
-@property (nonatomic, strong) NSNumber *slotItemID;
-
 @end
index b74b391..852349f 100644 (file)
@@ -17,6 +17,8 @@ static CGImageRef sAirLevelMaskImage = nil;
 
 @interface HMSlotItemLevelView ()
 
+@property (nonatomic, strong) NSNumber *slotItemID;
+
 @property (strong) NSObjectController *slotItemController;
 
 @property (nonatomic, strong) NSNumber *slotItemLevel;
@@ -421,6 +423,14 @@ static CGImageRef sAirLevelMaskImage = nil;
 
 #pragma mark - property
 
+- (void)setObjectValue:(id)objectValue
+{
+       NSValueTransformer *f = [NSValueTransformer valueTransformerForName:@"HMSlotitemNameTransformer"];
+       NSString *name = [f transformedValue:objectValue];
+       [super setObjectValue:name];
+       [self setSlotItemID:objectValue];
+}
+
 - (void)fetchSlotItem
 {
        self.slotItemController.content =  nil;
index 018fa21..134949c 100644 (file)
                                         <binding destination="LyA-xZ-gxq" name="value" keyPath="selection.slot_0" id="4X3-Y8-nMp">
                                             <dictionary key="options">
                                                 <string key="NSNoSelectionPlaceholder">-</string>
-                                                <string key="NSValueTransformerName">HMSlotitemNameTransformer</string>
                                             </dictionary>
                                         </binding>
                                     </connections>
                                         <binding destination="LyA-xZ-gxq" name="value" keyPath="selection.slot_1" id="0io-F0-oA1">
                                             <dictionary key="options">
                                                 <string key="NSNoSelectionPlaceholder">-</string>
-                                                <string key="NSValueTransformerName">HMSlotitemNameTransformer</string>
                                             </dictionary>
                                         </binding>
                                     </connections>
                                         <binding destination="LyA-xZ-gxq" name="value" keyPath="selection.slot_2" id="n8h-wP-F5a">
                                             <dictionary key="options">
                                                 <string key="NSNoSelectionPlaceholder">-</string>
-                                                <string key="NSValueTransformerName">HMSlotitemNameTransformer</string>
                                             </dictionary>
                                         </binding>
                                     </connections>
                                         <binding destination="LyA-xZ-gxq" name="value" keyPath="selection.slot_3" id="w0M-jX-f3G">
                                             <dictionary key="options">
                                                 <string key="NSNoSelectionPlaceholder">-</string>
-                                                <string key="NSValueTransformerName">HMSlotitemNameTransformer</string>
                                             </dictionary>
                                         </binding>
                                     </connections>