From 6c5c763f6749a1f5e10e43653d46131148e5c4f4 Mon Sep 17 00:00:00 2001 From: DokaDoka <31368547+DokaDoka@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:24:51 +1000 Subject: [PATCH] feat(resource/zoneCreator): undo last point for poly zones closes #346 --- resource/zoneCreator/client.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resource/zoneCreator/client.lua b/resource/zoneCreator/client.lua index 11e8b43..61ba45a 100644 --- a/resource/zoneCreator/client.lua +++ b/resource/zoneCreator/client.lua @@ -29,6 +29,7 @@ local function updateText() text[#text + 1] = ('Cycle display mode [G]: %s \n'):format(firstToUpper(displayModes[displayMode])) text[#text + 1] = ('Toggle Axis mode [C]: %s \n'):format(alignMovementWithCamera and 'Camera' or 'Grid') text[#text + 1] = 'Create new point - [Space] \n' + text[#text + 1] = 'Edit last point - [Backspace] \n' elseif zoneType == 'box' then text[#text + 1] = ('Heading [Q/E]: %s° \n'):format(heading) text[#text + 1] = ('Height [Shift + Scroll]: %s \n'):format(height) @@ -440,6 +441,15 @@ local function startCreator(arg, useLast) yCoord = round(coords.y) elseif IsDisabledControlJustReleased(0, 201) then -- enter closeCreator() + elseif IsDisabledControlJustReleased(0, 194) then -- backspace + change = true + + if zoneType == 'poly' and #points > 0 then + xCoord = points[#points].x + yCoord = points[#points].y + + points[#points] = nil + end elseif IsDisabledControlJustReleased(0, 200) then -- esc SetPauseMenuActive(false) closeCreator(true)