mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Added frame close event cancelling
Adds a check whether the OnClose event handler returned false, in which case it will not remove the object.
This commit is contained in:
parent
60ad73f8b7
commit
49d8772c15
@ -71,9 +71,14 @@ function newobject:initialize()
|
|||||||
close.parent = self
|
close.parent = self
|
||||||
close.OnClick = function(x, y, object)
|
close.OnClick = function(x, y, object)
|
||||||
local onclose = object.parent.OnClose
|
local onclose = object.parent.OnClose
|
||||||
object.parent:Remove()
|
|
||||||
if onclose then
|
if onclose then
|
||||||
onclose(object.parent)
|
local ret = onclose(object.parent)
|
||||||
|
|
||||||
|
if ret ~= false then
|
||||||
|
object.parent:Remove()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
object.parent:Remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user