Merge carousel.love
This commit is contained in:
commit
fecff08fcf
|
@ -26,7 +26,7 @@ on.draw = function()
|
|||
--
|
||||
draw_menu()
|
||||
draw_next_frames_of_animations()
|
||||
if Window_in_focus then
|
||||
if Window_in_focus and Mouse_on_window then
|
||||
draw_button_tooltips(Global_state)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
Window_focus = true
|
||||
Window_in_focus = true
|
|
@ -0,0 +1 @@
|
|||
Mouse_on_window = true
|
|
@ -0,0 +1,3 @@
|
|||
on.mouse_focus = function(in_focus)
|
||||
Mouse_on_window = in_focus
|
||||
end
|
|
@ -22,7 +22,7 @@ function mouse_press_consumed_by_any_button(State, x, y, mouse_button)
|
|||
local button_pressed = false
|
||||
local consume_press = true
|
||||
for _,ev in ipairs(State.button_handlers) do
|
||||
if x>ev.x and x<ev.x+ev.w-1 and y>ev.y and y<ev.y+ev.h-1 then
|
||||
if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
|
||||
if ev.onpress1 and mouse_button == 1 then
|
||||
button_pressed = true
|
||||
if ev.onpress1() then
|
||||
|
@ -39,7 +39,7 @@ function draw_button_tooltips(State)
|
|||
local x,y = love.mouse.getPosition()
|
||||
for _,ev in ipairs(State.button_handlers) do
|
||||
if ev.tooltip then
|
||||
if x>ev.x and x<ev.x+ev.w-1 and y>ev.y and y<ev.y+ev.h-1 then
|
||||
if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
|
||||
ev.tooltip(x,y)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue