43#import "MyOpenGLView.h"
68#define CUSTOM_VIEW_ROTATE_SPEED 1.0
69#define CUSTOM_VIEW_ZOOM_SPEED 5.0
70#define CUSTOM_VIEW_SPEED_REDUCTION_FACTOR 0.3
107#if OO_RESOLUTION_OPTION
110#if OOLITE_SPEECH_SYNTH
113static BOOL speechVoiceSelectKeyPressed;
114static BOOL speechGenderSelectKeyPressed;
124static BOOL gammaControlPressed;
169@interface PlayerEntity (OOControlsPrivate)
171- (void) pollFlightControls:(
double) delta_t;
172- (void) pollFlightArrowKeyControls:(
double) delta_t;
173- (void) pollGuiArrowKeyControls:(
double) delta_t;
182- (void) pollGuiScreenControlsWithFKeyAlias:(BOOL)fKeyAlias;
185- (void) pollGameOverControls:(
double) delta_t;
186- (void) pollAutopilotControls:(
double) delta_t;
187- (void) pollDockedControls:(
double) delta_t;
188- (void) pollDemoControls:(
double) delta_t;
192- (void) switchToThisView:(
OOViewID)viewDirection;
193- (void) switchToThisView:(
OOViewID)viewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing;
194- (void) switchToThisView:(
OOViewID)viewDirection fromView:(
OOViewID)oldViewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing justNotify:(BOOL)justNotify;
196- (void) handleAutopilotOn:(BOOL)fastDocking;
204@implementation PlayerEntity (Controls)
210 keyCodeLookups = [[
NSDictionary alloc] initWithObjectsAndKeys:
211 [
NSNumber numberWithUnsignedShort:gvArrowKeyLeft], @"arrowleft",
212 [
NSNumber numberWithUnsignedShort:gvArrowKeyLeft], @"leftarrow",
213 [
NSNumber numberWithUnsignedShort:gvArrowKeyLeft], @"left",
214 [
NSNumber numberWithUnsignedShort:gvArrowKeyRight], @"arrowright",
215 [
NSNumber numberWithUnsignedShort:gvArrowKeyRight], @"rightarrow",
216 [
NSNumber numberWithUnsignedShort:gvArrowKeyRight], @"right",
217 [
NSNumber numberWithUnsignedShort:gvArrowKeyUp], @"arrowup",
218 [
NSNumber numberWithUnsignedShort:gvArrowKeyUp], @"uparrow",
219 [
NSNumber numberWithUnsignedShort:gvArrowKeyUp], @"up",
220 [
NSNumber numberWithUnsignedShort:gvArrowKeyDown], @"arrowdown",
221 [
NSNumber numberWithUnsignedShort:gvArrowKeyDown], @"downarrow",
222 [
NSNumber numberWithUnsignedShort:gvArrowKeyDown], @"down",
223 [
NSNumber numberWithUnsignedShort:gvPageUpKey], @"pageup",
224 [
NSNumber numberWithUnsignedShort:gvPageDownKey], @"pagedown",
225 [
NSNumber numberWithUnsignedShort:13], @"enter",
226 [
NSNumber numberWithUnsignedShort:13], @"return",
227 [
NSNumber numberWithUnsignedShort:27], @"escape",
228 [
NSNumber numberWithUnsignedShort:27], @"esc",
229 [
NSNumber numberWithUnsignedShort:9], @"tab",
230 [
NSNumber numberWithUnsignedShort:32], @"space",
231 [
NSNumber numberWithUnsignedShort:32], @"spc",
232 [
NSNumber numberWithUnsignedShort:gvHomeKey], @"home",
233 [
NSNumber numberWithUnsignedShort:gvEndKey], @"end",
234 [
NSNumber numberWithUnsignedShort:gvDeleteKey], @"delete",
235 [
NSNumber numberWithUnsignedShort:gvDeleteKey], @"del",
236 [
NSNumber numberWithUnsignedShort:gvBackspaceKey], @"backspace",
237 [
NSNumber numberWithUnsignedShort:gvBackspaceKey], @"backspc",
238 [
NSNumber numberWithUnsignedShort:gvBackspaceKey], @"bkspace",
239 [
NSNumber numberWithUnsignedShort:gvBackspaceKey], @"bkspc",
240 [
NSNumber numberWithUnsignedShort:gvInsertKey], @"insert",
241 [
NSNumber numberWithUnsignedShort:gvInsertKey], @"ins",
242 [
NSNumber numberWithUnsignedShort:gvFunctionKey1], @"f1",
243 [
NSNumber numberWithUnsignedShort:gvFunctionKey2], @"f2",
244 [
NSNumber numberWithUnsignedShort:gvFunctionKey3], @"f3",
245 [
NSNumber numberWithUnsignedShort:gvFunctionKey4], @"f4",
246 [
NSNumber numberWithUnsignedShort:gvFunctionKey5], @"f5",
247 [
NSNumber numberWithUnsignedShort:gvFunctionKey6], @"f6",
248 [
NSNumber numberWithUnsignedShort:gvFunctionKey7], @"f7",
249 [
NSNumber numberWithUnsignedShort:gvFunctionKey8], @"f8",
250 [
NSNumber numberWithUnsignedShort:gvFunctionKey9], @"f9",
251 [
NSNumber numberWithUnsignedShort:gvFunctionKey10], @"f10",
252 [
NSNumber numberWithUnsignedShort:gvFunctionKey11], @"f11",
253 [
NSNumber numberWithUnsignedShort:gvPauseKey], @"pause",
254 [
NSNumber numberWithUnsignedShort:gvPrintScreenKey], @"printscreen",
255 [
NSNumber numberWithUnsignedShort:gvPrintScreenKey], @"prtscrn",
256 [
NSNumber numberWithUnsignedShort:gvPrintScreenKey], @"prntscrn",
257 [
NSNumber numberWithUnsignedShort:gvPrintScreenKey], @"prtscn",
258 [
NSNumber numberWithUnsignedShort:gvNumberPadKey0], @"numpad0",
259 [
NSNumber numberWithUnsignedShort:gvNumberPadKey1], @"numpad1",
260 [
NSNumber numberWithUnsignedShort:gvNumberPadKey2], @"numpad2",
261 [
NSNumber numberWithUnsignedShort:gvNumberPadKey3], @"numpad3",
262 [
NSNumber numberWithUnsignedShort:gvNumberPadKey4], @"numpad4",
263 [
NSNumber numberWithUnsignedShort:gvNumberPadKey5], @"numpad5",
264 [
NSNumber numberWithUnsignedShort:gvNumberPadKey6], @"numpad6",
265 [
NSNumber numberWithUnsignedShort:gvNumberPadKey7], @"numpad7",
266 [
NSNumber numberWithUnsignedShort:gvNumberPadKey8], @"numpad8",
267 [
NSNumber numberWithUnsignedShort:gvNumberPadKey9], @"numpad9",
268 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyDivide], @"numpad/",
269 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyDivide], @"numpaddivide",
270 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyMultiply], @"numpad*",
271 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyMultiply], @"numpadmultiply",
272 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyMinus], @"numpad-",
273 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyMinus], @"numpadminus",
274 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyPlus], @"numpad+",
275 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyPlus], @"numpadplus",
276 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyPeriod], @"numpad.",
277 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyPeriod], @"numpadperiod",
278 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyEquals], @"numpad=",
279 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyEquals], @"numpadequals",
280 [
NSNumber numberWithUnsignedShort:gvNumberPadKeyEnter], @"numpadenter", nil];
282 keyShiftText = [DESC(@"oolite-keyconfig-shift") retain];
283 keyMod1Text = [DESC(@"oolite-keyconfig-mod1") retain];
285 keyMod2Text = [DESC(@"oolite-keyconfig-mod2-mac") retain];
287 keyMod2Text = [DESC(@"oolite-keyconfig-mod2-pc") retain];
300 NSString *kbd = [
defaults oo_stringForKey:@"keyboard-code" defaultValue:@"default"];
306 NSArray *def_list =
nil;
308 keys = [
kdic2 allKeys];
309 for (i = 0; i < [
keys count]; i++)
311 key = [
keys objectAtIndex:i];
312 if ([[kdic2 objectForKey:key] isKindOfClass:[NSArray
class]])
314 def_list = (NSArray*)[kdic2 objectForKey: key];
323 NSArray *temp = [
defaults arrayForKey:KEYCONFIG_CUSTOMEQUIP];
324 customEquipActivation = [[
NSMutableArray arrayWithArray:temp] retain];
340 NSMutableArray *keyDef =
nil;
341 NSString *lookup =
nil;
343 NSDictionary *key1 =
nil;
344 NSDictionary *key2 =
nil;
347 NSDictionary *dict = [
defaults objectForKey:KEYCONFIG_OVERRIDES];
349 keys = [
dict allKeys];
350 for (i = 0; i < [
keys count]; i++)
352 key = [
keys objectAtIndex:i];
353 [
kdic2 setObject:[
dict objectForKey:key] forKey:key];
358#define LOAD_KEY_SETTING2(name, default_1, shift_1, mod1_1, default_2, shift_2, mod1_2) \
359 lookup = [@#name substringFromIndex:2]; \
360 curr = (NSArray*)[[kdic2 objectForKey:lookup] copy]; \
361 key1 = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedShort:default_1], @"key", [NSNumber numberWithBool:shift_1], @"shift", [NSNumber numberWithBool:mod1_1], @"mod1", [NSNumber numberWithBool:NO], @"mod2", nil]; \
362 [keyDef addObject:key1]; \
365 key2 = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedShort:default_2], @"key", [NSNumber numberWithBool:shift_2], @"shift", [NSNumber numberWithBool:mod1_2], @"mod1", [NSNumber numberWithBool:NO], @"mod2", nil]; \
366 [keyDef addObject:key2]; \
368 name = curr?:keyDef; \
369 [kdic2 setObject:curr?:keyDef forKey:lookup]; \
502#if OO_FOV_INFLIGHT_CONTROL_ENABLED
519 keyconfig2_settings = [[
NSDictionary alloc] initWithDictionary:kdic2 copyItems:YES];
523- (NSArray*) processKeyCode:(NSArray*)key_def
526 id key =
nil, value =
nil;
528 unsigned char keychar;
529 NSString *keystring =
nil;
530 NSDictionary *def =
nil;
533 for (i = 0; i < [
key_def count]; i++)
535 def = [
key_def objectAtIndex:i];
536 if ([def
count] == 0)
continue;
537 value = [
def objectForKey:@"key"];
538 iValue = [
value intValue];
543 if ([def objectForKey:
@"shift"]) [
defNew setObject:[
def objectForKey:@"shift"] forKey:@"shift"];
else [
defNew setObject:[
NSNumber numberWithBool:NO] forKey:@"shift"];
544 if ([def objectForKey:
@"mod1"]) [
defNew setObject:[
def objectForKey:@"mod1"] forKey:@"mod1"];
else [
defNew setObject:[
NSNumber numberWithBool:NO] forKey:@"mod1"];
545 if ([def objectForKey:
@"mod2"]) [
defNew setObject:[
def objectForKey:@"mod2"] forKey:@"mod2"];
else [
defNew setObject:[
NSNumber numberWithBool:NO] forKey:@"mod2"];
550 if ([value isKindOfClass:[NSString
class]] && (iValue < 10))
555 if ([keystring length] != 0)
562 [
defNew setObject:[
NSNumber numberWithUnsignedShort:iValue] forKey:@"key"];
569 if ([keystring length] == 1 || (iValue == 0 && [keystring length] != 0))
571 keychar = [
keystring characterAtIndex:0] & 0x00ff;
573 else if (iValue <= 0xFF) keychar = iValue;
575 OOLogWARN(
@"testing",
@"continue hit for key %@.", key);
576 [
defNew setObject:[
def objectForKey:@"key"] forKey:@"key"];
582 [
defNew setObject:[
NSNumber numberWithUnsignedShort:keychar] forKey:@"key"];
588 [
defNew setObject:[
def objectForKey:@"key"] forKey:@"key"];
523- (NSArray*) processKeyCode:(NSArray*)key_def {
…}
599- (BOOL) checkNavKeyPress:(NSArray*)key_def
603 for (i = 0; i < [
key_def count]; i++)
605 NSDictionary *def = [
key_def objectAtIndex:i];
606 if ([gameView isDown:[[def objectForKey:
@"key"] intValue]])
return YES;
599- (BOOL) checkNavKeyPress:(NSArray*)key_def {
…}
612- (BOOL) checkKeyPress:(NSArray*)key_def
612- (BOOL) checkKeyPress:(NSArray*)key_def {
…}
618- (BOOL) checkKeyPress:(NSArray*)key_def fKey_only:(BOOL)fKey_only
618- (BOOL) checkKeyPress:(NSArray*)key_def fKey_only:(BOOL)fKey_only {
…}
624- (BOOL) checkKeyPress:(NSArray*)key_def ignore_ctrl:(BOOL)ignore_ctrl
624- (BOOL) checkKeyPress:(NSArray*)key_def ignore_ctrl:(BOOL)ignore_ctrl {
…}
630- (BOOL) checkKeyPress:(NSArray*)key_def fKey_only:(BOOL)fKey_only ignore_ctrl:(BOOL)ignore_ctrl
634 for (i = 0; i < [
key_def count]; i++)
636 NSDictionary *def = [
key_def objectAtIndex:i];
637 int keycode = [[
def objectForKey:@"key"] intValue];
644 if (fKey_only == YES && (keycode < gvFunctionKey1 || keycode >
gvFunctionKey11))
continue;
645 if ([gameView isDown:keycode]
646 && ([[def objectForKey:
@"shift"] boolValue] == [gameView isShiftDown])
647 && (ignore_ctrl || ([[def objectForKey:
@"mod1"] boolValue] == [gameView isCtrlDown]))
648 && ([[def objectForKey:
@"mod2"] boolValue] == [gameView isOptDown])
630- (BOOL) checkKeyPress:(NSArray*)key_def fKey_only:(BOOL)fKey_only ignore_ctrl:(BOOL)ignore_ctrl {
…}
655- (
int) getFirstKeyCode:(NSArray*)key_def
657 NSDictionary *def = [
key_def objectAtIndex:0];
658 return [[
def objectForKey:@"key"] intValue];
655- (
int) getFirstKeyCode:(NSArray*)key_def {
…}
662- (void) pollControls:(
double)delta_t
665 NSString *exceptionContext =
@"setup";
672 exceptionContext =
@"pollApplicationControls";
674 switch ([
self status])
676 case STATUS_WITCHSPACE_COUNTDOWN:
677 case STATUS_IN_FLIGHT:
678 exceptionContext =
@"pollFlightControls";
683 exceptionContext =
@"pollGameOverControls";
687 case STATUS_AUTOPILOT_ENGAGED:
688 exceptionContext =
@"pollAutopilotControls";
693 exceptionContext =
@"pollDockedControls";
697 case STATUS_START_GAME:
698 exceptionContext =
@"pollDemoControls";
708 @catch (NSException *exception)
710 OOLog(
kOOLogException,
@"***** Exception checking controls [%@]: %@ : %@", exceptionContext, [exception name], [exception reason]);
662- (void) pollControls:(
double)delta_t {
…}
729 if ([gui setNextRow: +1])
735 if ([gui setFirstSelectableRow]) result = YES;
749 if ([gui setNextRow: -1])
755 if ([gui setLastSelectableRow]) result = YES;
772 if ([gui setSelectedRow:click_row])
783 if ([gui setSelectedRow:click_row])
803- (void) targetNewSystem:(
int) direction whileTyping:(BOOL) whileTyping
805 target_system_id = [[UNIVERSE gui] targetNextFoundSystem:direction];
807 cursor_coordinates = [[UNIVERSE systemManager] getCoordinatesForSystem:target_system_id inGalaxy:galaxy_number];
809 found_system_id = target_system_id;
803- (void) targetNewSystem:(
int) direction whileTyping:(BOOL) whileTyping {
…}
820 [[UNIVERSE gameView] resetTypedString];
822 planetSearchString =
nil;
826- (void) targetNewSystem:(
int) direction
826- (void) targetNewSystem:(
int) direction {
…}
835 gui_screen = GUI_SCREEN_MAIN;
839 [UNIVERSE removeDemoShips];
842 if ([
self isMouseControlOn]) [[UNIVERSE gameView] resetMouse];
843 [UNIVERSE enterGUIViewModeWithMouseInteraction:NO];
857 if ([
self hasHyperspaceMotor])
861 witchspaceCountdown = hyperspaceMotorSpinTime;
865#ifndef OO_DUMP_PLANETINFO
868 witchspaceCountdown = 5;
873 witchspaceCountdown = spin_time;
876 [
self setStatus:STATUS_WITCHSPACE_COUNTDOWN];
879 [UNIVERSE clearPreviousMessage];
880 int seconds = round(witchspaceCountdown);
882 [UNIVERSE displayCountdownMessage:OOExpandKey(@"witch-to-x-in-y-seconds", seconds, destination) forCount:1.0];
885 [UNIVERSE preloadPlanetTexturesForSystem:target_system_id];
892 if ([
self hasHyperspaceMotor]) {
900 if ([
self status] == STATUS_WITCHSPACE_COUNTDOWN) {
905 [UNIVERSE clearPreviousMessage];
912@implementation PlayerEntity (OOControlsPrivate)
916 if (!pollControls)
return;
918 NSString *exceptionContext =
@"setup";
924 BOOL onTextEntryScreen = (gui_screen == GUI_SCREEN_LONG_RANGE_CHART) || (gui_screen == GUI_SCREEN_MISSION) ||
925 (gui_screen == GUI_SCREEN_SAVE) || (gui_screen == GUI_SCREEN_OXZMANAGER || (gui_screen == GUI_SCREEN_KEYBOARD_ENTRY));
930 #if !OOLITE_MAC_OS_X || !OOLITE_64_BIT
931 if ([gameController inFullScreenMode])
933 exceptionContext =
@"command key controls";
934 if ([gameView isCommandFDown])
938 if (mouse_control_on)
940 [UNIVERSE addMessage:DESC(@"mouse-off") forCount:3.0];
941 mouse_control_on = NO;
945 if ([gameView isCommandQDown])
953 if ([
self status] == STATUS_HANDLING_ERROR)
955 exceptionContext =
@"error handling mode";
956 if ([gameView isDown:113]||[gameView isDown:81]||[gameView isDown:27])
962 if ([gameController isGamePaused])
965 switch ([
self status])
967 case STATUS_WITCHSPACE_COUNTDOWN:
968 case STATUS_IN_FLIGHT:
969 case STATUS_AUTOPILOT_ENGAGED:
981 [UNIVERSE clearPreviousMessage];
993 if (([
self checkKeyPress:n_key_snapshot] || joyButtonState[
BUTTON_SNAPSHOT]) &&
997 exceptionContext =
@"snapshot";
1010 if (!onTextEntryScreen && [
self checkKeyPress:n_key_show_fps])
1012 exceptionContext =
@"toggle FPS";
1013 if (!
f_key_pressed) [UNIVERSE setDisplayFPS:![UNIVERSE displayFPS]];
1022 if ([
self checkKeyPress:n_key_bloom_toggle])
1026 BOOL oldBloom = [UNIVERSE bloom];
1027 [UNIVERSE setBloom:!oldBloom];
1037 BOOL allowMouseControl;
1039 allowMouseControl = YES;
1042 [[
NSUserDefaults standardUserDefaults] boolForKey:@"mouse-control-in-windowed-mode"];
1045 if (allowMouseControl)
1047 exceptionContext =
@"mouse control";
1048 if (!onTextEntryScreen && ([
self checkKeyPress:n_key_mouse_control_roll] || [
self checkKeyPress:n_key_mouse_control_yaw]))
1052 mouse_control_on = !mouse_control_on;
1053 if (mouse_control_on)
1055 [UNIVERSE addMessage:DESC(@"mouse-on") forCount:3.0];
1061 if ([[NSUserDefaults standardUserDefaults] boolForKey:
@"grab-mouse-on-mouse-control"])
1068 keyboardPitchOverride = NO;
1069 keyboardYawOverride = !keyboardRollOverride;
1073 [UNIVERSE addMessage:DESC(@"mouse-off") forCount:3.0];
1092 if (mouse_control_on)
1094 mouse_control_on = NO;
1095 [UNIVERSE addMessage:DESC(@"mouse-off") forCount:3.0];
1108 if (([
self checkKeyPress:n_key_hud_toggle] || joyButtonState[
BUTTON_TOGGLEHUD]) && [gameController isGamePaused] && !onTextEntryScreen)
1110 exceptionContext =
@"toggle HUD";
1115 if (gui_screen == GUI_SCREEN_STATUS)
1128 @catch (NSException *exception)
1130 OOLog(
kOOLogException,
@"***** Exception in pollApplicationControls [%@]: %@ : %@", exceptionContext, [exception name], [exception reason]);
1135- (void) pollFlightControls:(
double)delta_t
1139 NSString *exceptionContext =
@"setup";
1143 exceptionContext =
@"joystick handling";
1146 BOOL paused = [[UNIVERSE gameController] isGamePaused];
1149 if (!paused && gui_screen == GUI_SCREEN_MISSION)
1151 exceptionContext =
@"mission screen";
1154 NSPoint virtualView = NSZeroPoint;
1155 double view_threshold = 0.5;
1157 if ([stickHandler joystickCount])
1161 virtualView.y = 0.0;
1163 virtualView.x = 0.0;
1164 if (fabs(virtualView.y) >= fabs(virtualView.x))
1165 virtualView.x = 0.0;
1167 virtualView.y = 0.0;
1170 if ([
self checkKeyPress:n_key_view_forward] || (virtualView.y < -view_threshold) || joyButtonState[
BUTTON_VIEWFORWARD])
1172 view = VIEW_FORWARD;
1174 if ([
self checkKeyPress:n_key_view_aft]|(virtualView.y > view_threshold)||joyButtonState[
BUTTON_VIEWAFT])
1178 if ([
self checkKeyPress:n_key_view_port]||(virtualView.x < -view_threshold)||joyButtonState[
BUTTON_VIEWPORT])
1182 if ([
self checkKeyPress:n_key_view_starboard]||(virtualView.x > view_threshold)||joyButtonState[
BUTTON_VIEWSTARBOARD])
1184 view = VIEW_STARBOARD;
1186 if (view == VIEW_NONE)
1193 [[UNIVERSE gui] clearBackground];
1195 if (_missionWithCallback)
1205 exceptionContext =
@"arrow keys";
1217 exceptionContext =
@"afterburner";
1218 if ((joyButtonState[
BUTTON_FUELINJECT] || [
self checkKeyPress:n_key_inject_fuel]) &&
1219 [
self hasFuelInjection] &&
1220 !hyperspeed_engaged)
1222 if (fuel > 0 && !afterburner_engaged)
1224 [UNIVERSE addMessage:DESC(@"fuel-inject-on") forCount:1.5];
1225 afterburner_engaged = YES;
1231 [UNIVERSE addMessage:DESC(@"fuel-out") forCount:1.5];
1233 afterburner_engaged = (fuel > 0);
1236 afterburner_engaged = NO;
1238 if ((!afterburner_engaged)&&(afterburnerSoundLooping))
1241 exceptionContext =
@"thrust";
1244 float mouseWheelDeltaFactor = mouse_control_on ? fabs([gameView mouseWheelDelta]) : 1.0f;
1245 if (mouseWheelDeltaFactor == 0.0f) mouseWheelDeltaFactor = 1.0f;
1247 if (([
self checkKeyPress:n_key_increase_speed] ||
1249 ((mouse_control_on)&&([gameView mouseWheelState] ==
gvMouseWheelUp) && ([
UNIVERSE viewDirection] <= VIEW_STARBOARD || ![gameView isCapsLockOn])))
1250 && (flightSpeed < maxFlightSpeed) && (!afterburner_engaged))
1252 flightSpeed += speed_delta * delta_t * mouseWheelDeltaFactor;
1255 if (([
self checkKeyPress:n_key_decrease_speed] ||
1257 ((mouse_control_on)&&([gameView mouseWheelState] ==
gvMouseWheelDown) && ([
UNIVERSE viewDirection] <= VIEW_STARBOARD || ![gameView isCapsLockOn])))
1258 && (!afterburner_engaged))
1260 flightSpeed -= speed_delta * delta_t * mouseWheelDeltaFactor;
1262 hyperspeed_engaged = NO;
1266 if([stickHandler joystickCount] != 0 && functionForThrustAxis !=
nil)
1268 if (flightSpeed < maxFlightSpeed * reqSpeed)
1270 flightSpeed += speed_delta * delta_t;
1272 if (flightSpeed > maxFlightSpeed * reqSpeed)
1274 flightSpeed -= speed_delta * delta_t;
1278 if (!afterburner_engaged && ![
self atHyperspeed] && !hyperspeed_engaged)
1280 flightSpeed = OOClamp_0_max_f(flightSpeed, maxFlightSpeed);
1283 exceptionContext =
@"hyperspeed";
1289 if (!hyperspeed_engaged)
1292 hyperspeed_engaged = !hyperspeed_locked;
1293 if (hyperspeed_locked)
1296 [UNIVERSE addMessage:DESC(@"jump-mass-locked") forCount:1.5];
1301 hyperspeed_engaged = NO;
1311 exceptionContext =
@"shoot";
1313 if ((([
self checkNavKeyPress:n_key_fire_lasers])||((mouse_control_on)&&([gameView isDown:
gvMouseLeftButton]) && ([
UNIVERSE viewDirection] <= VIEW_STARBOARD || ![gameView isCapsLockOn]))||joyButtonState[
BUTTON_FIRE])&&(shot_time > weapon_recharge_rate))
1315 if ([
self fireMainWeapon])
1321 exceptionContext =
@"weapons online toggle";
1327 NSString* weaponsOnlineToggleMsg;
1330 weaponsOnlineToggleMsg = [
self weaponsOnline] ?
DESC(
@"weapons-systems-online") :
DESC(
@"weapons-systems-offline");
1331 if ([
self weaponsOnline])
1339 [UNIVERSE addMessage:weaponsOnlineToggleMsg forCount:2.0];
1346 exceptionContext =
@"missile fire";
1359 exceptionContext =
@"next missile";
1372 exceptionContext =
@"next target";
1374 if ([
self checkKeyPress:n_key_next_target] || joyButtonState[
BUTTON_NEXTTARGET])
1384 exceptionContext =
@"previous target";
1386 if ([
self checkKeyPress:n_key_previous_target] || joyButtonState[
BUTTON_PREVTARGET])
1396 exceptionContext =
@"ident R";
1398 if ([
self checkKeyPress:n_key_ident_system] || joyButtonState[
BUTTON_ID])
1409 exceptionContext =
@"prime equipment";
1426 if (primedEquipment > c) primedEquipment = 0;
1430 if (primedEquipment > 0) primedEquipment--;
1431 else primedEquipment = c;
1434 NSString *eqKey =
@"";
1436 if (primedEquipment == c)
1441 [UNIVERSE addMessage:DESC(@"equipment-primed-none") forCount:2.0];
1443 else [UNIVERSE addMessage:DESC(@"equipment-primed-none-available") forCount:2.0];
1449 eqKey = [[
eqScripts oo_arrayAtIndex:primedEquipment] oo_stringAtIndex:0];
1450 [UNIVERSE addMessage:OOExpandKey(@"equipment-primed", equipmentName) forCount:2.0];
1459 exceptionContext =
@"activate equipment";
1471 exceptionContext =
@"mode equipment";
1483 exceptionContext =
@"fast equipment A";
1484 if ([
self checkKeyPress:n_key_fastactivate_equipment_a] || joyButtonState[
BUTTON_CLOAK])
1494 exceptionContext =
@"fast equipment B";
1495 if ([
self checkKeyPress:n_key_fastactivate_equipment_b] || joyButtonState[
BUTTON_ENERGYBOMB])
1505 exceptionContext =
@"custom equipment";
1513 if ([
self hasOneEquipmentItem:[item oo_stringForKey:
CUSTOMEQUIP_EQUIPKEY] includeWeapons:NO whileLoading:NO])
1515 NSArray *key_act = [
item oo_arrayForKey:CUSTOMEQUIP_KEYACTIVATE];
1516 NSArray *key_mod = [
item oo_arrayForKey:CUSTOMEQUIP_KEYMODE];
1517 NSDictionary *but_act = [
item oo_dictionaryForKey:CUSTOMEQUIP_BUTTONACTIVATE];
1518 NSDictionary *but_mod = [
item oo_dictionaryForKey:CUSTOMEQUIP_BUTTONMODE];
1523 if (![[customActivatePressed objectAtIndex:i] boolValue])
1535 if (![[customModePressed objectAtIndex:i] boolValue])
1546 exceptionContext =
@"incoming missile T";
1558 exceptionContext =
@"missile T";
1560 if (([
self checkKeyPress:n_key_target_missile] || joyButtonState[
BUTTON_ARMMISSILE])&&(missile_entity[activeMissile]))
1571 exceptionContext =
@"missile U";
1573 if ([
self checkKeyPress:n_key_untarget_missile] || joyButtonState[
BUTTON_UNARM])
1581 if (!ident_engaged && [
self weaponsOnline])
1583 [UNIVERSE addMessage:DESC(@"missile-safe") forCount:2.0];
1588 [UNIVERSE addMessage:DESC(@"ident-off") forCount:2.0];
1597 exceptionContext =
@"ECM";
1599 if (([
self checkKeyPress:n_key_ecm] || joyButtonState[
BUTTON_ECM]) && [
self hasECM])
1601 if (!ecm_in_operation)
1606 [UNIVERSE addMessage:DESC(@"ecm-on") forCount:3.0];
1612 exceptionContext =
@"escape pod";
1616 if (([
self checkKeyPress:n_key_launch_escapepod] || joyButtonState[
BUTTON_ESCAPE]) && [
self hasEscapePod])
1618 BOOL goodToLaunch = [[
NSUserDefaults standardUserDefaults] boolForKey:@"escape-pod-activation-immediate"];
1630 if ([stickHandler joystickCount])
1639 if (timeNow < escapePodKeyResetTime) goodToLaunch = YES;
1648 exceptionContext =
@"dump cargo";
1650 if (([
self checkKeyPress:n_key_dump_cargo] || joyButtonState[
BUTTON_JETTISON]) && [cargo
count] > 0)
1655 exceptionContext =
@"rotate cargo";
1666 exceptionContext =
@"autopilot C";
1668 if ([
self checkKeyPress:n_key_autopilot] || joyButtonState[
BUTTON_DOCKCPU])
1679 exceptionContext =
@"autopilot shift-C";
1694 exceptionContext =
@"docking clearance request";
1710 exceptionContext =
@"hyperspace";
1712 if ( ([
self checkKeyPress:n_key_hyperspace] || joyButtonState[
BUTTON_HYPERDRIVE]) &&
1713 [
self hasHyperspaceMotor] )
1717 if ([
self status] == STATUS_WITCHSPACE_COUNTDOWN)
1720 if (galactic_witchjump)
1722 galactic_witchjump = NO;
1723 [UNIVERSE addMessage:DESC(@"witch-user-galactic-abort") forCount:3.0];
1727 [UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
1730 else if ([
self witchJumpChecklist:
false])
1740 exceptionContext =
@"galactic hyperspace";
1742 if (([
self checkKeyPress:n_key_galactic_hyperspace] || joyButtonState[
BUTTON_GALACTICDRIVE]) &&
1743 ([
self hasEquipmentItemProviding:
@"EQ_GAL_DRIVE"]))
1747 if ([
self status] == STATUS_WITCHSPACE_COUNTDOWN)
1750 if (galactic_witchjump)
1752 galactic_witchjump = NO;
1753 [UNIVERSE addMessage:DESC(@"witch-user-galactic-abort") forCount:3.0];
1757 [UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
1762 galactic_witchjump = YES;
1765 if(
EXPECT([
self hasHyperspaceMotor])) witchspaceCountdown = hyperspaceMotorSpinTime;
1768 [
self setStatus:STATUS_WITCHSPACE_COUNTDOWN];
1771 [UNIVERSE addMessage:[
NSString stringWithFormat:DESC(@"witch-galactic-in-f-seconds"), witchspaceCountdown] forCount:1.0];
1785#if OO_FOV_INFLIGHT_CONTROL_ENABLED
1789 if (([
self checkKeyPress:n_key_inc_field_of_view] || joyButtonState[BUTTON_INC_FIELD_OF_VIEW]) && (fieldOfView <
MAX_FOV))
1791 fieldOfView *= pow(fov_delta, delta_t);
1795 if (([
self checkKeyPress:n_key_dec_field_of_view] || joyButtonState[BUTTON_DEC_FIELD_OF_VIEW]) && (fieldOfView >
MIN_FOV))
1797 fieldOfView /= pow(fov_delta, delta_t);
1802 if ([stickHandler joystickCount] != 0 && functionForFovAxis !=
nil)
1806 if (fieldOfView < maxFieldOfView * reqFov)
1808 fieldOfView *= pow(fov_delta, delta_t);
1811 if (fieldOfView > maxFieldOfView * reqFov)
1813 fieldOfView /= pow(fov_delta, delta_t);
1821 exceptionContext =
@"dump target state";
1822 if ([
self checkKeyPress:n_key_dump_target_state])
1828 if (target ==
nil) target =
self;
1836 exceptionContext =
@"pollGuiScreenControls";
1843 exceptionContext =
@"options menu";
1844 if (([
self checkKeyPress:n_key_gui_screen_options]) && (gui_screen != GUI_SCREEN_OPTIONS) && ![gameView allowingStringInput])
1850 #if (ALLOW_CUSTOM_VIEWS_WHILE_PAUSED)
1854 if (gui_screen == GUI_SCREEN_OPTIONS || gui_screen == GUI_SCREEN_GAMEOPTIONS || gui_screen == GUI_SCREEN_STICKMAPPER ||
1855 gui_screen == GUI_SCREEN_STICKPROFILE || gui_screen == GUI_SCREEN_KEYBOARD || gui_screen == GUI_SCREEN_KEYBOARD_CONFIRMCLEAR ||
1856 gui_screen == GUI_SCREEN_KEYBOARD_CONFIG || gui_screen == GUI_SCREEN_KEYBOARD_ENTRY || gui_screen == GUI_SCREEN_KEYBOARD_LAYOUT)
1858 if ([
UNIVERSE pauseMessageVisible]) [[UNIVERSE messageGUI] leaveLastLine];
1859 else [[UNIVERSE messageGUI] clear];
1860 NSTimeInterval time_this_frame = [
NSDate timeIntervalSinceReferenceDate];
1873 script_time += time_delta;
1877 exceptionContext =
@"debug keys";
1880 if ([
self checkKeyPress:n_key_dump_entity_list] && ![gameView allowingStringInput])
1884 [UNIVERSE debugDumpEntities];
1886 [UNIVERSE addMessage:@"Entity List dumped. Debugging OFF" forCount:3];
1894 if ([
self checkKeyPress:n_key_debug_full] && ![gameView allowingStringInput])
1897 [UNIVERSE addMessage:@"Full debug ON" forCount:3];
1900 if ([
self checkKeyPress:n_key_debug_collision] && ![gameView allowingStringInput])
1903 [UNIVERSE addMessage:@"Collision debug ON" forCount:3];
1906 if ([
self checkKeyPress:n_key_debug_console_connect] && ![[
OODebugMonitor sharedDebugMonitor] usingPlugInController] && ![gameView allowingStringInput])
1915 [UNIVERSE addMessage:@"Connected to debug console." forCount:3];
1920 [UNIVERSE addMessage:@"Disconnected from debug console." forCount:3];
1928 if ([
self checkKeyPress:n_key_debug_bounding_boxes] && ![gameView allowingStringInput])
1931 [UNIVERSE addMessage:@"Bounding box debug ON" forCount:3];
1934 if ([
self checkKeyPress:n_key_debug_shaders] && ![gameView allowingStringInput])
1937 [UNIVERSE addMessage:@"Shader debug ON" forCount:3];
1940 if (([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_arrow_right]) && gui_screen != GUI_SCREEN_GAMEOPTIONS && [
UNIVERSE displayFPS] && ![gameView allowingStringInput])
1944 float newTimeAccelerationFactor = [
self checkKeyPress:n_key_gui_arrow_left] ?
1947 [UNIVERSE setTimeAccelerationFactor:newTimeAccelerationFactor];
1955 if ([
self checkKeyPress:n_key_debug_off] && ![gameView allowingStringInput])
1958 [UNIVERSE addMessage:@"All debug flags OFF" forCount:3];
1964 exceptionContext =
@"pause";
1966 if (([
self checkKeyPress:n_key_pausebutton] || joyButtonState[
BUTTON_PAUSE]) && gui_screen != GUI_SCREEN_LONG_RANGE_CHART && gui_screen != GUI_SCREEN_MISSION && ![gameView allowingStringInput])
1978 case GUI_SCREEN_STATUS:
1981 case GUI_SCREEN_LONG_RANGE_CHART:
1984 case GUI_SCREEN_SHORT_RANGE_CHART:
1987 case GUI_SCREEN_MANIFEST:
1990 case GUI_SCREEN_MARKET:
1993 case GUI_SCREEN_MARKETINFO:
1996 case GUI_SCREEN_SYSTEM_DATA:
1998 if (gui_screen != GUI_SCREEN_SYSTEM_DATA)
2006 [UNIVERSE clearPreviousMessage];
2007 [UNIVERSE setViewDirection:saved_view_direction];
2010 if (
saved_gui_screen == GUI_SCREEN_SYSTEM_DATA) [UNIVERSE setMainLightPosition:_sysInfoLight];
2011 [[UNIVERSE gui] setForegroundTextureKey:@"overlay"];
2012 [[UNIVERSE gameController] setGamePaused:NO];
2020 [UNIVERSE pauseGame];
2030 @catch (NSException *exception)
2032 OOLog(
kOOLogException,
@"***** Exception in pollFlightControls [%@]: %@ : %@", exceptionContext, [exception name], [exception reason]);
1135- (void) pollFlightControls:(
double)delta_t {
…}
2037- (void) pollGuiArrowKeyControls:(
double) delta_t
2048 if (gui_screen == GUI_SCREEN_LONG_RANGE_CHART)
2052 else if (gui_screen == GUI_SCREEN_SAVE)
2056 else if (gui_screen == GUI_SCREEN_MISSION && _missionTextEntry)
2060 else if (gui_screen == GUI_SCREEN_KEYBOARD_ENTRY)
2067 else if (gui_screen == GUI_SCREEN_OXZMANAGER && [[
OOOXZManager sharedManager] isAcceptingTextInput])
2077 if (afterburner_engaged && ![
self checkKeyPress:n_key_inject_fuel])
2079 afterburner_engaged = NO;
2086 case GUI_SCREEN_LONG_RANGE_CHART:
2088 if ([
self status] != STATUS_WITCHSPACE_COUNTDOWN)
2090 if ([[gameView typedString] length] > 0)
2093 NSPoint search_coords = [UNIVERSE findSystemCoordinatesWithPrefix:planetSearchString];
2094 if ((search_coords.x >= 0.0)&&(search_coords.y >= 0.0))
2097 if ([planetSearchString length] == 1) [[UNIVERSE gui] targetNextFoundSystem:0];
2104 found_system_id = -1;
2112 found_system_id = -1;
2113 [UNIVERSE findSystemCoordinatesWithPrefix:@""];
2116 planetSearchString =
nil;
2123 case GUI_SCREEN_SHORT_RANGE_CHART:
2125 if ([
self checkKeyPress:n_key_chart_highlight])
2130 if (
mode != OOLRC_MODE_TECHLEVEL)
2151 show_info_flag = !show_info_flag;
2160 if ([
self status] != STATUS_WITCHSPACE_COUNTDOWN)
2162 if ([
self hasEquipmentItemProviding:
@"EQ_ADVANCED_NAVIGATIONAL_ARRAY"])
2164 if ([
self checkKeyPress:n_key_advanced_nav_array_next] || [
self checkKeyPress:n_key_advanced_nav_array_previous])
2168 if ([
self checkKeyPress:n_key_advanced_nav_array_previous])
2208 showingLongRangeChart = (gui_screen == GUI_SCREEN_LONG_RANGE_CHART);
2223 chart_focus_coordinates.x = OOClamp_0_max_f(centre.x + (maus.x *
MAIN_GUI_PIXEL_WIDTH) / hscale, 256.0);
2224 chart_focus_coordinates.y = OOClamp_0_max_f(centre.y + (maus.y *
MAIN_GUI_PIXEL_HEIGHT + vadjust) / vscale, 256.0);
2225 target_chart_focus = chart_focus_coordinates;
2232 target_chart_centre = chart_centre_coordinates;
2235 if (gui_screen == GUI_SCREEN_LONG_RANGE_CHART)
2245 cursor_coordinates = chart_focus_coordinates;
2254 if ([
self checkKeyPress:n_key_map_home])
2256 if ([gameView isOptDown])
2259 target_chart_focus = galaxy_coordinates;
2264 cursor_coordinates = galaxy_coordinates;
2265 target_chart_focus = cursor_coordinates;
2266 target_chart_centre = galaxy_coordinates;
2267 found_system_id = -1;
2268 [UNIVERSE findSystemCoordinatesWithPrefix:@""];
2272 if ([
self checkKeyPress:n_key_map_end])
2275 target_chart_focus = cursor_coordinates;
2277 if ([
self checkKeyPress:n_key_map_zoom_in] || [gameView mouseWheelState] ==
gvMouseWheelDown)
2281 saved_chart_zoom = target_chart_zoom;
2283 if ([
self checkKeyPress:n_key_map_zoom_out] || [gameView mouseWheelState] ==
gvMouseWheelUp)
2285 if (gui_screen == GUI_SCREEN_LONG_RANGE_CHART)
2291 if (target_chart_zoom < 1.0) target_chart_zoom = 1.0;
2292 saved_chart_zoom = target_chart_zoom;
2294 target_chart_focus = target_chart_centre;
2300 if ([
self checkNavKeyPress:n_key_gui_arrow_left])
2302 if ((nextSystem || nextSystemOnRoute) &&
pressedArrow != 1)
2307 target_chart_focus = cursor_coordinates;
2313 target_chart_focus = [[UNIVERSE systemManager] getCoordinatesForSystem:info_system_id inGalaxy:galaxy_number];
2317 else if (!nextSystem && !nextSystemOnRoute)
2320 cursor_coordinates.x -= cursor_speed*delta_t;
2321 if (cursor_coordinates.x < 0.0) cursor_coordinates.x = 0.0;
2323 target_chart_focus = cursor_coordinates;
2329 if ([
self checkNavKeyPress:n_key_gui_arrow_right])
2331 if ((nextSystem || nextSystemOnRoute) &&
pressedArrow != 2)
2336 target_chart_focus = cursor_coordinates;
2342 target_chart_focus = [[UNIVERSE systemManager] getCoordinatesForSystem:info_system_id inGalaxy:galaxy_number];
2346 else if (!nextSystem && !nextSystemOnRoute)
2349 cursor_coordinates.x += cursor_speed*delta_t;
2350 if (cursor_coordinates.x > 256.0) cursor_coordinates.x = 256.0;
2352 target_chart_focus = cursor_coordinates;
2358 if ([
self checkNavKeyPress:n_key_gui_arrow_down])
2365 else if (!nextSystem)
2368 cursor_coordinates.y += cursor_speed*delta_t*2.0;
2369 if (cursor_coordinates.y > 256.0) cursor_coordinates.y = 256.0;
2372 target_chart_focus = cursor_coordinates;
2377 if ([
self checkNavKeyPress:n_key_gui_arrow_up])
2384 else if (!nextSystem)
2387 cursor_coordinates.y -= cursor_speed*delta_t*2.0;
2388 if (cursor_coordinates.y < 0.0) cursor_coordinates.y = 0.0;
2391 target_chart_focus = cursor_coordinates;
2397 if (found_system_id == -1)
2399 target_system_id = [UNIVERSE findSystemNumberAtCoords:cursor_coordinates withGalaxy:galaxy_number includingHidden:NO];
2405 NSPoint fpos = [[UNIVERSE systemManager] getCoordinatesForSystem:found_system_id inGalaxy:galaxy_number];
2406 if (fpos.x != cursor_coordinates.x && fpos.y != cursor_coordinates.y)
2408 target_system_id = [UNIVERSE findSystemNumberAtCoords:cursor_coordinates withGalaxy:galaxy_number includingHidden:NO];
2412 cursor_coordinates = [[UNIVERSE systemManager] getCoordinatesForSystem:target_system_id inGalaxy:galaxy_number];
2414 if (chart_focus_coordinates.x - target_chart_centre.x <= -
CHART_SCROLL_AT_X*chart_zoom)
2416 target_chart_centre.x = chart_focus_coordinates.x +
CHART_SCROLL_AT_X*chart_zoom;
2418 else if (chart_focus_coordinates.x - target_chart_centre.x >=
CHART_SCROLL_AT_X*chart_zoom)
2420 target_chart_centre.x = chart_focus_coordinates.x -
CHART_SCROLL_AT_X*chart_zoom;
2422 if (chart_focus_coordinates.y - target_chart_centre.y <= -
CHART_SCROLL_AT_Y*chart_zoom)
2424 target_chart_centre.y = chart_focus_coordinates.y +
CHART_SCROLL_AT_Y*chart_zoom;
2426 else if (chart_focus_coordinates.y - target_chart_centre.y >=
CHART_SCROLL_AT_Y*chart_zoom)
2428 target_chart_centre.y = chart_focus_coordinates.y -
CHART_SCROLL_AT_Y*chart_zoom;
2430 chart_centre_coordinates.x = (3.0*chart_centre_coordinates.x + target_chart_centre.x)/4.0;
2431 chart_centre_coordinates.y = (3.0*chart_centre_coordinates.y + target_chart_centre.y)/4.0;
2432 chart_zoom = (3.0*chart_zoom + target_chart_zoom)/4.0;
2433 chart_focus_coordinates.x = (3.0*chart_focus_coordinates.x + target_chart_focus.x)/4.0;
2434 chart_focus_coordinates.y = (3.0*chart_focus_coordinates.y + target_chart_focus.y)/4.0;
2440 case GUI_SCREEN_SYSTEM_DATA:
2441 if ([
self checkKeyPress:n_key_system_next_system])
2453 if ([
self checkKeyPress:n_key_system_previous_system])
2465 if ([
self checkKeyPress:n_key_system_home])
2477 if ([
self checkKeyPress:n_key_system_end])
2491#if OO_USE_CUSTOM_LOAD_SAVE
2493 case GUI_SCREEN_LOAD:
2507 case GUI_SCREEN_SAVE:
2512 if (gui_screen == GUI_SCREEN_SAVE)
2516 else pollControls = YES;
2519 case GUI_SCREEN_SAVE_OVERWRITE:
2524 case GUI_SCREEN_STICKMAPPER:
2528 case GUI_SCREEN_STICKPROFILE:
2532 case GUI_SCREEN_GAMEOPTIONS:
2536 case GUI_SCREEN_KEYBOARD:
2544 case GUI_SCREEN_KEYBOARD_CONFIRMCLEAR:
2548 case GUI_SCREEN_KEYBOARD_CONFIG:
2552 case GUI_SCREEN_KEYBOARD_ENTRY:
2556 case GUI_SCREEN_KEYBOARD_LAYOUT:
2560 case GUI_SCREEN_SHIPLIBRARY:
2561 if ([gameView isDown:
' '])
2566 if ([
self checkKeyPress:n_key_gui_arrow_up])
2569 [UNIVERSE selectIntro2Previous];
2571 if ([
self checkKeyPress:n_key_gui_arrow_down])
2574 [UNIVERSE selectIntro2Next];
2578 if ([
self checkKeyPress:n_key_gui_arrow_left])
2581 [UNIVERSE selectIntro2PreviousCategory];
2583 if ([
self checkKeyPress:n_key_gui_arrow_right])
2586 [UNIVERSE selectIntro2NextCategory];
2591 case GUI_SCREEN_OPTIONS:
2605 @catch (NSException *exception)
2607 OOLog(
kOOLogException,
@"\n\n***** Handling exception: %@ : %@ *****\n\n",[exception name], [exception reason]);
2608 if ([[exception name] isEqual:
@"GameNotSavedException"])
2611 if ([controller inFullScreenMode])
2630 if (![
self loadPlayer])
2641 [UNIVERSE setUseAddOns:SCENARIO_OXP_DEFINITION_ALL fromSaveGame:NO forceReinit:YES];
2656 if ((guiSelectedRow ==
GUI_ROW(,QUIT)) && selectKeyPress)
2658 [[UNIVERSE gameController] exitAppWithContext:@"Exit Game selected on options screen"];
2662 if ((guiSelectedRow ==
GUI_ROW(,GAMEOPTIONS)) && selectKeyPress)
2670 case GUI_SCREEN_EQUIP_SHIP:
2671 if ([
self handleGUIUpDownArrowKeys])
2681 if (weaponType !=
nil)
2685 if ([[weaponType identifier] isEqualToString:
@"EQ_WEAPON_NONE"]) itemText =
DESC(
@"no-weapon-enter-to-install");
2689 if (sameAs) itemText = [
NSString stringWithFormat:DESC(@"weapon-installed-@"), weaponName];
2690 else itemText = [
NSString stringWithFormat:DESC(@"weapon-@-enter-to-replace"), weaponName];
2699 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
2712 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
2746 case GUI_SCREEN_INTERFACES:
2747 if ([
self handleGUIUpDownArrowKeys])
2751 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
2764 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
2798 case GUI_SCREEN_MARKETINFO:
2802 case GUI_SCREEN_MARKET:
2805 if ([
self checkKeyPress:n_key_market_filter_cycle] || [
self checkKeyPress:n_key_market_sorter_cycle])
2810 if ([
self checkKeyPress:n_key_market_filter_cycle])
2843 case GUI_SCREEN_REPORT:
2844 if ([gameView isDown:32])
2867 case GUI_SCREEN_STATUS:
2869 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
2884 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
2923 case GUI_SCREEN_MANIFEST:
2925 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
2940 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
2943 if ([[
self hud] isHidden] || [[
self hud] allowBigGui])
2949 if ([[gui keyForRow:nextRow] isEqual:
GUI_KEY_OK])
2983 case GUI_SCREEN_SHIPYARD:
2984 if ([
self handleGUIUpDownArrowKeys])
2989 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
3002 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
3017 if ([
self checkKeyPress:n_key_gui_select])
3024 if (![key hasPrefix:
@"More:"])
3029 if ([
self buySelectedShip])
3031 if (![key hasPrefix:
@"More:"])
3033 [UNIVERSE removeDemoShips];
3076 NSInteger kc = [
keys count];
3078 NSDictionary *keydefs =
nil;
3079 NSString *key =
nil;
3081 definition = [
keys objectAtIndex:kc];
3083 foreach (key, [keydefs allKeys])
3085 if ([
self checkKeyPress:[keydefs objectForKey:key]])
3092 [[UNIVERSE gameView] clearKeys];
3097 OOLog(
@"interface.missingCallback",
@"Unable to find callback definition for %@ using key %@", [definition name], key);
3109 if (flightRoll > 0.0)
3112 else flightRoll = 0.0;
3114 if (flightRoll < 0.0)
3117 else flightRoll = 0.0;
3119 if (flightPitch > 0.0)
3122 else flightPitch = 0.0;
3124 if (flightPitch < 0.0)
3127 else flightPitch = 0.0;
3129 if (flightYaw > 0.0)
3132 else flightYaw = 0.0;
3134 if (flightYaw < 0.0)
3137 else flightYaw = 0.0;
2037- (void) pollGuiArrowKeyControls:(
double) delta_t {
…}
3147 if (gui_screen == GUI_SCREEN_MARKET)
3150 DESTROY(marketSelectedCommodity);
3155 if (page_up || page_down)
3161 if ([goods
count] > 0)
3163 NSInteger goodsIndex = [
goods indexOfObject:marketSelectedCommodity];
3164 NSInteger offset1 = 0;
3165 NSInteger offset2 = 0;
3172 if (goodsIndex - 16 <= 0)
3177 if (offset1 == 1 && offset2 == 0 && goodsIndex < (NSInteger)[goods
count] - 1 && goodsIndex - 15 > 0) offset2 = 1;
3178 goodsIndex -= (16 - (offset1 + offset2));
3179 if (goodsIndex < 0) goodsIndex = 0;
3180 if ([goods
count] <= 17) goodsIndex = 0;
3186 if (offset1 == 0 && offset2 == 1 && goodsIndex > 1) offset1 = 1;
3187 if (offset2 == 1 && goodsIndex + 15 == (NSInteger)[goods
count] - 1) offset2 = 0;
3188 goodsIndex += (16 - (offset1 + offset2));
3189 if (goodsIndex > ((NSInteger)[goods
count] - 1) || [goods
count] <= 17) goodsIndex = (NSInteger)[goods
count] - 1;
3191 DESTROY(marketSelectedCommodity);
3192 marketSelectedCommodity = [[
goods oo_stringAtIndex:goodsIndex] retain];
3207 BOOL arrow_down = [
self checkKeyPress:n_key_gui_arrow_down];
3208 if (arrow_up || arrow_down)
3214 if ([goods
count] > 0)
3216 NSInteger goodsIndex = [
goods indexOfObject:marketSelectedCommodity];
3227 goodsIndex = [
goods count]-1;
3229 else if (goodsIndex >= (NSInteger)[goods
count])
3233 DESTROY(marketSelectedCommodity);
3234 marketSelectedCommodity = [[
goods oo_stringAtIndex:goodsIndex] retain];
3249 if (([
self checkNavKeyPress:n_key_gui_arrow_right])||([
self checkNavKeyPress:n_key_gui_arrow_left])||([
self checkKeyPress:n_key_gui_select]||[gameView isDown:
gvMouseDoubleClick]))
3251 if ([
self checkNavKeyPress:n_key_gui_arrow_right])
3255 if (isdocked && [
self tryBuyingCommodity:marketSelectedCommodity all:[gameView isShiftDown]])
3258 if (gui_screen == GUI_SCREEN_MARKET)
3269 if ([[gui selectedRowKey] isEqualToString:
@">>>"])
3274 else if ([[gui selectedRowKey] isEqualToString:
@"<<<"])
3287 if ([
self checkNavKeyPress:n_key_gui_arrow_left])
3291 if (isdocked && [
self trySellingCommodity:marketSelectedCommodity all:[gameView isShiftDown]])
3294 if (gui_screen == GUI_SCREEN_MARKET)
3305 if ([[gui selectedRowKey] isEqualToString:
@">>>"])
3310 else if ([[gui selectedRowKey] isEqualToString:
@"<<<"])
3324 if ((gui_screen == GUI_SCREEN_MARKET && [gameView isDown:
gvMouseDoubleClick]) || [
self checkKeyPress:n_key_gui_select])
3335 if ([item isEqualToString:
@">>>"])
3340 else if ([item isEqualToString:
@"<<<"])
3345 else if (isdocked && [gameView isShiftDown] && [
self tryBuyingCommodity:item all:YES])
3348 if (gui_screen == GUI_SCREEN_MARKET)
3357 else if (isdocked && (yours > 0) && [
self trySellingCommodity:item all:YES])
3360 if (gui_screen == GUI_SCREEN_MARKET)
3369 else if (isdocked && [
self tryBuyingCommodity:item all:YES])
3372 if (gui_screen == GUI_SCREEN_MARKET)
3410 if ((guiSelectedRow ==
GUI_ROW(GAME,STICKMAPPER)) && selectKeyPress)
3416 if ((guiSelectedRow ==
GUI_ROW(GAME,KEYMAPPER)) && selectKeyPress)
3425 if ([gameView hdrOutput])
3427 if ((guiSelectedRow ==
GUI_ROW(GAME,HDRMAXBRIGHTNESS))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3431 int direction = ([
self checkKeyPress:n_key_gui_arrow_right]) ? 1 : -1;
3432 NSArray *brightnesses = [[UNIVERSE descriptions] oo_arrayForKey: @"hdr_maxBrightness_array"];
3435 if (brightnessIdx == NSNotFound)
3437 OOLogWARN(
@"hdr.maxBrightness.notFound",
@"%@",
@"couldn't find current max brightness setting, switching to lowest.");
3441 brightnessIdx += direction;
3443 if (brightnessIdx < 0)
3444 brightnessIdx =
count - 1;
3445 if (brightnessIdx >=
count)
3448 int brightnessValue = [
brightnesses oo_intAtIndex:brightnessIdx];
3455 [
gameView setHDRMaxBrightness:(float)brightnessValue];
3456 NSString *maxBrightnessString =
OOExpandKey(
@"gameoptions-hdr-maxbrightness", brightnessValue);
3469#if OO_RESOLUTION_OPTION
3471 guiSelectedRow ==
GUI_ROW(GAME,DISPLAY) &&
3472 ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_arrow_left]))
3475 int direction = ([
self checkKeyPress:n_key_gui_arrow_right]) ? 1 : -1;
3479 if (displayModeIndex == (NSInteger)NSNotFound)
3481 OOLogWARN(
@"graphics.mode.notFound",
@"%@",
@"couldn't find current fullscreen setting, switching to default.");
3482 displayModeIndex = 0;
3485 displayModeIndex = displayModeIndex + direction;
3487 if (displayModeIndex < 0)
3488 displayModeIndex =
count - 1;
3489 if (displayModeIndex >=
count)
3490 displayModeIndex = 0;
3492 NSDictionary *
mode = [
modes objectAtIndex:displayModeIndex];
3493 int modeWidth = [mode oo_intForKey:kOODisplayWidth];
3494 int modeHeight = [mode oo_intForKey:kOODisplayHeight];
3495 int modeRefresh = [mode oo_intForKey:kOODisplayRefreshRate];
3511 if (
switching_resolution && ![
self checkKeyPress:n_key_gui_arrow_right] && ![
self checkKeyPress:n_key_gui_arrow_left] && !selectKeyPress)
3517#if OOLITE_SPEECH_SYNTH
3519 if ((guiSelectedRow ==
GUI_ROW(GAME,SPEECH))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3537 NSString *message =
nil;
3541 message =
DESC(
@"gameoptions-spoken-messages-no");
3544 message =
DESC(
@"gameoptions-spoken-messages-comms");
3547 message =
DESC(
@"gameoptions-spoken-messages-yes");
3554 [UNIVERSE stopSpeaking];
3555 [UNIVERSE startSpeakingString:message];
3565 if (guiSelectedRow ==
GUI_ROW(GAME,SPEECH_LANGUAGE))
3567 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_arrow_left])
3572 if ([
self checkKeyPress:n_key_gui_arrow_right])
3573 voice_no = [UNIVERSE nextVoice: voice_no];
3575 voice_no = [UNIVERSE prevVoice: voice_no];
3576 [UNIVERSE setVoice: voice_no withGenderM:voice_gender_m];
3577 NSString *voiceName = [UNIVERSE voiceName:voice_no];
3578 NSString *message =
OOExpandKey(
@"gameoptions-voice-name", voiceName);
3582 [UNIVERSE stopSpeaking];
3583 [UNIVERSE startSpeakingString:[UNIVERSE voiceName: voice_no]];
3587 speechVoiceSelectKeyPressed = YES;
3590 speechVoiceSelectKeyPressed = NO;
3593 if (guiSelectedRow ==
GUI_ROW(GAME,SPEECH_GENDER))
3595 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_arrow_left])
3597 if (!speechGenderSelectKeyPressed)
3601 if (m != voice_gender_m)
3604 [UNIVERSE setVoice:voice_no withGenderM:voice_gender_m];
3605 NSString *message = [
NSString stringWithFormat:DESC(voice_gender_m ? @"gameoptions-voice-M" : @"gameoptions-voice-F")];
3609 [UNIVERSE stopSpeaking];
3610 [UNIVERSE startSpeakingString:[UNIVERSE voiceName: voice_no]];
3614 speechGenderSelectKeyPressed = YES;
3617 speechGenderSelectKeyPressed = NO;
3622 if ((guiSelectedRow ==
GUI_ROW(GAME,MUSIC))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3628 int mode = initialMode;
3630 if ([
self checkKeyPress:n_key_gui_arrow_right])
mode++;
3631 if ([
self checkKeyPress:n_key_gui_arrow_left])
mode--;
3635 if ((
int)[musicController
mode] != initialMode)
3639 NSString *message =
OOExpandKey(
@"gameoptions-music-mode", musicMode);
3647 if ((guiSelectedRow ==
GUI_ROW(GAME,AUTOSAVE))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3649 if ([
self checkKeyPress:n_key_gui_arrow_right] != [
UNIVERSE autoSave])
3651 [UNIVERSE setAutoSave:[
self checkKeyPress:n_key_gui_arrow_right]];
3655 [UNIVERSE setAutoSaveNow:YES];
3656 [
gui setText:DESC(@"gameoptions-autosave-yes")
forRow:GUI_ROW(GAME,AUTOSAVE)
align:GUI_ALIGN_CENTER];
3660 [UNIVERSE setAutoSaveNow:NO];
3661 [
gui setText:DESC(@"gameoptions-autosave-no")
forRow:GUI_ROW(GAME,AUTOSAVE)
align:GUI_ALIGN_CENTER];
3665 if ((guiSelectedRow ==
GUI_ROW(GAME,VOLUME))
3666 &&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left]))
3667 &&[
OOSound respondsToSelector:
@selector(masterVolume)])
3671 BOOL rightKeyDown = [
self checkKeyPress:n_key_gui_arrow_right];
3672 BOOL leftKeyDown = [
self checkKeyPress:n_key_gui_arrow_left];
3674 int vol = (volume / 5.0 + 0.5);
3675 if (rightKeyDown) vol++;
3676 if (leftKeyDown) vol--;
3681 espeak_SetParameter(espeakVOLUME, vol * 5, 0);
3685 NSString* soundVolumeWordDesc =
DESC(
@"gameoptions-sound-volume");
3686 NSString* v1_string =
@"|||||||||||||||||||||||||";
3687 NSString* v0_string =
@".........................";
3688 v1_string = [
v1_string substringToIndex:vol];
3689 v0_string = [
v0_string substringToIndex:20 - vol];
3690 [
gui setText:[
NSString stringWithFormat:@"%@%@%@ ", soundVolumeWordDesc, v1_string, v0_string]
3691 forRow:GUI_ROW(GAME,VOLUME)
3692 align:GUI_ALIGN_CENTER];
3695 [
gui setText:DESC(@"gameoptions-sound-volume-mute")
forRow:GUI_ROW(GAME,VOLUME)
align:GUI_ALIGN_CENTER];
3704 if ((guiSelectedRow ==
GUI_ROW(GAME,GAMMA))
3705 &&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3707 if (!gammaControlPressed)
3709 BOOL rightKeyDown = [
self checkKeyPress:n_key_gui_arrow_right];
3710 BOOL leftKeyDown = [
self checkKeyPress:n_key_gui_arrow_left];
3712 gamma += (((rightKeyDown && (gamma < 4.0f)) ? 0.2f : 0.0f) - ((leftKeyDown && (gamma > 0.2f)) ? 0.2f : 0.0f));
3713 if (gamma > 3.95f) gamma = 4.0f;
3714 if (gamma < 0.25f) gamma = 0.2f;
3716 int gamma5 = gamma * 5;
3717 NSString* gammaWordDesc =
DESC(
@"gameoptions-gamma-value");
3718 NSString* v1_string =
@"|||||||||||||||||||||||||";
3719 NSString* v0_string =
@".........................";
3720 v1_string = [
v1_string substringToIndex:gamma5];
3721 v0_string = [
v0_string substringToIndex:20 - gamma5];
3722 [
gui setText:[
NSString stringWithFormat:@"%@%@%@ (%.1f) ", gammaWordDesc, v1_string, v0_string, gamma]
forRow:GUI_ROW(GAME,GAMMA)
align:GUI_ALIGN_CENTER];
3724 gammaControlPressed = YES;
3727 gammaControlPressed = NO;
3731 if ((guiSelectedRow ==
GUI_ROW(GAME,FOV))
3732 &&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3736 BOOL rightKeyDown = [
self checkKeyPress:n_key_gui_arrow_right];
3737 BOOL leftKeyDown = [
self checkKeyPress:n_key_gui_arrow_left];
3741 fovStep : 0.0f) - ((leftKeyDown && (fov >
MIN_FOV_DEG)) ? fovStep : 0.0f));
3747 NSString* fovWordDesc =
DESC(
@"gameoptions-fov-value");
3748 NSString* v1_string =
@"|||||||||||||||||||||||||";
3749 NSString* v0_string =
@".........................";
3750 v1_string = [
v1_string substringToIndex:fovTicks];
3751 v0_string = [
v0_string substringToIndex:20 - fovTicks];
3752 [
gui setText:[
NSString stringWithFormat:@"%@%@%@ (%d%c) ", fovWordDesc, v1_string, v0_string, (int)fov, 176 ]
forRow:GUI_ROW(GAME,FOV)
align:GUI_ALIGN_CENTER];
3763 if ((guiSelectedRow ==
GUI_ROW(GAME,COLORBLINDMODE))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3767 int colorblindMode = [UNIVERSE colorblindMode];
3768 if ([
self checkKeyPress:n_key_gui_arrow_right])
3770 [UNIVERSE setCurrentPostFX:[UNIVERSE nextColorblindMode:colorblindMode]];
3774 [UNIVERSE setCurrentPostFX:[UNIVERSE prevColorblindMode:colorblindMode]];
3776 colorblindMode = [UNIVERSE colorblindMode];
3777 NSString *colorblindModeDesc = [[[UNIVERSE descriptions] oo_arrayForKey: @"colorblind_mode"] oo_stringAtIndex:[UNIVERSE useShaders] ? colorblindMode : 0];
3778 NSString *colorblindModeMsg =
OOExpandKey(
@"gameoptions-colorblind-mode", colorblindModeDesc);
3787 if (![gameView hdrOutput])
3789 if ((guiSelectedRow ==
GUI_ROW(GAME,WIREFRAMEGRAPHICS))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3791 if ([
self checkKeyPress:n_key_gui_arrow_right] != [
UNIVERSE wireframeGraphics])
3793 [UNIVERSE setWireframeGraphics:[
self checkKeyPress:n_key_gui_arrow_right]];
3795 [
gui setText:DESC(@"gameoptions-wireframe-graphics-yes")
forRow:GUI_ROW(GAME,WIREFRAMEGRAPHICS)
align:GUI_ALIGN_CENTER];
3797 [
gui setText:DESC(@"gameoptions-wireframe-graphics-no")
forRow:GUI_ROW(GAME,WIREFRAMEGRAPHICS)
align:GUI_ALIGN_CENTER];
3803 if ((guiSelectedRow ==
GUI_ROW(GAME,HDRPAPERWHITE))
3804 &&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3808 BOOL rightKeyDown = [
self checkKeyPress:n_key_gui_arrow_right];
3809 BOOL leftKeyDown = [
self checkKeyPress:n_key_gui_arrow_left];
3810 float paperWhite = [
gameView hdrPaperWhiteBrightness];
3814 [
gameView setHDRPaperWhiteBrightness:paperWhite];
3816 NSString* paperWhiteWordDesc =
DESC(
@"gameoptions-hdr-paperwhite");
3817 NSString* v1_string =
@"|||||||||||||||||||||||||";
3818 NSString* v0_string =
@".........................";
3819 v1_string = [
v1_string substringToIndex:paperWhiteNorm];
3820 v0_string = [
v0_string substringToIndex:20 - paperWhiteNorm];
3821 [
gui setText:[
NSString stringWithFormat:@"%@%@%@ (%d) ", paperWhiteWordDesc, v1_string, v0_string, (int)paperWhite]
forRow:GUI_ROW(GAME,HDRPAPERWHITE)
align:GUI_ALIGN_CENTER];
3831 if ((guiSelectedRow ==
GUI_ROW(GAME,PROCEDURALLYTEXTUREDPLANETS))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3833 if ([
self checkKeyPress:n_key_gui_arrow_right] != [
UNIVERSE doProcedurallyTexturedPlanets])
3835 [UNIVERSE setDoProcedurallyTexturedPlanets:[
self checkKeyPress:n_key_gui_arrow_right]];
3839 [UNIVERSE setUpPlanet];
3842 if ([
UNIVERSE doProcedurallyTexturedPlanets])
3843 [
gui setText:DESC(@"gameoptions-procedurally-textured-planets-yes")
forRow:GUI_ROW(GAME,PROCEDURALLYTEXTUREDPLANETS)
align:GUI_ALIGN_CENTER];
3845 [
gui setText:DESC(@"gameoptions-procedurally-textured-planets-no")
forRow:GUI_ROW(GAME,PROCEDURALLYTEXTUREDPLANETS)
align:GUI_ALIGN_CENTER];
3849 if (guiSelectedRow ==
GUI_ROW(GAME,SHADEREFFECTS) && ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_arrow_left]))
3853 int direction = ([
self checkKeyPress:n_key_gui_arrow_right]) ? 1 : -1;
3878 [UNIVERSE setDetailLevel:detailLevel];
3879 detailLevel = [UNIVERSE detailLevel];
3881 NSString *shaderEffectsOptionsString =
OOExpand(
@"gameoptions-detaillevel-[detailLevel]", detailLevel);
3882 [
gui setText:OOExpandKey(shaderEffectsOptionsString)
forRow:GUI_ROW(GAME,SHADEREFFECTS)
align:GUI_ALIGN_CENTER];
3897 if ((guiSelectedRow ==
GUI_ROW(GAME,DISPLAYSTYLE)) && selectKeyPress)
3905 if ((guiSelectedRow ==
GUI_ROW(GAME,DOCKINGCLEARANCE))&&(([
self checkKeyPress:n_key_gui_arrow_right])||([
self checkKeyPress:n_key_gui_arrow_left])))
3907 if ([
self checkKeyPress:n_key_gui_arrow_right] != [
UNIVERSE dockingClearanceProtocolActive])
3909 [UNIVERSE setDockingClearanceProtocolActive:[
self checkKeyPress:n_key_gui_arrow_right]];
3910 if ([
UNIVERSE dockingClearanceProtocolActive])
3911 [
gui setText:DESC(@"gameoptions-docking-clearance-yes")
forRow:GUI_ROW(GAME,DOCKINGCLEARANCE)
align:GUI_ALIGN_CENTER];
3913 [
gui setText:DESC(@"gameoptions-docking-clearance-no")
forRow:GUI_ROW(GAME,DOCKINGCLEARANCE)
align:GUI_ALIGN_CENTER];
3916 if ((guiSelectedRow ==
GUI_ROW(GAME,BACK)) && selectKeyPress)
3934 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
3938 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
3942 int from_function = 0;
3943 NSArray *keyComponents = [
key componentsSeparatedByString:@":"];
3944 if ([keyComponents
count] > 1)
3947 if (from_function < 0) from_function = 0;
3952 [[UNIVERSE gui] setSelectedRow: GUI_ROW_KC_FUNCSTART];
3954 if (from_function == 0)
3956 [[UNIVERSE gui] setSelectedRow: GUI_ROW_KC_FUNCSTART + MAX_ROWS_KC_FUNCTIONS - 1];
3973 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
3977 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
3981 int from_function = 0;
3982 NSArray *keyComponents = [
key componentsSeparatedByString:@":"];
3983 if ([keyComponents
count] > 1)
3986 if (from_function < 0) from_function = 0;
3991 [[UNIVERSE gui] setSelectedRow: GUI_ROW_KC_FUNCSTART];
3993 if (from_function == 0)
3995 [[UNIVERSE gui] setSelectedRow: GUI_ROW_KC_FUNCSTART + MAX_ROWS_KC_FUNCTIONS - 1];
4012 if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
4016 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
4020 int from_function = 0;
4021 NSArray *keyComponents = [
key componentsSeparatedByString:@":"];
4022 if ([keyComponents
count] > 1)
4025 if (from_function < 0) from_function = 0;
4030 [[UNIVERSE gui] setSelectedRow: GUI_ROW_FUNCSTART];
4032 if (from_function == 0)
4034 [[UNIVERSE gui] setSelectedRow: GUI_ROW_FUNCSTART + MAX_ROWS_FUNCTIONS - 1];
4044 static Quaternion viewQuaternion;
4045 static Vector viewOffset;
4046 static Vector rotationCenter;
4048 static Vector right;
4049 static BOOL mouse_clicked = NO;
4050 static NSPoint mouse_clicked_position;
4051 static BOOL shift_down;
4052 static BOOL caps_on = NO;
4053 static NSTimeInterval last_time = 0.0;
4059 if (!
customView_pressed && [_customViews
count] != 0 && gui_screen != GUI_SCREEN_LONG_RANGE_CHART && ![gameView allowingStringInput])
4061 if ([
UNIVERSE viewDirection] == VIEW_CUSTOM)
4064 _customViewIndex = (_customViewIndex + 1) % [_customViews
count];
4075 NSTimeInterval this_time = [
NSDate timeIntervalSinceReferenceDate];
4076 if ([
UNIVERSE viewDirection] > VIEW_STARBOARD && [gameView isCapsLockOn])
4082 if (!caps_on) caps_on = YES;
4085 if (([
self checkKeyPress:n_key_custom_view_zoom_out ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_zoom_in ignore_ctrl:YES]) || [gameView mouseWheelState] ==
gvMouseWheelDown)
4089 if (([
self checkKeyPress:n_key_custom_view_zoom_in ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_zoom_out ignore_ctrl:YES]) || [gameView mouseWheelState] ==
gvMouseWheelUp)
4093 if ([
self checkKeyPress:n_key_custom_view_roll_left ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_roll_right ignore_ctrl:YES])
4097 if ([
self checkKeyPress:n_key_custom_view_pan_left ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_pan_right ignore_ctrl:YES])
4101 if ([
self checkKeyPress:n_key_custom_view_roll_right ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_roll_left ignore_ctrl:YES])
4105 if ([
self checkKeyPress:n_key_custom_view_pan_right ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_pan_left ignore_ctrl:YES])
4109 if ([
self checkKeyPress:n_key_custom_view_rotate_up ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_rotate_down ignore_ctrl:YES])
4113 if ([
self checkKeyPress:n_key_custom_view_pan_down ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_pan_up ignore_ctrl:YES])
4117 if ([
self checkKeyPress:n_key_custom_view_rotate_down ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_rotate_up ignore_ctrl:YES])
4121 if ([
self checkKeyPress:n_key_custom_view_pan_up ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_pan_down ignore_ctrl:YES])
4125 if ([
self checkKeyPress:n_key_custom_view_rotate_left ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_rotate_right ignore_ctrl:YES])
4129 if ([
self checkKeyPress:n_key_custom_view_rotate_right ignore_ctrl:YES] && ![
self checkKeyPress:n_key_custom_view_rotate_left ignore_ctrl:YES])
4135 if(!mouse_clicked || shift_down != [gameView isShiftDown])
4137 mouse_clicked = YES;
4138 viewQuaternion = [PLAYER customViewQuaternion];
4139 viewOffset = [PLAYER customViewOffset];
4140 rotationCenter = [PLAYER customViewRotationCenter];
4141 up = [PLAYER customViewUpVector];
4142 right = [PLAYER customViewRightVector];
4147 Vector axis = vector_add(vector_multiply_scalar(up, mouse_position.x - mouse_clicked_position.x),
4148 vector_multiply_scalar(right, mouse_position.y - mouse_clicked_position.y));
4149 float angle = magnitude(axis);
4150 axis = vector_normal(axis);
4151 Quaternion newViewQuaternion = viewQuaternion;
4152 if ([gameView isShiftDown])
4155 [PLAYER setCustomViewQuaternion: newViewQuaternion];
4156 [PLAYER setCustomViewRotationCenter: vector_subtract(viewOffset,
4157 vector_multiply_scalar([PLAYER customViewForwardVector],
4158 dot_product([PLAYER customViewForwardVector], viewOffset)))];
4163 OOScalar m = magnitude(vector_subtract(viewOffset, rotationCenter));
4164 [PLAYER setCustomViewQuaternion: newViewQuaternion];
4165 Vector
offset = vector_flip([
PLAYER customViewForwardVector]);
4167 [PLAYER setCustomViewOffset:vector_add(offset, rotationCenter)];
4184 last_time = this_time;
4196 NSPoint virtualView = NSZeroPoint;
4197 double view_threshold = 0.5;
4199 if ([stickHandler joystickCount])
4203 virtualView.y = 0.0;
4205 virtualView.x = 0.0;
4206 if (fabs(virtualView.y) >= fabs(virtualView.x))
4207 virtualView.x = 0.0;
4209 virtualView.y = 0.0;
4215 if (([
self checkKeyPress:n_key_view_forward]) || (virtualView.y < -view_threshold)||joyButtonState[
BUTTON_VIEWFORWARD] || ((([
self checkKeyPress:n_key_hyperspace] && gui_screen != GUI_SCREEN_LONG_RANGE_CHART) || joyButtonState[
BUTTON_HYPERDRIVE]) && [
UNIVERSE displayGUI]))
4219 if (([
self checkKeyPress:n_key_view_aft])||(virtualView.y > view_threshold)||joyButtonState[
BUTTON_VIEWAFT])
4223 if (([
self checkKeyPress:n_key_view_port])||(virtualView.x < -view_threshold)||joyButtonState[
BUTTON_VIEWPORT])
4227 if (([
self checkKeyPress:n_key_view_starboard])||(virtualView.x > view_threshold)||joyButtonState[
BUTTON_VIEWSTARBOARD])
4237 if (!scanner_zoom_rate)
4239 if ([hud scannerZoom] < 5.0)
4258 if ((!scanner_zoom_rate)&&([hud scannerZoom] > 1.0))
4262 if (
EXPECT([[
self hud] isCompassActive]))
4276 if ([
self checkKeyPress:n_key_next_compass_mode] || joyButtonState[
BUTTON_COMPASSMODE])
4294 if (![
self checkKeyPress:n_key_cycle_previous_mfd] || joyButtonState[
BUTTON_MFDCYCLEPREV])
4313 if ([[
self hud] mfdCount] > 1)
4337 if ([
self checkKeyPress:n_key_comms_log])
4339 [UNIVERSE showCommsLog: 1.5];
4340 [
hud refreshLastTransmitter];
4345- (void) pollFlightArrowKeyControls:(
double)delta_t
4350 NSPoint virtualStick = NSZeroPoint;
4351 double reqYaw = 0.0;
4357 if (mouse_control_on)
4360 double sensitivity = 2.0;
4361 virtualStick.x *= sensitivity;
4362 virtualStick.y *= sensitivity;
4363 reqYaw = virtualStick.x;
4365 else if (numSticks > 0)
4374 else if(virtualStick.x != 0)
4377 keyboardRollOverride=NO;
4385 else if(virtualStick.y != 0)
4388 keyboardPitchOverride=NO;
4397 else if(reqYaw != 0)
4400 keyboardYawOverride=NO;
4411 double flightArrowKeyPrecisionFactor = [[
NSUserDefaults standardUserDefaults] oo_doubleForKey:@"flight-arrow-key-precision-factor" defaultValue:0.5];
4412 if (flightArrowKeyPrecisionFactor < 0.05) flightArrowKeyPrecisionFactor = 0.05;
4413 if (flightArrowKeyPrecisionFactor > 1.0) flightArrowKeyPrecisionFactor = 1.0;
4419 if ([
self checkNavKeyPress:n_key_roll_left] && [
self checkNavKeyPress:n_key_roll_right])
4421 keyboardRollOverride = YES;
4424 else if ([
self checkNavKeyPress:n_key_roll_left] && !capsLockCustomView)
4426 keyboardRollOverride=YES;
4427 if (flightRoll > 0.0) flightRoll = 0.0;
4428 [
self decrease_flight_roll:isCtrlDown ? flightArrowKeyPrecisionFactor*roll_dampner*roll_delta : delta_t*roll_delta];
4431 else if ([
self checkNavKeyPress:n_key_roll_right] && !capsLockCustomView)
4433 keyboardRollOverride=YES;
4434 if (flightRoll < 0.0) flightRoll = 0.0;
4435 [
self increase_flight_roll:isCtrlDown ? flightArrowKeyPrecisionFactor*roll_dampner*roll_delta : delta_t*roll_delta];
4439 if(((mouse_control_on && !
mouse_x_axis_map_to_yaw) || numSticks) && !keyboardRollOverride && !capsLockCustomView)
4441 stick_roll = max_flight_roll * virtualStick.x;
4442 if (flightRoll < stick_roll)
4445 if (flightRoll > stick_roll)
4446 flightRoll = stick_roll;
4448 if (flightRoll > stick_roll)
4451 if (flightRoll < stick_roll)
4452 flightRoll = stick_roll;
4454 rolling = (fabs(virtualStick.x) > 0.0);
4458 if (flightRoll > 0.0)
4461 else flightRoll = 0.0;
4463 if (flightRoll < 0.0)
4466 else flightRoll = 0.0;
4472 if (!mouse_control_on)
4474 if ([
self checkNavKeyPress:n_key_pitch_back] && [
self checkNavKeyPress:n_key_pitch_forward])
4476 keyboardPitchOverride=YES;
4479 else if ([
self checkNavKeyPress:n_key_pitch_back] && !capsLockCustomView)
4481 keyboardPitchOverride=YES;
4482 if (flightPitch < 0.0) flightPitch = 0.0;
4483 [
self increase_flight_pitch:isCtrlDown ? flightArrowKeyPrecisionFactor*pitch_dampner*pitch_delta : delta_t*pitch_delta];
4486 else if ([
self checkNavKeyPress:n_key_pitch_forward] && !capsLockCustomView)
4488 keyboardPitchOverride=YES;
4489 if (flightPitch > 0.0) flightPitch = 0.0;
4490 [
self decrease_flight_pitch:isCtrlDown ? flightArrowKeyPrecisionFactor*pitch_dampner*pitch_delta : delta_t*pitch_delta];
4494 if((mouse_control_on || (numSticks && !keyboardPitchOverride)) && !capsLockCustomView)
4496 stick_pitch = max_flight_pitch * virtualStick.y;
4497 if (flightPitch < stick_pitch)
4500 if (flightPitch > stick_pitch)
4501 flightPitch = stick_pitch;
4503 if (flightPitch > stick_pitch)
4506 if (flightPitch < stick_pitch)
4507 flightPitch = stick_pitch;
4509 pitching = (fabs(virtualStick.y) > 0.0);
4513 if (flightPitch > 0.0)
4516 else flightPitch = 0.0;
4518 if (flightPitch < 0.0)
4521 else flightPitch = 0.0;
4529 if ([
self checkNavKeyPress:n_key_yaw_left] && [
self checkNavKeyPress:n_key_yaw_right])
4531 keyboardYawOverride=YES;
4534 else if ([
self checkNavKeyPress:n_key_yaw_left] && !capsLockCustomView)
4536 keyboardYawOverride=YES;
4537 if (flightYaw < 0.0) flightYaw = 0.0;
4538 [
self increase_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
4541 else if ([
self checkNavKeyPress:n_key_yaw_right] && !capsLockCustomView)
4543 keyboardYawOverride=YES;
4544 if (flightYaw > 0.0) flightYaw = 0.0;
4545 [
self decrease_flight_yaw:isCtrlDown ? flightArrowKeyPrecisionFactor*yaw_dampner*yaw_delta : delta_t*yaw_delta];
4549 if(((mouse_control_on &&
mouse_x_axis_map_to_yaw) || numSticks) && !keyboardYawOverride && !capsLockCustomView)
4553 stick_yaw = max_flight_yaw * (-reqYaw);
4554 if (flightYaw < stick_yaw)
4557 if (flightYaw > stick_yaw)
4558 flightYaw = stick_yaw;
4560 if (flightYaw > stick_yaw)
4563 if (flightYaw < stick_yaw)
4564 flightYaw = stick_yaw;
4566 yawing = (fabs(reqYaw) > 0.0);
4570 if (flightYaw > 0.0)
4573 else flightYaw = 0.0;
4575 if (flightYaw < 0.0)
4578 else flightYaw = 0.0;
4345- (void) pollFlightArrowKeyControls:(
double)delta_t {
…}
4591- (void) pollGuiScreenControlsWithFKeyAlias:(BOOL)fKeyAlias
4593 if(!pollControls && fKeyAlias)
4598 BOOL docked_okay = ([
self status] == STATUS_DOCKED);
4601 if ([
self checkKeyPress:n_key_gui_screen_status fKey_only:!fKeyAlias])
4606 if (gui_screen == GUI_SCREEN_STATUS)
4621 if ([
self checkKeyPress:n_key_gui_chart_screens fKey_only:!fKeyAlias])
4629 if (
EXPECT_NOT([
self status] == STATUS_WITCHSPACE_COUNTDOWN && gui_screen == GUI_SCREEN_SHORT_RANGE_CHART))
4634 else if (gui_screen == GUI_SCREEN_SHORT_RANGE_CHART || (gui_screen == GUI_SCREEN_SYSTEM_DATA && showingLongRangeChart))
4638 saved_chart_zoom = target_chart_zoom;
4648 target_chart_zoom = saved_chart_zoom;
4661 if ([
self checkKeyPress:n_key_gui_system_data fKey_only:!fKeyAlias])
4663 if (gui_screen != GUI_SCREEN_SYSTEM_DATA)
4665 showingLongRangeChart = (gui_screen == GUI_SCREEN_LONG_RANGE_CHART);
4671 if ([
self checkKeyPress:n_key_gui_market fKey_only:!fKeyAlias])
4673 if (gui_screen != GUI_SCREEN_MARKET)
4690 if (([
self checkKeyPress:n_key_gui_screen_options fKey_only:!fKeyAlias]) && (gui_screen != GUI_SCREEN_OPTIONS))
4696 if ([
self checkKeyPress:n_key_gui_screen_equipship fKey_only:!fKeyAlias])
4703 if ((gui_screen == GUI_SCREEN_EQUIP_SHIP) && [[
self dockedStation] hasShipyard])
4728 if ([
self checkKeyPress:n_key_gui_screen_interfaces fKey_only:!fKeyAlias])
4591- (void) pollGuiScreenControlsWithFKeyAlias:(BOOL)fKeyAlias {
…}
4738- (void) pollGameOverControls:(
double)delta_t
4741 if ([gameView isDown:32])
4745 [UNIVERSE displayMessage:@"" forCount:1.0];
4738- (void) pollGameOverControls:(
double)delta_t {
…}
4759- (void) pollAutopilotControls:(
double)delta_t
4762 if (gui_screen == GUI_SCREEN_KEYBOARD_ENTRY || gui_screen == GUI_SCREEN_KEYBOARD_CONFIG || gui_screen == GUI_SCREEN_KEYBOARD_LAYOUT || gui_screen == GUI_SCREEN_KEYBOARD || gui_screen == GUI_SCREEN_KEYBOARD_CONFIRMCLEAR)
return;
4767 if (![[
UNIVERSE gameController] isGamePaused])
4778 if ([
self checkKeyPress:n_key_autopilot] || joyButtonState[
BUTTON_DOCKCPU]
4784 [UNIVERSE addMessage:DESC(@"autopilot-off") forCount:4.5];
4811 if (([
self checkKeyPress:n_key_pausebutton] || joyButtonState[
BUTTON_PAUSE]) && gui_screen != GUI_SCREEN_SHORT_RANGE_CHART && gui_screen != GUI_SCREEN_MISSION && gui_screen != GUI_SCREEN_KEYBOARD_ENTRY)
4831 if ([
self checkKeyPress:n_key_pausebutton] || joyButtonState[
BUTTON_PAUSE])
4759- (void) pollAutopilotControls:(
double)delta_t {
…}
4849- (void) pollDockedControls:(
double)delta_t
4854 NSString *exceptionContext =
@"setup";
4859 exceptionContext =
@"pause key";
4860 if (([
self checkKeyPress:n_key_pausebutton] || joyButtonState[
BUTTON_PAUSE]) && (gui_screen != GUI_SCREEN_LONG_RANGE_CHART &&
4861 gui_screen != GUI_SCREEN_MISSION && gui_screen != GUI_SCREEN_REPORT &&
4862 gui_screen != GUI_SCREEN_SAVE && gui_screen != GUI_SCREEN_KEYBOARD_ENTRY) )
4866 if ([gameController isGamePaused])
4870 if ([
UNIVERSE pauseMessageVisible])
4872 [UNIVERSE clearPreviousMessage];
4874 [[UNIVERSE gui] setForegroundTextureKey:@"docked_overlay"];
4880 [[UNIVERSE messageGUI] clear];
4882 [UNIVERSE pauseGame];
4892 if ([gameController isGamePaused])
return;
4896 exceptionContext =
@"undock";
4897 if ([
self checkKeyPress:n_key_launch_ship])
4899 if (
EXPECT((gui_screen != GUI_SCREEN_MISSION || _missionAllowInterrupt) && gui_screen != GUI_SCREEN_KEYBOARD_ENTRY))
4908 exceptionContext =
@"GUI keys";
4909 if (gui_screen == GUI_SCREEN_MISSION || gui_screen == GUI_SCREEN_KEYBOARD_ENTRY)
4920 @catch (NSException *exception)
4922 OOLog(
kOOLogException,
@"***** Exception in pollDockedControls [%@]: %@ : %@", exceptionContext, [exception name], [exception reason]);
4849- (void) pollDockedControls:(
double)delta_t {
…}
4930 [UNIVERSE setUpUniverseFromStation];
4942- (void) pollDemoControls:(
double)delta_t
4946 NSUInteger end_row = 21;
4951 case GUI_SCREEN_INTRO1:
4959 if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 2+row_zero)
4962 [UNIVERSE removeDemoShips];
4964 if (![
self loadPlayer])
4971 if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 1+row_zero)
4976 else if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 3+row_zero)
4980 else if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 4+row_zero)
4984 else if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 5+row_zero)
4988 else if (([gameView isDown:
gvMouseDoubleClick] || [
self checkKeyPress:n_key_gui_select]) && [gui selectedRow] == 6+row_zero)
4990 [[UNIVERSE gameController] exitAppWithContext:@"Exit Game selected on start screen"];
5004 case GUI_SCREEN_GAMEOPTIONS:
5008 case GUI_SCREEN_KEYBOARD:
5016 case GUI_SCREEN_KEYBOARD_CONFIRMCLEAR:
5020 case GUI_SCREEN_KEYBOARD_CONFIG:
5024 case GUI_SCREEN_KEYBOARD_ENTRY:
5028 case GUI_SCREEN_KEYBOARD_LAYOUT:
5032 case GUI_SCREEN_STICKMAPPER:
5036 case GUI_SCREEN_STICKPROFILE:
5040 case GUI_SCREEN_SHIPLIBRARY:
5041 if ([gameView isDown:
' '])
5046 if ([
self checkKeyPress:n_key_gui_arrow_up])
5049 [UNIVERSE selectIntro2Previous];
5051 if ([
self checkKeyPress:n_key_gui_arrow_down])
5054 [UNIVERSE selectIntro2Next];
5058 if ([
self checkKeyPress:n_key_gui_arrow_left])
5061 [UNIVERSE selectIntro2PreviousCategory];
5063 if ([
self checkKeyPress:n_key_gui_arrow_right])
5066 [UNIVERSE selectIntro2NextCategory];
5073 case GUI_SCREEN_NEWGAME:
5074 if ([
self handleGUIUpDownArrowKeys])
5081 if ([
self checkKeyPress:n_key_gui_page_up])
5093 else if ([
self checkKeyPress:n_key_gui_page_down])
5111 if (![
self startScenario])
5113 [UNIVERSE removeDemoShips];
5125 case GUI_SCREEN_OXZMANAGER:
5128 if (
EXPECT(![oxzmanager isRestarting]))
5130 if ([oxzmanager isAcceptingGUIInput])
5132 if ([oxzmanager isAcceptingTextInput])
5141 if ([
self handleGUIUpDownArrowKeys])
5146 if ([
self checkKeyPress:n_key_gui_arrow_left] || [
self checkKeyPress:n_key_gui_page_up])
5153 else if ([
self checkKeyPress:n_key_gui_arrow_right] || [
self checkKeyPress:n_key_gui_page_down])
5166 if ([oxzmanager isAcceptingTextInput])
5182 if ([
self checkKeyPress:n_key_oxzmanager_setfilter] ||
5183 [
self checkKeyPress:n_key_oxzmanager_showinfo] ||
5184 [
self checkKeyPress:n_key_oxzmanager_extract])
5189 if ([
self checkKeyPress:n_key_oxzmanager_setfilter])
5193 else if ([
self checkKeyPress:n_key_oxzmanager_showinfo])
5197 else if ([
self checkKeyPress:n_key_oxzmanager_extract])
5213 case GUI_SCREEN_MISSION:
5214 if ([[
self hud] allowBigGui])
5218 if (_missionTextEntry)
5240 else if ([[gui keyForRow:end_row] isEqual:
@"spacebar"])
5242 if ([gameView isDown:32])
5261 NSString *extraKey =
@"";
5262 if (extraMissionKeys)
5264 NSString *key =
nil;
5265 foreach (key, [extraMissionKeys allKeys])
5267 if ([
self checkKeyPress:[extraMissionKeys oo_arrayForKey:key]]) {
5270 extraKey = [
key copy];
5278 if ([
self checkKeyPress:n_key_gui_select] || [gameView isDown:
gvMouseDoubleClick] || [extraKey length] > 0)
5287 if ([extraKey length] == 0) extraKey =
@"enter";
5307#if OO_USE_CUSTOM_LOAD_SAVE
5309 case GUI_SCREEN_LOAD:
4942- (void) pollDemoControls:(
double)delta_t {
…}
5332 if (_missionAllowInterrupt)
5334 if (gui_screen == GUI_SCREEN_MISSION && _missionTextEntry)
5341 if (gui_screen != GUI_SCREEN_MISSION)
5343 if (gui_screen != GUI_SCREEN_SYSTEM_DATA)
5345 [UNIVERSE removeDemoShips];
5355 [UNIVERSE removeDemoShips];
5356 [[UNIVERSE gui] clearBackground];
5362 if (_missionWithCallback)
5367 if ([
self status] != STATUS_DOCKED)
5374 if (gui_screen != GUI_SCREEN_MISSION)
5388 if ([
self status] != STATUS_DOCKED)
5394 switch (_missionExitScreen)
5396 case GUI_SCREEN_MANIFEST:
5400 case GUI_SCREEN_EQUIP_SHIP:
5404 case GUI_SCREEN_SHIPYARD:
5405 if ([[
self dockedStation] hasShipyard])
5409 [[UNIVERSE gui] setSelectedRow:GUI_ROW_SHIPYARD_START];
5418 case GUI_SCREEN_LONG_RANGE_CHART:
5421 case GUI_SCREEN_SHORT_RANGE_CHART:
5424 case GUI_SCREEN_SYSTEM_DATA:
5428 case GUI_SCREEN_MARKET:
5432 case GUI_SCREEN_MARKETINFO:
5436 case GUI_SCREEN_INTERFACES:
5439 case GUI_SCREEN_STATUS:
5452- (void) switchToThisView:(
OOViewID)viewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing
5452- (void) switchToThisView:(
OOViewID)viewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing {
…}
5458- (void) switchToThisView:(
OOViewID)viewDirection fromView:(
OOViewID)oldViewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing justNotify:(BOOL)justNotify
5463 [UNIVERSE setViewDirection:viewDirection];
5465 if (processWeaponFacing)
5468 switch (viewDirection)
5482 case VIEW_STARBOARD:
5492 currentWeaponFacing = facing;
5500 if ((oldViewDirection != viewDirection || viewDirection == VIEW_CUSTOM) && ![[
UNIVERSE gameController] isGamePaused])
5458- (void) switchToThisView:(
OOViewID)viewDirection fromView:(
OOViewID)oldViewDirection andProcessWeaponFacing:(BOOL)processWeaponFacing justNotify:(BOOL)justNotify {
…}
5510- (void) handleAutopilotOn:(BOOL)fastDocking
5512 NSString *message =
nil;
5525 if (![target isStation])
5532 for (i = 0; i < uni->
n_entities && nStations < 2; i++)
5534 if (entities[i]->isStation && [entities[i] isKindOfClass:[
StationEntity class]] &&
5538 target = entities[
i];
5545 if ([
self withinStationAegis] && legalStatus <= 50)
5547 target = [UNIVERSE station];
5549 else if (nStations != 1)
5559 message =
OOExpandKey(
@"autopilot-multiple-targets");
5571 if (![ts allowsAutoDocking])
5574 message =
OOExpandKey(
@"autopilot-station-does-not-allow-autodocking", stationName);
5577 else if ((legalStatus > 50 && ts == [
UNIVERSE station]) || [ts isHostileTo:
self])
5580 message =
OOExpandKey((ts == [
UNIVERSE station]) ?
@"autopilot-denied" :
@"autopilot-target-docking-instructions-denied", stationName);
5583 else if (fastDocking && [ts allowsFastDocking])
5586 NSEnumerator *subEnum =
nil;
5588 for (subEnum = [ts dockSubEntityEnumerator]; (sub = [
subEnum nextObject]); )
5591 if([[sub canAcceptShipForDocking:
self] isEqualToString:
@"TOO_BIG_TO_DOCK"])
5593 message =
OOExpandKey((ts == [
UNIVERSE station]) ?
@"autopilot-denied" :
@"autopilot-target-docking-instructions-denied", stationName);
5598 if (legalStatus > 0)
5602 int government = 1 + [[UNIVERSE currentSystemData] oo_intForKey:KEY_GOVERNMENT];
5603 if ([
UNIVERSE inInterstellarSpace]) government = 2;
5604 fine_chance /= government;
5605 if (fine_chance < legalStatus)
5613 [UNIVERSE forceWitchspaceEntries];
5614 ship_clock_adjust += 1200.0;
5617 [UNIVERSE setViewDirection:VIEW_FORWARD];
5629 if (message !=
nil) [UNIVERSE addMessage:message forCount:4.5];
5510- (void) handleAutopilotOn:(BOOL)fastDocking {
…}
5640 ident_engaged = YES;
5641 if ([
self primaryTarget] ==
nil)
5644 [UNIVERSE addMessage:OOExpandKey(@"ident-on") forCount:2.0];
5656 if (![
self weaponsOnline])
5670 if ([missile_entity[activeMissile] isMissile])
5672 if ([[
self primaryTarget] isShip])
5682 if ([
self primaryTarget] !=
nil)
5688 [UNIVERSE addMessage:OOExpandKey(@"missile-armed", weaponName) forCount:2.0];
5692 else if ([missile_entity[activeMissile] isMine])
5695 [UNIVERSE addMessage:OOExpandKey(@"mine-armed", weaponName) forCount:2.0];
#define SCANNER_MAX_RANGE2
#define MINIMUM_GAME_TICK
#define MAIN_GUI_PIXEL_WIDTH
#define MAIN_GUI_PIXEL_HEIGHT
OOINLINE jsval OOJSValueFromViewID(JSContext *context, OOViewID value)
void OOInitDebugSupport(void)
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
#define STICK_AXISUNASSIGNED
@ BUTTON_DOCKINGCLEARANCE
@ BUTTON_TARGETINCOMINGMISSILE
@ BUTTON_ACTIVATEEQUIPMENT
@ BUTTON_WEAPONSONLINETOGGLE
@ BUTTON_COMPASSMODE_PREV
@ BUTTON_PRIMEEQUIPMENT_PREV
#define OOLogWARN(class, format,...)
#define OOLogERR(class, format,...)
NSString *const kOOLogException
#define OOLog(class, format,...)
NSString *const kOOLogParameterError
void OOLogSetDisplayMessagesInClass(NSString *inClass, BOOL inFlag)
BOOL OOMouseInteractionModeIsFlightMode(OOMouseInteractionMode mode)
void quaternion_rotate_about_axis(Quaternion *quat, Vector axis, OOScalar angle)
#define OOExpandKey(key,...)
#define OOExpand(string,...)
NSString * OOCommodityType
uint64_t OOCreditsQuantity
@ WEAPON_FACING_STARBOARD
#define MAX_ROWS_SHIPS_FOR_SALE
#define GUI_ROW_SHIPYARD_START
static BOOL speech_settings_pressed
static BOOL musicModeKeyPressed
static BOOL cycleMFD_pressed
static BOOL extra_gui_key_pressed
static BOOL selectPressed
static NSPoint centre_at_mouse_click
static BOOL shaderSelectKeyPressed
static BOOL prime_equipment_pressed
static BOOL pageUpDownKeyPressed
static BOOL ident_pressed
static BOOL chartInfoPressed
static BOOL dump_target_state_pressed
static BOOL next_target_pressed
static BOOL rotateCargo_pressed
static BOOL taking_snapshot
static BOOL switching_chart_screens
static BOOL upDownKeyPressed
static BOOL previous_target_pressed
static BOOL next_planet_info_pressed
static BOOL m_key_pressed
static NSTimeInterval time_last_frame
static OOWeaponFacing saved_weapon_facing
static BOOL mode_equipment_pressed
#define CUSTOM_VIEW_SPEED_REDUCTION_FACTOR
static BOOL fire_missile_pressed
static BOOL autopilot_pause
static BOOL safety_pressed
static BOOL target_incoming_missile_pressed
static BOOL switching_equipship_screens
static BOOL galhyperspace_pressed
static int saved_gui_screen
static BOOL target_info_pressed
static BOOL wait_for_key_up
static BOOL next_missile_pressed
static BOOL weaponsOnlineToggle_pressed
static BOOL home_info_pressed
static BOOL switching_status_screens
static BOOL f_key_pressed
static BOOL hyperspace_pressed
static BOOL volumeControlPressed
static BOOL fast_autopilot_key_pressed
static BOOL hdrPaperWhiteControlPressed
#define CUSTOM_VIEW_ZOOM_SPEED
static BOOL leftRightKeyPressed
static BOOL fastactivate_a_pressed
static BOOL fovControlPressed
static BOOL previous_planet_info_pressed
static BOOL switchMFD_pressed
static BOOL extra_key_pressed
static BOOL hide_hud_pressed
static int saved_view_direction
static BOOL mouse_left_down
static BOOL pause_pressed
#define LOAD_KEY_SETTING2(name, default_1, shift_1, mod1_1, default_2, shift_2, mod1_2)
static BOOL escapePodKey_pressed
static BOOL next_compass_mode_pressed
static BOOL activate_equipment_pressed
static BOOL disc_operation_in_progress
static BOOL oxz_manager_pressed
static BOOL pling_pressed
#define CUSTOM_VIEW_ROTATE_SPEED
static BOOL prev_compass_mode_pressed
static BOOL customView_pressed
static BOOL f9_key_pressed
static NSUInteger searchStringLength
static double saved_script_time
static BOOL colorblindModeControlPressed
static BOOL dump_entity_list_pressed
static BOOL toggling_music
static NSPoint mouse_click_position
static BOOL playing_music
static BOOL fastactivate_b_pressed
static BOOL target_missile_pressed
static BOOL cursor_moving
static BOOL mouse_x_axis_map_to_yaw
static BOOL autopilot_key_pressed
static BOOL docking_clearance_request_key_pressed
static BOOL switching_resolution
static double timeLastKeyPress
static BOOL hdrMaxBrightnessControlPressed
#define GUI_ROW_KC_FUNCSTART
#define GUI_ROW_FUNCSTART
#define CHART_SCREEN_VERTICAL_CENTRE
#define PORT_FACING_STRING
#define CHART_ZOOM_SHOW_LABELS
#define YAW_DAMPING_FACTOR
#define ROLL_DAMPING_FACTOR
#define MANIFEST_SCREEN_ROW_BACK
#define SCANNER_ZOOM_RATE_DOWN
#define FORWARD_FACING_STRING
#define AFT_FACING_STRING
#define KEY_REPEAT_INTERVAL
#define CHART_ZOOM_SPEED_FACTOR
#define MANIFEST_SCREEN_ROW_NEXT
#define GUI_ROW_INIT(GUI)
#define SCANNER_ZOOM_RATE_UP
#define GUI_ROW(GROUP, ITEM)
@ STATUS_EQUIPMENT_FIRST_ROW
@ GUI_ROW_SCENARIOS_START
@ STATUS_EQUIPMENT_MAX_ROWS
@ GUI_ROW_EQUIPMENT_START
@ STATUS_EQUIPMENT_BIGGUI_EXTRA_ROWS
@ GUI_ROW_INTERFACES_START
@ GUI_MAX_ROWS_INTERFACES
#define STARBOARD_FACING_STRING
#define CUSTOMEQUIP_EQUIPKEY
#define CHART_SCROLL_AT_Y
#define CHART_SCROLL_AT_X
@ MISSILE_STATUS_TARGET_LOCKED
#define KEYCONFIG_CUSTOMEQUIP
#define PITCH_DAMPING_FACTOR
#define MIN_HDR_MAXBRIGHTNESS
#define MIN_HDR_PAPERWHITE
#define MAX_HDR_MAXBRIGHTNESS
#define MAX_HDR_PAPERWHITE
#define INITIAL_SHOT_TIME
OOEquipmentType * OOWeaponType
#define DEFAULT_HYPERSPACE_SPIN_TIME
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString *string) PURE_FUNC
#define SHIP_THRUST_FACTOR
#define ShipScriptEvent(context, ship, event,...)
#define TIME_ACCELERATION_FACTOR_MAX
#define TIME_ACCELERATION_FACTOR_MIN
void cancelWitchspaceCountdown()
void clearPlanetSearchString()
BOOL handleGUIUpDownArrowKeys()
void initKeyConfigSettings()
void beginWitchspaceCountdown()
void setGuiToMissionEndScreen()
void handleKeyboardLayoutKeys()
void handleGameOptionsScreenKeys()
void handleStickMapperScreenKeys()
void pollMissionInterruptControls()
void pollMarketScreenControls()
void handleKeyMapperScreenKeys()
void pollGuiScreenControls()
void handleButtonTargetMissile()
void handleUndockControl()
void handleMissionCallback()
void pollCustomViewControls()
void pollApplicationControls()
void setGuiToIntroFirstGo:(BOOL justCobra)
void setGamePaused:(BOOL value)
void exitAppWithContext:(NSString *context)
void exitFullScreenMode()
void setMouseInteractionModeForFlight()
NSUInteger indexOfCurrentDisplayMode()
void pauseFullScreenModeToPerform:onTarget:(SEL selector,[onTarget] id target)
BOOL setDisplayWidth:Height:Refresh:(unsigned int d_width,[Height] unsigned int d_height,[Refresh] unsigned int d_refresh)
BOOL setSelectedRow:(OOGUIRow row)
void setStatusPage:(NSInteger pageNum)
NSString * selectedRowText()
void setText:forRow:align:(NSString *str,[forRow] OOGUIRow row,[align] OOGUIAlignment alignment)
NSString * selectedRowKey()
NSString * keyForRow:(OOGUIRow row)
void setKey:forRow:(NSString *str,[forRow] OOGUIRow row)
void setHidden:(BOOL newValue)
void grabMouseInsideGameWindow:(BOOL value)
void clearKey:(int theKey)
void setFov:fromFraction:(float value,[fromFraction] BOOL fromFraction)
void setGammaValue:(float value)
NSMutableString * typedString
void setScreenSize:(int sizeIndex)
NSPoint virtualJoystickPosition
float fov:(BOOL inFraction)
void allowStringInput:(BOOL value)
void setStringInput:(enum StringInput value)
BOOL snapShot:(NSString *filename)
BOOL setDebugger:(id< OODebuggerInterface > debugger)
OODebugMonitor * sharedDebugMonitor()
OOEquipmentType * equipmentTypeWithIdentifier:(NSString *identifier)
void runCallback:(NSString *key)
NSDictionary * registerKeys()
NSDictionary * axisFunctions()
const BOOL * getAllButtonStates()
double getAxisState:(int function)
NSUInteger joystickCount()
void clearStickButtonState:(int stickButton)
void toggleDockingMusic()
OOMusicController * sharedController()
void setMode:(OOMusicMode mode)
void processOptionsNext()
void processTextInput:(NSString *input)
void processOptionsPrev()
OOOXZManager * sharedManager()
void refreshTextInput:(NSString *input)
void processShowInfoKey()
void setMasterVolume:(float fraction)
void setGuiToMissionEndScreen()
void setGuiToSystemDataScreen()
OOWeaponType currentWeapon()
void playAutopilotOutOfRange()
void cycleNextMultiFunctionDisplay:(NSUInteger index)
void pollGuiArrowKeyControls:(double delta_t)
void overwriteCommanderInputHandler()
void customViewPanRight:(OOScalar angle)
void playNextEquipmentSelected()
void setNextCompassMode()
void setGuiToLongRangeChartScreen()
void setGuiToScenarioScreen:(int page)
BOOL engageAutopilotToStation:(StationEntity *stationForDocking)
void setGuiToLoadSaveScreen()
void pollAutopilotControls:(double delta_t)
void cyclePreviousMultiFunctionDisplay:(NSUInteger index)
ShipEntity * launchEscapeCapsule()
void setGuiToChartScreenFrom:(OOGUIScreenID oldScreen)
void activateSelectedInterface()
void setGuiToMarketScreen()
void setGuiToGameOptionsScreen()
void customViewRotateDown:(OOScalar angle)
void playMenuPagePrevious()
void saveCommanderInputHandler()
BOOL checkKeyPress:(NSArray *key_def)
void setGuiToInterfacesScreen:(int skip)
void handleKeyboardLayoutKeys()
void playMenuNavigationDown()
void handleAutopilotOn:(BOOL fastDocking)
void handleGameOptionsScreenKeys()
void pollGuiScreenControlsWithFKeyAlias:(BOOL fKeyAlias)
void setPrevCompassMode()
void playGalacticHyperspace()
void pollFlightControls:(double delta_t)
NSString * screenModeStringForWidth:height:refreshRate:(unsigned inWidth,[height] unsigned inHeight,[refreshRate] float inRate)
void setGuiToStatusScreen()
void customViewPanUp:(OOScalar angle)
void customViewZoomOut:(OOScalar rate)
void activatePrimableEquipment:withMode:(NSUInteger index,[withMode] OOPrimedEquipmentMode mode)
BOOL loadPlayerFromFile:asNew:(NSString *fileToOpen,[asNew] BOOL asNew)
void handleStickMapperScreenKeys()
void setGuiToMarketInfoScreen()
OOLongRangeChartMode longRangeChartMode
void playMenuNavigationNot()
void setGuiToShipyardScreen:(NSUInteger skip)
BOOL trySellingCommodity:all:(OOCommodityType type,[all] BOOL all)
StationEntity * dockedStation()
void setShowDemoShips:(BOOL value)
void cancelWitchspaceCountdown()
void customViewRotateUp:(OOScalar angle)
void endMissionScreenAndNoteOpportunity()
void setWeaponsOnline:(BOOL newValue)
void targetNewSystem:(int direction)
void stickMapperInputHandler:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
void setDockingClearanceStatus:(OODockingClearanceStatus newValue)
void targetNearestIncomingMissile()
void stopAfterburnerSound()
void beginWitchspaceCountdown:(int spin_time)
NSUInteger eqScriptIndexForKey:(NSString *eq_key)
NSArray * applyMarketFilter:onMarket:(NSArray *goods,[onMarket] OOCommodityMarket *market)
void pollMissionInterruptControls()
void clearPlanetSearchString()
OOCreditsQuantity priceForShipKey:(NSString *key)
void setGuiToKeyboardLayoutScreen:resetCurrentRow:(unsigned skip,[resetCurrentRow] BOOL resetCurrentRow)
void customViewRollLeft:(OOScalar angle)
void pollFlightArrowKeyControls:(double delta_t)
void showScenarioDetails()
void playCantBuyCommodity()
void setInfoSystemID:moveChart:(OOSystemID sid,[moveChart] BOOL moveChart)
void noteGUIWillChangeTo:(OOGUIScreenID toScreen)
void resetStickFunctions()
void customViewRotateRight:(OOScalar angle)
void showInformationForSelectedInterface()
int getFirstKeyCode:(NSArray *key_def)
NSString * fastEquipmentA()
void setGuiToDockingReportScreen()
void stickProfileInputHandler:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
void setMissionChoice:keyPress:(NSString *newChoice,[keyPress] NSString *keyPress)
OOCommodityType dumpCargo()
void handleKeyMapperConfirmClearKeys:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
NSString * commanderSelector()
void pollMarketScreenControls()
void keyMapperInputHandler:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
void playMenuNavigationUp()
void previousInfoSystem()
void handleKeyConfigEntryKeys:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
void showInformationForSelectedUpgradeWithFormatString:(NSString *extraString)
void customViewRotateLeft:(OOScalar angle)
void handleKeyboardLayoutEntryKeys:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
void customViewZoomIn:(OOScalar rate)
void pollGameOverControls:(double delta_t)
void handleKeyMapperScreenKeys()
void handleKeyConfigKeys:view:(GuiDisplayGen *gui,[view] MyOpenGLView *gameView)
ShipEntity * fireMissile()
void targetNewSystem:whileTyping:(int direction, [whileTyping] BOOL whileTyping)
void setLongRangeChartMode:(OOLongRangeChartMode mode)
void refreshMissionScreenTextEntry()
void setDockedAtMainStation()
void playJumpMassLocked()
void selectPreviousMultiFunctionDisplay()
void startAfterburnerSound()
void pollGuiScreenControls()
void playCantSellCommodity()
void setGuiToShortRangeChartScreen()
NSString * fastEquipmentB()
NSPoint adjusted_chart_centre()
void playAutopilotCannotDockWithTarget()
void setGuiToStickMapperScreen:resetCurrentRow:(unsigned skip,[resetCurrentRow] BOOL resetCurrentRow)
void playDismissedMissionScreen()
void switchToThisView:fromView:andProcessWeaponFacing:justNotify:(OOViewID viewDirection,[fromView] OOViewID oldViewDirection,[andProcessWeaponFacing] BOOL processWeaponFacing,[justNotify] BOOL justNotify)
void currentWeaponStats()
void handleButtonTargetMissile()
void setGuiToOXZManager()
void performDockingRequest:(StationEntity *stationForDocking)
void pollDockedControls:(double delta_t)
void disengageAutopilot()
void playStandardHyperspace()
BOOL handleGUIUpDownArrowKeys()
void playLaserHit:offset:weaponIdentifier:(BOOL hit,[offset] Vector weaponOffset,[weaponIdentifier] NSString *weaponIdentifier)
BOOL checkKeyPress:fKey_only:ignore_ctrl:(NSArray *key_def,[fKey_only] BOOL fKey_only,[ignore_ctrl] BOOL ignore_ctrl)
void printIdentLockedOnForMissile:(BOOL missile)
void playMissileLockedOn()
void playDismissedReportScreen()
void playNextMissileSelected()
void switchToThisView:(OOViewID viewDirection)
void customViewPanDown:(OOScalar angle)
void noteGUIDidChangeFrom:to:(OOGUIScreenID fromScreen,[to] OOGUIScreenID toScreen)
void enterDock:(StationEntity *station)
void handleUndockControl()
void handleMissionCallback()
void pollDemoControls:(double delta_t)
void playHyperspaceAborted()
void pollCustomViewControls()
void setCustomViewDataFromDictionary:withScaling:(NSDictionary *viewDict,[withScaling] BOOL withScaling)
void playWeaponsOffline()
void pollApplicationControls()
OOSystemID nextHopTargetSystemID()
BOOL tryBuyingCommodity:all:(OOCommodityType type,[all] BOOL all)
void initKeyConfigSettings()
void customViewPanLeft:(OOScalar angle)
NSArray * applyMarketSorter:onMarket:(NSArray *goods,[onMarket] OOCommodityMarket *market)
void setGuiToManifestScreen()
void showShipyardInfoForSelection()
void setGuiToKeyMapperScreen:resetCurrentRow:(unsigned skip,[resetCurrentRow] BOOL resetCurrentRow)
void showInformationForSelectedUpgrade()
void selectNextMultiFunctionDisplay()
void setGuiToEquipShipScreen:(int skip)
void customViewRollRight:(OOScalar angle)
BOOL doWorldEventUntilMissionScreen:(jsid message)
OOCommodityMarket * localMarket()
NSArray * processKeyCode:(NSArray *key_def)
BOOL moveTargetMemoryBy:(NSInteger delta)
NSArray * currentLaserOffset()
void switchToThisView:andProcessWeaponFacing:(OOViewID viewDirection,[andProcessWeaponFacing] BOOL processWeaponFacing)
NSDictionary * dictionaryFromFilesNamed:inFolder:mergeMode:cache:(NSString *fileName,[inFolder] NSString *folderName,[mergeMode] OOResourceMergeMode mergeMode,[cache] BOOL useCache)
void decrease_flight_roll:(double delta)
void setStatus:(OOEntityStatus stat)
void doScriptEvent:(jsid message)
void decrease_flight_yaw:(double delta)
void doScriptEvent:withArguments:(jsid message,[withArguments] NSArray *arguments)
ShipEntity * shipHitByLaser()
void increase_flight_yaw:(double delta)
void doScriptEvent:withArgument:(jsid message,[withArgument] id argument)
void decrease_flight_pitch:(double delta)
void increase_flight_pitch:(double delta)
void increase_flight_roll:(double delta)
void doScriptEvent:withArgument:andArgument:(jsid message,[withArgument] id argument1,[andArgument] id argument2)
Entity * sortedEntities[UNIVERSE_MAX_ENTITIES+1]
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque