aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/tcb_ts_ui.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-07 01:18:23 +0100
committerorwell <orwell@bleipb.de>2025-01-07 01:18:23 +0100
commitfed637080a4dcfee889bdfa30ca4744018b92e00 (patch)
tree2170f9e3ffc1581f5f4f5ce6894bc72af7140c76 /advtrains_interlocking/tcb_ts_ui.lua
parent2e1681930c15954bead9c1b0ef9f4296508f60ee (diff)
downloadadvtrains-fed637080a4dcfee889bdfa30ca4744018b92e00.tar.gz
advtrains-fed637080a4dcfee889bdfa30ca4744018b92e00.tar.bz2
advtrains-fed637080a4dcfee889bdfa30ca4744018b92e00.zip
Add facility to auto-name signals when they are assigned
Diffstat (limited to 'advtrains_interlocking/tcb_ts_ui.lua')
-rwxr-xr-xadvtrains_interlocking/tcb_ts_ui.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index edc6921..9abd4f7 100755
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -192,6 +192,8 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
local tcbs = ildb.get_tcbs(sigd)
if tcbs then
ildb.assign_signal_to_tcbs(pos, sigd)
+ -- use auto-naming
+ advtrains.interlocking.add_autoname_to_tcbs(tcbs, pname)
minetest.chat_send_player(pname, "Configuring TCB: Successfully assigned signal.")
advtrains.interlocking.show_ip_form(pos, pname, true)
else
@@ -265,6 +267,8 @@ function advtrains.interlocking.self_tcb_make_after_place_callback(fail_silently
ildb.assign_signal_to_tcbs(pos, sigd)
-- assign influence point to itself
ildb.set_ip_signal(advtrains.roundfloorpts(pos), 1, pos)
+ -- use auto-naming
+ advtrains.interlocking.add_autoname_to_tcbs(tcbs, pname)
end
end
end
@@ -350,6 +354,8 @@ function advtrains.interlocking.self_tcb_make_on_rightclick_callback(fail_silent
ildb.assign_signal_to_tcbs(pos, sigd)
-- assign influence point to itself
ildb.set_ip_signal(advtrains.roundfloorpts(pos), 1, pos)
+ -- use auto-naming
+ advtrains.interlocking.add_autoname_to_tcbs(tcbs, pname)
end
-- in any case open the signalling form nouw
local control = player:get_player_control()