v1.3.0: implemented new radial menus and made a bunch of keybind changes

This commit is contained in:
Evan Debenham
2022-07-01 13:37:51 -04:00
parent 2e595ed392
commit e3687bb2ca
21 changed files with 620 additions and 98 deletions
@@ -82,19 +82,17 @@ public class KeyBindings {
return GameAction.NONE;
}
public static ArrayList<Integer> getBoundKeysForAction(GameAction action){
ArrayList<Integer> result = new ArrayList<>();
for( int i : bindings.keySet() ){
if (bindings.get(i) == action){
result.add(i);
}
public static int getFirstKeyForAction(GameAction action, boolean preferController){
ArrayList<Integer> keys = getKeyboardKeysForAction(action);
ArrayList<Integer> buttons = getControllerKeysForAction(action);
if (preferController){
if (!buttons.isEmpty()) return buttons.get(0);
else if (!keys.isEmpty()) return keys.get(0);
} else {
if (!keys.isEmpty()) return keys.get(0);
else if (!buttons.isEmpty()) return buttons.get(0);
}
for( int i : controllerBindings.keySet() ){
if (controllerBindings.get(i) == action){
result.add(i);
}
}
return result;
return 0;
}
public static ArrayList<Integer> getKeyboardKeysForAction(GameAction action){