mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2025-01-10 01:50:29 +01:00
Also show upper and lower box boundaries
This commit is contained in:
parent
27c0c2764c
commit
f4470596dc
30
init.lua
30
init.lua
@ -698,7 +698,7 @@ function schemedit.mark(pos)
|
|||||||
local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = pos1.y + sizey - 0.5, z = z + offset}, "schemedit:display")
|
local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = pos1.y + sizey - 0.5, z = z + offset}, "schemedit:display")
|
||||||
if marker ~= nil then
|
if marker ~= nil then
|
||||||
marker:set_properties({
|
marker:set_properties({
|
||||||
visual_size={x=(sizex+0.01) * 2, y=sizey * 2},
|
visual_size={x=(sizex+0.01) * 2, y=(sizey+0.01) * 2},
|
||||||
})
|
})
|
||||||
marker:get_luaentity().id = id
|
marker:get_luaentity().id = id
|
||||||
marker:get_luaentity().owner = owner
|
marker:get_luaentity().owner = owner
|
||||||
@ -719,9 +719,9 @@ function schemedit.mark(pos)
|
|||||||
local marker = minetest.add_entity({x = x + offset, y = pos1.y + sizey - 0.5, z = pos1.z + sizez - 0.5}, "schemedit:display")
|
local marker = minetest.add_entity({x = x + offset, y = pos1.y + sizey - 0.5, z = pos1.z + sizez - 0.5}, "schemedit:display")
|
||||||
if marker ~= nil then
|
if marker ~= nil then
|
||||||
marker:set_properties({
|
marker:set_properties({
|
||||||
visual_size={x=(sizez+0.01) * 2, y=sizey * 2},
|
visual_size={x=(sizez+0.01) * 2, y=(sizey+0.01) * 2},
|
||||||
})
|
})
|
||||||
marker:set_yaw(math.pi / 2)
|
marker:set_rotation({x=0, y=math.pi / 2, z=0})
|
||||||
marker:get_luaentity().id = id
|
marker:get_luaentity().id = id
|
||||||
marker:get_luaentity().owner = owner
|
marker:get_luaentity().owner = owner
|
||||||
table.insert(m, marker)
|
table.insert(m, marker)
|
||||||
@ -729,6 +729,30 @@ function schemedit.mark(pos)
|
|||||||
low = false
|
low = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
low = true
|
||||||
|
-- XZ plane markers
|
||||||
|
for _, y in ipairs({pos1.y - 0.5, pos2.y + 0.5}) do
|
||||||
|
if low then
|
||||||
|
offset = -0.01
|
||||||
|
else
|
||||||
|
offset = 0.01
|
||||||
|
end
|
||||||
|
|
||||||
|
local marker = minetest.add_entity({x = pos1.x + sizex - 0.5, y = y + offset, z = pos1.z + sizez - 0.5}, "schemedit:display")
|
||||||
|
if marker ~= nil then
|
||||||
|
marker:set_properties({
|
||||||
|
visual_size={x=(sizex+0.01) * 2, y=(sizez+0.01) * 2},
|
||||||
|
})
|
||||||
|
marker:set_rotation({x=math.pi/2, y=0, z=0})
|
||||||
|
marker:get_luaentity().id = id
|
||||||
|
marker:get_luaentity().owner = owner
|
||||||
|
table.insert(m, marker)
|
||||||
|
end
|
||||||
|
low = false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
schemedit.markers[id] = m
|
schemedit.markers[id] = m
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user