Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: osc option hidetimeout not work #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion modern.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1669,8 +1669,18 @@ function request_tick()
end
end

-- check if cursor is in player
function cursor_in_player()
local x = state.last_mouseX
local y = state.last_mouseY
local gap = 32
local x_in = x ~= nil and x > gap and x < (osc_param.playresx - gap)
local y_in = y ~= nil and y > gap and y < (osc_param.playresy - gap)
return x_in and y_in
end

function mouse_leave()
if get_hidetimeout() >= 0 then
if get_hidetimeout() >= 0 and cursor_in_player() == false then
hide_osc()
end
-- reset mouse position
Expand Down