37#import "OOJavaScriptEngine.h"
53#define COMMAND_MODIFIER_KEY "Ctrl"
57@interface MyOpenGLView (OOLoadSaveExtensions)
63@interface PlayerEntity (OOLoadSavePrivate)
66- (void)setGuiToSaveCommanderScreen:(NSString*)cdrName;
67- (void)setGuiToOverwriteScreen:(NSString*)cdrName;
68- (void)lsCommanders:(
GuiDisplayGen*)gui directory:(NSString*)directory pageNumber:(
int)page highlightName:(NSString*)highlightName;
69- (void)showCommanderShip:(
int)cdrArrayIndex;
70- (
int)findIndexOfCommander:(NSString*)cdrName;
71- (void)nativeSavePlayer:(NSString*)cdrName;
72- (BOOL)existingNativeSave:(NSString*)cdrName;
74- (void)writePlayerToPath:(NSString*)path;
78@implementation PlayerEntity (LoadSave)
95 NSString* tmp_path =
nil;
96 NSString* tmp_name =
nil;
97 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
100 tmp_path = save_path;
105 NSString* autosaveSuffix =
DESC(
@"autosave-commander-suffix");
107 if (![saveName hasSuffix:autosaveSuffix]) {
108 saveName = [
saveName stringByAppendingString:autosaveSuffix];
110 NSString* savePath = [
dir stringByAppendingPathComponent:[
saveName stringByAppendingString:@".oolite-save"]];
117 @catch (
id exception) {
121 if (tmp_path !=
nil) {
131 NSString* path =
nil;
137 OOLog(
@"quickSave.failed.noName",
@"%@",
@"ERROR no file name returned by [[gameView gameController] playerFileToLoad]");
139 format:@"ERROR no file name returned by [[gameView gameController] playerFileToLoad]"];
145 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
149- (void)setGuiToScenarioScreen:(
int)page
151 NSArray* scenarios = [UNIVERSE scenarios];
152 [UNIVERSE removeDemoShips];
158 BOOL guiChanged = (gui_screen != GUI_SCREEN_NEWGAME);
171 NSDictionary* scenario =
nil;
185 for (i = page * n_rows; i <
count && row < start_row + n_rows; i++) {
186 scenario = [[UNIVERSE scenarios] objectAtIndex:i];
187 NSString* scenarioName = [
NSString stringWithFormat:@" %@ ", [
scenario oo_stringForKey:@"name"]];
193 if ((page + 1) * n_rows <
count) {
200 gui_screen = GUI_SCREEN_NEWGAME;
212 [UNIVERSE enterGUIViewModeWithMouseInteraction:YES];
215- (void)addScenarioModel:(NSString*)shipKey
224 [UNIVERSE removeDemoShips];
226 if ([key hasPrefix:
@"Scenario"]) {
227 int item = [[
key componentsSeparatedByString:@":"] oo_intAtIndex:1];
228 NSDictionary* scenario = [[UNIVERSE scenarios] objectAtIndex:item];
235 NSString* shipKey = [
scenario oo_stringForKey:@"model"];
236 if (shipKey !=
nil) {
249 if ([key isEqualToString:
@"exit"]) {
253 if ([key hasPrefix:
@"__page"]) {
254 int page = [[
key componentsSeparatedByString:@":"] oo_intAtIndex:1];
258 int selection = [[
key componentsSeparatedByString:@":"] oo_intAtIndex:1];
260 NSDictionary* scenario = [[UNIVERSE scenarios] objectAtIndex:selection];
261 NSString* file = [
scenario oo_stringForKey:@"file" defaultValue:nil];
263 OOLog(
@"scenario.init.error",
@"%@",
@"No file entry found for scenario");
268 OOLog(
@"scenario.init.error",
@"Game file not found for scenario %@", file);
276 scenarioKey = [[
scenario oo_stringForKey:@"scenario" defaultValue:nil] retain];
286 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
290 if ([
self handleGUIUpDownArrowKeys]) {
296 [UNIVERSE removeDemoShips];
324 switch ([gui selectedRow]) {
326 if ([
self status] == STATUS_START_GAME) {
343 if ([cdr oo_boolForKey:
@"isSavedGame"])
344 return [
cdr oo_stringForKey:@"saved_game_path"];
348 NSString* newDir = [
cdr oo_stringForKey:@"saved_game_path"];
349 [[UNIVERSE gameController] setPlayerFileDirectory:newDir];
359 if ([gameView isDown:27])
370 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
373 if ([
self handleGUIUpDownArrowKeys]) {
378 if ([(NSDictionary*)[cdrDetailArray objectAtIndex:idx] oo_boolForKey:
@"isSavedGame"])
379 commanderNameString = [[
cdrDetailArray oo_dictionaryAtIndex:idx] oo_stringForKey:@"player_save_name" defaultValue:[[
cdrDetailArray oo_dictionaryAtIndex:idx] oo_stringForKey:@"player_name"]];
383 [UNIVERSE removeDemoShips];
395 [
NSString stringWithFormat:DESC(@"savescreen-commander-name-@"), commanderNameString]
400 if (((([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select] || joyButtonState[
BUTTON_GUISELECT]) && [gui selectedRow] ==
BACKROW) || ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up]))
407 if (((([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select] || joyButtonState[
BUTTON_GUISELECT]) && [gui selectedRow] ==
MOREROW) || ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down]))
415 if (([
self checkKeyPress:n_key_gui_select ignore_ctrl:YES] || [gameView isDown:
gvMouseDoubleClick] || joyButtonState[
BUTTON_GUISELECT]) && [commanderNameString length]) {
421 if (![cdr oo_boolForKey:
@"isSavedGame"])
424 NSString* newDir = [
cdr oo_stringForKey:@"saved_game_path"];
425 [[UNIVERSE gameController] setPlayerFileDirectory:newDir];
433 if ([
self existingNativeSave:commanderNameString]) {
438 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
444 if ([gameView isDown:27])
448 [[UNIVERSE gameView] resetTypedString];
462 id valueYes = [[[UNIVERSE descriptions] oo_stringForKey:@"load-previous-commander-yes" defaultValue:@"y"] lowercaseString];
463 id valueNo = [[[UNIVERSE descriptions] oo_stringForKey:@"load-previous-commander-no" defaultValue:@"n"] lowercaseString];
464 unsigned char cYes, cNo;
466 cYes = [
valueYes characterAtIndex:0] & 0x00ff;
467 cNo = [
valueNo characterAtIndex:0] & 0x00ff;
469 if ((([
self checkKeyPress:n_key_gui_select] || joyButtonState[
BUTTON_GUISELECT]) && ([gui selectedRow] ==
SAVE_OVERWRITE_YES_ROW)) || [gameView isDown:cYes] || [gameView isDown:cYes - 32]) {
473 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
477 if ((([
self checkKeyPress:n_key_gui_select] || joyButtonState[
BUTTON_GUISELECT]) && ([gui selectedRow] ==
SAVE_OVERWRITE_NO_ROW)) || [gameView isDown:27] || [gameView isDown:cNo] || [gameView isDown:cNo - 32]) {
485- (BOOL)loadPlayerFromFile:(NSString*)fileToOpen asNew:(BOOL)asNew
497 NSDictionary* fileDic =
nil;
498 NSString* fail_reason =
nil;
500 if (fileToOpen ==
nil) {
501 fail_reason =
DESC(
@"loadfailed-no-file-specified");
506 OOLog(
@"load.progress",
@"%@",
@"Reading file");
508 if (fileDic ==
nil) {
509 fail_reason =
DESC(
@"loadfailed-could-not-load-file");
515 OOLog(
@"load.progress",
@"%@",
@"Restricting scenario");
516 NSString* scenarioRestrict = [
fileDic oo_stringForKey:@"scenario_restriction" defaultValue:nil];
517 if (scenarioRestrict ==
nil) {
519 BOOL strict = [
fileDic oo_boolForKey:@"strict" defaultValue:NO];
527 if (![
UNIVERSE setUseAddOns:scenarioRestrict fromSaveGame:YES forceReinit:YES]) {
528 fail_reason =
DESC(
@"loadfailed-saved-game-failed-to-load");
534 OOLog(
@"load.progress",
@"%@",
@"Creating player ship");
536 NSString* shipKey =
nil;
537 NSDictionary* shipDict =
nil;
539 shipKey = [
fileDic oo_stringForKey:@"ship_desc"];
542 if (shipDict ==
nil) {
545 fail_reason = [
NSString stringWithFormat:DESC(@"loadfailed-could-not-find-ship-type-@-please-reinstall-the-appropriate-OXP"), shipKey];
547 fail_reason =
DESC(
@"loadfailed-invalid-saved-game-no-ship-specified");
552 OOLog(
@"load.progress",
@"%@",
@"Initialising player entity");
553 if (![
self setUpAndConfirmOK:YES saveGame:YES]) {
554 fail_reason =
DESC(
@"loadfailed-could-not-reset-javascript");
560 OOLog(
@"load.progress",
@"%@",
@"Loading commander data");
561 if (![
self setCommanderDataFromDictionary:fileDic]) {
564 fail_reason =
DESC(
@"loadfailed-could-not-set-up-player-ship");
570 OOLog(
@"load.progress",
@"%@",
@"Recording save path");
575 [[[UNIVERSE gameView] gameController] setPlayerFileToLoad:fileToOpen];
576 [[[UNIVERSE gameView] gameController] setPlayerFileDirectory:fileToOpen];
579 OOLog(
@"load.failed",
@"***** Failed to load saved game \"%@\
": %@", [fileToOpen lastPathComponent], fail_reason ? fail_reason : (NSString*)
@"unknown error");
580 [[UNIVERSE gameController] setPlayerFileToLoad:nil];
581 [UNIVERSE handleGameOver];
582 [UNIVERSE clearPreviousMessage];
583 [UNIVERSE addMessage:DESC(@"loadfailed-saved-game-failed-to-load") forCount:9.0];
584 if (fail_reason !=
nil)
585 [UNIVERSE addMessage:fail_reason forCount:9.0];
589 OOLog(
@"load.progress",
@"%@",
@"Creating system");
590 [UNIVERSE setTimeAccelerationFactor:TIME_ACCELERATION_FACTOR_DEFAULT];
591 [UNIVERSE setSystemTo:system_id];
592 [UNIVERSE removeAllEntitiesExceptPlayer];
593 [UNIVERSE setGalaxyTo:galaxy_number andReinit:YES];
594 [UNIVERSE setUpSpace];
595 [UNIVERSE setAutoSaveNow:NO];
597 OOLog(
@"load.progress",
@"%@",
@"Resetting player flight variables");
601 [UNIVERSE enterGUIViewModeWithMouseInteraction:NO];
618 OOLog(
@"load.progress",
@"%@",
@"Loading system market");
621 NSArray* market = [
fileDic oo_arrayForKey:@"localMarket"];
630 OOLog(
@"load.progress",
@"%@",
@"Setting scenario key");
632 NSString* scenario = [
fileDic oo_stringForKey:@"scenario_key" defaultValue:nil];
634 if (scenario !=
nil) {
638 OOLog(
@"load.progress",
@"%@",
@"Starting JS engine");
642 OOLog(
@"load.progress",
@"%@",
@"Populating initial system");
643 [UNIVERSE populateNormalSpace];
651 HPVector dockedPos = [
fileDic oo_hpvectorForKey:@"docked_station_position"];
652 NSString* dockedRole = [
fileDic oo_stringForKey:@"docked_station_role" defaultValue:@""];
653 StationEntity* saveStation = [UNIVERSE stationWithRole:dockedRole andPosition:dockedPos];
654 if (saveStation !=
nil && [saveStation allowsSaving]) {
659 [UNIVERSE loadStationMarkets:[
fileDic oo_arrayForKey:@"station_markets"]];
661 OOLog(
@"load.progress",
@"%@",
@"Completing JS startup");
665 if ([[
UNIVERSE gameController] finishedLaunching])
666 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
668 gui_screen = GUI_SCREEN_NEWGAME;
670 gui_screen = GUI_SCREEN_LOAD;
675 OOLog(
@"load.progress",
@"%@",
@"Loading complete");
681@implementation PlayerEntity (OOLoadSavePrivate)
683- (void)writePlayerToPath:(NSString*)path
685 NSString* errDesc =
nil;
686 NSDictionary* dict =
nil;
688 [[UNIVERSE gameView] resetTypedString];
691 OOLog(
@"save.failed",
@"***** SAVE ERROR: %s called with nil path.", __PRETTY_FUNCTION__);
697 errDesc =
@"could not construct commander data dictionary.";
699 didSave = [
dict writeOOXMLToFile:path atomically:YES errorDescription:&errDesc];
701 [UNIVERSE clearPreviousMessage];
702 [UNIVERSE addMessage:DESC(@"game-saved") forCount:2];
704 save_path = [
path copy];
705 [[UNIVERSE gameController] setPlayerFileToLoad:save_path];
706 [[UNIVERSE gameController] setPlayerFileDirectory:save_path];
708 [UNIVERSE setAutoSaveNow:NO];
710 OOLog(
@"save.failed",
@"***** SAVE ERROR: %@", errDesc);
712 format:@"Attempt to save game to file '%@' failed: %@", path, errDesc];
714 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
718- (void)nativeSavePlayer:(NSString*)cdrName
720 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
721 NSString* savePath = [
dir stringByAppendingPathComponent:[
cdrName stringByAppendingPathExtension:@"oolite-save"]];
733 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
735 gui_screen = GUI_SCREEN_LOAD;
746 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
749 [UNIVERSE enterGUIViewModeWithMouseInteraction:YES];
752- (void)setGuiToSaveCommanderScreen:(NSString*)cdrName
756 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
759 gui_screen = GUI_SCREEN_SAVE;
779 [UNIVERSE enterGUIViewModeWithMouseInteraction:YES];
782- (void)setGuiToOverwriteScreen:(NSString*)cdrName
790 gui_screen = GUI_SCREEN_SAVE_OVERWRITE;
795 [
gui setText:[
NSString stringWithFormat:DESC(@"overwritescreen-commander-@-already-exists-overwrite-query"), cdrName]
796 forRow:SAVE_OVERWRITE_WARN_ROW
797 align:GUI_ALIGN_CENTER];
815 [UNIVERSE enterGUIViewModeWithMouseInteraction:NO];
820 return [[
cdr1 objectForKey:@"saved_game_path"] localizedCompare:[
cdr2 objectForKey:@"saved_game_path"]];
824 directory:(NSString*)directory
826 highlightName:(NSString*)highlightName
828 NSFileManager* cdrFileManager = [
NSFileManager defaultManager];
835 NSArray* cdrArray = [
cdrFileManager commanderContentsOfPath:directory];
845 @"YES", @"isParentFolder",
846 [
directory stringByDeletingLastPathComponent], @"saved_game_path", nil]];
848 for (i = 0; i < [
cdrArray count]; i++) {
849 NSString* path = [
cdrArray objectAtIndex:i];
850 BOOL exists, isDirectory = NO;
852 exists = [
cdrFileManager fileExistsAtPath:path isDirectory:&isDirectory];
855 if (!isDirectory && [[[path pathExtension] lowercaseString] isEqualToString:
@"oolite-save"]) {
860 [
cdr1 setObject:@"YES" forKey:@"isSavedGame"];
861 [
cdr1 setObject:path forKey:@"saved_game_path"];
865 if (isDirectory && ![[path lastPathComponent] hasPrefix:
@"."]) {
871 if (![cdrDetailArray
count]) {
881 int highlightIdx = 0;
884 if (highlightIdx < 0) {
885 OOLog(
@"save.list.commanders.commanderNotFound",
@"Commander %@ doesn't exist, very bad", highlightName);
896 unsigned firstIndex = page *
NUMROWS;
913 [
gui setArray:[
NSArray arrayWithObjects:DESC(@"loadsavescreen-commander-name"), DESC(@"loadsavescreen-rating"), nil]
924 if ([
self status] == STATUS_START_GAME) {
943 for (i = firstIndex; i < lastIndex; i++) {
945 if ([cdr oo_boolForKey:
@"isSavedGame"]) {
948 [
NSString stringWithFormat:@" %@ ", [
cdr oo_stringForKey:@"player_save_name" defaultValue:[
cdr oo_stringForKey:@"player_name"]]],
949 [
NSString stringWithFormat:@" %@ ", ratingDesc],
952 if ([[
self lastsaveName] isEqualToString:[cdr oo_stringForKey:
@"player_save_name" defaultValue:[cdr oo_stringForKey:
@"player_name"]]]) {
953 highlightRowOnPage = row;
959 if ([cdr oo_boolForKey:
@"isParentFolder"]) {
961 [
NSString stringWithFormat:@" (..) %@ ", [[
cdr oo_stringForKey:@"saved_game_path"] lastPathComponent]],
969 if ([cdr oo_boolForKey:
@"isFolder"]) {
971 [
NSString stringWithFormat:@" >> %@ ", [[
cdr oo_stringForKey:@"saved_game_path"] lastPathComponent]],
981 highlightIdx = (highlightRowOnPage -
STARTROW) + (currentPage *
NUMROWS);
987- (BOOL)existingNativeSave:(NSString*)cdrName
989 NSString* dir = [[UNIVERSE gameController] playerFileDirectory];
991 NSString* savePath = [
dir stringByAppendingPathComponent:[
cdrName stringByAppendingPathExtension:@"oolite-save"]];
992 return [[
NSFileManager defaultManager] fileExistsAtPath:savePath];
996- (void)showCommanderShip:(
int)cdrArrayIndex
999 [UNIVERSE removeDemoShips];
1000 NSDictionary* cdr = [
cdrDetailArray objectAtIndex:cdrArrayIndex];
1006 if ([cdr oo_boolForKey:
@"isFolder"]) {
1007 NSString* folderDesc = [
NSString stringWithFormat:DESC(@"loadsavescreen-hold-@-and-press-return-to-open-folder-@"), @COMMAND_MODIFIER_KEY, [[
cdr oo_stringForKey:@"saved_game_path"] lastPathComponent]];
1013 if ([cdr oo_boolForKey:
@"isParentFolder"]) {
1014 NSString* folderDesc = [
NSString stringWithFormat:DESC(@"loadsavescreen-hold-@-and-press-return-to-open-parent-folder-@"), @COMMAND_MODIFIER_KEY, [[
cdr oo_stringForKey:@"saved_game_path"] lastPathComponent]];
1021 if (![cdr oo_boolForKey:
@"isSavedGame"])
1024 if ([
self dockedStation] ==
nil)
1028 NSString* shipDesc = [
cdr oo_stringForKey:@"ship_desc"];
1029 NSString* shipName =
nil;
1030 NSDictionary* shipDict =
nil;
1031 NSString* rating =
nil;
1035 if (shipDict !=
nil) {
1037 [
dict setDictionary:shipDict];
1038 id subEntStatus = [
cdr objectForKey:@"subentities_status"];
1040 if (subEntStatus !=
nil)
1041 [
dict setObject:subEntStatus forKey:@"subentities_status"];
1044 shipName = [
shipDict oo_stringForKey:@"display_name"];
1045 if (shipName ==
nil)
1046 shipName = [
shipDict oo_stringForKey:KEY_NAME];
1049 shipName = [
cdr oo_stringForKey:@"ship_name" defaultValue:@"unknown"];
1051 shipName = [
shipName stringByAppendingString:@" - OXPs disabled or not installed"];
1053 shipName = [
shipName stringByAppendingString:@" - OXP not installed"];
1067 NSString* timeStamp =
nil;
1068 NSString* locationName = [
cdr oo_stringForKey:@"current_system_name"];
1074 if (locationName ==
nil) {
1079 galNumber = [
cdr oo_intForKey:@"galaxy_number"] + 1;
1081 NSString* locationGov =
@"";
1082 NSString* locationEco =
@"";
1083 NSString* locationTL = [
cdr objectForKey:@"current_system_techlevel"] ? [
NSString stringWithFormat:@"%u", [
cdr oo_unsignedIntForKey:@"current_system_techlevel"] + 1] :
nil;
1085 locationGov = [
NSString stringWithFormat:@"%c", [
cdr oo_unsignedCharForKey:@"current_system_government"]];
1086 locationEco = [
NSString stringWithFormat:@" %c", (7 - [
cdr oo_unsignedCharForKey:@"current_system_economy"]) + 16];
1094 NSString* cdrDesc =
nil;
1096 cdrDesc = [
NSString stringWithFormat:DESC(@"loadsavescreen-commander-@-rated-@-has-@-legal-status-@-ship-@-location-@-g-@-eco-@-gov-@-tl-@-timestamp-@"),
1097 [
cdr oo_stringForKey:@"player_name"],
1114- (
int)findIndexOfCommander:(NSString*)cdrName
1118 NSString* currentName = [[
cdrDetailArray oo_dictionaryAtIndex:i] oo_stringForKey:@"player_save_name" defaultValue:[[
cdrDetailArray oo_dictionaryAtIndex:i] oo_stringForKey:@"player_name"]];
1119 if ([cdrName compare:currentName] == NSOrderedSame) {
1130@implementation MyOpenGLView (OOLoadSaveExtensions)
1141 uint16_t personality = [dict oo_unsignedShortForKey:@"entity_personality" defaultValue:ENTITY_PERSONALITY_INVALID];
1145 personality = [[dict oo_stringForKey:@"ship_desc"] oo_hash] * [[dict oo_stringForKey:@"player_name"] oo_hash];
1164 if (doubleDeciCredits > 0) {
1165 doubleDeciCredits = round(doubleDeciCredits);
1168 if (doubleDeciCredits <= threshold) {
1169 return doubleDeciCredits;
1180 if ([
object isKindOfClass:[NSNumber
class]] && [
object oo_isFloatingPointNumber]) {
OOGUITabStop OOGUITabSettings[GUI_MAX_COLUMNS]
#define OOLog(class, format,...)
NSDictionary * OODictionaryFromFile(NSString *path)
Vector vector_forward_from_quaternion(Quaternion quat) CONST_FUNC
Vector vector_up_from_quaternion(Quaternion quat) CONST_FUNC
Vector vector_right_from_quaternion(Quaternion quat) CONST_FUNC
NSString * ClockToString(double clock, BOOL adjusting)
uint64_t OOCreditsQuantity
#define SAVE_OVERWRITE_NO_ROW
#define SAVE_OVERWRITE_YES_ROW
OOCreditsQuantity OODeciCreditsFromObject(id object)
OOCreditsQuantity OODeciCreditsFromObject(id object)
OOCreditsQuantity OODeciCreditsFromDouble(double doubleDeciCredits)
static uint16_t PersonalityForCommanderDict(NSDictionary *dict)
@ GUI_ROW_SCENARIOS_START
@ GUI_ROW_SCENARIOS_DETAIL
NSString * OODisplayRatingStringFromKillCount(unsigned kills)
NSString * OODisplayStringFromLegalStatus(int legalStatus)
NSString * KillCountToRatingAndKillString(unsigned kills)
#define PLAYER_SHIP_CLOCK_START
#define SCENARIO_OXP_DEFINITION_NONE
#define SCENARIO_OXP_DEFINITION_ALL
#define ENTITY_PERSONALITY_INVALID
#define ENTITY_PERSONALITY_MAX
BOOL isCommandModifierKeyDown()
void overwriteCommanderInputHandler()
void saveCommanderInputHandler()
void showScenarioDetails()
NSString * commanderSelector()
void setGuiToLoadCommanderScreen()
NSComparisonResult sortCommanders(id cdr1, id cdr2, void *context)
void setGuiToIntroFirstGo:(BOOL justCobra)
void setOrientation:(Quaternion quat)
NSString * playerFileToLoad
BOOL setBackgroundTextureKey:(NSString *key)
OOColor * colorFromSetting:defaultValue:(NSString *setting,[defaultValue] OOColor *def)
BOOL setSelectedRow:(OOGUIRow row)
OOGUIRow addLongText:startingAtRow:align:(NSString *str,[startingAtRow] OOGUIRow row,[align] OOGUIAlignment alignment)
BOOL setForegroundTextureKey:(NSString *key)
void setText:forRow:(NSString *str,[forRow] OOGUIRow row)
void setText:forRow:align:(NSString *str,[forRow] OOGUIRow row,[align] OOGUIAlignment alignment)
void clearAndKeepBackground:(BOOL keepBackground)
void setSelectableRange:(NSRange range)
void setColor:forRow:(OOColor *color,[forRow] OOGUIRow row)
NSString * selectedRowKey()
void setTitle:(NSString *str)
void setTabStops:(OOGUITabSettings stops)
void setShowTextCursor:(BOOL yesno)
void setCurrentRow:(OOGUIRow value)
void setArray:forRow:(NSArray *arr,[forRow] OOGUIRow row)
void setKey:forRow:(NSString *str,[forRow] OOGUIRow row)
void setTypedString:(NSString *value)
void suppressKeysUntilKeyUp()
NSMutableString * typedString
void setStringInput:(enum StringInput value)
GameController * gameController
OOJavaScriptEngine * sharedEngine()
void garbageCollectionOpportunity:(BOOL force)
const BOOL * getAllButtonStates()
OOShipRegistry * sharedRegistry()
NSDictionary * shipInfoForKey:(NSString *key)
void showShipyardModel:shipData:personality:(NSString *shipKey,[shipData] NSDictionary *shipDict,[personality] uint16_t personality)
void showShipModelWithKey:shipData:personality:factorX:factorY:factorZ:inContext:(NSString *shipKey,[shipData] NSDictionary *shipData,[personality] uint16_t personality,[factorX] GLfloat factorX,[factorY] GLfloat factorY,[factorZ] GLfloat factorZ,[inContext] NSString *context)
void setGuiToScenarioScreen:(int page)
void playMenuPagePrevious()
void writePlayerToPath:(NSString *path)
void playSaveOverwriteNo()
void setGuiToLoadCommanderScreen()
void setGuiToStatusScreen()
BOOL loadPlayerFromFile:asNew:(NSString *fileToOpen,[asNew] BOOL asNew)
StationEntity * dockedStation()
void setShowDemoShips:(BOOL value)
BOOL doWorldEventUntilMissionScreen:(OOJSPropID message)
NSDictionary * commanderDataDictionary()
void nativeSavePlayer:(NSString *cdrName)
void setLastsaveName:(NSString *value)
void completeSetUpAndSetTarget:(BOOL setTarget)
void calculateCurrentCargo()
void showScenarioDetails()
void lsCommanders:directory:pageNumber:highlightName:(GuiDisplayGen *gui,[directory] NSString *directory,[pageNumber] int page,[highlightName] NSString *highlightName)
void addScenarioModel:(NSString *shipKey)
void setDockedAtMainStation()
void showCommanderShip:(int cdrArrayIndex)
void setDockedStation:(StationEntity *station)
NSString * lastsaveName()
BOOL handleGUIUpDownArrowKeys()
int findIndexOfCommander:(NSString *cdrName)
void playSaveOverwriteYes()
void setGuiToOverwriteScreen:(NSString *cdrName)
void setGuiToSaveCommanderScreen:(NSString *cdrName)
NSString * pathForFileNamed:inFolder:(NSString *fileName,[inFolder] NSString *folderName)
void setEntityPersonalityInt:(uint16_t value)
void doScriptEvent:withArgument:(OOJSPropID message,[withArgument] id argument)
OOCommodityMarket * initialiseLocalMarket()
void setLocalMarket:(NSArray *market)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque