Oolite
Loading...
Searching...
No Matches
PlayerEntity(KeyMapperInternal) Category Reference

Instance Methods

(void) - resetKeyFunctions
(void) - updateKeyDefinition:index:
(void) - updateShiftKeyDefinition:index:
(void) - displayKeyFunctionList:skip:
(NSString *) - keyboardDescription:
(void) - displayKeyboardLayoutList:skip:
(BOOL) - entryIsIndexCustomEquip:
(BOOL) - entryIsDictCustomEquip:
(BOOL) - entryIsCustomEquip:
(NSArray *) - getCustomEquipArray:
(NSString *) - getCustomEquipKeyDefType:
(NSArray *) - keyFunctionList
(NSArray *) - validateAllKeys
(NSString *) - searchArrayForMatch:key:checkKeys:
(NSUInteger) - getCustomEquipIndex:
(BOOL) - entryIsEqualToDefault:
(BOOL) - compareKeyEntries:second:
(void) - saveKeySetting:
(void) - unsetKeySetting:
(void) - deleteKeySetting:
(void) - deleteAllKeySettings
(NSDictionary *) - loadKeySettings
(void) - reloadPage

Detailed Description

Definition at line 47 of file PlayerEntityKeyMapper.m.

Method Documentation

◆ compareKeyEntries:second:

- (BOOL) compareKeyEntries: (NSDictionary *) first
second: (NSDictionary *) second 

Extends class PlayerEntity.

Definition at line 1468 of file PlayerEntityKeyMapper.m.

1468 :(NSDictionary*)first second:(NSDictionary*)second
1469{
1470 if ([(NSString*)[first objectForKey:@"key"] integerValue] == [(NSString*)[second objectForKey:@"key"] integerValue]) {
1471 if ([[first objectForKey:@"shift"] boolValue] == [[second objectForKey:@"shift"] boolValue] &&
1472 [[first objectForKey:@"mod1"] boolValue] == [[second objectForKey:@"mod1"] boolValue] &&
1473 [[first objectForKey:@"mod2"] boolValue] == [[second objectForKey:@"mod2"] boolValue])
1474 return YES;
1475 }
1476 return NO;
1477}

◆ deleteAllKeySettings

- (void) deleteAllKeySettings

Extends class PlayerEntity.

Definition at line 1570 of file PlayerEntityKeyMapper.m.

1571{
1572 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1573 [defaults removeObjectForKey:KEYCONFIG_OVERRIDES];
1574 if ([customEquipActivation count] > 0) {
1575 NSUInteger i;
1576 for (i = 0; i < [customEquipActivation count]; i++) {
1577 NSString* eq = [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY];
1578 OOEquipmentType* item = [OOEquipmentType equipmentTypeWithIdentifier:eq];
1579 if ([item defaultActivateKey])
1580 [[customEquipActivation objectAtIndex:i] setObject:[item defaultActivateKey] forKey:CUSTOMEQUIP_KEYACTIVATE];
1581 else
1582 [[customEquipActivation objectAtIndex:i] removeObjectForKey:CUSTOMEQUIP_KEYACTIVATE];
1583
1584 if ([item defaultModeKey])
1585 [[customEquipActivation objectAtIndex:i] setObject:[item defaultModeKey] forKey:CUSTOMEQUIP_KEYMODE];
1586 else
1587 [[customEquipActivation objectAtIndex:i] removeObjectForKey:CUSTOMEQUIP_KEYMODE];
1588 }
1589 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
1590 }
1591 // reload settings
1592 [self initKeyConfigSettings];
1593}
unsigned count
#define CUSTOMEQUIP_KEYACTIVATE
#define CUSTOMEQUIP_KEYMODE
OOEquipmentType * equipmentTypeWithIdentifier:(NSString *identifier)

References count, OOEquipmentType::defaultActivateKey, OOEquipmentType::defaultModeKey, deleteAllKeySettings, OOEquipmentType::equipmentTypeWithIdentifier:, and PlayerEntity::initKeyConfigSettings.

Referenced by deleteAllKeySettings, PlayerEntity(KeyMapper)::handleKeyMapperConfirmClearKeys:view:, and resetKeyFunctions.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteKeySetting:

- (void) deleteKeySetting: (NSString *) key

Extends class PlayerEntity.

Definition at line 1553 of file PlayerEntityKeyMapper.m.

1553 :(NSString*)key
1554{
1555 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1556 if (![self entryIsCustomEquip:key]) {
1557 NSMutableDictionary* keyconf = [NSMutableDictionary dictionaryWithDictionary:[defaults objectForKey:KEYCONFIG_OVERRIDES]];
1558 [keyconf removeObjectForKey:key];
1559 [defaults setObject:keyconf forKey:KEYCONFIG_OVERRIDES];
1560 } else {
1561 NSString* custkey = [self getCustomEquipKeyDefType:key];
1562 [[customEquipActivation objectAtIndex:[self getCustomEquipIndex:key]] removeObjectForKey:custkey];
1563 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
1564 }
1565 // reload settings
1566 [self initKeyConfigSettings];
1567}

References PlayerEntity::getCustomEquipIndex:, PlayerEntity::getCustomEquipKeyDefType:, and PlayerEntity::initKeyConfigSettings.

Referenced by PlayerEntity(KeyMapper)::keyMapperInputHandler:view:, and saveKeySetting:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayKeyboardLayoutList:skip:

- (void) displayKeyboardLayoutList: (GuiDisplayGen *) gui
skip: (NSUInteger) skip 

Extends class PlayerEntity.

Definition at line 1207 of file PlayerEntityKeyMapper.m.

