More game strings moved out to descriptions.plist. Also added the commsMessageByUnpiloted method, but its code is disabled until approved for inclusion.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1309 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Nikos Barkas 2008-01-14 07:18:46 +00:00
parent 00da1bed7e
commit 0bce1be2ed
7 changed files with 98 additions and 36 deletions

View File

@ -896,6 +896,25 @@
<string>y</string>
</array>
<!-- The four main views -->
<key>forward-view-string</key>
<string>Forward View</string>
<key>aft-view-string</key>
<string>Aft View</string>
<key>port-view-string</key>
<string>Port View</string>
<key>starboard-view-string</key>
<string>Starboard View</string>
<!-- GUI strings common to more than one screens -->
<key>gui-back</key>
<string> Back </string>
<key>gui-more</key>
<string> More </string>
<key>press-space-commander</key>
<string>Press Space Commander</string>
<!-- Intro1 screen -->
<key>game-copyright</key>
<string>by Giles Williams and contributors (C) 2003-2008</string>
@ -904,10 +923,6 @@
<key>load-previous-commander</key>
<string>Load Previous Commander (Y/N)?</string>
<!-- Intro2 screen -->
<key>press-space-commander</key>
<string>Press Space Commander</string>
<!-- Status screen -->
<key>status-commander-@</key>
<string>Commander %@</string>
@ -919,6 +934,8 @@
<string>Condition:</string>
<key>status-fuel</key>
<string>Fuel:</string>
<key>status-light-years-desc</key>
<string>Light Years</string>
<key>status-cash</key>
<string>Cash:</string>
<key>status-legal-status</key>
@ -991,6 +1008,8 @@
<string>Tech Level:</string>
<key>sysdata-pop</key>
<string>Population:</string>
<key>sysdata-billion-word</key>
<string>Billion</string>
<key>sysdata-prod</key>
<string>Gross productivity:</string>
<key>sysdata-radius</key>
@ -1112,8 +1131,12 @@
<string>Price:</string>
<key>shipyard-cargo</key>
<string>Cargo:</string>
<key>shipyard-cargo-d-tc</key>
<string>Cargo: %d TC</string>
<key>shipyard-speed</key>
<string>Speed:</string>
<key>shipyard-speed-f-ls</key>
<string>Speed: %.3f LS</string>
<key>shipyard-no-ships-available-for-purchase</key>
<string>No ships available for purchase.</string>
<key>shipyard-your-@-trade-in-value-d</key>
@ -1149,6 +1172,31 @@
<key>overwritescreen-no</key>
<string> NO </string>
<!-- Mission screen -->
<key>mission-information</key>
<string>Mission Information</string>
<!-- Game Over screen -->
<key>gameoverscreen-game-over</key>
<string>Game Over</string>
<key>gameoverscreen-press-space</key>
<string>Press Space</string>
<!-- Various HUD dials and/or messages and miscellaneous strings -->
<key>no-target-string</key>
<string>No target</string>
<key>ident-system-string</key>
<string>Ident system</string>
<key>missile-string</key>
<string>Missile</string>
<key>communications-log-string</key>
<string>Communications Log</string>
<key>human-colonial-description</key>
<string>Human Colonial</string>
<key>human-colonial-description-plural</key>
<string>Human Colonials</string>
<!-- delivery reports -->
<key>arrival-report-title</key>
<string>%H Arrival Report</string>

View File

