Skip to content

Commit

Permalink
Creation: Make ctrl work with BoxZone width and length controls
Browse files Browse the repository at this point in the history
Ctrl to go slower use to only work with heading controls for BoxZones. Now it works for width and length too.
  • Loading branch information
mkafrin committed Sep 5, 2020
1 parent 552a5cd commit 1c85a14
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions creation/BoxZone.lua
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
local function handleInput(useZ, heading, length, width, center)
if not useZ then
local scaleDelta, headingDelta = 0.2, 5
BlockWeaponWheelThisFrame()
DisableControlAction(0, 36, true)
if IsDisabledControlPressed(0, 36) then -- ctrl held down
scaleDelta, headingDelta = 0.05, 1
end

DisableControlAction(0, 81, true)
if IsDisabledControlJustPressed(0, 81) then
if IsControlPressed(0, 19) then -- alt held down
return heading, length, math.max(0.0, width - 0.2), center
return heading, length, math.max(0.0, width - scaleDelta), center
end
if IsControlPressed(0, 21) then -- shift held down
return heading, math.max(0.0, length - 0.2), width, center
return heading, math.max(0.0, length - scaleDelta), width, center
end
if IsDisabledControlPressed(0, 36) then -- ctrl held down
return (heading - 1) % 360, length, width, center
end
return (heading - 5) % 360, length, width, center
return (heading - headingDelta) % 360, length, width, center
end

DisableControlAction(0, 99, true)
if IsDisabledControlJustPressed(0, 99) then
if IsControlPressed(0, 19) then -- alt held down
return heading, length, math.max(0.0, width + 0.2), center
return heading, length, math.max(0.0, width + scaleDelta), center
end
if IsControlPressed(0, 21) then -- shift held down
return heading, math.max(0.0, length + 0.2), width, center
end
if IsDisabledControlPressed(0, 36) then -- ctrl held down
return (heading + 1) % 360, length, width, center
return heading, math.max(0.0, length + scaleDelta), width, center
end
return (heading + 5) % 360, length, width, center
return (heading + headingDelta) % 360, length, width, center
end
end

Expand Down

0 comments on commit 1c85a14

Please sign in to comment.