Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
PlayerEntityLoadSave.h
Go to the documentation of this file.
1/*
2
3PlayerEntityLoadSave.h
4
5Created for the Oolite-Linux project (but is portable)
6
7LoadSave has been separated out into a separate category because
8PlayerEntity.m has gotten far too big and is in danger of becoming
9the whole general mish mash.
10
11Oolite
12Copyright (C) 2004-2013 Giles C Williams and contributors
13
14This program is free software; you can redistribute it and/or
15modify it under the terms of the GNU General Public License
16as published by the Free Software Foundation; either version 2
17of the License, or (at your option) any later version.
18
19This program is distributed in the hope that it will be useful,
20but WITHOUT ANY WARRANTY; without even the implied warranty of
21MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22GNU General Public License for more details.
23
24You should have received a copy of the GNU General Public License
25along with this program; if not, write to the Free Software
26Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
27MA 02110-1301, USA.
28
29*/
30
31#import "PlayerEntity.h"
32#import "GuiDisplayGen.h"
33#import "MyOpenGLView.h"
34#import "Universe.h"
35
36#define EXITROW 1
37#define LABELROW 2
38#define BACKROW 3
39#define STARTROW 4
40#define ENDROW 17
41#define MOREROW 17
42#define NUMROWS 13
43#define COLUMNS 2
44#define INPUTROW 21
45#define CDRDESCROW 19
46#define SAVE_OVERWRITE_WARN_ROW 5
47#define SAVE_OVERWRITE_YES_ROW 8
48#define SAVE_OVERWRITE_NO_ROW 9
49
50
51// Set to 1 to use custom load/save dialogs in windowed mode on Macs in debug builds. No effect on other platforms.
52#define USE_CUSTOM_LOAD_SAVE_ON_MAC_DEBUG 0
53
54// OOLITE_USE_APPKIT_LOAD_SAVE is true if we ever want AppKit dialogs.
55#define OOLITE_USE_APPKIT_LOAD_SAVE (OOLITE_MAC_OS_X && !USE_CUSTOM_LOAD_SAVE_ON_MAC_DEBUG)
56
57// Mac 64-bit builds: never use custom load/save dialogs.
58#define OO_USE_APPKIT_LOAD_SAVE_ALWAYS (OOLITE_USE_APPKIT_LOAD_SAVE && OOLITE_64_BIT)
59
60// OO_USE_CUSTOM_LOAD_SAVE is true if we will ever want custom dialogs.
61#define OO_USE_CUSTOM_LOAD_SAVE (!OO_USE_APPKIT_LOAD_SAVE_ALWAYS)
62
63
64@interface PlayerEntity (LoadSave)
65
66- (BOOL) loadPlayer; // Returns NO on immediate failure, i.e. when using an OS X modal open panel which is cancelled.
67- (void) savePlayer;
68- (void) quicksavePlayer;
69- (void) autosavePlayer;
70
71- (void) setGuiToScenarioScreen:(int)page;
72- (void) addScenarioModel:(NSString *)shipKey;
73- (void) showScenarioDetails;
74- (BOOL) startScenario;
75
76
77#if OO_USE_CUSTOM_LOAD_SAVE
78
79// Interface for PlayerEntityControls
80- (NSString *) commanderSelector;
83
84#endif
85
86- (BOOL) loadPlayerFromFile:(NSString *)fileToOpen asNew:(BOOL)asNew;
87
88@end
89
90
91OOCreditsQuantity OODeciCreditsFromDouble(double doubleDeciCredits);
92
93/* Object is either a floating-point NSNumber or something that can be duck-
94 typed to an integer using OOUnsignedLongLongFromObject().
95*/
uint64_t OOCreditsQuantity
Definition OOTypes.h:182
OOCreditsQuantity OODeciCreditsFromObject(id object)
OOCreditsQuantity OODeciCreditsFromDouble(double doubleDeciCredits)