1207 :(GuiDisplayGen*)gui skip:(NSUInteger)skip
1208{
1209 [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_HEADING];
1210 [gui setArray:[NSArray arrayWithObjects:DESC(@"oolite-keyconfig-kbd-layout"), nil] forRow:GUI_ROW_KC_HEADING];
1211
1212 if (!kbdLayouts)
1213 kbdLayouts = [[self keyboardLayoutList] retain];
1214
1215 NSUInteger i, n_functions = [kbdLayouts count];
1216 NSInteger n_rows, start_row, previous = 0;
1217
1218 if (skip >= n_functions)
1219 skip = n_functions - 1;
1220
1221 if (n_functions < MAX_ROWS_KC_FUNCTIONS) {
1222 skip = 0;
1223 previous = 0;
1224 n_rows = MAX_ROWS_KC_FUNCTIONS;
1225 start_row = GUI_ROW_KC_FUNCSTART;
1226 } else {
1227 n_rows = MAX_ROWS_KC_FUNCTIONS - 1;
1228 start_row = GUI_ROW_KC_FUNCSTART;
1229 if (skip > 0) {
1230 n_rows -= 1;
1231 start_row += 1;
1232 if (skip > MAX_ROWS_KC_FUNCTIONS)
1233 previous = skip - (MAX_ROWS_KC_FUNCTIONS - 2);
1234 else
1235 previous = 0;
1236 }
1237 }
1238
1239 if (n_functions > 0) {
1240 if (skip > 0) {
1241 [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_FUNCSTART];
1242 [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_KC_FUNCSTART];
1243 [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_KC_FUNCSTART];
1244 }
1245
1246 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1247 NSString* kbd = [defaults oo_stringForKey:@"keyboard-code" defaultValue:@"default"];
1248
1249 for (i = 0; i < (n_functions - skip) && (int)i < n_rows; i++) {
1250 NSDictionary* entry = [kbdLayouts objectAtIndex:i + skip];
1251 NSString* desc = [entry objectForKey:@"description"];
1252 NSString* selected = @"";
1253 if ([[entry objectForKey:@"key"] isEqualToString:kbd])
1254 selected = DESC(@"oolite-keyconfig-kbd-current");
1255 [gui setArray:[NSArray arrayWithObjects:desc, selected, nil] forRow:i + start_row];
1256 [gui setKey:[NSString stringWithFormat:@"Index:%zu", i + skip] forRow:i + start_row];
1257 }
1258 if (i < n_functions - skip) {
1259 [gui setColor:[OOColor greenColor] forRow:start_row + i];
1260 [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:start_row + i];
1261 [gui setKey:[NSString stringWithFormat:@"More:%zu", n_rows + skip] forRow:start_row + i];
1262 i++;
1263 }
1264
1265 [gui setSelectableRange:NSMakeRange(GUI_ROW_KC_FUNCSTART, i + start_row - GUI_ROW_KC_FUNCSTART)];
1266 }
1267}
#define MAX_ROWS_KC_FUNCTIONS
#define GUI_ROW_KC_FUNCSTART
#define DESC(key)
Definition Universe.h:832
void setSelectableRange:(NSRange range)
void setColor:forRow:(OOColor *color,[forRow] OOGUIRow row)
void setArray:forRow:(NSArray *arr,[forRow] OOGUIRow row)
void setKey:forRow:(NSString *str,[forRow] OOGUIRow row)
OOColor * greenColor()
Definition OOColor.m:264
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

References DESC, OOColor::greenColor, GUI_ROW_KC_FUNCSTART, int(), PlayerEntity::keyboardLayoutList, MAX_ROWS_KC_FUNCTIONS, GuiDisplayGen::setArray:forRow:, GuiDisplayGen::setColor:forRow:, GuiDisplayGen::setKey:forRow:, and GuiDisplayGen::setSelectableRange:.

Referenced by PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayKeyFunctionList:skip:

- (void) displayKeyFunctionList: (GuiDisplayGen *) gui
skip: (NSUInteger) skip 

Extends class PlayerEntity.

Definition at line 764 of file PlayerEntityKeyMapper.m.