@ -1708,7 +1708,7 @@ double scoopSoundPlayTime = 0.0;
missile_status = MISSILE_STATUS_TARGET_LOCKED;
if ((missile_entity[activeMissile])&&(!ident_engaged))
[missile_entity[activeMissile] addTarget:first_target];
[UNIVERSE addMessage:[NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[@-locked-onto-@]"), (ident_engaged)? @"Ident system": @"Missile", [(ShipEntity *)first_target name]] forCount:4.5];
[UNIVERSE addMessage:[NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[@-locked-onto-@]"), (ident_engaged)? DESC(@"ident-system-string"): DESC(@"missile-string"), [(ShipEntity *)first_target name]] forCount:4.5];
if (ident_engaged)
{
if (![UNIVERSE playCustomSound:@"[ident-locked-on]"])
@ -2539,7 +2539,7 @@ double scoopSoundPlayTime = 0.0;
if ((target_entity)&&(target_entity->isShip))
return [(ShipEntity*)target_entity identFromShip:self];
else
return @"No target";
return DESC(@"no-target-string");
}
@ -3569,11 +3569,11 @@ double scoopSoundPlayTime = 0.0;
flightSpeed = 160.0;
status = STATUS_DEAD;
[UNIVERSE displayMessage:@"Game Over" forCount:30.0];
[UNIVERSE displayMessage:DESC(@"gameoverscreen-game-over") forCount:30.0];
[UNIVERSE displayMessage:@"" forCount:30.0];
[UNIVERSE displayMessage:scoreMS forCount:30.0];
[UNIVERSE displayMessage:@"" forCount:30.0];
[UNIVERSE displayMessage:@"Press Space" forCount:30.0];
[UNIVERSE displayMessage:DESC(@"gameoverscreen-press-space") forCount:30.0];
shot_time = 0.0;
if (whom == nil) whom = (id)[NSNull null];
@ -4054,10 +4054,12 @@ double scoopSoundPlayTime = 0.0;
ship_dict = [UNIVERSE getDictionaryForShip:ship_desc];
shipName = [ship_dict stringForKey:KEY_NAME];
NSString *lightYearsDesc = DESC(@"status-light-years-desc");
legal_desc = LegalStatusToString(legalStatus);
rating_desc = KillCountToRatingAndKillString(ship_kills);
alert_desc = AlertConditionToString([self alertCondition]);
fuel_desc = [NSString stringWithFormat:@"%.1f Light Years", fuel/10.0];
fuel_desc = [NSString stringWithFormat:@"%.1f %@", fuel/10.0, lightYearsDesc];
credits_desc = [NSString stringWithFormat:@"%.1f Cr", credits/10.0];
[gui clear];
@ -4242,7 +4244,7 @@ double scoopSoundPlayTime = 0.0;
[gui setArray:[NSArray arrayWithObjects:[descriptions objectForKey:@"sysdata-tl"], [NSString stringWithFormat:@"%d", techlevel + 1], nil] forRow:5];
[gui setArray:[NSArray arrayWithObjects:[descriptions objectForKey:@"sysdata-pop"], [NSString stringWithFormat:@"%.1f Billion", 0.1*population], nil] forRow:7];
[gui setArray:[NSArray arrayWithObjects:[descriptions objectForKey:@"sysdata-pop"], [NSString stringWithFormat:@"%.1f %@", 0.1*population, DESC(@"sysdata-billion-word")], nil] forRow:7];
[gui setArray:[NSArray arrayWithObjects:@"", [NSString stringWithFormat:@"(%@)", inhabitants], nil] forRow:8];
[gui setArray:[NSArray arrayWithObjects:[descriptions objectForKey:@"sysdata-prod"], @"", [NSString stringWithFormat:@"%5d M Cr.", productivity], nil] forRow:10];
@ -4553,7 +4555,7 @@ double scoopSoundPlayTime = 0.0;
}
// Back menu option
[gui setText:DESC(@"gameoptions-back") forRow:GUI_ROW_GAMEOPTIONS_BACK align:GUI_ALIGN_CENTER];
[gui setText:DESC(@"gui-back") forRow:GUI_ROW_GAMEOPTIONS_BACK align:GUI_ALIGN_CENTER];
[gui setKey:GUI_KEY_OK forRow:GUI_ROW_GAMEOPTIONS_BACK];

View File

@ -1007,9 +1007,9 @@ static NSString * const kOOLogNoteShowShipyardModel = @"script.debug.note.showSh
else
text_row = [gui addLongText:report startingAtRow:text_row align:GUI_ALIGN_LEFT];
[gui setText:[NSString stringWithFormat:@"Cash:\t%.1f Cr.\t\tLoad %d of %d t.\tPassengers %d of %d berths.", 0.1*credits, current_cargo, max_cargo, [passengers count], max_passengers] forRow: GUI_ROW_MARKET_CASH];
[gui setText:[NSString stringWithFormat:DESC(@"contracts-cash-f-load-d-of-d-passengers-d-of-d-berths"), 0.1*credits, current_cargo, max_cargo, [passengers count], max_passengers] forRow: GUI_ROW_MARKET_CASH];
[gui setText:@"Press Space Commander" forRow:21 align:GUI_ALIGN_CENTER];
[gui setText:@"press-space-commander" forRow:21 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:21];
[gui setShowTextCursor:NO];
@ -1068,9 +1068,9 @@ static NSString * const kOOLogNoteShowShipyardModel = @"script.debug.note.showSh
}
}
[gui setText:[NSString stringWithFormat:@"Cash:\t%.1f Cr.\t\tLoad %d of %d t.\tPassengers %d of %d berths.", 0.1*credits, current_cargo, max_cargo, [passengers count], max_passengers] forRow: GUI_ROW_MARKET_CASH];
[gui setText:[NSString stringWithFormat:DESC(@"contracts-cash-f-load-d-of-d-passengers-d-of-d-berths"), 0.1*credits, current_cargo, max_cargo, [passengers count], max_passengers] forRow: GUI_ROW_MARKET_CASH];
[gui setText:@"Press Space Commander" forRow:21 align:GUI_ALIGN_CENTER];
[gui setText:DESC(@"press-space-commander") forRow:21 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:21];
[gui setShowTextCursor:NO];
@ -1189,7 +1189,7 @@ static NSMutableDictionary* currentShipyard = nil;
if (skip > 0)
{
[gui setColor:[OOColor greenColor] forRow:GUI_ROW_SHIPYARD_START];
[gui setArray:[NSArray arrayWithObjects:@" Back ", @" <-- ", nil] forRow:GUI_ROW_SHIPYARD_START];
[gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_SHIPYARD_START];
[gui setKey:[NSString stringWithFormat:@"More:%d", previous] forRow:GUI_ROW_SHIPYARD_START];
}
for (i = 0; i < (n_ships - skip) && (int)i < n_rows; i++)
@ -1207,7 +1207,7 @@ static NSMutableDictionary* currentShipyard = nil;
if (i < n_ships - skip)
{
[gui setColor:[OOColor greenColor] forRow:start_row + i];
[gui setArray:[NSArray arrayWithObjects:@" More ", @" --> ", nil] forRow:start_row + i];
[gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:start_row + i];
[gui setKey:[NSString stringWithFormat:@"More:%d", n_rows + skip] forRow:start_row + i];
i++;
}
@ -1278,8 +1278,8 @@ static NSMutableDictionary* currentShipyard = nil;
cargo_rating -= 5;
}
[row_info replaceObjectAtIndex:2 withObject:[NSString stringWithFormat:@"Cargo: %d TC", cargo_rating]];
[row_info replaceObjectAtIndex:3 withObject:[NSString stringWithFormat:@"Speed: %.3f LS", speed_rating]];
[row_info replaceObjectAtIndex:2 withObject:[NSString stringWithFormat:DESC(@"shipyard-cargo-d-tc"), cargo_rating]];
[row_info replaceObjectAtIndex:3 withObject:[NSString stringWithFormat:DESC(@"shipyard-speed-f-ls"), speed_rating]];
[gui setArray:[NSArray arrayWithArray:row_info] forRow:GUI_ROW_SHIPYARD_LABELS];
for (i = GUI_ROW_SHIPYARD_INFO_START; i < GUI_ROW_MARKET_CASH - 1; i++)

