From ac139186e4398e84a66daf25e70c47cd6c795d9d Mon Sep 17 00:00:00 2001 From: schl3ck Date: Sun, 8 May 2022 12:28:07 +0200 Subject: [PATCH] update callback functions to new signature and bump version --- info.toml | 5 +---- readme.md | 3 +++ src/Main.as | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/info.toml b/info.toml index f1ffaf3..7cc0107 100644 --- a/info.toml +++ b/info.toml @@ -4,10 +4,7 @@ author = "schl3ck" category = "Map Editor" siteid = 109 -version = "1.3.0" - -[game] -min_version = "2021-08-30" +version = "1.3.1" [script] imports = [ "Icons.as", "Permissions.as" ] diff --git a/readme.md b/readme.md index 6327e09..d6f9601 100644 --- a/readme.md +++ b/readme.md @@ -47,6 +47,9 @@ Download it from https://openplanet.nl/files/109. You can also find a tutorial t You can find the source code to this plugin on [GitHub](https://github.com/schl3ck/OPPlugin-advanced-free-block-mode) # Changelog +## v1.3.1 - 2022-05-08 +* Update callback functions to new signature + ## v1.3.0 - 2022-02-20 * Add ability to use modifier keys for keyboard shortcuts * Organize sections of UI into collapsing headers diff --git a/src/Main.as b/src/Main.as index afb71c9..fa61bd8 100644 --- a/src/Main.as +++ b/src/Main.as @@ -930,26 +930,26 @@ void RenderInterface() { } } -bool OnKeyPress(bool down, VirtualKey key) { +UI::InputBlocking OnKeyPress(bool down, VirtualKey key) { if (settingKeyInfoWaitingForKey !is null) { if (!ModifierKeys::Handle(down, key)) { auto keys = ModifierKeys::GetKeys(key); Keybindings::SetKey(settingKeyInfoWaitingForKey.name, keys); @settingKeyInfoWaitingForKey = null; - return true; + return UI::InputBlocking::Block; } } if (!settingShowInterface) - return false; + return UI::InputBlocking::DoNothing; CGameCtnEditorFree@ editor = GetMapEditor(); if (editor is null) - return false; + return UI::InputBlocking::DoNothing; // maybe handles it twice, but that is no problem ModifierKeys::Handle(down, key); - if (!down) return false; + if (!down) return UI::InputBlocking::DoNothing; bool handled = false; vec3 move = vec3(); @@ -979,7 +979,7 @@ bool OnKeyPress(bool down, VirtualKey key) { + " the block: \\$z" + tostring(settingNudgeModeRotation) ); - return false; + return UI::InputBlocking::DoNothing; } VirtualKey[] keyCombination = ModifierKeys::GetKeys(key); @@ -1087,7 +1087,7 @@ bool OnKeyPress(bool down, VirtualKey key) { handled = true; } } - return handled; + return handled ? UI::InputBlocking::Block : UI::InputBlocking::DoNothing; } void FocusCameraOnPivot() {