|
7 | 7 | import net.neoforged.bus.api.SubscribeEvent; |
8 | 8 | import net.neoforged.fml.common.EventBusSubscriber; |
9 | 9 | import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; |
| 10 | +import net.neoforged.neoforge.client.settings.KeyConflictContext; |
10 | 11 | import yesman.epicfight.main.EpicFightMod; |
11 | 12 |
|
12 | 13 | @EventBusSubscriber(value = Dist.CLIENT) |
13 | 14 | public class EpicFightKeyMappings { |
14 | 15 |
|
15 | | - // GUI |
16 | | - public static final KeyMapping WEAPON_INNATE_SKILL_TOOLTIP = new KeyMapping(EpicFightMod.format("key.%s.show_tooltip"), InputConstants.KEY_LSHIFT, EpicFightMod.format("key.%s.gui")); |
17 | | - public static final KeyMapping SKILL_EDIT = new KeyMapping(EpicFightMod.format("key.%s.skill_gui"), InputConstants.KEY_K, EpicFightMod.format("key.%s.gui")); |
18 | | - public static final KeyMapping OPEN_CONFIG_SCREEN = new KeyMapping(EpicFightMod.format("key.%s.config"), -1, EpicFightMod.format("key.%s.gui")); |
| 16 | + // Key mappings for GUI |
| 17 | + public static final KeyMapping WEAPON_INNATE_SKILL_TOOLTIP = |
| 18 | + new KeyMapping( |
| 19 | + EpicFightMod.format("key.%s.show_tooltip"), |
| 20 | + KeyConflictContext.GUI, |
| 21 | + InputConstants.Type.KEYSYM, |
| 22 | + InputConstants.KEY_LSHIFT, |
| 23 | + EpicFightMod.format("key.%s.gui") |
| 24 | + ); |
| 25 | + |
| 26 | + public static final KeyMapping SKILL_EDIT = |
| 27 | + new KeyMapping( |
| 28 | + EpicFightMod.format("key.%s.skill_gui"), |
| 29 | + KeyConflictContext.IN_GAME, |
| 30 | + InputConstants.Type.KEYSYM, |
| 31 | + InputConstants.KEY_K, |
| 32 | + EpicFightMod.format("key.%s.gui") |
| 33 | + ); |
| 34 | + |
| 35 | + public static final KeyMapping OPEN_CONFIG_SCREEN = |
| 36 | + new KeyMapping( |
| 37 | + EpicFightMod.format("key.%s.config"), |
| 38 | + KeyConflictContext.IN_GAME, |
| 39 | + InputConstants.Type.KEYSYM, |
| 40 | + -1, |
| 41 | + EpicFightMod.format("key.%s.gui") |
| 42 | + ); |
19 | 43 |
|
20 | | - // Ingame |
21 | | - public static final KeyMapping SWITCH_MODE = new KeyMapping(EpicFightMod.format("key.%s.switch_mode"), InputConstants.KEY_R, EpicFightMod.format("key.%s.combat")); |
22 | | - public static final KeyMapping DODGE = new KeyMapping(EpicFightMod.format("key.%s.dodge"), InputConstants.KEY_LALT, EpicFightMod.format("key.%s.combat")); |
23 | | - public static final KeyMapping GUARD = new KeyMapping(EpicFightMod.format("key.%s.guard"), InputConstants.Type.MOUSE, InputConstants.MOUSE_BUTTON_RIGHT, EpicFightMod.format("key.%s.combat")); |
24 | | - public static final KeyMapping ATTACK = new CombatKeyMapping(EpicFightMod.format("key.%s.attack"), InputConstants.Type.MOUSE, InputConstants.MOUSE_BUTTON_LEFT, EpicFightMod.format("key.%s.combat")); |
25 | | - public static final KeyMapping WEAPON_INNATE_SKILL = new CombatKeyMapping(EpicFightMod.format("key.%s.weapon_innate_skill"), InputConstants.Type.MOUSE, InputConstants.MOUSE_BUTTON_LEFT, EpicFightMod.format("key.%s.combat")); |
26 | | - public static final KeyMapping MOVER_SKILL = new CombatKeyMapping(EpicFightMod.format("key.%s.mover_skill"), InputConstants.Type.KEYSYM, InputConstants.KEY_SPACE, EpicFightMod.format("key.%s.combat")); |
27 | | - public static final KeyMapping LOCK_ON = new KeyMapping(EpicFightMod.format("key.%s.lock_on"), InputConstants.KEY_G, EpicFightMod.format("key.%s.combat")); |
| 44 | + // Ingame key mappings |
| 45 | + public static final KeyMapping DODGE = |
| 46 | + new CombatKeyMapping( |
| 47 | + EpicFightMod.format("key.%s.dodge"), |
| 48 | + InputConstants.KEY_LALT, |
| 49 | + EpicFightMod.format("key.%s.combat") |
| 50 | + ); |
| 51 | + |
| 52 | + public static final KeyMapping GUARD = |
| 53 | + new CombatKeyMapping( |
| 54 | + EpicFightMod.format("key.%s.guard"), |
| 55 | + InputConstants.Type.MOUSE, |
| 56 | + InputConstants.MOUSE_BUTTON_RIGHT, |
| 57 | + EpicFightMod.format("key.%s.combat") |
| 58 | + ); |
| 59 | + |
| 60 | + public static final KeyMapping ATTACK = |
| 61 | + new CombatKeyMapping( |
| 62 | + EpicFightMod.format("key.%s.attack"), |
| 63 | + InputConstants.Type.MOUSE, |
| 64 | + InputConstants.MOUSE_BUTTON_LEFT, |
| 65 | + EpicFightMod.format("key.%s.combat")); |
| 66 | + |
| 67 | + public static final KeyMapping WEAPON_INNATE_SKILL = |
| 68 | + new CombatKeyMapping( |
| 69 | + EpicFightMod.format("key.%s.weapon_innate_skill"), |
| 70 | + InputConstants.Type.MOUSE, |
| 71 | + InputConstants.MOUSE_BUTTON_LEFT, |
| 72 | + EpicFightMod.format("key.%s.combat") |
| 73 | + ); |
| 74 | + |
| 75 | + public static final KeyMapping MOVER_SKILL = |
| 76 | + new CombatKeyMapping( |
| 77 | + EpicFightMod.format("key.%s.mover_skill"), |
| 78 | + InputConstants.KEY_SPACE, |
| 79 | + EpicFightMod.format("key.%s.combat") |
| 80 | + ); |
| 81 | + |
| 82 | + public static final KeyMapping SWITCH_MODE = |
| 83 | + new KeyMapping( |
| 84 | + EpicFightMod.format("key.%s.switch_mode"), |
| 85 | + KeyConflictContext.IN_GAME, |
| 86 | + InputConstants.Type.KEYSYM, |
| 87 | + InputConstants.KEY_R, |
| 88 | + EpicFightMod.format("key.%s.combat") |
| 89 | + ); |
| 90 | + |
| 91 | + public static final KeyMapping LOCK_ON = |
| 92 | + new KeyMapping( |
| 93 | + EpicFightMod.format("key.%s.lock_on"), |
| 94 | + KeyConflictContext.IN_GAME, |
| 95 | + InputConstants.Type.KEYSYM, |
| 96 | + InputConstants.KEY_G, |
| 97 | + EpicFightMod.format("key.%s.combat") |
| 98 | + ); |
28 | 99 |
|
29 | | - // System |
30 | | - public static final KeyMapping SWITCH_VANILLA_MODEL_DEBUGGING = new KeyMapping(EpicFightMod.format("key.%s.switch_vanilla_model_debug"), -1, EpicFightMod.format("key.%s.system")); |
| 100 | + // Systemical key mappings especially for debugging |
| 101 | + public static final KeyMapping SWITCH_VANILLA_MODEL_DEBUGGING = |
| 102 | + new KeyMapping( |
| 103 | + EpicFightMod.format("key.%s.switch_vanilla_model_debug"), |
| 104 | + KeyConflictContext.IN_GAME, |
| 105 | + InputConstants.Type.KEYSYM, |
| 106 | + -1, |
| 107 | + EpicFightMod.format("key.%s.system") |
| 108 | + ); |
31 | 109 |
|
32 | 110 | @SubscribeEvent |
33 | 111 | public static void registerKeys(RegisterKeyMappingsEvent event) { |
|
0 commit comments