aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/signal_api.lua
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-12-18 11:01:26 +0100
committerY. Wang <yw05@forksworld.de>2023-03-23 20:06:02 +0100
commit67efae9c9ad6f93aaa418d512c4ae1817eed6d24 (patch)
tree5959e058eed2c9b50909622fac6521e9aa964ad4 /advtrains_interlocking/signal_api.lua
parent640d72929d67a516cc870986bd27ed0408eb684d (diff)
downloadadvtrains-67efae9c9ad6f93aaa418d512c4ae1817eed6d24.tar.gz
advtrains-67efae9c9ad6f93aaa418d512c4ae1817eed6d24.tar.bz2
advtrains-67efae9c9ad6f93aaa418d512c4ae1817eed6d24.zip
Adjust signal aspect formspecs to be of similar size
Diffstat (limited to 'advtrains_interlocking/signal_api.lua')
-rw-r--r--advtrains_interlocking/signal_api.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua
index 54202f0..8bb92bf 100644
--- a/advtrains_interlocking/signal_api.lua
+++ b/advtrains_interlocking/signal_api.lua
@@ -137,14 +137,18 @@ function advtrains.interlocking.show_ip_form(pos, pname, only_notset)
if not minetest.check_player_privs(pname, "interlocking") then
return
end
- local form = "size[7,5]label[0.5,0.5;Signal at "..minetest.pos_to_string(pos).."]"
- form = form .. advtrains.interlocking.make_signal_formspec_tabheader(pname, pos, 7, 2)
+ local form = "size[7,6.5]label[0.5,0.5;Signal at "..minetest.pos_to_string(pos).."]"
+ local node = advtrains.ndb.get_node(pos)
+ local ndef = minetest.registered_nodes[node.name] or {}
+ if ndef.advtrains and ndef.advtrains.set_aspect then
+ form = form .. advtrains.interlocking.make_signal_formspec_tabheader(pname, pos, 7, 2)
+ end
advtrains.interlocking.db.check_for_duplicate_ip(pos)
local pts, connid = advtrains.interlocking.db.get_ip_by_signalpos(pos)
if pts then
form = form.."label[0.5,1.5;Influence point is set at "..pts.."/"..connid.."]"
- form = form.."button_exit[0.5,2.5; 5,1;set;Move]"
- form = form.."button_exit[0.5,3.5; 5,1;clear;Clear]"
+ form = form.."button_exit[0.5,4.25; 6,1;set;Move]"
+ form = form.."button_exit[0.5,5.25; 6,1;clear;Clear]"
local ipos = minetest.string_to_pos(pts)
ipmarker(ipos, connid)
else
@@ -152,7 +156,7 @@ function advtrains.interlocking.show_ip_form(pos, pname, only_notset)
form = form.."label[0.5,2.0;It is recommended to set an influence point.]"
form = form.."label[0.5,2.5;This is the point where trains will obey the signal.]"
- form = form.."button_exit[0.5,3.5; 5,1;set;Set]"
+ form = form.."button_exit[0.5,5.25; 6,1;set;Set]"
end
if not only_notset or not pts then
minetest.show_formspec(pname, "at_il_ipassign_"..minetest.pos_to_string(pos), form)