mouse handling refact
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-04-02 22:12:58 +02:00
parent 211af18c26
commit 8921f02821
7 changed files with 55 additions and 45 deletions

View File

@@ -355,14 +355,9 @@ function MinigameDDRWindow.update()
right = Input.right()
}
if Mouse.clicked() then
local mx = Mouse.x()
local my = Mouse.y()
for _, target in ipairs(mg.target_arrows) do
if mx >= target.x and mx < target.x + mg.arrow_size and
my >= mg.target_y and my < mg.target_y + mg.arrow_size then
input_map[target.dir] = true
end
for _, target in ipairs(mg.target_arrows) do
if Mouse.zone({ x = target.x, y = mg.target_y, w = mg.arrow_size, h = mg.arrow_size }) then
input_map[target.dir] = true
end
end