From 28ede3cc2666e695c6c1b23ce2b03d9af3c9517f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 23 Dec 2023 21:08:37 +0100 Subject: [PATCH] Highlight the Northern border by default --- init.lua | 12 ++++++++++-- settingtypes.txt | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 2a53d47..e7940a7 100644 --- a/init.lua +++ b/init.lua @@ -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({ diff --git a/settingtypes.txt b/settingtypes.txt index 321aae9..b18dfb2 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -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