589{
592 NSString *v1 = @"||||||||||||||||||||";
593 NSString *v2 = @"....................";
594 int bars;
595 double value;
596 double power;
597
599 tabStop[0] = 50;
600 tabStop[1] = 140;
601 [gui setTabStops:tabStop];
602 [gui setArray: [NSArray arrayWithObjects: DESC(@"oolite-stickprofile-axis"), [self currentAxis], nil ] forRow: GUI_ROW_STICKPROFILE_AXIS];
603 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_AXIS];
606 if (bars < 0) bars = 0;
607 if (bars > 20) bars = 20;
608 [gui setArray: [NSArray arrayWithObjects: DESC(@"oolite-stickprofile-deadzone"),
609 [NSString stringWithFormat:
610 @"%@%@ (%0.4f)",
611 [v1 substringToIndex: bars],
612 [v2 substringToIndex: 20 - bars],
613 value],
614 nil] forRow: GUI_ROW_STICKPROFILE_DEADZONE];
615 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_DEADZONE];
616 [gui setArray: [NSArray arrayWithObjects: DESC(@"oolite-stickprofile-profile-type"), [self profileType], nil ] forRow: GUI_ROW_STICKPROFILE_PROFILE_TYPE];
617 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_PROFILE_TYPE];
619 {
621 power = [standard_profile
power];
623 if (bars < 0) bars = 0;
624 if (bars > 20) bars = 20;
625 [gui setArray: [NSArray arrayWithObjects: DESC(@"oolite-stickprofile-range"),
626 [NSString stringWithFormat: @"%@%@ (%.1f) ", [v1 substringToIndex: bars], [v2 substringToIndex: 20 - bars], power],
627 nil] forRow: GUI_ROW_STICKPROFILE_POWER];
628 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_POWER];
630 bars = 20*value;
631 if (bars < 0) bars = 0;
632 if (bars > 20) bars = 20;
633 [gui setArray: [NSArray arrayWithObjects: DESC(@"oolite-stickprofile-sensitivity"),
634 [NSString stringWithFormat: @"%@%@ (%0.2f) ", [v1 substringToIndex: bars], [v2 substringToIndex: 20 - bars], value],
635 nil] forRow: GUI_ROW_STICKPROFILE_PARAM];
636 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_PARAM];
638 }
639 else
640 {
641 [gui setText: @"" forRow: GUI_ROW_STICKPROFILE_POWER];
642 [gui setKey: GUI_KEY_SKIP forRow: GUI_ROW_STICKPROFILE_POWER];
643 [gui setText: DESC(@"oolite-stickprofile-spline-instructions") forRow: GUI_ROW_STICKPROFILE_PARAM];
644 [gui setKey: GUI_KEY_SKIP forRow: GUI_ROW_STICKPROFILE_PARAM];
646 }
647 [gui setText: DESC(@"gui-back") forRow: GUI_ROW_STICKPROFILE_BACK];
648 [gui setKey: GUI_KEY_OK forRow: GUI_ROW_STICKPROFILE_BACK];
649 [gui setSelectableRange: NSMakeRange(1, GUI_ROW_STICKPROFILE_BACK)];
650 [[UNIVERSE gameView] suppressKeysUntilKeyUp];
651 [gui setForegroundTextureKey:[PLAYER status] == STATUS_DOCKED ? @"docked_overlay" : @"paused_overlay"];
652 [gui setBackgroundTextureKey: @"settings"];
653 return;
654}
#define STICK_MAX_DEADZONE
#define STICKPROFILE_MAX_POWER
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque