From 936fd84f55c805abf93b137901f4dccc6ef8f465 Mon Sep 17 00:00:00 2001 From: Kuma <20806030+lkkuma@users.noreply.github.com> Date: Sat, 8 Mar 2025 11:50:37 -0500 Subject: [PATCH] Update zoneCreator.lua Refactored KeyMapped commands to prevent keybinds spamming chat outside of the zone creator --- client/zoneCreator.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/zoneCreator.lua b/client/zoneCreator.lua index 616fa2a..db4baa2 100644 --- a/client/zoneCreator.lua +++ b/client/zoneCreator.lua @@ -235,9 +235,8 @@ function zoneCreator.freecamMode(bool) end end -RegisterCommand('+usePoint', function() +local function usePoint() if not zoneCreator.active then return end - if not zoneCreator.cursor then return end if zoneCreator.deleteIndex then @@ -245,19 +244,20 @@ RegisterCommand('+usePoint', function() else zoneCreator.addPoint(zoneCreator.cursor) end -end, false) +end +RegisterCommand('+usePoint', usePoint, false) +RegisterCommand('-usePoint', usePoint, false) +RegisterKeyMapping('+usePoint', 'Add/Remove Point', 'keyboard', 'c') -RegisterCommand('+editPoint', function() +local function editPoint() if not zoneCreator.active then return end if not zoneCreator.cursor then return end - zoneCreator.editPoint() - -end, false) - +end +RegisterCommand('+editPoint', editPoint, false) +RegisterCommand('-editPoint', editPoint, false) RegisterKeyMapping('+editPoint', 'edit Point', 'keyboard', 'k') -RegisterKeyMapping('+usePoint', 'Add/Remove Point', 'keyboard', 'c') local function polyCreator() zoneCreator.freecamMode(false) @@ -363,4 +363,4 @@ end return { mloDoor = mloDoor, polyCreator = polyCreator -} \ No newline at end of file +}