80 NSPoint mouse_position = NSMakePoint(
81 [gameView virtualJoystickPosition].
x * [gui
size].width,
82 [gameView virtualJoystickPosition].
y * [gui
size].height);
96 switch ([gui selectedRow]) {
98 if ([
self checkKeyPress:n_key_gui_arrow_left]) {
103 }
else if ([
self checkKeyPress:n_key_gui_arrow_right]) {
114 if ([
self checkKeyPress:n_key_gui_arrow_left]) {
119 }
else if ([
self checkKeyPress:n_key_gui_arrow_right]) {
130 if ([
self checkKeyPress:n_key_gui_arrow_left]) {
135 }
else if ([
self checkKeyPress:n_key_gui_arrow_right]) {
146 if (![stickProfileScreen currentProfileIsSpline]) {
148 if ([
self checkKeyPress:n_key_gui_arrow_left]) {
153 }
else if ([
self checkKeyPress:n_key_gui_arrow_right]) {
162 if ([
self checkKeyPress:n_key_gui_arrow_left]) {
167 }
else if ([
self checkKeyPress:n_key_gui_arrow_right]) {
439- (void)graphProfile:(GLfloat)alpha at:(
Vector)at size:(NSSize)size
445 NSArray* control_points;
449 graphRect = NSMakeRect(at.
x, at.
y,
size.width,
size.height);
451 OOGL(glColor4f(0.2, 0.2, 0.5, alpha));
453 glVertex3f(at.
x, at.
y, at.
z);
454 glVertex3f(at.
x +
size.width, at.
y, at.
z);
455 glVertex3f(at.
x +
size.width, at.
y +
size.height, at.
z);
456 glVertex3f(at.
x, at.
y +
size.height, at.
z);
458 OOGL(glColor4f(0.9, 0.9, 0.9, alpha));
461 for (i = 0; i <=
size.width - 20; i++) {
462 glVertex3f(at.
x + i + 10, at.
y + 10 + (
size.height - 20) * [profile rawValue:((
float)i) / (
size.width - 20)], at.
z);
465 OOGL(glColor4f(0.5, 0.0, 0.5, alpha));
472 if (i == selected_control_point) {
473 OOGL(glColor4f(1.0, 0.0, 0.0, alpha));
475 OOGL(glColor4f(0.0, 1.0, 0.0, alpha));
481 OOGL(glColor4f(0.9, 0.9, 0.0, alpha));
514 NSString* v1 =
@"||||||||||||||||||||";
515 NSString* v2 =
@"....................";
535 [
v1 substringToIndex:bars],
536 [
v2 substringToIndex:20 - bars],
539 forRow:GUI_ROW_STICKPROFILE_DEADZONE];
552 [
NSString stringWithFormat:@"%@%@ (%.1f) ", [
v1 substringToIndex:bars], [
v2 substringToIndex:20 - bars], power],
554 forRow:GUI_ROW_STICKPROFILE_POWER];
563 [
NSString stringWithFormat:@"%@%@ (%0.2f) ", [
v1 substringToIndex:bars], [
v2 substringToIndex:20 - bars], value],
565 forRow:GUI_ROW_STICKPROFILE_PARAM];
571 [
gui setText:DESC(@"oolite-stickprofile-spline-instructions")
forRow:GUI_ROW_STICKPROFILE_PARAM];
578 [[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)