Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
PlayerEntityStickMapper.h
Go to the documentation of this file.
1/*
2
3PlayerEntityStickMapper.h
4
5Joystick support for SDL implementation of Oolite.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
27#import "PlayerEntity.h"
28#import "GuiDisplayGen.h"
29#import "MyOpenGLView.h"
30#import "Universe.h"
31
32#define MAX_ROWS_FUNCTIONS 12
33
34#define GUI_ROW_STICKNAME 1
35// leave row 2 empty - we need it in case we have a
36// second joystick connected. Also, we need a different way
37// of listing joysticks, if we ever decide to support more
38// than the current maximum of 2 - Nikos 20151103
39#define GUI_ROW_STICKPROFILE 3
40#define GUI_ROW_HEADING 4
41#define GUI_ROW_FUNCSTART 5
42#define GUI_ROW_FUNCEND (GUI_ROW_FUNCSTART + MAX_ROWS_FUNCTIONS - 1)
43#define GUI_ROW_INSTRUCT 18
44
45// Dictionary keys
46#define KEY_HEADER @"header"
47#define KEY_GUIDESC @"guiDesc"
48#define KEY_ALLOWABLE @"allowable"
49#define KEY_AXISFN @"axisfunc"
50#define KEY_BUTTONFN @"buttonfunc"
51
52@interface PlayerEntity (StickMapper)
53
54 - (void) resetStickFunctions;
55 - (void) setGuiToStickMapperScreen: (unsigned)skip resetCurrentRow: (BOOL) resetCurrentRow;
56 - (void) setGuiToStickMapperScreen: (unsigned)skip;
57 - (void) stickMapperInputHandler: (GuiDisplayGen *)gui
58 view: (MyOpenGLView *)gameView;
59 // Callback method
60 - (void) updateFunction: (NSDictionary *)hwDict;
61
62 // Future: populate via plist
63 - (NSDictionary *)makeStickGuiDictHeader:(NSString *)header;
64 - (NSDictionary *)makeStickGuiDict: (NSString *)what
65 allowable: (int)allowable
66 axisfn: (int)axisfn
67 butfn: (int)butfn;
68
69@end
70