Highlight the Northern border by default

This commit is contained in:
Wuzzy 2023-12-23 21:08:37 +01:00
parent f5beb59b54
commit 28ede3cc26
2 changed files with 13 additions and 2 deletions

View File

@ -937,7 +937,7 @@ function schemedit.mark(pos)
local offset
-- XY plane markers
for _, z in ipairs({pos1.z - 0.5, pos2.z + 0.5}) do
for i, z in ipairs({pos1.z - 0.5, pos2.z + 0.5}) do
if low then
offset = -0.01
else
@ -945,8 +945,17 @@ function schemedit.mark(pos)
end
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
local textures
if i == 2 then
if minetest.settings:get_bool("schemedit_highlight_north", true) then
-- Highlight Northern side
textures = marker:get_properties().textures
textures[1] = "("..textures[1] .. ")^[brighten"
end
end
marker:set_properties({
visual_size={x=(sizex+0.01) * 2, y=(sizey+0.01) * 2},
textures=textures,
})
marker:get_luaentity().id = id
marker:get_luaentity().owner = owner
@ -963,7 +972,6 @@ function schemedit.mark(pos)
else
offset = 0.01
end
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
marker:set_properties({

View File

@ -6,3 +6,6 @@ schemedit_export_lua (.lua file schematic export) bool false
# * edges: Show borders at the edges
# * checkers: Checker pattern at the sides
schemedit_border_style (Border style) enum edges edges,checkers
# If enabled, the Northern border marker will be brighter.
schemedit_highlight_north (Highlight Northern border) bool true