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/events/ChatReceivedEvent.kt | 6 ++++++ .../com/dulkirfabric/events/OverlayReceivedEvent.kt | 5 +++++ .../com/dulkirfabric/features/KeyShortCutImpl.kt | 21 +++++++++++++++++++++ .../com/dulkirfabric/features/NoReverseCam.kt | 4 ++++ 4 files changed, 36 insertions(+) create mode 100644 src/main/kotlin/com/dulkirfabric/events/ChatReceivedEvent.kt create mode 100644 src/main/kotlin/com/dulkirfabric/events/OverlayReceivedEvent.kt 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') diff --git a/src/main/kotlin/com/dulkirfabric/events/ChatReceivedEvent.kt b/src/main/kotlin/com/dulkirfabric/events/ChatReceivedEvent.kt new file mode 100644 index 0000000..892baf1 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/events/ChatReceivedEvent.kt @@ -0,0 +1,6 @@ +package com.dulkirfabric.events + +import com.dulkirfabric.events.base.CancellableEvent + +data class +ChatReceivedEvent(val message: String): CancellableEvent() \ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/events/OverlayReceivedEvent.kt b/src/main/kotlin/com/dulkirfabric/events/OverlayReceivedEvent.kt new file mode 100644 index 0000000..d97dda1 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/events/OverlayReceivedEvent.kt @@ -0,0 +1,5 @@ +package com.dulkirfabric.events + +import com.dulkirfabric.events.base.CancellableEvent + +data class OverlayReceivedEvent(val message: String): CancellableEvent() 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