764 :(GuiDisplayGen*)gui skip:(NSUInteger)skip
765{
766 [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_HEADING];
767 [gui setArray:[NSArray arrayWithObjects:
768 DESC(@"oolite-keyconfig-column-function"), DESC(@"oolite-keyconfig-column-assigned-to"), DESC(@"oolite-keyconfig-column-overrides"), nil]
769 forRow:GUI_ROW_KC_HEADING];
770
771 NSDictionary* overrides = [self loadKeySettings];
772
773 if (!keyFunctions) {
774 keyFunctions = [[self keyFunctionList] retain];
775 }
776
777 NSUInteger i, n_functions = [keyFunctions count];
778 NSInteger n_rows, start_row, previous = 0;
779 NSString* validate = nil;
780
781 if (skip >= n_functions)
782 skip = n_functions - 1;
783
784 if (n_functions < MAX_ROWS_KC_FUNCTIONS) {
785 skip = 0;
786 previous = 0;
787 n_rows = MAX_ROWS_KC_FUNCTIONS;
788 start_row = GUI_ROW_KC_FUNCSTART;
789 } else {
790 n_rows = MAX_ROWS_KC_FUNCTIONS - 1;
791 start_row = GUI_ROW_KC_FUNCSTART;
792 if (skip > 0) {
793 n_rows -= 1;
794 start_row += 1;
795 if (skip > MAX_ROWS_KC_FUNCTIONS)
796 previous = skip - (MAX_ROWS_KC_FUNCTIONS - 2);
797 else
798 previous = 0;
799 }
800 }
801
802 if (n_functions > 0) {
803 if (skip > 0) {
804 [gui setColor:[OOColor greenColor] forRow:GUI_ROW_KC_FUNCSTART];
805 [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @" <-- ", nil] forRow:GUI_ROW_KC_FUNCSTART];
806 [gui setKey:[NSString stringWithFormat:@"More:%zd", previous] forRow:GUI_ROW_KC_FUNCSTART];
807 }
808
809 for (i = 0; i < (n_functions - skip) && (int)i < n_rows; i++) {
810 NSDictionary* entry = [keyFunctions objectAtIndex:i + skip];
811 if ([entry objectForKey:KEY_KC_HEADER]) {
812 NSString* header = [entry objectForKey:KEY_KC_HEADER];
813 [gui setArray:[NSArray arrayWithObjects:header, @"", @"", nil] forRow:i + start_row];
814 [gui setColor:[OOColor cyanColor] forRow:i + start_row];
815 } else {
816 NSString* assignment = nil;
817 NSString* override = nil;
818 if (![self entryIsDictCustomEquip:entry]) {
819 // Find out what's assigned for this function currently.
820 assignment = [PLAYER keyBindingDescription2:[entry objectForKey:KEY_KC_DEFINITION]];
821 override = ([overrides objectForKey:[entry objectForKey:KEY_KC_DEFINITION]] ? @"Yes" : @""); // work out whether this assignment is overriding the setting in keyconfig2.plist
822 validate = [self validateKey:[entry objectForKey:KEY_KC_DEFINITION] checkKeys:(NSArray*)[keyconfig2_settings objectForKey:[entry objectForKey:KEY_KC_DEFINITION]]];
823 } else {
824 NSString* custom_keytype = [self getCustomEquipKeyDefType:[entry oo_stringForKey:KEY_KC_DEFINITION]];
825 NSUInteger idx = [self getCustomEquipIndex:[entry oo_stringForKey:KEY_KC_DEFINITION]];
826 assignment = [PLAYER getKeyBindingDescription:[[customEquipActivation objectAtIndex:idx] oo_arrayForKey:custom_keytype]];
827 OOEquipmentType* item = [OOEquipmentType equipmentTypeWithIdentifier:[[customEquipActivation objectAtIndex:idx] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY]];
828 bool result = true;
829 int j, k;
830 NSArray* defArray = nil;
831 NSArray* compArray = nil;
832
833 if ([custom_keytype isEqualToString:CUSTOMEQUIP_KEYACTIVATE]) {
834 defArray = [item defaultActivateKey];
835 compArray = [[customEquipActivation objectAtIndex:idx] oo_arrayForKey:custom_keytype];
836 }
837 if ([custom_keytype isEqualToString:CUSTOMEQUIP_KEYMODE]) {
838 defArray = [item defaultModeKey];
839 compArray = [[customEquipActivation objectAtIndex:idx] oo_arrayForKey:custom_keytype];
840 }
841 for (j = 0; j < [defArray count]; j++) {
842 for (k = 0; k < [compArray count]; k++) {
843 if (![self compareKeyEntries:[defArray objectAtIndex:j] second:[compArray objectAtIndex:k]]) {
844 result = false;
845 break;
846 }
847 }
848 if (result == false)
849 break;
850 }
851
852 override = (!result ? @"Yes" : @"");
853 validate = [self validateKey:[entry objectForKey:KEY_KC_DEFINITION] checkKeys:(NSArray*)[[customEquipActivation objectAtIndex:idx] oo_arrayForKey:custom_keytype]];
854 }
855 if (assignment == nil) {
856 assignment = @" - ";
857 }
858
859 [gui setArray:[NSArray arrayWithObjects:
860 [entry objectForKey:KEY_KC_GUIDESC], assignment, override, nil]
861 forRow:i + start_row];
862 [gui setKey:[NSString stringWithFormat:@"Index:%zu", i + skip] forRow:i + start_row];
863 if (validate) {
864 [gui setColor:[OOColor orangeColor] forRow:i + start_row];
865 }
866 }
867 }
868 if (i < n_functions - skip) {
869 [gui setColor:[OOColor greenColor] forRow:start_row + i];
870 [gui setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @" --> ", nil] forRow:start_row + i];
871 [gui setKey:[NSString stringWithFormat:@"More:%zu", n_rows + skip] forRow:start_row + i];
872 i++;
873 }
874
875 [gui setSelectableRange:NSMakeRange(GUI_ROW_KC_SELECTKBD, (i + start_row - GUI_ROW_KC_FUNCSTART) + (GUI_ROW_KC_FUNCSTART - GUI_ROW_KC_SELECTKBD))];
876 }
877}
return nil
#define KEY_KC_HEADER
OOColor * cyanColor()
Definition OOColor.m:274
OOColor * orangeColor()
Definition OOColor.m:289
NSArray * defaultActivateKey()
NSArray * defaultModeKey()

References CUSTOMEQUIP_KEYACTIVATE, CUSTOMEQUIP_KEYMODE, OOColor::cyanColor, OOEquipmentType::defaultActivateKey, OOEquipmentType::defaultModeKey, OOEquipmentType::equipmentTypeWithIdentifier:, PlayerEntity::getCustomEquipIndex:, PlayerEntity::getCustomEquipKeyDefType:, OOColor::greenColor, GUI_ROW_KC_FUNCSTART, int(), KEY_KC_HEADER, PlayerEntity::keyFunctionList, PlayerEntity::loadKeySettings, MAX_ROWS_KC_FUNCTIONS, nil, OOColor::orangeColor, GuiDisplayGen::setArray:forRow:, GuiDisplayGen::setColor:forRow:, GuiDisplayGen::setKey:forRow:, GuiDisplayGen::setSelectableRange:, and PlayerEntity::validateKey:checkKeys:.

Referenced by PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ entryIsCustomEquip:

- (BOOL) entryIsCustomEquip: (NSString *) entry

Extends class PlayerEntity.

Definition at line 308 of file PlayerEntityKeyMapper.m.

308 :(NSString*)entry
309{
310 BOOL result = NO;
311 if ([entry hasPrefix:@"activate_"] || [entry hasPrefix:@"mode_"])
312 result = YES;
313 return result;
314}

Referenced by entryIsDictCustomEquip:, and entryIsIndexCustomEquip:.

Here is the caller graph for this function:

◆ entryIsDictCustomEquip:

- (BOOL) entryIsDictCustomEquip: (NSDictionary *) dict

Extends class PlayerEntity.

Definition at line 303 of file PlayerEntityKeyMapper.m.

303 :(NSDictionary*)dict
304{
305 return [self entryIsCustomEquip:[dict oo_stringForKey:KEY_KC_DEFINITION]];
306}

References PlayerEntity::entryIsCustomEquip:.

Here is the call graph for this function:

◆ entryIsEqualToDefault:

