Fixed default value in string extractors (broken in last rev). Changed semantics of JS timer constructor to match documentation (negative delay gives paused timer).

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1602 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2008-04-30 20:54:13 +00:00
parent ff322eafcb
commit 1e3aec21f4
3 changed files with 6 additions and 5 deletions

View File

@ -3182,6 +3182,7 @@ static GLfloat mascem_color2[4] = { 0.4, 0.1, 0.4, 1.0}; // purple
- (NSString *) displayName
{
if (displayName == nil) return name;
return displayName;
}
@ -7490,9 +7491,9 @@ static BOOL AuthorityPredicate(Entity *entity, void *parameter)
return; // out of comms range
if (!other_ship)
return;
NSMutableString* localExpandedMessage = [NSMutableString stringWithString:message_text];
NSMutableString *localExpandedMessage = [NSMutableString stringWithString:message_text];
[localExpandedMessage replaceOccurrencesOfString:@"[self:name]"
withString:displayName
withString:[self displayName]
options:NSLiteralSearch range:NSMakeRange(0, [localExpandedMessage length])];
[localExpandedMessage replaceOccurrencesOfString:@"[target:name]"
withString:[other_ship identFromShip: self]

View File

@ -1403,7 +1403,7 @@ static NSSet *SetForObject(id object, NSSet *defaultValue)
if ([object isKindOfClass:[NSArray class]]) return [NSSet setWithArray:object];
else if ([object isKindOfClass:[NSSet class]]) return [[object copy] autorelease];
else return defaultValue;
return defaultValue;
}
@ -1412,5 +1412,5 @@ static NSString *StringForObject(id object, NSString *defaultValue)
if ([object isKindOfClass:[NSString class]]) return object;
else if ([object respondsToSelector:@selector(stringValue)]) return [object stringValue];
return nil;
return defaultValue;
}

View File

@ -385,7 +385,7 @@ static JSBool TimerConstruct(JSContext *context, JSObject *inThis, uintN argc, j
function:function
this:this];
*outResult = [timer javaScriptValueInContext:context];
[timer scheduleTimer];
if (delay >= 0) [timer scheduleTimer];
[timer release]; // The JS object retains the ObjC object.
return YES;