From cb14c32b71e52406faa2e8cddd3270de8a58380d Mon Sep 17 00:00:00 2001 From: Gary Tierney Date: Sun, 25 Jun 2017 02:49:58 +0100 Subject: [PATCH] Add kotlin port of the walk/run toggle plugin --- game/src/plugins/run/meta.toml | 1 + game/src/plugins/run/src/run.plugin.kts | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 game/src/plugins/run/meta.toml create mode 100644 game/src/plugins/run/src/run.plugin.kts diff --git a/game/src/plugins/run/meta.toml b/game/src/plugins/run/meta.toml new file mode 100644 index 00000000..fd05752f --- /dev/null +++ b/game/src/plugins/run/meta.toml @@ -0,0 +1 @@ +name = "run" \ No newline at end of file diff --git a/game/src/plugins/run/src/run.plugin.kts b/game/src/plugins/run/src/run.plugin.kts new file mode 100644 index 00000000..00c6a470 --- /dev/null +++ b/game/src/plugins/run/src/run.plugin.kts @@ -0,0 +1,10 @@ +import org.apollo.game.message.impl.ButtonMessage + +val WALK_BUTTON_ID = 152 +val RUN_BUTTON_ID = 153 + +on { ButtonMessage::class } + .where { widgetId == WALK_BUTTON_ID || widgetId == RUN_BUTTON_ID } + .then { + it.toggleRunning() + } \ No newline at end of file