- (BOOL) entryIsEqualToDefault: (NSString *) key

Extends class PlayerEntity.

Definition at line 1451 of file PlayerEntityKeyMapper.m.

1451 :(NSString*)key
1452{
1453 NSArray* def = (NSArray*)[kdic_check objectForKey:key];
1454 NSUInteger i;
1455
1456 if ([def count] != [key_list count])
1457 return NO;
1458 for (i = 0; i < [key_list count]; i++) {
1459 NSDictionary* orig = (NSDictionary*)[def objectAtIndex:i];
1460 NSDictionary* entrd = (NSDictionary*)[key_list objectAtIndex:i];
1461 if (![self compareKeyEntries:orig second:entrd])
1462 return NO;
1463 }
1464 return YES;
1465}
static NSDictionary * kdic_check
static NSMutableArray * key_list

References count, kdic_check, and key_list.

◆ entryIsIndexCustomEquip:

- (BOOL) entryIsIndexCustomEquip: (NSUInteger) idx

Extends class PlayerEntity.

Definition at line 298 of file PlayerEntityKeyMapper.m.

298 :(NSUInteger)idx
299{
300 return [self entryIsCustomEquip:[[keyFunctions objectAtIndex:idx] oo_stringForKey:KEY_KC_DEFINITION]];
301}

References PlayerEntity::entryIsCustomEquip:.

Here is the call graph for this function:

◆ getCustomEquipArray:

- (NSArray *) getCustomEquipArray: (NSString *) key_def

Extends class PlayerEntity.

Definition at line 316 of file PlayerEntityKeyMapper.m.

