81 NSPoint mouse_position = NSMakePoint(
82 [gameView virtualJoystickPosition].
x * [gui
size].width,
83 [gameView virtualJoystickPosition].
y * [gui
size].height );
101 switch ([gui selectedRow])
104 if ([
self checkKeyPress:n_key_gui_arrow_left])
112 else if ([
self checkKeyPress: n_key_gui_arrow_right])
127 if ([
self checkKeyPress:n_key_gui_arrow_left])
135 else if ([
self checkKeyPress: n_key_gui_arrow_right])
150 if ([
self checkKeyPress:n_key_gui_arrow_left])
158 else if ([
self checkKeyPress: n_key_gui_arrow_right])
173 if (![stickProfileScreen currentProfileIsSpline])
177 if ([
self checkKeyPress:n_key_gui_arrow_left])
185 else if ([
self checkKeyPress: n_key_gui_arrow_right])
200 if ([
self checkKeyPress:n_key_gui_arrow_left])
208 else if ([
self checkKeyPress: n_key_gui_arrow_right])
510- (void) graphProfile: (GLfloat) alpha at: (Vector) at size: (NSSize) size
516 NSArray *control_points;
518 if (!profile)
return;
519 graphRect = NSMakeRect(at.x, at.y,
size.width,
size.height);
521 OOGL(glColor4f(0.2,0.2,0.5,alpha));
523 glVertex3f(at.x,at.y,at.z);
524 glVertex3f(at.x +
size.width,at.y,at.z);
525 glVertex3f(at.x +
size.width,at.y +
size.height,at.z);
526 glVertex3f(at.x,at.y +
size.height,at.z);
528 OOGL(glColor4f(0.9,0.9,0.9,alpha));
531 for (i = 0; i <=
size.width - 20; i++)
533 glVertex3f(at.x+i+10,at.y+10+(
size.height-20)*[profile rawValue:((
float)i)/(
size.width-20)],at.z);
536 OOGL(glColor4f(0.5,0.0,0.5,alpha));
545 if (i == selected_control_point)
547 OOGL(glColor4f(1.0,0.0,0.0,alpha));
551 OOGL(glColor4f(0.0,1.0,0.0,alpha));
557 OOGL(glColor4f(0.9,0.9,0.0,alpha));
559 OODrawString(
DESC(
@"oolite-stickprofile-response"), at.x, at.y +
size.height - 10, at.z, NSMakeSize(8,10));
592 NSString *v1 =
@"||||||||||||||||||||";
593 NSString *v2 =
@"....................";
606 if (bars < 0) bars = 0;
607 if (bars > 20) bars = 20;
611 [
v1 substringToIndex: bars],
612 [
v2 substringToIndex: 20 - bars],
614 nil]
forRow: GUI_ROW_STICKPROFILE_DEADZONE];
623 if (bars < 0) bars = 0;
624 if (bars > 20) bars = 20;
626 [
NSString stringWithFormat: @"%@%@ (%.1f) ", [
v1 substringToIndex: bars], [
v2 substringToIndex: 20 - bars], power],
627 nil]
forRow: GUI_ROW_STICKPROFILE_POWER];
631 if (bars < 0) bars = 0;
632 if (bars > 20) bars = 20;
634 [
NSString stringWithFormat: @"%@%@ (%0.2f) ", [
v1 substringToIndex: bars], [
v2 substringToIndex: 20 - bars], value],
635 nil]
forRow: GUI_ROW_STICKPROFILE_PARAM];
643 [
gui setText: DESC(@"oolite-stickprofile-spline-instructions")
forRow: GUI_ROW_STICKPROFILE_PARAM];
650 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
void OODrawStringAligned(NSString *text, GLfloat x, GLfloat y, GLfloat z, NSSize siz, BOOL rightAlign)
void OODrawString(NSString *text, GLfloat x, GLfloat y, GLfloat z, NSSize siz)