aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-11-09 21:55:52 +0100
committerorwell <orwell@bleipb.de>2024-11-09 21:55:52 +0100
commit96f4ac7f6c2ff7fae56102640e9e63305ca64b16 (patch)
treeb281c20dc8c2b55875a5c561d8c4dcadb836d53b /advtrains/atc.lua
parent35167fe928e61ecf35c633014972e36c921a1b78 (diff)
parent943505a797e628ef8e447a8fdb362f777b325dec (diff)
downloadadvtrains-96f4ac7f6c2ff7fae56102640e9e63305ca64b16.tar.gz
advtrains-96f4ac7f6c2ff7fae56102640e9e63305ca64b16.tar.bz2
advtrains-96f4ac7f6c2ff7fae56102640e9e63305ca64b16.zip
Merge remote-tracking branch 'origin/l10n'
Diffstat (limited to 'advtrains/atc.lua')
-rw-r--r--advtrains/atc.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua
index c1ff218..b572cdc 100644
--- a/advtrains/atc.lua
+++ b/advtrains/atc.lua
@@ -106,7 +106,7 @@ local apn_func=function(pos)
-- FIX for long-persisting ndb bug: there's no node in parameter 2 of this function!
local meta=minetest.get_meta(pos)
if meta then
- meta:set_string("infotext", attrans("ATC controller, unconfigured."))
+ meta:set_string("infotext", attrans("Unconfigured ATC controller"))
meta:set_string("formspec", atc.get_atc_controller_formspec(pos, meta))
end
end
@@ -233,7 +233,7 @@ local matchptn={
advtrains.train_ensure_init(id, train)
-- no one minds if this failed... this shouldn't even be called without train being initialized...
else
- atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving!"))
+ atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving."))
end
return 1
end,
@@ -245,11 +245,11 @@ local matchptn={
end,
["K"] = function(id, train)
if train.door_open == 0 then
- atwarn(sid(id), attrans("ATC Kick command warning: Doors closed"))
+ atwarn(sid(id), attrans("ATC Kick command warning: doors are closed."))
return 1
end
if train.velocity > 0 then
- atwarn(sid(id), attrans("ATC Kick command warning: Train moving"))
+ atwarn(sid(id), attrans("ATC Kick command warning: train moving."))
return 1
end
local tp = train.trainparts
an class="hl opt">(mp.."/active_common.lua") dofile(mp.."/atc_rail.lua") dofile(mp.."/operation_panel.lua") dofile(mp.."/p_mesecon_iface.lua") dofile(mp.."/chatcmds.lua") local filename=minetest.get_worldpath().."/advtrains_luaautomation" local file, err = io.open(filename, "r") if not file then minetest.log("error", " Failed to read advtrains_luaautomation save data from file "..filename..": "..(err or "Unknown Error")) else local tbl = minetest.deserialize(file:read("*a")) if type(tbl) == "table" then if tbl.version==1 then for envname, data in pairs(tbl.envs) do atlatc.envs[envname]=atlatc.env_load(envname, data) end atlatc.active.load(tbl.active) atlatc.interrupt.load(tbl.interrupt) end else minetest.log("error", " Failed to read advtrains_luaautomation save data from file "..filename..": Not a table!") end file:close() end -- run init code of all environments atlatc.run_initcode() atlatc.save = function() --versions: -- 1 - Initial save format. local envdata={} for envname, env in pairs(atlatc.envs) do envdata[envname]=env:save() end local save_tbl={ version = 1, envs=envdata, active = atlatc.active.save(), interrupt = atlatc.interrupt.save(), } local datastr = minetest.serialize(save_tbl) if not datastr then minetest.log("error", " Failed to save advtrains_luaautomation save data to file "..filename..": Can't serialize!") return end local file, err = io.open(filename, "w") if err then minetest.log("error", " Failed to save advtrains_luaautomation save data to file "..filename..": "..(err or "Unknown Error")) return end file:write(datastr) file:close() end -- globalstep for step code local timer, step_int=0, 2 local stimer, sstep_int=0, 10 minetest.register_globalstep(function(dtime) timer=timer+dtime if timer>step_int then timer=0 atlatc.run_stepcode() end stimer=stimer+dtime if stimer>sstep_int then stimer=0 atlatc.save() end end) minetest.register_on_shutdown(atlatc.save)