Move const to const.lua

This commit is contained in:
Insality
2019-12-05 21:34:26 +03:00
parent e45dce150d
commit f8a3b6f632
3 changed files with 17 additions and 16 deletions

View File

@@ -81,7 +81,6 @@ function M.after(count, callback)
end
local STRING = "string"
function M.node(node_or_name)
if type(node_or_name) == const.STRING then
return gui.get_node(node_or_name)
@@ -144,19 +143,8 @@ function M.is_enabled(node)
end
local pivots = {
[gui.PIVOT_CENTER] = vmath.vector3(0),
[gui.PIVOT_N] = vmath.vector3(0, 0.5, 0),
[gui.PIVOT_NE] = vmath.vector3(0.5, 0.5, 0),
[gui.PIVOT_E] = vmath.vector3(0.5, 0, 0),
[gui.PIVOT_SE] = vmath.vector3(0.5, -0.5, 0),
[gui.PIVOT_S] = vmath.vector3(0, -0.5, 0),
[gui.PIVOT_SW] = vmath.vector3(-0.5, -0.5, 0),
[gui.PIVOT_W] = vmath.vector3(-0.5, 0, 0),
[gui.PIVOT_NW] = vmath.vector3(-0.5, -0.5, 0),
}
function M.get_pivot_offset(pivot)
return pivots[pivot]
return const.PIVOTS[pivot]
end