2121import de .bwravencl .controllerbuddy .input .Mode .Component ;
2222import de .bwravencl .controllerbuddy .input .Mode .Component .ComponentType ;
2323import de .bwravencl .controllerbuddy .input .Profile ;
24- import de .bwravencl .controllerbuddy .input .action .AxisToRelativeAxisAction ;
2524import de .bwravencl .controllerbuddy .input .action .ButtonToCycleAction ;
2625import de .bwravencl .controllerbuddy .input .action .ButtonToModeAction ;
2726import de .bwravencl .controllerbuddy .input .action .IAction ;
@@ -93,11 +92,14 @@ public final class EditActionsDialog extends JDialog {
9392
9493 private static final List <Class <?>> ON_SCREEN_KEYBOARD_ACTION_CLASSES ;
9594
95+ private static final List <Class <?>> TRIGGER_ACTION_CLASSES ;
96+
9697 @ Serial
9798 private static final long serialVersionUID = 5007388251349678609L ;
9899
99100 static {
100101 final List <Class <?>> mutableAxisActionClasses = new ArrayList <>();
102+ final List <Class <?>> mutableTriggerActionClasses = new ArrayList <>();
101103 final List <Class <?>> mutableButtonActionClasses = new ArrayList <>();
102104 final List <Class <?>> mutableCycleActionClasses = new ArrayList <>();
103105 final List <Class <?>> mutableOnScreenKeyboardActionClasses = new ArrayList <>();
@@ -119,9 +121,13 @@ public final class EditActionsDialog extends JDialog {
119121 // noinspection DataFlowIssue
120122 final var category = actionAnnotation .category ();
121123
122- if (category == ActionCategory .ALL || category == ActionCategory .AXIS ) {
124+ if (category == ActionCategory .ALL || category == ActionCategory .AXIS
125+ || category == ActionCategory .AXIS_AND_TRIGGER ) {
123126 mutableAxisActionClasses .add (actionClass );
124127 }
128+ if (category == ActionCategory .ALL || category == ActionCategory .AXIS_AND_TRIGGER ) {
129+ mutableTriggerActionClasses .add (actionClass );
130+ }
125131 if (category == ActionCategory .ALL || category == ActionCategory .BUTTON
126132 || category == ActionCategory .BUTTON_AND_CYCLES ) {
127133 mutableButtonActionClasses .add (actionClass );
@@ -136,6 +142,7 @@ public final class EditActionsDialog extends JDialog {
136142 }
137143
138144 AXIS_ACTION_CLASSES = Collections .unmodifiableList (mutableAxisActionClasses );
145+ TRIGGER_ACTION_CLASSES = Collections .unmodifiableList (mutableTriggerActionClasses );
139146 BUTTON_ACTION_CLASSES = Collections .unmodifiableList (mutableButtonActionClasses );
140147 CYCLE_ACTION_CLASSES = Collections .unmodifiableList (mutableCycleActionClasses );
141148 ON_SCREEN_KEYBOARD_ACTION_CLASSES = Collections .unmodifiableList (mutableOnScreenKeyboardActionClasses );
@@ -367,9 +374,8 @@ private List<Class<?>> getAllowedActionClasses() {
367374 final var componentIndex = component .getIndex ();
368375 if (componentIndex == SDLGamepad .SDL_GAMEPAD_AXIS_LEFT_TRIGGER
369376 || componentIndex == SDLGamepad .SDL_GAMEPAD_AXIS_RIGHT_TRIGGER ) {
370- return AXIS_ACTION_CLASSES . stream (). filter ( clazz -> clazz != AxisToRelativeAxisAction . class ). toList () ;
377+ return TRIGGER_ACTION_CLASSES ;
371378 }
372-
373379 return AXIS_ACTION_CLASSES ;
374380 } else if (Profile .DEFAULT_MODE .equals (selectedMode )) {
375381 return BUTTON_ACTION_CLASSES ;
0 commit comments