316 :(NSString*)key_def
317{
318 NSString* eq = nil;
319 NSUInteger i;
320 NSString* key;
321 if ([key_def hasPrefix:@"activate_"]) {
322 eq = [key_def stringByReplacingOccurrencesOfString:@"activate_" withString:@""];
324 }
325 if ([key_def hasPrefix:@"mode_"]) {
326 eq = [key_def stringByReplacingOccurrencesOfString:@"mode_" withString:@""];
328 }
329 if (eq == nil)
330 return nil;
331 for (i = 0; i < [customEquipActivation count]; i++) {
332 if ([[[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY] isEqualToString:eq]) {
333 return [[customEquipActivation objectAtIndex:i] oo_arrayForKey:key];
334 }
335 }
336 return nil;
337}
#define CUSTOMEQUIP_EQUIPKEY

References CUSTOMEQUIP_EQUIPKEY, CUSTOMEQUIP_KEYACTIVATE, CUSTOMEQUIP_KEYMODE, and nil.

Referenced by PlayerEntity(KeyMapper)::keyMapperInputHandler:view:.

Here is the caller graph for this function:

◆ getCustomEquipIndex:

- (NSUInteger) getCustomEquipIndex: (NSString *) key_def

Extends class PlayerEntity.

Definition at line 339 of file PlayerEntityKeyMapper.m.

339 :(NSString*)key_def
340{
341 NSString* eq = nil;
342 NSUInteger i;
343 if ([key_def hasPrefix:@"activate_"]) {
344 eq = [key_def stringByReplacingOccurrencesOfString:@"activate_" withString:@""];
345 }
346 if ([key_def hasPrefix:@"mode_"]) {
347 eq = [key_def stringByReplacingOccurrencesOfString:@"mode_" withString:@""];
348 }
349 if (eq == nil)
350 return -1;
351 for (i = 0; i < [customEquipActivation count]; i++) {
352 if ([[[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY] isEqualToString:eq]) {
353 return i;
354 }
355 }
356 return -1;
357}

References CUSTOMEQUIP_EQUIPKEY, and nil.

Referenced by deleteKeySetting:, displayKeyFunctionList:skip:, PlayerEntity(KeyMapper)::keyMapperInputHandler:view:, saveKeySetting:, searchArrayForMatch:key:checkKeys:, and unsetKeySetting:.

Here is the caller graph for this function:

◆ getCustomEquipKeyDefType:

- (NSString *) getCustomEquipKeyDefType: (NSString *) key_def

Extends class PlayerEntity.

Definition at line 359 of file PlayerEntityKeyMapper.m.

359 :(NSString*)key_def
360{
361 if ([key_def hasPrefix:@"activate_"]) {
363 }
364 if ([key_def hasPrefix:@"mode_"]) {
365 return CUSTOMEQUIP_KEYMODE;
366 }
367 return @"";
368}

References CUSTOMEQUIP_KEYACTIVATE, and CUSTOMEQUIP_KEYMODE.

Referenced by deleteKeySetting:, displayKeyFunctionList:skip:, saveKeySetting:, searchArrayForMatch:key:checkKeys:, and unsetKeySetting:.

Here is the caller graph for this function:

◆ keyboardDescription:

- (NSString *) keyboardDescription: (NSString *) kbd

Extends class PlayerEntity.

Definition at line 1147 of file PlayerEntityKeyMapper.m.

1147 :(NSString*)kbd
1148{
1149 NSString* map = @"";
1150#if OOLITE_WINDOWS
1151 map = @"keymappings_windows.plist";
1152#endif
1153#if OOLITE_LINUX
1154 map = @"keymappings_linux.plist";
1155#endif
1156#if OOLITE_MAC_COCOA_UI
1157 map = @"keymappings_mac.plist";
1158#endif
1159 NSDictionary* kmap = [NSDictionary dictionaryWithDictionary:[ResourceManager dictionaryFromFilesNamed:map inFolder:@"Config" mergeMode:MERGE_BASIC cache:NO]];
1160 NSDictionary* sect = [kmap objectForKey:kbd];
1161 return [sect objectForKey:@"description"];
1162}
NSDictionary * dictionaryFromFilesNamed:inFolder:mergeMode:cache:(NSString *fileName,[inFolder] NSString *folderName,[mergeMode] OOResourceMergeMode mergeMode,[cache] BOOL useCache)

References ResourceManager::dictionaryFromFilesNamed:inFolder:mergeMode:cache:.

Referenced by PlayerEntity(KeyMapper)::keyboardLayoutList, and PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyFunctionList

- (NSArray *) keyFunctionList

Extends class PlayerEntity.

Definition at line 879 of file PlayerEntityKeyMapper.m.

880{
881 NSMutableArray* funcList = [NSMutableArray array];
882
883 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-screen-access")]];
884 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_launch_ship") keyDef:@"key_launch_ship"]];
885 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_screen_options") keyDef:@"key_gui_screen_options"]];
886 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_screen_equipship") keyDef:@"key_gui_screen_equipship"]];
887 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_screen_interfaces") keyDef:@"key_gui_screen_interfaces"]];
888 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_screen_status") keyDef:@"key_gui_screen_status"]];
889 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_chart_screens") keyDef:@"key_gui_chart_screens"]];
890 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_system_data") keyDef:@"key_gui_system_data"]];
891 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_market") keyDef:@"key_gui_market"]];
892
893 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-propulsion")]];
894 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_roll_left") keyDef:@"key_roll_left"]];
895 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_roll_right") keyDef:@"key_roll_right"]];
896 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_pitch_forward") keyDef:@"key_pitch_forward"]];
897 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_pitch_back") keyDef:@"key_pitch_back"]];
898 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_yaw_left") keyDef:@"key_yaw_left"]];
899 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_yaw_right") keyDef:@"key_yaw_right"]];
900
901 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_increase_speed") keyDef:@"key_increase_speed"]];
902 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_decrease_speed") keyDef:@"key_decrease_speed"]];
903 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_inject_fuel") keyDef:@"key_inject_fuel"]];
904 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_jumpdrive") keyDef:@"key_jumpdrive"]];
905 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_hyperspace") keyDef:@"key_hyperspace"]];
906 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_galactic_hyperspace") keyDef:@"key_galactic_hyperspace"]];
907
908 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-navigation")]];
909 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_next_compass_mode") keyDef:@"key_next_compass_mode"]];
910 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_prev_compass_mode") keyDef:@"key_prev_compass_mode"]];
911 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_scanner_zoom") keyDef:@"key_scanner_zoom"]];
912 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_scanner_unzoom") keyDef:@"key_scanner_unzoom"]];
913 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_view_forward") keyDef:@"key_view_forward"]];
914 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_view_aft") keyDef:@"key_view_aft"]];
915 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_view_port") keyDef:@"key_view_port"]];
916 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_view_starboard") keyDef:@"key_view_starboard"]];
917 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_ident_system") keyDef:@"key_ident_system"]];
918
919 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_docking_clearance_request") keyDef:@"key_docking_clearance_request"]];
920 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_autopilot") keyDef:@"key_autopilot"]];
921 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_autodock") keyDef:@"key_autodock"]];
922 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_docking_music") keyDef:@"key_docking_music"]];
923
924 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-offensive")]];
925 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_weapons_online_toggle") keyDef:@"key_weapons_online_toggle"]];
926 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_fire_lasers") keyDef:@"key_fire_lasers"]];
927 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_launch_missile") keyDef:@"key_launch_missile"]];
928 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_target_missile") keyDef:@"key_target_missile"]];
929 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_untarget_missile") keyDef:@"key_untarget_missile"]];
930 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_target_incoming_missile") keyDef:@"key_target_incoming_missile"]];
931 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_next_missile") keyDef:@"key_next_missile"]];
932 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_next_target") keyDef:@"key_next_target"]];
933 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_previous_target") keyDef:@"key_previous_target"]];
934
935 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-defensive")]];
936 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_ecm") keyDef:@"key_ecm"]];
937 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_dump_cargo") keyDef:@"key_dump_cargo"]];
938 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_rotate_cargo") keyDef:@"key_rotate_cargo"]];
939 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_launch_escapepod") keyDef:@"key_launch_escapepod"]];
940
941 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-special-equip")]];
942 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_cycle_next_mfd") keyDef:@"key_cycle_next_mfd"]];
943 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_cycle_previous_mfd") keyDef:@"key_cycle_previous_mfd"]];
944 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_switch_next_mfd") keyDef:@"key_switch_next_mfd"]];
945 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_switch_previous_mfd") keyDef:@"key_switch_previous_mfd"]];
946
947 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_prime_next_equipment") keyDef:@"key_prime_next_equipment"]];
948 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_prime_previous_equipment") keyDef:@"key_prime_previous_equipment"]];
949 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_activate_equipment") keyDef:@"key_activate_equipment"]];
950 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_mode_equipment") keyDef:@"key_mode_equipment"]];
951 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_fastactivate_equipment_a") keyDef:@"key_fastactivate_equipment_a"]];
952 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_fastactivate_equipment_b") keyDef:@"key_fastactivate_equipment_b"]];
953
954 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-chart-screen")]];
955 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_advanced_nav_array_next") keyDef:@"key_advanced_nav_array_next"]];
956 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_advanced_nav_array_previous") keyDef:@"key_advanced_nav_array_previous"]];
957 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_home") keyDef:@"key_map_home"]];
958 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_end") keyDef:@"key_map_end"]];
959 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_info") keyDef:@"key_map_info"]];
960 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_zoom_in") keyDef:@"key_map_zoom_in"]];
961 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_zoom_out") keyDef:@"key_map_zoom_out"]];
962 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_next_system") keyDef:@"key_map_next_system"]];
963 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_map_previous_system") keyDef:@"key_map_previous_system"]];
964 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_chart_highlight") keyDef:@"key_chart_highlight"]];
965
966 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-planet-info-screen")]];
967 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_system_home") keyDef:@"key_system_home"]];
968 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_system_end") keyDef:@"key_system_end"]];
969 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_system_next_system") keyDef:@"key_system_next_system"]];
970 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_system_previous_system") keyDef:@"key_system_previous_system"]];
971
972 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-market-screen")]];
973 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_filter_cycle") keyDef:@"key_market_filter_cycle"]];
974 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_sorter_cycle") keyDef:@"key_market_sorter_cycle"]];
975 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_buy_one") keyDef:@"key_market_buy_one"]];
976 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_sell_one") keyDef:@"key_market_sell_one"]];
977 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_buy_max") keyDef:@"key_market_buy_max"]];
978 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_market_sell_max") keyDef:@"key_market_sell_max"]];
979
980 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-misc")]];
981 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_snapshot") keyDef:@"key_snapshot"]];
982 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_pausebutton") keyDef:@"key_pausebutton"]];
983 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_show_fps") keyDef:@"key_show_fps"]];
984 //[funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_bloom_toggle") keyDef:@"key_bloom_toggle"]];
985 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_mouse_control_roll") keyDef:@"key_mouse_control_roll"]];
986 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_mouse_control_yaw") keyDef:@"key_mouse_control_yaw"]];
987 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_hud_toggle") keyDef:@"key_hud_toggle"]];
988#if OO_FOV_INFLIGHT_CONTROL_ENABLED
989 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_inc_field_of_view") keyDef:@"key_inc_field_of_view"]];
990 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_dec_field_of_view") keyDef:@"key_dec_field_of_view"]];
991#endif
992 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_comms_log") keyDef:@"key_comms_log"]];
993
994 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-custom-view")]];
995 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view") keyDef:@"key_custom_view"]];
996 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_zoom_in") keyDef:@"key_custom_view_zoom_in"]];
997 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_zoom_out") keyDef:@"key_custom_view_zoom_out"]];
998 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_roll_left") keyDef:@"key_custom_view_roll_left"]];
999 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_roll_right") keyDef:@"key_custom_view_roll_right"]];
1000 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_pan_left") keyDef:@"key_custom_view_pan_left"]];
1001 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_pan_right") keyDef:@"key_custom_view_pan_right"]];
1002 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_pan_up") keyDef:@"key_custom_view_pan_up"]];
1003 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_pan_down") keyDef:@"key_custom_view_pan_down"]];
1004 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_rotate_left") keyDef:@"key_custom_view_rotate_left"]];
1005 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_rotate_right") keyDef:@"key_custom_view_rotate_right"]];
1006 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_rotate_up") keyDef:@"key_custom_view_rotate_up"]];
1007 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_custom_view_rotate_down") keyDef:@"key_custom_view_rotate_down"]];
1008
1009 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-oxz-manager")]];
1010 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_oxzmanager_setfilter") keyDef:@"key_oxzmanager_setfilter"]];
1011 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_oxzmanager_showinfo") keyDef:@"key_oxzmanager_showinfo"]];
1012 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_oxzmanager_extract") keyDef:@"key_oxzmanager_extract"]];
1013
1014 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-gui")]];
1015 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_arrow_left") keyDef:@"key_gui_arrow_left"]];
1016 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_arrow_right") keyDef:@"key_gui_arrow_right"]];
1017 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_arrow_up") keyDef:@"key_gui_arrow_up"]];
1018 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_arrow_down") keyDef:@"key_gui_arrow_down"]];
1019 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_page_down") keyDef:@"key_gui_page_down"]];
1020 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_page_up") keyDef:@"key_gui_page_up"]];
1021 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_gui_select") keyDef:@"key_gui_select"]];
1022
1023 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-debug")]];
1024 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_dump_target_state") keyDef:@"key_dump_target_state"]];
1025 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_dump_entity_list") keyDef:@"key_dump_entity_list"]];
1026 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_full") keyDef:@"key_debug_full"]];
1027 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_collision") keyDef:@"key_debug_collision"]];
1028 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_console_connect") keyDef:@"key_debug_console_connect"]];
1029 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_bounding_boxes") keyDef:@"key_debug_bounding_boxes"]];
1030 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_shaders") keyDef:@"key_debug_shaders"]];
1031 [funcList addObject:[self makeKeyGuiDict:DESC(@"oolite-keydesc-key_debug_off") keyDef:@"key_debug_off"]];
1032
1033 if ([customEquipActivation count] > 0) {
1034 [funcList addObject:[self makeKeyGuiDictHeader:DESC(@"oolite-keydesc-header-oxp-equip")]];
1035 int i;
1036 for (i = 0; i < [customEquipActivation count]; i++) {
1037 [funcList addObject:[self makeKeyGuiDict:[NSString stringWithFormat:@"%@ '%@'", DESC(@"oolite-keyconfig-cust-activate"), [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPNAME]]
1038 keyDef:[NSString stringWithFormat:@"activate_%@", [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY]]]];
1039 [funcList addObject:[self makeKeyGuiDict:[NSString stringWithFormat:@"%@ '%@'", DESC(@"oolite-keyconfig-cust-mode"), [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPNAME]]
1040 keyDef:[NSString stringWithFormat:@"mode_%@", [[customEquipActivation objectAtIndex:i] oo_stringForKey:CUSTOMEQUIP_EQUIPKEY]]]];
1041 }
1042 }
1043 return funcList;
1044}

References count, keyFunctionList, PlayerEntity::makeKeyGuiDict:keyDef:, and PlayerEntity::makeKeyGuiDictHeader:.

Referenced by displayKeyFunctionList:skip:, and keyFunctionList.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadKeySettings

- (NSDictionary *) loadKeySettings

Extends class PlayerEntity.

Definition at line 1596 of file PlayerEntityKeyMapper.m.

1597{
1598 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1599 return [defaults objectForKey:KEYCONFIG_OVERRIDES];
1600}

References loadKeySettings.

Referenced by displayKeyFunctionList:skip:, loadKeySettings, and resetKeyFunctions.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reloadPage

- (void) reloadPage

Extends class PlayerEntity.

Definition at line 1603 of file PlayerEntityKeyMapper.m.

1604{
1605 // Update the GUI (this will refresh the function list).
1606 unsigned skip;
1607 if (selFunctionIdx < MAX_ROWS_KC_FUNCTIONS - 1) {
1608 skip = 0;
1609 } else {
1610 skip = ((selFunctionIdx - 1) / (MAX_ROWS_KC_FUNCTIONS - 2)) * (MAX_ROWS_KC_FUNCTIONS - 2) + 1;
1611 }
1612
1613 [self setGuiToKeyMapperScreen:skip];
1614}

References MAX_ROWS_KC_FUNCTIONS, reloadPage, and PlayerEntity::setGuiToKeyMapperScreen:.

Referenced by PlayerEntity(KeyMapper)::handleKeyConfigKeys:view:, PlayerEntity(KeyMapper)::keyMapperInputHandler:view:, reloadPage, resetKeyFunctions, and saveKeySetting:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetKeyFunctions

- (void) resetKeyFunctions

Extends class PlayerEntity.

Definition at line 66 of file PlayerEntityKeyMapper.m.

114{
115 [keyFunctions release];
116 keyFunctions = nil;
117}

References deleteAllKeySettings, loadKeySettings, and reloadPage.

Referenced by PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveKeySetting:

- (void) saveKeySetting: (NSString *) key

Extends class PlayerEntity.

Definition at line 1480 of file PlayerEntityKeyMapper.m.

1480 :(NSString*)key
1481{
1482 // check for a blank entry
1483 if ([key_list count] > 1 && [[(NSDictionary*)[key_list objectAtIndex:1] objectForKey:@"key"] integerValue] == 0) {
1484 [key_list removeObjectAtIndex:1];
1485 }
1486 // make sure the primary and alternate keys are different
1487 if ([key_list count] > 1) {
1488 if ([self compareKeyEntries:[key_list objectAtIndex:0] second:[key_list objectAtIndex:1]]) {
1489 [key_list removeObjectAtIndex:1];
1490 }
1491 }
1492 // see if we've set the key settings to blank - in which case, delete the override
1493 if ([[(NSDictionary*)[key_list objectAtIndex:0] objectForKey:@"key"] integerValue] == 0) {
1494 if ([key_list count] == 1 || ([key_list count] > 1 && [[(NSDictionary*)[key_list objectAtIndex:1] objectForKey:@"key"] isEqualToString:@""])) {
1495 [self deleteKeySetting:key];
1496 // reload settings
1497 [self initKeyConfigSettings];
1498 [self reloadPage];
1499 return;
1500 }
1501 }
1502
1503 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1504
1505 if (![self entryIsCustomEquip:key]) {
1506 // if we've got the same settings as the default, revert to the default
1507 if ([self entryIsEqualToDefault:key]) {
1508 [self deleteKeySetting:key];
1509 // reload settings
1510 [self initKeyConfigSettings];
1511 [self reloadPage];
1512 return;
1513 }
1514 NSMutableDictionary* keyconf = [NSMutableDictionary dictionaryWithDictionary:[defaults objectForKey:KEYCONFIG_OVERRIDES]];
1515 [keyconf setObject:key_list forKey:key];
1516 [defaults setObject:keyconf forKey:KEYCONFIG_OVERRIDES];
1517 } else {
1518 NSUInteger idx = [self getCustomEquipIndex:key];
1519 NSString* custkey = [self getCustomEquipKeyDefType:key];
1520 NSMutableDictionary* custEquip = [[customEquipActivation objectAtIndex:idx] mutableCopy];
1521 [custEquip setObject:key_list forKey:custkey];
1522 [customEquipActivation replaceObjectAtIndex:idx withObject:custEquip];
1523 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
1524 }
1525 // reload settings
1526 [self initKeyConfigSettings];
1527 [self reloadPage];
1528}

References count, PlayerEntity::deleteKeySetting:, PlayerEntity::getCustomEquipIndex:, PlayerEntity::getCustomEquipKeyDefType:, PlayerEntity::initKeyConfigSettings, key_list, and PlayerEntity::reloadPage.

Referenced by PlayerEntity(KeyMapper)::handleKeyConfigKeys:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchArrayForMatch:key:checkKeys:

- (NSString *) searchArrayForMatch: (NSArray *) search_list
key: (NSString *) key
checkKeys: (NSArray *) check_keys 

Extends class PlayerEntity.

Definition at line 1421 of file PlayerEntityKeyMapper.m.

1421 :(NSArray*)search_list key:(NSString*)key checkKeys:(NSArray*)check_keys
1422{
1423 NSString* search = nil;
1424 NSUInteger i, j, k;
1425 for (i = 0; i < [search_list count]; i++) {
1426 search = (NSString*)[search_list objectAtIndex:i];
1427 // only check other key settings, not the one we've been passed
1428 if (![search isEqualToString:key]) {
1429 // get the array from keyconfig2_settings
1430 // we need to compare all entries to each other to look for any match, as any match would indicate a conflict
1431 NSArray* current = nil;
1432 if (![self entryIsCustomEquip:search]) {
1433 current = (NSArray*)[keyconfig2_settings objectForKey:search];
1434 } else {
1435 NSUInteger idx = [self getCustomEquipIndex:search];
1436 NSString* keytype = [self getCustomEquipKeyDefType:search];
1437 current = (NSArray*)[[customEquipActivation objectAtIndex:idx] objectForKey:keytype];
1438 }
1439 for (j = 0; j < [current count]; j++) {
1440 for (k = 0; k < [check_keys count]; k++) {
1441 if ([self compareKeyEntries:[current objectAtIndex:j] second:[check_keys objectAtIndex:k]])
1442 return search;
1443 }
1444 }
1445 }
1446 }
1447 return nil;
1448}

References PlayerEntity::getCustomEquipIndex:, PlayerEntity::getCustomEquipKeyDefType:, and nil.

Referenced by PlayerEntity(KeyMapper)::validateKey:checkKeys:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsetKeySetting:

- (void) unsetKeySetting: (NSString *) key

Extends class PlayerEntity.

Definition at line 1531 of file PlayerEntityKeyMapper.m.

1531 :(NSString*)key
1532{
1533 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
1534 if (![self entryIsCustomEquip:key]) {
1535 NSMutableDictionary* keyconf = [NSMutableDictionary dictionaryWithDictionary:[defaults objectForKey:KEYCONFIG_OVERRIDES]];
1536 NSMutableArray* empty = [[NSMutableArray alloc] init];
1537 [keyconf setObject:empty forKey:key];
1538 [defaults setObject:keyconf forKey:KEYCONFIG_OVERRIDES];
1539 [empty release];
1540 } else {
1541 NSString* custkey = [self getCustomEquipKeyDefType:key];
1542 NSMutableDictionary* custEquip = [[customEquipActivation objectAtIndex:[self getCustomEquipIndex:key]] mutableCopy];
1543 [custEquip removeObjectForKey:custkey];
1544 [customEquipActivation replaceObjectAtIndex:[self getCustomEquipIndex:key] withObject:custEquip];
1545 [defaults setObject:customEquipActivation forKey:KEYCONFIG_CUSTOMEQUIP];
1546 [custEquip release];
1547 }
1548 // reload settings
1549 [self initKeyConfigSettings];
1550}

References PlayerEntity::getCustomEquipIndex:, PlayerEntity::getCustomEquipKeyDefType:, and PlayerEntity::initKeyConfigSettings.

Referenced by PlayerEntity(KeyMapper)::keyMapperInputHandler:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateKeyDefinition:index:

- (void) updateKeyDefinition: (NSString *) keystring
index: (NSUInteger) index 

Extends class PlayerEntity.

Definition at line 633 of file PlayerEntityKeyMapper.m.

633 :(NSString*)keystring index:(NSUInteger)index
634{
635 NSMutableDictionary* key_def = [[NSMutableDictionary alloc] initWithDictionary:(NSDictionary*)[key_list objectAtIndex:index] copyItems:YES];
636 [key_def setObject:keystring forKey:@"key"];
637 // auto=turn on shift if the entered key was shifted
638
639 if (last_shift && [keystring length] == 1 && ![nav_keys containsObject:[selected_entry objectForKey:KEY_KC_DEFINITION]]) {
640 [key_def setObject:[NSNumber numberWithBool:YES] forKey:@"shift"];
641 }
642 if (!last_shift && [keystring length] == 1) {
643 [key_def setObject:[NSNumber numberWithBool:NO] forKey:@"shift"];
644 }
645 last_shift = NO;
646 if (index > [key_list count] - 1) {
647 [key_list insertObject:key_def atIndex:index];
648 } else {
649 [key_list replaceObjectAtIndex:index withObject:key_def];
650 }
651 [key_def release];
652 NSArray* new_array = [self processKeyCode:key_list];
653 [key_list release];
654 key_list = [[NSMutableArray alloc] initWithArray:new_array copyItems:YES];
655 [new_array release];
656}
#define KEY_KC_DEFINITION
static NSDictionary * selected_entry
static NSArray * nav_keys
static BOOL last_shift

References count, KEY_KC_DEFINITION, key_list, last_shift, nav_keys, PlayerEntity::processKeyCode:, and selected_entry.

Referenced by PlayerEntity(KeyMapper)::handleKeyConfigEntryKeys:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateShiftKeyDefinition:index:

- (void) updateShiftKeyDefinition: (NSString *) key
index: (NSUInteger) index 

Extends class PlayerEntity.

Definition at line 659 of file PlayerEntityKeyMapper.m.

659 :(NSString*)key index:(NSUInteger)index
660{
661 NSMutableDictionary* key_def = [[NSMutableDictionary alloc] initWithDictionary:(NSDictionary*)[key_list objectAtIndex:index] copyItems:YES];
662 BOOL current = [[key_def objectForKey:key] boolValue];
663 BOOL keycode_changed = NO;
664 current = !current;
665 [key_def setObject:[NSNumber numberWithBool:current] forKey:key];
666 if ([key isEqualToString:@"shift"]) {
667 // force the key into upper or lower case, to limit invalid key combos as much as possible
668 NSString* keycode = [key_def objectForKey:@"key"];
669 NSInteger k_int = (OOKeyCode)[keycode integerValue];
670 if (k_int > 0) {
671 NSString* keystring = [self keyCodeDescription:k_int];
672 NSString* newstring;
673 if ([keystring length] == 1) {
674 // try switching the case. for characters that can't be switched (eg 1,2,3,etc), this should do nothing
675 if (current) {
676 newstring = [keystring uppercaseString];
677 } else {
678 newstring = [keystring lowercaseString];
679 }
680 if (![newstring isEqualToString:keystring]) {
681 [key_def setObject:newstring forKey:@"key"];
682 keycode_changed = YES;
683 }
684 }
685 }
686 }
687 if (index > [key_list count] - 1) {
688 [key_list insertObject:key_def atIndex:index];
689 } else {
690 [key_list replaceObjectAtIndex:index withObject:key_def];
691 }
692 [key_def release];
693 if (keycode_changed) {
694 NSArray* new_array = [self processKeyCode:key_list];
695 [key_list release];
696 key_list = [[NSMutableArray alloc] initWithArray:new_array copyItems:YES];
697 [new_array release];
698 }
699}
uint16_t OOKeyCode
Definition OOTypes.h:163

References count, key_list, PlayerEntity::keyCodeDescription:, and PlayerEntity::processKeyCode:.

Referenced by PlayerEntity(KeyMapper)::handleKeyConfigKeys:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateAllKeys

- (NSArray *) validateAllKeys

Extends class PlayerEntity.

Definition at line 1270 of file PlayerEntityKeyMapper.m.

1271{
1272 NSMutableArray* failed = [[NSMutableArray alloc] init];
1273 NSString* validate = nil;
1274 NSUInteger i;
1275
1276 for (i = 0; i < [keyFunctions count]; i++) {
1277 NSDictionary* entry = [keyFunctions objectAtIndex:i];
1278 validate = [self validateKey:[entry objectForKey:KEY_KC_DEFINITION] checkKeys:(NSArray*)[keyconfig2_settings objectForKey:[entry objectForKey:KEY_KC_DEFINITION]]];
1279 if (validate) {
1280 [failed addObject:validate];
1281 }
1282 }
1283 return [failed copy];
1284}

References nil, validateAllKeys, and PlayerEntity::validateKey:checkKeys:.

Referenced by validateAllKeys.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this category was generated from the following file: