comparison Libs/DF/button.lua @ 28:7523376ecaa3

- framework update.
author Tercioo
date Fri, 18 Dec 2015 15:15:50 -0200
parents dbd417f413a8
children 5da06cb420d4
comparison
equal deleted inserted replaced
27:f9601754ab46 28:7523376ecaa3
852 end 852 end
853 853
854 local x, y = GetCursorPosition() 854 local x, y = GetCursorPosition()
855 x = _math_floor (x) 855 x = _math_floor (x)
856 y = _math_floor (y) 856 y = _math_floor (y)
857 if ((button.mouse_down+0.4 > GetTime() and (x == button.x and y == button.y)) or (x == button.x and y == button.y)) then 857 if (
858 (x == button.x and y == button.y) or
859 (button.mouse_down+0.5 > GetTime() and button:IsMouseOver())
860 ) then
858 if (buttontype == "LeftButton") then 861 if (buttontype == "LeftButton") then
859 button.MyObject.func (button, buttontype, button.MyObject.param1, button.MyObject.param2) 862 button.MyObject.func (button, buttontype, button.MyObject.param1, button.MyObject.param2)
860 else 863 else
861 button.MyObject.funcright (button, buttontype, button.MyObject.param1, button.MyObject.param2) 864 button.MyObject.funcright (button, buttontype, button.MyObject.param1, button.MyObject.param2)
862 end 865 end
934 if (not container) then 937 if (not container) then
935 container = parent 938 container = parent
936 end 939 end
937 940
938 if (name:find ("$parent")) then 941 if (name:find ("$parent")) then
939 name = name:gsub ("$parent", parent:GetName()) 942 local parentName = DF.GetParentName (parent)
943 name = name:gsub ("$parent", parentName)
940 end 944 end
941 945
942 local ButtonObject = {type = "button", dframework = true} 946 local ButtonObject = {type = "button", dframework = true}
943 947
944 if (member) then 948 if (member) then