From 8b69b68978e32d6f8e66fca06a8c7ed36523062f Mon Sep 17 00:00:00 2001 From: inglettronald Date: Sat, 10 Jun 2023 16:45:36 -0500 Subject: initial commit --- .../com/dulkirfabric/features/KeyShortCutImpl.kt | 21 +++++++++++++++++++++ .../com/dulkirfabric/features/NoReverseCam.kt | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt create mode 100644 src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt (limited to 'src/main/kotlin/com/dulkirfabric/features') diff --git a/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt b/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt new file mode 100644 index 0000000..c94c258 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt @@ -0,0 +1,21 @@ +package com.dulkirfabric.features + +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.WorldKeyPressEvent +import com.dulkirfabric.util.TextUtils +import meteordevelopment.orbit.EventHandler + +object KeyShortCutImpl { + @EventHandler + fun onKeyPress(event: WorldKeyPressEvent) { + DulkirConfig.configOptions.macrosList.forEach { + if (it.keyBinding.code == event.key) { + // This conditional allows for these shortcuts to work for commands or normal messages + if (it.command.startsWith("/")) + TextUtils.sendCommand(it.command.substring(1)) + else + TextUtils.sendMessage(it.command) + } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt b/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt new file mode 100644 index 0000000..b8cb36d --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt @@ -0,0 +1,4 @@ +package com.dulkirfabric.features + +class NoReverseCam { +} \ No newline at end of file -- cgit