Skip to content

Commit

Permalink
Added joystick button support for docking computer (standard and fast…
Browse files Browse the repository at this point in the history
…) and next compass target.
  • Loading branch information
AnotherCommander committed Dec 31, 2018
1 parent 94df646 commit 036c0ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Resources/Config/descriptions.plist
Expand Up @@ -1656,6 +1656,9 @@
"stickmapper-scanner-zoom" = "Scanner zoom";
"stickmapper-scanner-unzoom" = "Scanner unzoom";
"stickmapper-jettison" = "Jettison cargo";
"stickmapper-dockcpu" = "Autopilot (standard)";
"stickmapper-dockcpufast" = "Autopilot (fast)";
"stickmapper-compass-mode-next" = "Next compass target";

"oolite-stickprofile-title" = "Joystick Profile";
"oolite-stickprofile-back" = "Back";
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Entities/PlayerEntityControls.m
Expand Up @@ -3,7 +3,7 @@
PlayerEntityControls.m

Oolite
Copyright (C) 2004-2013 Giles C Williams and contributors
Copyright (C) 2004-2019 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -3656,7 +3656,7 @@ - (void) pollViewControls
prev_compass_mode_pressed = NO;
}
// Compass mode '\'
if ([gameView isDown:key_next_compass_mode]) // look for the '\' key
if ([gameView isDown:key_next_compass_mode] || joyButtonState[BUTTON_COMPASSMODE]) // look for the '\' key
{
if ((!next_compass_mode_pressed)&&(compassMode != COMPASS_MODE_BASIC))
[self setNextCompassMode];
Expand Down
17 changes: 16 additions & 1 deletion src/Core/Entities/PlayerEntityStickMapper.m
Expand Up @@ -3,7 +3,7 @@
PlayerEntityStickMapper.m
Oolite
Copyright (C) 2004-2013 Giles C Williams and contributors
Copyright (C) 2004-2019 Giles C Williams and contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -660,6 +660,21 @@ - (NSArray *)stickFunctionList
axisfn:AXIS_FIELD_OF_VIEW
butfn:BUTTON_DEC_FIELD_OF_VIEW]];
#endif
[funcList addObject:
[self makeStickGuiDict:DESC(@"stickmapper-dockcpu")
allowable:HW_BUTTON
axisfn:STICK_NOFUNCTION
butfn:BUTTON_DOCKCPU]];
[funcList addObject:
[self makeStickGuiDict:DESC(@"stickmapper-dockcpufast")
allowable:HW_BUTTON
axisfn:STICK_NOFUNCTION
butfn:BUTTON_DOCKCPUFAST]];
[funcList addObject:
[self makeStickGuiDict:DESC(@"stickmapper-compass-mode-next")
allowable:HW_BUTTON
axisfn:STICK_NOFUNCTION
butfn:BUTTON_COMPASSMODE]];
return funcList;
}

Expand Down

0 comments on commit 036c0ee

Please sign in to comment.