mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +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.OnClick = function(x, y, object)
|
||||
local onclose = object.parent.OnClose
|
||||
object.parent:Remove()
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user