View File

@ -113,6 +113,11 @@ MA 02110-1301, USA.
- (void) commsMessage:(NSString *)valueString;
#if 0 // Disabled until approved for inclusion.
- (void) commsMessageByUnpiloted:(NSString *)valueString; // Same as commsMessage, but can be used by scripts to have
// unpiloted ships sending commsMessages, if we want to.
#endif
- (void) consoleMessage3s:(NSString *)valueString;
- (void) consoleMessage6s:(NSString *)valueString;

View File

@ -967,9 +967,7 @@ static int scriptRandomSeed = -1; // ensure proper random function
/*-----------------------------------------------------*/
- (void) commsMessage:(NSString *)valueString
{
if (scriptTarget != self) return;
{
Random_Seed very_random_seed;
very_random_seed.a = rand() & 255;
very_random_seed.b = rand() & 255;
@ -985,6 +983,15 @@ static int scriptRandomSeed = -1; // ensure proper random function
}
#if 0 // Disabled until approved for inclusion.
// This method does the same as -commsMessage, (which in fact calls), the difference being that scripts can use this
// method to have unpiloted ship entities sending comms messages.
- (void) commsMessageByUnpiloted:(NSString *)valueString
{
[self commsMessage:valueString];
}
#endif
- (void) consoleMessage3s:(NSString *)valueString
{
Random_Seed very_random_seed;
@ -2149,9 +2156,9 @@ static int scriptRandomSeed = -1; // ensure proper random function
// GUI stuff
{
[gui clear];
[gui setTitle:@"Mission Information"];
[gui setTitle:DESC(@"mission-information")];
//
[gui setText:@"Press Space Commander" forRow:21 align:GUI_ALIGN_CENTER];
[gui setText:DESC(@"press-space-commander") forRow:21 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:21];
[gui setKey:@"spacebar" forRow:21];
//

View File

@ -755,7 +755,7 @@
if (page)
{
[gui setArray:[NSArray arrayWithObjects:@" Back ", @" <-- ", nil]
[gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil]
forRow:STARTROW-1];
[gui setKey:GUI_KEY_OK forRow:STARTROW-1];
rangeStart=STARTROW-1;
@ -771,7 +771,7 @@
else
{
lastIndex=(page * NUMROWS) + NUMROWS;
[gui setArray:[NSArray arrayWithObjects:@" More ", @" --> ", nil]
[gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil]
forRow:ENDROW];
[gui setKey:GUI_KEY_OK forRow:ENDROW];
[gui setSelectableRange: NSMakeRange(rangeStart, NUMROWS+1)];
@ -900,7 +900,7 @@
// Nikos - Add some more information in the load game screen (current location, galaxy number and timestamp).
//-------------------------------------------------------------------------------------------------------------------------
// Store the current galaxy seed because findSystemNumberAtCoords will alter it in a while.
// Store the current galaxy seed because findSystemNumberAtCoords may alter it in a while.
PlayerEntity *player = [PlayerEntity sharedPlayer];
Random_Seed player_galaxy_seed = [player galaxy_seed];

View File

@ -188,7 +188,7 @@ static NSComparisonResult comparePrice(NSDictionary *dict1, NSDictionary *dict2,
[comm_log_gui setBackgroundColor:[OOColor colorWithCalibratedRed:0.0 green:0.05 blue:0.45 alpha:0.5]];
[comm_log_gui setTextColor:[OOColor whiteColor]];
[comm_log_gui setAlpha:0.0];
[comm_log_gui printLongText:@"Communications Log" align:GUI_ALIGN_CENTER color:[OOColor yellowColor] fadeTime:0 key:nil addToArray:nil];
[comm_log_gui printLongText:DESC(@"communications-log-string") align:GUI_ALIGN_CENTER color:[OOColor yellowColor] fadeTime:0 key:nil addToArray:nil];
[comm_log_gui setDrawPosition: make_vector(0.0, 180.0, 640.0)];
displayFPS = NO;
@ -437,7 +437,7 @@ static NSComparisonResult comparePrice(NSDictionary *dict1, NSDictionary *dict2,
[comm_log_gui setBackgroundColor:[OOColor colorWithCalibratedRed:0.0 green:0.05 blue:0.45 alpha:0.5]];
[comm_log_gui setTextColor:[OOColor whiteColor]];
[comm_log_gui setAlpha:0.0];
[comm_log_gui printLongText:@"Communications Log" align:GUI_ALIGN_CENTER color:[OOColor yellowColor] fadeTime:0 key:nil addToArray:nil];
[comm_log_gui printLongText:DESC(@"communications-log-string") align:GUI_ALIGN_CENTER color:[OOColor yellowColor] fadeTime:0 key:nil addToArray:nil];
[comm_log_gui setDrawPosition: make_vector(0.0, 180.0, 640.0)];
time_delta = 0.0;
@ -4798,22 +4798,22 @@ static BOOL MaintainLinkedLists(Universe* uni)
switch (vd)
{
case VIEW_FORWARD:
ms = @"Forward View";
ms = DESC(@"forward-view-string");
displayGUI = NO; // switch off any text displays
break;
case VIEW_AFT:
ms = @"Aft View";
ms = DESC(@"aft-view-string");
displayGUI = NO; // switch off any text displays
break;
case VIEW_PORT:
ms = @"Port View";
ms = DESC(@"port-view-string");
displayGUI = NO; // switch off any text displays
break;
case VIEW_STARBOARD:
ms = @"Starboard View";
ms = DESC(@"starboard-view-string");
displayGUI = NO; // switch off any text displays
break;
/* GILES custom views */
@ -5811,11 +5811,11 @@ static BOOL MaintainLinkedLists(Universe* uni)
if (plural)
{
// TODO: use plist
[inhabitants appendString:@"Human Colonials"];
[inhabitants appendString:DESC(@"human-colonial-description-plural")];
}
else
{
[inhabitants appendString:@"Human Colonial"];
[inhabitants appendString:DESC(@"human-colonial-description")];
}
}
else
@ -7452,7 +7452,7 @@ static NSComparisonResult comparePrice(NSDictionary *dict1, NSDictionary *dict2,
[gui clear];
[message_gui clear];
[comm_log_gui clear];
[comm_log_gui printLongText:@"Communications Log"
[comm_log_gui printLongText:DESC(@"communications-log-string")
align:GUI_ALIGN_CENTER color:[OOColor yellowColor] fadeTime:0 key:nil addToArray:nil];
}