OSDN Git Service

小破・中破・大破表示を復活させた
authormasakih <masakih@users.sourceforge.jp>
Sun, 25 May 2014 15:54:40 +0000 (00:54 +0900)
committermasakih <masakih@users.sourceforge.jp>
Sun, 25 May 2014 15:54:40 +0000 (00:54 +0900)
KCD/HMKCShipObject.m

index 3002359..a94f464 100644 (file)
@@ -600,11 +600,14 @@ static NSMutableDictionary *names = nil;
 
 - (NSColor *)statusColor
 {
-#if 0
+#if 1
        [self willAccessValueForKey:@"maxhp"];
        [self willAccessValueForKey:@"nowhp"];
        NSInteger maxhp = [[self valueForKey:@"maxhp"] integerValue];
        CGFloat nowhp = [[self valueForKey:@"nowhp"] integerValue];
+       [self didAccessValueForKey:@"nowhp"];
+       [self didAccessValueForKey:@"maxhp"];
+       
        CGFloat status = nowhp / maxhp;
        if(status <= 0.25) {
                return [NSColor redColor];
@@ -616,8 +619,6 @@ static NSMutableDictionary *names = nil;
                return [NSColor yellowColor];
 
        }
-       [self didAccessValueForKey:@"nowhp"];
-       [self didAccessValueForKey:@"maxhp"];
 #endif
        return [NSColor controlTextColor];
 }