Skip to content

Commit

Permalink
Prevent dragging window when already dragging another one
Browse files Browse the repository at this point in the history
  • Loading branch information
immortalx74 committed Dec 1, 2022
1 parent 7c6e31c commit 3997dc0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ui/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,12 @@ function UI.End( main_pass )
main_pass:setMaterial( cur_window.texture )
cur_window.unscaled_transform = lovr.math.newMat4( cur_window.transform )

if cur_window.id == hovered_window_id then
if cur_window.id == hovered_window_id and not window_drag.is_dragging then
if lovr.headset.wasPressed( dominant_hand, "grip" ) then
window_drag.offset:set( mat4( ray.pos, ray.ori ):invert() * cur_window.transform )
end
if lovr.headset.isDown( dominant_hand, "grip" ) then
window_drag.id = cur_window.id
window_drag.is_dragging = true

end
end

Expand Down

0 comments on commit 3997dc0

Please sign in to comment.