diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar new file mode 100644 index 0000000..db0c510 Binary files /dev/null and b/bin/RabiClone.jar differ diff --git a/bin/controls.config b/bin/controls.config deleted file mode 100644 index eb3def4..0000000 Binary files a/bin/controls.config and /dev/null differ diff --git a/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class b/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class index a6a321b..c75cc66 100644 Binary files a/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class and b/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/AWTKeyboard.class b/lib/bin/net/java/games/input/AWTKeyboard.class index 019512c..4345a62 100644 Binary files a/lib/bin/net/java/games/input/AWTKeyboard.class and b/lib/bin/net/java/games/input/AWTKeyboard.class differ diff --git a/lib/bin/net/java/games/input/AWTMouse.class b/lib/bin/net/java/games/input/AWTMouse.class index c82627b..9ca0133 100644 Binary files a/lib/bin/net/java/games/input/AWTMouse.class and b/lib/bin/net/java/games/input/AWTMouse.class differ diff --git a/lib/bin/net/java/games/input/AbstractController.class b/lib/bin/net/java/games/input/AbstractController.class index a685a49..8c4da9a 100644 Binary files a/lib/bin/net/java/games/input/AbstractController.class and b/lib/bin/net/java/games/input/AbstractController.class differ diff --git a/lib/bin/net/java/games/input/Controller.class b/lib/bin/net/java/games/input/Controller.class index 8683137..6456b6f 100644 Binary files a/lib/bin/net/java/games/input/Controller.class and b/lib/bin/net/java/games/input/Controller.class differ diff --git a/lib/bin/net/java/games/input/ControllerEnvironment.class b/lib/bin/net/java/games/input/ControllerEnvironment.class index 413bcca..2095dae 100644 Binary files a/lib/bin/net/java/games/input/ControllerEnvironment.class and b/lib/bin/net/java/games/input/ControllerEnvironment.class differ diff --git a/lib/bin/net/java/games/input/ControllerEvent.class b/lib/bin/net/java/games/input/ControllerEvent.class index c8d4a6b..fb83ee5 100644 Binary files a/lib/bin/net/java/games/input/ControllerEvent.class and b/lib/bin/net/java/games/input/ControllerEvent.class differ diff --git a/lib/bin/net/java/games/input/DIAbstractController.class b/lib/bin/net/java/games/input/DIAbstractController.class index ebbfc92..fbeeb30 100644 Binary files a/lib/bin/net/java/games/input/DIAbstractController.class and b/lib/bin/net/java/games/input/DIAbstractController.class differ diff --git a/lib/bin/net/java/games/input/DIKeyboard.class b/lib/bin/net/java/games/input/DIKeyboard.class index c47fd01..a3b111d 100644 Binary files a/lib/bin/net/java/games/input/DIKeyboard.class and b/lib/bin/net/java/games/input/DIKeyboard.class differ diff --git a/lib/bin/net/java/games/input/DIMouse.class b/lib/bin/net/java/games/input/DIMouse.class index fc5067f..ba6695c 100644 Binary files a/lib/bin/net/java/games/input/DIMouse.class and b/lib/bin/net/java/games/input/DIMouse.class differ diff --git a/lib/bin/net/java/games/input/DefaultControllerEnvironment$4.class b/lib/bin/net/java/games/input/DefaultControllerEnvironment$4.class index 3d2db77..9fa0138 100644 Binary files a/lib/bin/net/java/games/input/DefaultControllerEnvironment$4.class and b/lib/bin/net/java/games/input/DefaultControllerEnvironment$4.class differ diff --git a/lib/bin/net/java/games/input/DefaultControllerEnvironment.class b/lib/bin/net/java/games/input/DefaultControllerEnvironment.class index fecbbc5..b1e2d60 100644 Binary files a/lib/bin/net/java/games/input/DefaultControllerEnvironment.class and b/lib/bin/net/java/games/input/DefaultControllerEnvironment.class differ diff --git a/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class index eb4dd5f..56c351e 100644 Binary files a/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class index f47586d..c581e05 100644 Binary files a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/Keyboard.class b/lib/bin/net/java/games/input/Keyboard.class index 8e558df..0517cf8 100644 Binary files a/lib/bin/net/java/games/input/Keyboard.class and b/lib/bin/net/java/games/input/Keyboard.class differ diff --git a/lib/bin/net/java/games/input/LinuxAbstractController.class b/lib/bin/net/java/games/input/LinuxAbstractController.class index 023d9ac..9eef781 100644 Binary files a/lib/bin/net/java/games/input/LinuxAbstractController.class and b/lib/bin/net/java/games/input/LinuxAbstractController.class differ diff --git a/lib/bin/net/java/games/input/LinuxCombinedController.class b/lib/bin/net/java/games/input/LinuxCombinedController.class index aa6894c..3212eb6 100644 Binary files a/lib/bin/net/java/games/input/LinuxCombinedController.class and b/lib/bin/net/java/games/input/LinuxCombinedController.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class index 5fdf9c9..9e3df57 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class index 0a4abd0..1b97b4a 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class index b976f7f..b688771 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/LinuxJoystickAbstractController.class b/lib/bin/net/java/games/input/LinuxJoystickAbstractController.class index ca9ad22..ccd685f 100644 Binary files a/lib/bin/net/java/games/input/LinuxJoystickAbstractController.class and b/lib/bin/net/java/games/input/LinuxJoystickAbstractController.class differ diff --git a/lib/bin/net/java/games/input/LinuxKeyboard.class b/lib/bin/net/java/games/input/LinuxKeyboard.class index f9c1780..d668f9b 100644 Binary files a/lib/bin/net/java/games/input/LinuxKeyboard.class and b/lib/bin/net/java/games/input/LinuxKeyboard.class differ diff --git a/lib/bin/net/java/games/input/LinuxMouse.class b/lib/bin/net/java/games/input/LinuxMouse.class index 7c0a579..7335bd8 100644 Binary files a/lib/bin/net/java/games/input/LinuxMouse.class and b/lib/bin/net/java/games/input/LinuxMouse.class differ diff --git a/lib/bin/net/java/games/input/Mouse.class b/lib/bin/net/java/games/input/Mouse.class index f3e426f..8486d47 100644 Binary files a/lib/bin/net/java/games/input/Mouse.class and b/lib/bin/net/java/games/input/Mouse.class differ diff --git a/lib/bin/net/java/games/input/OSXAbstractController.class b/lib/bin/net/java/games/input/OSXAbstractController.class index a28f29a..b9b91fc 100644 Binary files a/lib/bin/net/java/games/input/OSXAbstractController.class and b/lib/bin/net/java/games/input/OSXAbstractController.class differ diff --git a/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class b/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class index 0f56b0b..769932f 100644 Binary files a/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class and b/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/OSXKeyboard.class b/lib/bin/net/java/games/input/OSXKeyboard.class index d974705..8dbb1e0 100644 Binary files a/lib/bin/net/java/games/input/OSXKeyboard.class and b/lib/bin/net/java/games/input/OSXKeyboard.class differ diff --git a/lib/bin/net/java/games/input/OSXMouse.class b/lib/bin/net/java/games/input/OSXMouse.class index efd02e2..afcccf5 100644 Binary files a/lib/bin/net/java/games/input/OSXMouse.class and b/lib/bin/net/java/games/input/OSXMouse.class differ diff --git a/lib/bin/net/java/games/input/RawDeviceInfo.class b/lib/bin/net/java/games/input/RawDeviceInfo.class index 8081c4c..6fb5051 100644 Binary files a/lib/bin/net/java/games/input/RawDeviceInfo.class and b/lib/bin/net/java/games/input/RawDeviceInfo.class differ diff --git a/lib/bin/net/java/games/input/RawHIDInfo.class b/lib/bin/net/java/games/input/RawHIDInfo.class index a352d40..5a13e86 100644 Binary files a/lib/bin/net/java/games/input/RawHIDInfo.class and b/lib/bin/net/java/games/input/RawHIDInfo.class differ diff --git a/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class index fe139ac..415474d 100644 Binary files a/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/RawKeyboard.class b/lib/bin/net/java/games/input/RawKeyboard.class index 03ff314..52a9320 100644 Binary files a/lib/bin/net/java/games/input/RawKeyboard.class and b/lib/bin/net/java/games/input/RawKeyboard.class differ diff --git a/lib/bin/net/java/games/input/RawKeyboardInfo.class b/lib/bin/net/java/games/input/RawKeyboardInfo.class index 255ba7e..d567c03 100644 Binary files a/lib/bin/net/java/games/input/RawKeyboardInfo.class and b/lib/bin/net/java/games/input/RawKeyboardInfo.class differ diff --git a/lib/bin/net/java/games/input/RawMouse.class b/lib/bin/net/java/games/input/RawMouse.class index 0388d1d..4702684 100644 Binary files a/lib/bin/net/java/games/input/RawMouse.class and b/lib/bin/net/java/games/input/RawMouse.class differ diff --git a/lib/bin/net/java/games/input/RawMouseInfo.class b/lib/bin/net/java/games/input/RawMouseInfo.class index be40482..1ecf8b6 100644 Binary files a/lib/bin/net/java/games/input/RawMouseInfo.class and b/lib/bin/net/java/games/input/RawMouseInfo.class differ diff --git a/lib/bin/net/java/games/input/jinput.properties b/lib/bin/net/java/games/input/jinput.properties index 2b0e575..3c6280c 100644 --- a/lib/bin/net/java/games/input/jinput.properties +++ b/lib/bin/net/java/games/input/jinput.properties @@ -1,2 +1,2 @@ -version=2.10 -date=13/05/2021 +version=2.11 +date=22/06/2022 diff --git a/lib/jinput.jar b/lib/jinput.jar index 63f40c2..3a5ae90 100644 Binary files a/lib/jinput.jar and b/lib/jinput.jar differ diff --git a/src/sig/RabiClone.java b/src/sig/RabiClone.java index a1fe908..0c404d7 100644 --- a/src/sig/RabiClone.java +++ b/src/sig/RabiClone.java @@ -2,6 +2,7 @@ package sig; import javax.swing.JFrame; +import net.java.games.input.AbstractController; import net.java.games.input.Controller; import net.java.games.input.ControllerEnvironment; import net.java.games.input.ControllerEvent; @@ -30,7 +31,6 @@ import sig.engine.KeyBind; import sig.engine.PaletteColor; import java.awt.Toolkit; -import java.awt.event.KeyEvent; import java.awt.RenderingHints; public class RabiClone implements ControllerListener{ @@ -67,7 +67,7 @@ public class RabiClone implements ControllerListener{ public static Player player; public static Maps CURRENT_MAP; - public static Controller[] CONTROLLERS = new Controller[] {}; + public static AbstractController[] CONTROLLERS = new AbstractController[] {}; public static long lastControllerScan = System.currentTimeMillis(); @@ -77,26 +77,11 @@ public class RabiClone implements ControllerListener{ public static long TIME = 0; public static long scaleTime; - public static boolean reloadControllerList = false; - public static HashMap> DEFAULT_KEYBINDS = new HashMap<>(); public static RenderingHints RENDERHINTS = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF); - public static void main(String[] args) { - CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().getControllers(); - - RabiClone r = new RabiClone(); - - ControllerEnvironment.getDefaultEnvironment().addControllerListener(r); - - while (true) { - if (System.currentTimeMillis() - lastControllerScan > 5000) { - lastControllerScan=System.currentTimeMillis(); - ControllerEnvironment.getDefaultEnvironment().rescanControllers(); - } - } - /*System.setProperty("sun.java2d.transaccel", "True"); + public static void main(String[] args) {System.setProperty("sun.java2d.transaccel", "True"); System.setProperty("sun.java2d.d3d", "True"); System.setProperty("sun.java2d.ddforcevram", "True"); System.setProperty("sun.java2d.xrender", "True"); @@ -151,14 +136,9 @@ public class RabiClone implements ControllerListener{ KeyBind.poll(); - if ((Key.isKeyHeld(KeyEvent.VK_F5)||reloadControllerList) && System.currentTimeMillis() - lastControllerScan > 5000) { - CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().rescanControllers(); - System.out.println(Arrays.toString(CONTROLLERS)); + if (System.currentTimeMillis() - lastControllerScan > 5000) { + ControllerEnvironment.getDefaultEnvironment().rescanControllers(); lastControllerScan = System.currentTimeMillis(); - if (reloadControllerList) { - ConfigureControls.LoadControls(); - } - reloadControllerList=false; } FRIENDLY_OBJ.clear(); @@ -192,7 +172,7 @@ public class RabiClone implements ControllerListener{ // System.out.println(TIME); } gameUpdateLoopStabilizer(dt); //This is hackish. Removing this slows down the game by about 30%. The timer runs slower. ??? - }*/ + } } public static void setupDefaultControls() { @@ -281,7 +261,7 @@ public class RabiClone implements ControllerListener{ ConfigureControls.updateHighlightSections(); } } - Controller[] newArr = new Controller[CONTROLLERS.length - 1]; + AbstractController[] newArr = new AbstractController[CONTROLLERS.length - 1]; for (int j = 0; j < CONTROLLERS.length; j++) { if (j != i) { newArr[(j > i ? j - 1 : j)] = CONTROLLERS[i]; diff --git a/src/sig/objects/ConfigureControls.java b/src/sig/objects/ConfigureControls.java index bfed807..38ea08f 100644 --- a/src/sig/objects/ConfigureControls.java +++ b/src/sig/objects/ConfigureControls.java @@ -43,9 +43,6 @@ public class ConfigureControls extends Object{ public ConfigureControls(Panel panel) { super(panel); RabiClone.BACKGROUND_COLOR = PaletteColor.WHITE; - if (GAME_CONTROLS_FILE.exists()) { - RabiClone.reloadControllerList = true; - } updateHighlightSections(); } @@ -204,41 +201,37 @@ public class ConfigureControls extends Object{ @Override public void draw(byte[] p) { - if (!RabiClone.reloadControllerList) { - int y = 4; - if (!assigningKey) { - selectedAction=null; - selectedKeybind=null; - for (Action a : Action.values()) { - if (RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY() sectionList = actionHighlightSections.get(a.ordinal()); - int startX=sectionList.get(i)*Font.PROFONT_12.getGlyphWidth()-4; - int endX=sectionList.get(i+1)*Font.PROFONT_12.getGlyphWidth()+4; - if (selectedKeybind==null&&RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY()=startX&&RabiClone.MOUSE_POS.getX()<=endX) { - Draw_Rect(p,PaletteColor.RED,startX,getY()+y,endX-startX,Font.PROFONT_12.getGlyphHeight()+4); - storedX=startX; - storedY=y; - storedEndX=endX; - selectedKeybind=KeyBind.KEYBINDS.get(a).get(i/2); - break; - } - } - Draw_Text_Ext(4,getY()+y,DisplayActionKeys(a),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.MIDNIGHT_BLUE); - y+=Font.PROFONT_12.getGlyphHeight()+4; + int y = 4; + if (!assigningKey) { + selectedAction=null; + selectedKeybind=null; + for (Action a : Action.values()) { + if (RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY() sectionList = actionHighlightSections.get(a.ordinal()); + int startX=sectionList.get(i)*Font.PROFONT_12.getGlyphWidth()-4; + int endX=sectionList.get(i+1)*Font.PROFONT_12.getGlyphWidth()+4; + if (selectedKeybind==null&&RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY()=startX&&RabiClone.MOUSE_POS.getX()<=endX) { + Draw_Rect(p,PaletteColor.RED,startX,getY()+y,endX-startX,Font.PROFONT_12.getGlyphHeight()+4); + storedX=startX; + storedY=y; + storedEndX=endX; + selectedKeybind=KeyBind.KEYBINDS.get(a).get(i/2); + break; + } } - } else { - Draw_Text_Ext(4, 4, new String("Press a key to assign to ").append(selectedAction), Font.PROFONT_12, Alpha.ALPHA0, PaletteColor.MIDNIGHT_BLUE); + Draw_Text_Ext(4,getY()+y,DisplayActionKeys(a),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.MIDNIGHT_BLUE); + y+=Font.PROFONT_12.getGlyphHeight()+4; + } + if (selectedKeybind!=null) { + Draw_Line(p,storedX,getY()+storedY,storedEndX,getY()+storedY+Font.PROFONT_12.getGlyphHeight()+4,PaletteColor.BLACK,Alpha.ALPHA32); + Draw_Line(p,storedX,getY()+storedY+Font.PROFONT_12.getGlyphHeight()+4,storedEndX,getY()+storedY,PaletteColor.BLACK,Alpha.ALPHA32); } } else { - Draw_Text_Ext(4, 4, new String("Preparing controller list..."), Font.PROFONT_12, Alpha.ALPHA0, PaletteColor.MIDNIGHT_BLUE); + Draw_Text_Ext(4, 4, new String("Press a key to assign to ").append(selectedAction), Font.PROFONT_12, Alpha.ALPHA0, PaletteColor.MIDNIGHT_BLUE); } }