From 283efc44ce78001ebd17f64555eb795e36b27a61 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sat, 27 May 2023 12:09:10 +0200 Subject: Add function to get wagon in train from index Can be used to determine which wagon is at a certain world position Testing: use debugitems.lua --- advtrains/wagons.lua | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index fe1a0f8..b0fb575 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1418,3 +1418,64 @@ advtrains.register_wagon("advtrains:wagon_placeholder", { drops={}, }, "Wagon placeholder", "advtrains_wagon_placeholder.png", true) + + +-- Helper function to retrieve the wagon at a certain position in a train, given its train ID and the desired index within that train's path +-- +-- Returns: wagon_num, wagon_id, wagon_data, offset_from_center +-- wagon_num: The n'th wagon in the train (index into "trainparts" table) +-- wagon_id: The wagon ID. Obtain wagon data from advtrains.wagons[wagon_id], and subsequently the wagon prototype via advtrains.get_wagon_prototype(data) +-- offset_from_center: The offset (an absolute distance value) from the center point of the wagon. Positive is towards the end of the train, negative towards the start. (note that this is inverse to the counting direction of the index!) +-- +--[[ To get the wagon standing at a certain world position, you first need to retrieve the index via the occupation table, as follows: + local trains = advtrains.occ.get_trains_at(pos) + for train_id, index in pairs(trains) do + local wagon_num, wagon_id, wagon_data, offset_from_center = advtrains.get_wagon_at_index(train_id, index) + if wagon_num then + ... + end + end +]]-- +function advtrains.get_wagon_at_index(train_id, w_index) + local train = advtrains.trains[train_id] + if not train then error("Passed train id "..train_id.." doesnt exist") end + -- ensure init - always required + advtrains.train_ensure_init(train_id, train) + -- Use path dist to determine the offset from the start of the train + local dstart = advtrains.path_get_path_dist_fractional(train, train.index) + local dtarget = advtrains.path_get_path_dist_fractional(train, w_index) + local dist_from_start = dstart - dtarget -- NOTE: dist_from_start is supposed to be positive, but dtarget will be smaller than dstart + -- if dist_from_start is <0, we are outside of train + if dist_from_start < 0 then + return nil + end + -- scan over wagons to see if dist_from_start falls into its window + local start_pos = 0 + local center_pos + local end_pos + local i = 1 + while train.trainparts[i] do + local w_id = train.trainparts[i] + -- get wagon prototype to retrieve wagon span + local wdata = advtrains.wagons[w_id] + if wdata then + local wtype, wproto = advtrains.get_wagon_prototype(wdata) + local wagon_span = wproto.wagon_span + -- determine center and end pos + center_pos = start_pos + wagon_span + end_pos = center_pos + wagon_span + if start_pos <= dist_from_start and dist_from_start < end_pos then + -- Found the correct wagon in the train! + local offset_from_center = dist_from_start - center_pos + return i, w_id, wdata, offset_from_center + end + -- go on + start_pos = end_pos + else + error("Wagon "..w_id.." from train "..train_id.." doesnt exist!") + end + i = i + 1 + end + -- nothing found, dist must be further back + return nil +end \ No newline at end of file -- cgit v1.2.3 From 2884ed3e27b2a850ea21866ba5260d5a41f5f825 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 20 Jul 2023 21:36:06 +0200 Subject: advtrains_techage: Liquid infotext display needs to be added in core --- advtrains/wagons.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index b0fb575..62e65af 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -364,6 +364,15 @@ function wagon:on_step(dtime) outside = outside .."\n!!! Train off track !!!" end + -- liquid container: display liquid contents in infotext + if self.techage_liquid_capacity then + if data.techage_liquid and data.techage_liquid.name then + outside = outside .."\nLiquid: "..data.techage_liquid.name..", "..data.techage_liquid.amount.." units" + else + outside = outside .."\nLiquid: empty" + end + end + if self.infotext_cache~=outside then self.object:set_properties({infotext=outside}) self.infotext_cache=outside -- cgit v1.2.3 From 950d6f640cae76d28253fadb7974a064017b104c Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 4 Sep 2023 19:34:47 +0200 Subject: Begin major rework of track registration system --- advtrains/api_doc.txt | 2 - advtrains/copytool.lua | 2 +- advtrains/helpers.lua | 6 +- advtrains/nodedb.lua | 6 +- advtrains/oldtracks.lua | 751 ++++++++++++++++++++++++ advtrains/passive.lua | 90 ++- advtrains/path.lua | 7 +- advtrains/signals.lua | 7 +- advtrains/trackplacer.lua | 592 ++++++++----------- advtrains/tracks.lua | 1038 ++++++++++----------------------- advtrains/trainlogic.lua | 12 +- advtrains/wagons.lua | 5 +- advtrains_interlocking/init.lua | 4 +- advtrains_line_automation/init.lua | 4 +- advtrains_signals_ks/init.lua | 21 +- advtrains_train_track/init.lua | 1109 ++++++------------------------------ advtrains_train_track/oldinit.lua | 937 ++++++++++++++++++++++++++++++ 17 files changed, 2443 insertions(+), 2150 deletions(-) create mode 100644 advtrains/oldtracks.lua create mode 100644 advtrains_train_track/oldinit.lua (limited to 'advtrains/wagons.lua') diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt index 5668ba3..6b338a7 100644 --- a/advtrains/api_doc.txt +++ b/advtrains/api_doc.txt @@ -18,8 +18,6 @@ advtrains.register_wagon(name, prototype, description, inventory_image) # Wagon prototype properties { ... all regular luaentity properties (mesh, textures, collisionbox a.s.o)... - drives_on = {default=true}, - ^- used to define the tracktypes (see below) that wagon can drive on. The tracktype identifiers are given as keys, similar to privileges) max_speed = 10, ^- optional, default 10: defines the maximum speed this wagon can drive. The maximum speed of a train is determined by the wagon with the lowest max_speed value. seats = { diff --git a/advtrains/copytool.lua b/advtrains/copytool.lua index 0c1cdfe..8a6d2f7 100644 --- a/advtrains/copytool.lua +++ b/advtrains/copytool.lua @@ -21,7 +21,7 @@ minetest.register_tool("advtrains:copytool", { local node=minetest.get_node_or_nil(pointed_thing.under) if not node then atprint("[advtrains]Ignore at placer position") return itemstack end local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, {default=true})) then + if(not advtrains.is_track(nodename)) then atprint("no track here, not placing.") return itemstack end diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua index 7e078fb..7a774d9 100644 --- a/advtrains/helpers.lua +++ b/advtrains/helpers.lua @@ -294,7 +294,7 @@ end -- Going from the rail at pos (does not need to be rounded) along connection with id conn_idx, if there is a matching rail, return it and the matching connid -- returns: , , , -- parameter this_conns_p is connection table of this rail and is optional, is determined by get_rail_info_at if not provided. -function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx, drives_on) +function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx) local this_pos = advtrains.round_vector_floor_y(this_posnr) local this_conns = this_conns_p local _ @@ -318,11 +318,11 @@ function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx, drives_ adj_pos.y = adj_pos.y + 1 end - local nextnode_ok, nextconns, nextrail_y=advtrains.get_rail_info_at(adj_pos, drives_on) + local nextnode_ok, nextconns, nextrail_y=advtrains.get_rail_info_at(adj_pos) if not nextnode_ok then adj_pos.y = adj_pos.y - 1 conn_y = conn_y + 1 - nextnode_ok, nextconns, nextrail_y=advtrains.get_rail_info_at(adj_pos, drives_on) + nextnode_ok, nextconns, nextrail_y=advtrains.get_rail_info_at(adj_pos) if not nextnode_ok then return nil end diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua index 41ac089..39106b2 100644 --- a/advtrains/nodedb.lua +++ b/advtrains/nodedb.lua @@ -268,17 +268,17 @@ end --false if it's not a rail or the train does not drive on this rail, but it is loaded or --nil if the node is neither loaded nor in trackdb --the distraction between false and nil will be needed only in special cases.(train initpos) -function advtrains.get_rail_info_at(pos, drives_on) +function advtrains.get_rail_info_at(pos) local rdp=advtrains.round_vector_floor_y(pos) local node=ndb.get_node_or_nil(rdp) if not node then return end local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, drives_on)) then + if(not advtrains.is_track(nodename)) then return false end - local conns, railheight, tracktype=advtrains.get_track_connections(node.name, node.param2) + local conns, railheight = advtrains.get_track_connections(node.name, node.param2) return true, conns, railheight end diff --git a/advtrains/oldtracks.lua b/advtrains/oldtracks.lua new file mode 100644 index 0000000..c415143 --- /dev/null +++ b/advtrains/oldtracks.lua @@ -0,0 +1,751 @@ +--advtrains by orwell96, see readme.txt + +--dev-time settings: +--EDIT HERE +--If the old non-model rails on straight tracks should be replaced by the new... +--false: no +--true: yes +advtrains.register_replacement_lbms=false + +--[[TracksDefinition +nodename_prefix +texture_prefix +description +common={} +straight={} +straight45={} +curve={} +curve45={} +lswitchst={} +lswitchst45={} +rswitchst={} +rswitchst45={} +lswitchcr={} +lswitchcr45={} +rswitchcr={} +rswitchcr45={} +vert1={ + --you'll probably want to override mesh here +} +vert2={ + --you'll probably want to override mesh here +} +]]-- +advtrains.all_tracktypes={} + +--definition preparation +local function conns(c1, c2, r1, r2) return {{c=c1, y=r1}, {c=c2, y=r2}} end +local function conns3(c1, c2, c3, r1, r2, r3) return {{c=c1, y=r1}, {c=c2, y=r2}, {c=c3, y=r3}} end + +advtrains.ap={} +advtrains.ap.t_30deg_flat={ + regstep=1, + variant={ + st={ + conns = conns(0,8), + desc = "straight", + tpdouble = true, + tpsingle = true, + trackworker = "cr", + }, + cr={ + conns = conns(0,7), + desc = "curve", + tpdouble = true, + trackworker = "swlst", + }, + swlst={ + conns = conns3(0,8,7), + desc = "left switch (straight)", + trackworker = "swrst", + switchalt = "cr", + switchmc = "on", + switchst = "st", + switchprefix = "swl", + }, + swlcr={ + conns = conns3(0,7,8), + desc = "left switch (curve)", + trackworker = "swrcr", + switchalt = "st", + switchmc = "off", + switchst = "cr", + switchprefix = "swl", + }, + swrst={ + conns = conns3(0,8,9), + desc = "right switch (straight)", + trackworker = "st", + switchalt = "cr", + switchmc = "on", + switchst = "st", + switchprefix = "swr", + }, + swrcr={ + conns = conns3(0,9,8), + desc = "right switch (curve)", + trackworker = "st", + switchalt = "st", + switchmc = "off", + switchst = "cr", + switchprefix = "swr", + }, + }, + regtp=true, + tpdefault="st", + trackworker={ + ["swrcr"]="st", + ["swrst"]="st", + ["cr"]="swlst", + ["swlcr"]="swrcr", + ["swlst"]="swrst", + }, + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_yturnout={ + regstep=1, + variant={ + l={ + conns = conns3(0,7,9), + desc = "Y-turnout (left)", + switchalt = "r", + switchmc = "off", + switchst = "l", + switchprefix = "", + }, + r={ + conns = conns3(0,9,7), + desc = "Y-turnout (right)", + switchalt = "l", + switchmc = "on", + switchst = "r", + switchprefix = "", + } + }, + regtp=true, + tpdefault="l", + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_s3way={ + regstep=1, + variant={ + l={ + conns = { {c=0}, {c=7}, {c=8}, {c=9}, {c=0} }, + desc = "3-way turnout (left)", + switchalt = "s", + switchst="l", + switchprefix = "", + }, + s={ + conns = { {c=0}, {c=8}, {c=7}, {c=9}, {c=0} }, + desc = "3-way turnout (straight)", + switchalt ="r", + switchst = "s", + switchprefix = "", + }, + r={ + conns = { {c=0}, {c=9}, {c=8}, {c=7}, {c=0} }, + desc = "3-way turnout (right)", + switchalt = "l", + switchst="r", + switchprefix = "", + } + }, + regtp=true, + tpdefault="l", + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_30deg_slope={ + regstep=1, + variant={ + vst1={conns = conns(8,0,0,0.5), rail_y = 0.25, desc = "steep uphill 1/2", slope=true}, + vst2={conns = conns(8,0,0.5,1), rail_y = 0.75, desc = "steep uphill 2/2", slope=true}, + vst31={conns = conns(8,0,0,0.33), rail_y = 0.16, desc = "uphill 1/3", slope=true}, + vst32={conns = conns(8,0,0.33,0.66), rail_y = 0.5, desc = "uphill 2/3", slope=true}, + vst33={conns = conns(8,0,0.66,1), rail_y = 0.83, desc = "uphill 3/3", slope=true}, + }, + regsp=true, + slopeplacer={ + [2]={"vst1", "vst2"}, + [3]={"vst31", "vst32", "vst33"}, + max=3,--highest entry + }, + slopeplacer_45={ + [2]={"vst1_45", "vst2_45"}, + max=2, + }, + rotation={"", "_30", "_45", "_60"}, + trackworker={}, + increativeinv={}, +} +advtrains.ap.t_30deg_straightonly={ + regstep=1, + variant={ + st={ + conns = conns(0,8), + desc = "straight", + tpdouble = true, + tpsingle = true, + trackworker = "st", + }, + }, + regtp=true, + tpdefault="st", + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_30deg_straightonly_noplacer={ + regstep=1, + variant={ + st={ + conns = conns(0,8), + desc = "straight", + tpdouble = true, + tpsingle = true, + trackworker = "st", + }, + }, + tpdefault="st", + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_45deg={ + regstep=2, + variant={ + st={ + conns = conns(0,8), + desc = "straight", + tpdouble = true, + tpsingle = true, + trackworker = "cr", + }, + cr={ + conns = conns(0,6), + desc = "curve", + tpdouble = true, + trackworker = "swlst", + }, + swlst={ + conns = conns3(0,8,6), + desc = "left switch (straight)", + trackworker = "swrst", + switchalt = "cr", + switchmc = "on", + switchst = "st", + }, + swlcr={ + conns = conns3(0,6,8), + desc = "left switch (curve)", + trackworker = "swrcr", + switchalt = "st", + switchmc = "off", + switchst = "cr", + }, + swrst={ + conns = conns3(0,8,10), + desc = "right switch (straight)", + trackworker = "st", + switchalt = "cr", + switchmc = "on", + switchst = "st", + }, + swrcr={ + conns = conns3(0,10,8), + desc = "right switch (curve)", + trackworker = "st", + switchalt = "st", + switchmc = "off", + switchst = "cr", + }, + }, + regtp=true, + tpdefault="st", + trackworker={ + ["swrcr"]="st", + ["swrst"]="st", + ["cr"]="swlst", + ["swlcr"]="swrcr", + ["swlst"]="swrst", + }, + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_perpcrossing={ + regstep = 1, + variant={ + st={ + conns = { {c=0}, {c=8}, {c=4}, {c=12} }, + desc = "perpendicular crossing", + tpdouble = true, + tpsingle = true, + trackworker = "st", + }, + }, + regtp=true, + tpdefault="st", + rotation={"", "_30", "_45", "_60"}, +} +advtrains.ap.t_90plusx_crossing={ + regstep = 1, + variant={ + ["30l"]={ + conns = { {c=0}, {c=8}, {c=1}, {c=9} }, + desc = "30/90 degree crossing (left)", + tpdouble = true, + tpsingle = true, + trackworker = "45l" + }, + ["45l"]={ + conns = { {c=0}, {c=8}, {c=2}, {c=10} }, + desc = "45/90 degree crossing (left)", + tpdouble = true, + tpsingle = true, + trackworker = "60l", + }, + ["60l"]={ + conns = { {c=0}, {c=8}, {c=3}, {c=11}}, + desc = "60/90 degree crossing (left)", + tpdouble = true, + tpsingle = true, + trackworker = "60r", + }, + ["60r"]={ + conns = { {c=0}, {c=8}, {c=5}, {c=13} }, + desc = "60/90 degree crossing (right)", + tpdouble = true, + tpsingle = true, + trackworker = "45r" + }, + ["45r"]={ + conns = { {c=0}, {c=8}, {c=6}, {c=14} }, + desc = "45/90 degree crossing (right)", + tpdouble = true, + tpsingle = true, + trackworker = "30r", + }, + ["30r"]={ + conns = { {c=0}, {c=8}, {c=7}, {c=15}}, + desc = "30/90 degree crossing (right)", + tpdouble = true, + tpsingle = true, + trackworker = "30l", + }, + }, + regtp=true, + tpdefault="30l", + rotation={""}, + trackworker = { + ["30l"] = "45l", + ["45l"] = "60l", + ["60l"] = "60r", + ["60r"] = "45r", + ["45r"] = "30r", + ["30r"] = "30l", + } +} + +advtrains.ap.t_diagonalcrossing = { + regstep=1, + variant={ + ["30l45r"]={ + conns = {{c=1}, {c=9}, {c=6}, {c=14}}, + desc = "30left-45right diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="60l30l", + }, + ["60l30l"]={ + conns = {{c=3}, {c=11}, {c=1}, {c=9}}, + desc = "30left-60right diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="60l45r" + }, + ["60l45r"]={ + conns = {{c=3}, {c=11}, {c=6}, {c=14}}, + desc = "60left-45right diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="60l60r" + }, + ["60l60r"]={ + conns = {{c=3}, {c=11}, {c=5}, {c=13}}, + desc = "60left-60right diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="60r45l", + }, + --If 60l60r had a mirror image, it would be here, but it's symmetric. + -- 60l60r is also equivalent to 30l30r but rotated 90 degrees. + ["60r45l"]={ + conns = {{c=5}, {c=13}, {c=2}, {c=10}}, + desc = "60right-45left diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="60r30r", + }, + ["60r30r"]={ + conns = {{c=5}, {c=13}, {c=7}, {c=15}}, + desc = "60right-30right diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="30r45l", + }, + ["30r45l"]={ + conns = {{c=7}, {c=15}, {c=2}, {c=10}}, + desc = "30right-45left diagonal crossing", + tpdouble=true, + tpsingle=true, + trackworker="30l45r", + }, + + }, + regtp=true, + tpdefault="30l45r", + rotation={""}, + trackworker = { + ["30l45r"] = "60l30l", + ["60l30l"] = "60l45r", + ["60l45r"] = "60l60r", + ["60l60r"] = "60r45l", + ["60r45l"] = "60r30r", + ["60r30r"] = "30r45l", + ["30r45l"] = "30l45r", + } +} + +advtrains.trackpresets = advtrains.ap + +--definition format: ([] optional) +--[[{ + nodename_prefix + texture_prefix + [shared_texture] + models_prefix + models_suffix (with dot) + [shared_model] + formats={ + st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 + (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) + } + common={} change something on common rail appearance +} +[18.12.17] Note on new connection system: +In order to support real rail crossing nodes and finally make the trackplacer respect switches, I changed the connection system. +There can be a variable number of connections available. These are specified as tuples {c=, y=} +The table "at_conns" consists of {, ...} +the "at_rail_y" property holds the value that was previously called "railheight" +Depending on the number of connections: +2 conns: regular rail +3 conns: switch: + - when train passes in at conn1, will move out of conn2 + - when train passes in at conn2 or conn3, will move out of conn1 +4 conns: cross (or cross switch, depending on arrangement of conns): + - conn1 <> conn2 + - conn3 <> conn4 +]] + +-- Notify the user if digging the rail is not allowed +local function can_dig_callback(pos, player) + local ok, reason = advtrains.can_dig_or_modify_track(pos) + if not ok and player then + minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed!") .. " " .. reason) + end + return ok +end + +function advtrains.register_tracks(tracktype, def, preset) + advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault) + if preset.regtp then + advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description, def) + end + if preset.regsp then + advtrains.slope.register_placer(def, preset) + end + for suffix, var in pairs(preset.variant) do + for rotid, rotation in ipairs(preset.rotation) do + if not def.formats[suffix] or def.formats[suffix][rotid] then + local img_suffix = suffix..rotation + local ndef = advtrains.merge_tables({ + description=def.description.."("..(var.desc or "any")..rotation..")", + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2}, + }, + + mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix), + tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png"), def.second_texture}, + + groups = { + attached_node = advtrains.IGNORE_WORLD and 0 or 1, + advtrains_track=1, + ["advtrains_track_"..tracktype]=1, + save_in_at_nodedb=1, + dig_immediate=2, + not_in_creative_inventory=1, + not_blocking_trains=1, + }, + + can_dig = can_dig_callback, + after_dig_node=function(pos) + advtrains.ndb.update(pos) + end, + after_place_node=function(pos) + advtrains.ndb.update(pos) + end, + at_nnpref = def.nodename_prefix, + at_suffix = suffix, + at_rotation = rotation, + at_rail_y = var.rail_y + }, def.common or {}) + + if preset.regtp then + ndef.drop = def.nodename_prefix.."_placer" + end + if preset.regsp and var.slope then + ndef.drop = def.nodename_prefix.."_slopeplacer" + end + + --connections + ndef.at_conns = advtrains.rotate_conn_by(var.conns, (rotid-1)*preset.regstep) + + local ndef_avt_table + + if var.switchalt and var.switchst then + local switchfunc=function(pos, node, newstate) + newstate = newstate or var.switchalt -- support for 3 (or more) state switches + -- this code is only called from the internal setstate function, which + -- ensures that it is safe to switch the turnout + if newstate~=var.switchst then + advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..(var.switchprefix or "")..newstate..rotation, param2=node.param2}) + advtrains.invalidate_all_paths(pos) + end + end + ndef.on_rightclick = function(pos, node, player) + if advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then + advtrains.setstate(pos, nil, node) + advtrains.log("Switch", player:get_player_name(), pos) + end + end + if var.switchmc then + ndef.mesecons = {effector = { + ["action_"..var.switchmc] = function(pos, node) + advtrains.setstate(pos, nil, node) + end, + rules=advtrains.meseconrules + }} + end + ndef_avt_table = { + getstate = var.switchst, + setstate = switchfunc, + } + end + + local adef={} + if def.get_additional_definiton then + adef=def.get_additional_definiton(def, preset, suffix, rotation) + end + ndef = advtrains.merge_tables(ndef, adef) + + -- insert getstate/setstate functions after merging the additional definitions + if ndef_avt_table then + ndef.advtrains = advtrains.merge_tables(ndef.advtrains or {}, ndef_avt_table) + end + + minetest.register_node(":"..def.nodename_prefix.."_"..suffix..rotation, ndef) + --trackplacer + if preset.regtp then + local tpconns = {conn1=ndef.at_conns[1].c, conn2=ndef.at_conns[2].c} + if var.tpdouble then + advtrains.trackplacer.add_double_conn(def.nodename_prefix, suffix, rotation, tpconns) + end + if var.tpsingle then + advtrains.trackplacer.add_single_conn(def.nodename_prefix, suffix, rotation, tpconns) + end + end + advtrains.trackplacer.add_worked(def.nodename_prefix, suffix, rotation, var.trackworker) + end + end + end + advtrains.all_tracktypes[tracktype]=true +end + +function advtrains.is_track_and_drives_on(nodename, drives_on_p) + local drives_on = drives_on_p + if not drives_on then drives_on = advtrains.all_tracktypes end + local hasentry = false + for _,_ in pairs(drives_on) do + hasentry=true + end + if not hasentry then drives_on = advtrains.all_tracktypes end + + if not minetest.registered_nodes[nodename] then + return false + end + local nodedef=minetest.registered_nodes[nodename] + for k,v in pairs(drives_on) do + if nodedef.groups["advtrains_track_"..k] then + return true + end + end + return false +end + +function advtrains.get_track_connections(name, param2) + local nodedef=minetest.registered_nodes[name] + if not nodedef then atprint(" get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return nil end + local noderot=param2 + if not param2 then noderot=0 end + if noderot > 3 then atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end + + local tracktype + for k,_ in pairs(nodedef.groups) do + local tt=string.match(k, "^advtrains_track_(.+)$") + if tt then + tracktype=tt + end + end + return advtrains.rotate_conn_by(nodedef.at_conns, noderot*AT_CMAX/4), (nodedef.at_rail_y or 0), tracktype +end + +-- Function called when a track is about to be dug or modified by the trackworker +-- Returns either true (ok) or false,"translated string describing reason why it isn't allowed" +function advtrains.can_dig_or_modify_track(pos) + if advtrains.get_train_at_pos(pos) then + return false, attrans("Position is occupied by a train.") + end + -- interlocking: tcb, signal IP a.s.o. + if advtrains.interlocking then + -- TCB? + if advtrains.interlocking.db.get_tcb(pos) then + return false, attrans("There's a Track Circuit Break here.") + end + -- signal ip? + if advtrains.interlocking.db.is_ip_at(pos, true) then -- is_ip_at with purge parameter + return false, attrans("There's a Signal Influence Point here.") + end + end + return true +end + +-- slope placer. Defined in register_tracks. +--crafted with rail and gravel +local sl={} +function sl.register_placer(def, preset) + minetest.register_craftitem(":"..def.nodename_prefix.."_slopeplacer",{ + description = attrans("@1 Slope", def.description), + inventory_image = def.texture_prefix.."_slopeplacer.png", + wield_image = def.texture_prefix.."_slopeplacer.png", + groups={}, + on_place = sl.create_slopeplacer_on_place(def, preset) + }) +end +--(itemstack, placer, pointed_thing) +function sl.create_slopeplacer_on_place(def, preset) + return function(istack, player, pt) + if not pt.type=="node" then + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) + return istack + end + local pos=pt.above + if not pos then + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) + return istack + end + local node=minetest.get_node(pos) + if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to then + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: space occupied!")) + return istack + end + if not advtrains.check_track_protection(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return istack + end + --determine player orientation (only horizontal component) + --get_look_horizontal may not be available + local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2) + + --rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5. + local dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} + --translate to direction to look up inside the preset table + local param2, rot45=({ + [-1]={ + [-1]=2, + [0]=3, + [1]=3, + }, + [0]={ + [-1]=2, + [1]=0, + }, + [1]={ + [-1]=1, + [0]=1, + [1]=0, + }, + })[dirvec.x][dirvec.z], dirvec.x~=0 and dirvec.z~=0 + local lookup=preset.slopeplacer + if rot45 then lookup=preset.slopeplacer_45 end + + --go unitvector forward and look how far the next node is + local step=1 + while step<=lookup.max do + local node=minetest.get_node(vector.add(pos, dirvec)) + --next node solid? + if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or advtrains.is_protected(pos, player:get_player_name()) then + --do slopes of this distance exist? + if lookup[step] then + if minetest.settings:get_bool("creative_mode") or istack:get_count()>=step then + --start placing + local placenodes=lookup[step] + while step>0 do + minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2}) + if not minetest.settings:get_bool("creative_mode") then + istack:take_item() + end + step=step-1 + pos=vector.subtract(pos, dirvec) + end + else + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: Not enough slope items left (@1 required)", step)) + end + else + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: There's no slope of length @1",step)) + end + return istack + end + step=step+1 + pos=vector.add(pos, dirvec) + end + minetest.chat_send_player(player:get_player_name(), attrans("Can't place: no supporting node at upper end.")) + return itemstack + end +end + +advtrains.slope=sl + +--END code, BEGIN definition +--definition format: ([] optional) +--[[{ + nodename_prefix + texture_prefix + [shared_texture] + models_prefix + models_suffix (with dot) + [shared_model] + formats={ + st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 + (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) + } + common={} change something on common rail appearance +}]] + + + + + + + + + diff --git a/advtrains/passive.lua b/advtrains/passive.lua index fe4790c..76da720 100644 --- a/advtrains/passive.lua +++ b/advtrains/passive.lua @@ -1,9 +1,5 @@ -- passive.lua --- API to passive components, as described in passive_api.txt of advtrains_luaautomation --- This has been moved to the advtrains core in turn with the interlocking system, --- to prevent a dependency on luaautomation. - -local deprecation_warned = {} +-- Rework for advtrains 2.5: The passive API now uses the reworked node_state system. Please see the comment in tracks.lua function advtrains.getstate(parpos, pnode) local pos @@ -19,20 +15,8 @@ function advtrains.getstate(parpos, pnode) local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] local st - if ndef and ndef.advtrains and ndef.advtrains.getstate then - st=ndef.advtrains.getstate - elseif ndef and ndef.luaautomation and ndef.luaautomation.getstate then - if not deprecation_warned[node.name] then - minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") - end - st=ndef.luaautomation.getstate - else - return nil - end - if type(st)=="function" then - return st(pos, node) - else - return st + if ndef and ndef.advtrains then + return ndef.advtrains.node_state end end @@ -45,31 +29,46 @@ function advtrains.setstate(parpos, newstate, pnode) end if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then debug.sethook() - error("Invalid position supplied to getstate") + error("Invalid position supplied to setstate") end local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] - local st - if ndef and ndef.advtrains and ndef.advtrains.setstate then - st=ndef.advtrains.setstate - elseif ndef and ndef.luaautomation and ndef.luaautomation.setstate then - if not deprecation_warned[node.name] then - minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") - end - st=ndef.luaautomation.setstate - else - return nil + + if not ndef or not ndef.advtrains then + return false, "missing_node_def" + end + local old_state = ndef.advtrains.node_state + + if old_state == newstate then + -- nothing needs to be done + return true end + if not ndef.advtrains.node_state_map then + return false, "missing_node_state_map" + end + local new_node_name = ndef.advtrains.node_state_map[newstate] + if not new_node_name then + return false, "no_such_state" + end + + -- prevent state switching when route lock or train is present if advtrains.get_train_at_pos(pos) then - return false + return false, "train_here" end if advtrains.interlocking and advtrains.interlocking.route.has_route_lock(minetest.pos_to_string(pos)) then - return false + return false, "route_lock_here" end - st(pos, node, newstate) + -- perform the switch + local new_node = {name = new_node_name, param2 = node.param2} + advtrains.ndb.swap_node(pos, new_node) + -- if callback is present, call it + if ndef.advtrains.node_on_switch_state then + ndef.advtrains.node_on_switch_state(pos, new_node, old_state, newstate) + end + return true end @@ -86,12 +85,7 @@ function advtrains.is_passive(parpos, pnode) end local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] - if ndef and ndef.advtrains and ndef.advtrains.getstate then - return true - elseif ndef and ndef.luaautomation and ndef.luaautomation.getstate then - if not deprecation_warned[node.name] then - minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") - end + if ndef and ndef.advtrains and ndef.advtrains.node_state_map then return true else return false @@ -102,20 +96,10 @@ end function advtrains.set_fallback_state(pos, pnode) local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] - local st - if ndef and ndef.advtrains and ndef.advtrains.setstate - and ndef.advtrains.fallback_state then - if advtrains.get_train_at_pos(pos) then - return false - end - - if advtrains.interlocking and advtrains.interlocking.route.has_route_lock(minetest.pos_to_string(pos)) then - return false - end - - ndef.advtrains.setstate(pos, node, ndef.advtrains.fallback_state) - return true - end + if not ndef or not ndef.advtrains or not ndef.advtrains.node_fallback_state then + return false, "no_fallback_state" + end + return advtrains.setstate(pos, ndef.advtrains.node_fallback_state, node) end diff --git a/advtrains/path.lua b/advtrains/path.lua index 19387b1..72ee05d 100644 --- a/advtrains/path.lua +++ b/advtrains/path.lua @@ -33,13 +33,12 @@ -- If you need to proceed along the path by a specific actual distance, it does NOT work to simply add it to the index. You should use the path_get_index_by_offset() function. -- creates the path data structure, reconstructing the train from a position and a connid --- Important! train.drives_on must exist while calling this method -- returns: true - successful -- nil - node not yet available/unloaded, please wait -- false - node definitely gone, remove train function advtrains.path_create(train, pos, connid, rel_index) local posr = advtrains.round_vector_floor_y(pos) - local node_ok, conns, rhe = advtrains.get_rail_info_at(pos, train.drives_on) + local node_ok, conns, rhe = advtrains.get_rail_info_at(pos) if not node_ok then return node_ok end @@ -211,7 +210,7 @@ function advtrains.path_get(train, index) if pef == train.path_trk_f then node_ok, this_conns = advtrains.get_rail_info_at(pos) if not node_ok then error("For train "..train.id..": Path item "..pef.." on-track but not a valid node!") end - adj_pos, adj_connid, conn_idx, nextrail_y, next_conns = advtrains.get_adjacent_rail(pos, this_conns, connid, train.drives_on) + adj_pos, adj_connid, conn_idx, nextrail_y, next_conns = advtrains.get_adjacent_rail(pos, this_conns, connid) end pef = pef + 1 if adj_pos then @@ -250,7 +249,7 @@ function advtrains.path_get(train, index) if peb == train.path_trk_b then node_ok, this_conns = advtrains.get_rail_info_at(pos) if not node_ok then error("For train "..train.id..": Path item "..peb.." on-track but not a valid node!") end - adj_pos, adj_connid, conn_idx, nextrail_y, next_conns = advtrains.get_adjacent_rail(pos, this_conns, connid, train.drives_on) + adj_pos, adj_connid, conn_idx, nextrail_y, next_conns = advtrains.get_adjacent_rail(pos, this_conns, connid) end peb = peb - 1 if adj_pos then diff --git a/advtrains/signals.lua b/advtrains/signals.lua index b26c950..58d28a5 100644 --- a/advtrains/signals.lua +++ b/advtrains/signals.lua @@ -40,9 +40,6 @@ local suppasp = { for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", als="green"}}) do - advtrains.trackplacer.register_tracktype("advtrains:retrosignal", "") - advtrains.trackplacer.register_tracktype("advtrains:signal", "") - for rotid, rotation in ipairs({"", "_30", "_45", "_60"}) do local crea=1 if rotid==1 and r=="off" then crea=0 end @@ -108,8 +105,8 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", }, can_dig = can_dig_func, after_dig_node = after_dig_func, + --TODO add rotation using trackworker }) - advtrains.trackplacer.add_worked("advtrains:retrosignal", r, rotation, nil) minetest.register_node("advtrains:signal_"..r..rotation, { drawtype = "mesh", @@ -179,8 +176,8 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", }, can_dig = can_dig_func, after_dig_node = after_dig_func, + --TODO add rotation using trackworker }) - advtrains.trackplacer.add_worked("advtrains:signal", r, rotation, nil) end local crea=1 diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua index fe76290..9d63199 100644 --- a/advtrains/trackplacer.lua +++ b/advtrains/trackplacer.lua @@ -3,311 +3,204 @@ --all new trackplacer code local tp={ - tracks={} + groups={} } -function tp.register_tracktype(nnprefix, n_suffix) - if tp.tracks[nnprefix] then return end--due to the separate registration of slopes and flats for the same nnpref, definition would be overridden here. just don't. - tp.tracks[nnprefix]={ - default=n_suffix, - single_conn={}, - single_conn_1={}, - single_conn_2={}, - double_conn={}, - double_conn_1={}, - double_conn_2={}, - --keys:conn1_conn2 (example:1_4) - --values:{name=x, param2=x} - twcycle={}, - twrotate={},--indexed by suffix, list, tells order of rotations - modify={}, - } -end -function tp.add_double_conn(nnprefix, suffix, rotation, conns) - local nodename=nnprefix.."_"..suffix..rotation - for i=0,3 do - tp.tracks[nnprefix].double_conn[((conns.conn1+4*i)%16).."_"..((conns.conn2+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].double_conn[((conns.conn2+4*i)%16).."_"..((conns.conn1+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].double_conn_1[((conns.conn1+4*i)%16).."_"..((conns.conn2+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].double_conn_2[((conns.conn2+4*i)%16).."_"..((conns.conn1+4*i)%16)]={name=nodename, param2=i} - end - tp.tracks[nnprefix].modify[nodename]=true -end -function tp.add_single_conn(nnprefix, suffix, rotation, conns) - local nodename=nnprefix.."_"..suffix..rotation - for i=0,3 do - tp.tracks[nnprefix].single_conn[((conns.conn1+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].single_conn[((conns.conn2+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].single_conn_1[((conns.conn1+4*i)%16)]={name=nodename, param2=i} - tp.tracks[nnprefix].single_conn_2[((conns.conn2+4*i)%16)]={name=nodename, param2=i} - end - tp.tracks[nnprefix].modify[nodename]=true -end +--[[ New in version 2.5: +The track placer no longer uses hacky nodename pattern matching. +The base criterion for rotating or matching tracks is the common "ndef.advtrains.track_place_group" property. +Only rails where this field is set are considered for replacement. Other rails can still be considered for connection. +Replacement ("bending") of rails can only happen within their respective track place group. Only two-conn rails are allowed in the trackplacer. -function tp.add_worked(nnprefix, suffix, rotation, cycle_follows) - tp.tracks[nnprefix].twcycle[suffix]=cycle_follows - if not tp.tracks[nnprefix].twrotate[suffix] then tp.tracks[nnprefix].twrotate[suffix]={} end - table.insert(tp.tracks[nnprefix].twrotate[suffix], rotation) -end +The track registration functions register the candidates for any given track_place_group in two separate collections: +- double: tracks that can be used to connect both ends of the rail +- single: tracks that will be used to connect conn1 when only a single end is to be connected +When track placing is requested, the calling code just supplies the track_place_group to be placed. ---[[ - rewrite algorithm. - selection criteria: these will never be changed or even selected: - - tracks being already connected on both sides - - tracks that are already connected on one side but are not bendable to the desired position - the following situations can occur: - 1. there are two more than two rails around - 1.1 there is one or more subset(s) that can be directly connected - -> choose the first possibility - 2.2 not - -> choose the first one and orient straight - 2. there's exactly 1 rail around - -> choose and orient straight - 3. there's no rail around - -> set straight -]] +]]-- -local function istrackandbc(pos_p, conn) - local tpos = pos_p - local cnode=minetest.get_node(advtrains.dirCoordSet(tpos, conn.c)) - if advtrains.is_track_and_drives_on(cnode.name, advtrains.all_tracktypes) then - local cconns=advtrains.get_track_connections(cnode.name, cnode.param2) - return advtrains.conn_matches_to(conn, cconns) - end - --try the same 1 node below - tpos = {x=tpos.x, y=tpos.y-1, z=tpos.z} - cnode=minetest.get_node(advtrains.dirCoordSet(tpos, conn.c)) - if advtrains.is_track_and_drives_on(cnode.name, advtrains.all_tracktypes) then - local cconns=advtrains.get_track_connections(cnode.name, cnode.param2) - return advtrains.conn_matches_to(conn, cconns) - end - return false +local function rotate(conn, rot) + return (conn + rot) % 16 end -function tp.find_already_connected(pos) - local dnode=minetest.get_node(pos) - local dconns=advtrains.get_track_connections(dnode.name, dnode.param2) - local found_conn - for connid, conn in ipairs(dconns) do - if istrackandbc(pos, conn) then - if found_conn then --we found one in previous iteration - return true, true --signal that it's connected - else - found_conn = conn.c +-- Register a track node as candidate +-- tpg: the track place group to register the candidates for +-- name, ndef: the node name and node definition table to register +-- as_single: whether the rail should be considered as candidate for one-endpoint connection +-- Typically only set for the straight rail variants +-- as_double: whether the rail should be considered as candidate for two-endpoint connection +-- Typically set for straights and curves +function tp.register_candidate(tpg, name, ndef, as_single, as_double) + --get or create TP group + if not tp.groups[tpg] then + tp.groups[tpg] = {double = {}, single1 = {}, single2 = {}, default = {name = name, param2 = 0} } + -- note: this causes the first candidate to ever be registered to be the default (which is typically what you want) + end + local g = tp.groups[tpg] + + -- get conns + assert(#ndef.at_conns == 2) + local c1, c2 = ndef.at_conns[1].c, ndef.at_conns[2].c + local is_symmetrical = (rotate(c1, 8) == c2) + + -- store all possible rotations (param2 values) + for i=0,3 do + if as_double then + g.double[rotate(c1,i*4).."_"..rotate(c2,i*4)] = {name=name, param2=i} + if not is_symmmetrical then + g.double[rotate(c2,i*4).."_"..rotate(c1,i*4)] = {name=name, param2=i} + -- if the track is unsymmetric (e.g. a curve), we may require the "wrong" orientation to fill a gap. end end + if as_single then + g.single1[rotate(c1,i*4)] = {name=name, param2=i} + g.single2[rotate(c2,i*4)] = {name=name, param2=i} + end end - return found_conn end -function tp.rail_and_can_be_bent(originpos, conn) - local pos=advtrains.dirCoordSet(originpos, conn) - local newdir=(conn+8)%16 - local node=minetest.get_node(pos) - if not advtrains.is_track_and_drives_on(node.name, advtrains.all_tracktypes) then + +local function check_or_bend_rail(origin, dir, pname, commit) + local pos = advtrains.pos_add_dir(origin, dir) + local back_dir = advtrains.oppd(dir); + + local node_ok, conns = advtrains.get_rail_info_at(pos) + if not node_ok then + -- try the node one level below + pos.y = pos.y - 1 + node_ok, conns = advtrains.get_rail_info_at(pos) + end + if not node_ok then return false end - local ndef=minetest.registered_nodes[node.name] - local nnpref = ndef and ndef.at_nnpref - if not nnpref then return false end - local tr=tp.tracks[nnpref] - if not tr then return false end - if not tr.modify[node.name] then - --we actually can use this rail, but only if it already points to the desired direction. - if advtrains.is_track_and_drives_on(node.name, advtrains.all_tracktypes) then - local cconns=advtrains.get_track_connections(node.name, node.param2) - return advtrains.conn_matches_to(conn, cconns) + -- if one conn of the node here already points towards us, nothing to do + for connid, conn in ipairs(conns) do + if back_dir == conn.c then + return true end end - -- If the rail is not allowed to be modified, also only use if already in desired direction + -- can we bend the node here? + local node = advtrains.ndb.get_node(pos) + local ndef = minetest.registered_nodes[node.name] + if not ndef or not ndef.advtrains or not ndef.advtrains.track_place_group then + return false + end + -- now the track must be two-conn, else it wouldn't be allowed to have track_place_group set. + assert(#conns == 2) + -- Is player and game allowed to do this? if not advtrains.can_dig_or_modify_track(pos) then - local cconns=advtrains.get_track_connections(node.name, node.param2) - return advtrains.conn_matches_to(conn, cconns) + return false end - --rail at other end? - local adj1, adj2=tp.find_already_connected(pos) - if adj1 and adj2 then - return false--dont destroy existing track - elseif adj1 and not adj2 then - if tr.double_conn[adj1.."_"..newdir] then - return true--if exists, connect new rail and old end - end + if not advtrains.check_track_protection(pos, pname) then return false - else - if tr.single_conn[newdir] then--just rotate old rail to right orientation - return true + end + -- we confirmed that track can be modified. Does there exist a suitable connection candidate? + -- check if there are any unbound ends + local bound_connids = {} + for connid, conn in ipairs(conns) do + local adj_pos, adj_connid = advtrains.get_adjacent_rail(pos, conns, connid) + if adj_pos then + bound_connids[#bound_connids+1] = connid end - return false end -end -function tp.bend_rail(originpos, conn) - local pos=advtrains.dirCoordSet(originpos, conn) - local newdir=advtrains.oppd(conn) - local node=minetest.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - local nnpref = ndef and ndef.at_nnpref - if not nnpref then return false end - local tr=tp.tracks[nnpref] - if not tr then return false end - --is rail already connected? no need to bend. - local conns=advtrains.get_track_connections(node.name, node.param2) - if advtrains.conn_matches_to(conn, conns) then - return + -- depending on the nummber of ends, decide + if #bound_connids == 2 then + -- rail is within a fixed track, do not break up + return false end - --rail at other end? - local adj1, adj2=tp.find_already_connected(pos) - if adj1 and adj2 then - return false--dont destroy existing track - elseif adj1 and not adj2 then - if tr.double_conn[adj1.."_"..newdir] then - advtrains.ndb.swap_node(pos, tr.double_conn[adj1.."_"..newdir]) - return true--if exists, connect new rail and old end + -- obtain the group table + local g = tp.groups[ndef.advtrains.track_place_group] + if #bound_connids == 1 then + -- we can attempt double + local bound_dir = conns[bound_connids[1]].c + if g.double[back_dir.."_"..bound_dir] then + if commit then + advtrains.ndb.swap_node(pos, g.double[back_dir.."_"..bound_dir]) + end + return true end - return false else - if tr.single_conn[newdir] then--just rotate old rail to right orientation - advtrains.ndb.swap_node(pos, tr.single_conn[newdir]) + -- rail is entirely unbound, we can attempt single1 + if g.single1[back_dir] then + if commit then + advtrains.ndb.swap_node(pos, g.single1[back_dir]) + end return true end - return false end end -function tp.placetrack(pos, nnpref, placer, itemstack, pointed_thing, yaw) - --1. find all rails that are likely to be connected - local tr=tp.tracks[nnpref] - local p_rails={} - local p_railpos={} + +local function track_place_node(pos, node, ndef) + advtrains.ndb.swap_node(pos, node) + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.after_place_node then + ndef.after_place_node(pos) + end +end + + +-- Main API function to place a track. Replaces the older "placetrack" +-- This function will attempt to place a track of the specified track placing group at the specified position, connecting it +-- with neighboring rails. Neighboring rails can themselves be replaced ("bent") within their own track place group, +-- if the player is permitted to do this. +-- Order of preference is: +-- Connect two track ends if possible +-- Connect one track end if any rail is near +-- Place the default track if no tracks are near +-- The function returns true on success. +function tp.place_track(pos, tpg, pname, yaw) + -- 1. collect neighboring tracks and whether they can be connected + local cand = {} for i=0,15 do - if tp.rail_and_can_be_bent(pos, i, nnpref) then - p_rails[#p_rails+1]=i - p_railpos[i] = pos - else - local upos = {x=pos.x, y=pos.y-1, z=pos.z} - if tp.rail_and_can_be_bent(upos, i, nnpref) then - p_rails[#p_rails+1]=i - p_railpos[i] = upos - end + if check_or_bend_rail(pos, i, pname) then + cand[#cand+1] = i end end - - -- try double_conn - if #p_rails > 1 then - --iterate subsets - for k1, conn1 in ipairs(p_rails) do - for k2, conn2 in ipairs(p_rails) do - if k1~=k2 then - local dconn1 = tr.double_conn_1 - local dconn2 = tr.double_conn_2 - if not (advtrains.yawToDirection(yaw, conn1, conn2) == conn1) then - dconn1 = tr.double_conn_2 - dconn2 = tr.double_conn_1 - end - -- Checks are made this way round so that dconn1 has priority (this will make arrows of atc rails - -- point in the right direction) - local using - if (dconn2[conn1.."_"..conn2]) then - using = dconn2[conn1.."_"..conn2] - end - if (dconn1[conn1.."_"..conn2]) then - using = dconn1[conn1.."_"..conn2] - end - if using then - -- has found a fitting rail in either direction - -- if not, continue loop - tp.bend_rail(p_railpos[conn1], conn1, nnpref) - tp.bend_rail(p_railpos[conn2], conn2, nnpref) - advtrains.ndb.swap_node(pos, using) - local nname=using.name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - return + -- obtain the group table + local g = tp.groups[tpg] + -- 2. try all possible two-endpoint connections + for k1, conn1 in ipairs(cand) do + for k2, conn2 in ipairs(cand) do + if k1~=k2 then + -- order of conn1/conn2: prefer conn2 being in the direction of the player facing. + -- the combination the other way round will be run through in a later loop iteration + if advtrains.yawToDirection(yaw, conn1, conn2) == conn2 then + -- does there exist a suitable double-connection rail? + local node = g.double[conn1.."_"..conn2] + if node then + check_or_bend_rail(pos, conn1, pname, true) + check_or_bend_rail(pos, conn2, pname, true) + track_place_node(pos, node) -- calls after_place_node implicitly + return true end end end end end - -- try single_conn - if #p_rails > 0 then - for ix, p_rail in ipairs(p_rails) do - local sconn1 = tr.single_conn_1 - local sconn2 = tr.single_conn_2 - if not (advtrains.yawToDirection(yaw, p_rail, (p_rail+8)%16) == p_rail) then - sconn1 = tr.single_conn_2 - sconn2 = tr.single_conn_1 - end - if sconn1[p_rail] then - local using = sconn1[p_rail] - tp.bend_rail(p_railpos[p_rail], p_rail, nnpref) - advtrains.ndb.swap_node(pos, using) - local nname=using.name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - return - end - if sconn2[p_rail] then - local using = sconn2[p_rail] - tp.bend_rail(p_railpos[p_rail], p_rail, nnpref) - advtrains.ndb.swap_node(pos, using) - local nname=using.name - if minetest.registered_nodes[nname] and minetest.registered_nodes[nname].after_place_node then - minetest.registered_nodes[nname].after_place_node(pos, placer, itemstack, pointed_thing) - end - return - end + -- 3. try all possible one_endpoint connections + for k1, conn1 in ipairs(cand) do + -- select single1 or single2? depending on yaw + local single + if advtrains.yawToDirection(yaw, conn1, advtrains.oppd(conn1)) == conn1 then + single = g.single1 + else + single = g.single2 + end + local node = single[conn1] + if node then + check_or_bend_rail(pos, conn1, pname, true) + track_place_node(pos, node) -- calls after_place_node implicitly + return true end end - --use default - minetest.set_node(pos, {name=nnpref.."_"..tr.default}) - if minetest.registered_nodes[nnpref.."_"..tr.default] and minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node then - minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node(pos, placer, itemstack, pointed_thing) - end + -- 4. if nothing worked, set the default + local node = g.default + track_place_node(pos, node) -- calls after_place_node implicitly + return true end - -function tp.register_track_placer(nnprefix, imgprefix, dispname, def) - minetest.register_craftitem(":"..nnprefix.."_placer",{ - description = dispname, - inventory_image = imgprefix.."_placer.png", - wield_image = imgprefix.."_placer.png", - groups={advtrains_trackplacer=1, digtron_on_place=1}, - liquids_pointable = def.liquids_pointable, - on_place = function(itemstack, placer, pointed_thing) - local name = placer:get_player_name() - if not name then - return itemstack, false - end - if pointed_thing.type=="node" then - local pos=pointed_thing.above - local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0}) - if not advtrains.check_track_protection(pos, name) then - return itemstack, false - end - if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to then - local s - if def.suitable_substrate then - s = def.suitable_substrate(upos) - else - s = minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable - end - if s then --- minetest.chat_send_all(nnprefix) - local yaw = placer:get_look_horizontal() - tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing, yaw) - if not advtrains.is_creative(name) then - itemstack:take_item() - end - end - end - end - return itemstack, true - end, - }) -end - - +-- TRACK WORKER -- minetest.register_craftitem("advtrains:trackworker",{ description = attrans("Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc."), @@ -316,116 +209,93 @@ minetest.register_craftitem("advtrains:trackworker",{ wield_image = "advtrains_trackworker.png", stack_max = 1, on_place = function(itemstack, placer, pointed_thing) - local name = placer:get_player_name() - if not name then + local name = placer:get_player_name() + if not name then + return + end + local has_aux1_down = placer:get_player_control().aux1 + if pointed_thing.type=="node" then + local pos=pointed_thing.under + if not advtrains.check_track_protection(pos, name) then return end - local has_aux1_down = placer:get_player_control().aux1 - if pointed_thing.type=="node" then - local pos=pointed_thing.under - if not advtrains.check_track_protection(pos, name) then - return - end - local node=minetest.get_node(pos) + local node=minetest.get_node(pos) - --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end - - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --atdebug(node.name.."\npattern recognizes:"..nnprefix.." / "..suffix.." / "..rotation) - --atdebug("nntab: ",tp.tracks[nnprefix]) - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then - nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") - rotation = "" - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then - minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker!")) - return - end - end - - -- check if the node is modify-protected - if advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then - -- is a track, we can query - local can_modify, reason = advtrains.can_dig_or_modify_track(pos) - if not can_modify then - local str = attrans("This track can not be rotated!") - if reason then - str = str .. " " .. reason - end - minetest.chat_send_player(placer:get_player_name(), str) - return + -- New since 2.5: only the fields in the node definition are considered, no more hacky pattern matching on the nodename + + local ndef = minetest.registered_nodes[node.name] + + if not ndef.advtrains or not ndef.advtrains.trackworker_next_rot then + minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker!")) + return + end + + -- check if the node is modify-protected + if advtrains.is_track(node.name) then + -- is a track, we can query + local can_modify, reason = advtrains.can_dig_or_modify_track(pos) + if not can_modify then + local str = attrans("This track can not be rotated!") + if reason then + str = str .. " " .. reason end - end - - if has_aux1_down then - --feature: flip the node by 180° - --i've always wanted this! - advtrains.ndb.swap_node(pos, {name=node.name, param2=(node.param2+2)%4}) + minetest.chat_send_player(placer:get_player_name(), str) return end - - local modext=tp.tracks[nnprefix].twrotate[suffix] - - if rotation==modext[#modext] then --increase param2 - advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..suffix..modext[1], param2=(node.param2+1)%4}) - return - else - local modpos - for k,v in pairs(modext) do - if v==rotation then modpos=k end - end - if not modpos then - minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker!")) - return - end - advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) - end end + + if has_aux1_down then + --feature: flip the node by 180° + --i've always wanted this! + advtrains.ndb.swap_node(pos, {name=node.name, param2=(node.param2+2)%4}) + return + end + + local new_node = {name = ndef.advtrains.trackworker_next_rot, param2 = node.param2} + if ndef.advtrains.trackworker_rot_incr_param2 then + new_node.param2 = ((node.param2 + 1) % 4) + end + advtrains.ndb.swap_node(pos, new_node) + end end, on_use=function(itemstack, user, pointed_thing) - local name = user:get_player_name() - if not name then - return + local name = user:get_player_name() + if not name then + return + end + if pointed_thing.type=="node" then + local pos=pointed_thing.under + local node=minetest.get_node(pos) + if not advtrains.check_track_protection(pos, name) then + return end - if pointed_thing.type=="node" then - local pos=pointed_thing.under - local node=minetest.get_node(pos) - if not advtrains.check_track_protection(pos, name) then - return - end - - --if not advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then return end - if advtrains.get_train_at_pos(pos) then return end - local nnprefix, suffix, rotation=string.match(node.name, "^(.+)_([^_]+)(_[^_]+)$") - --atdebug(node.name.."\npattern recognizes:"..nodeprefix.." / "..railtype.." / "..rotation) - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then - nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") - rotation = "" - if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then - minetest.chat_send_player(user:get_player_name(), attrans("This node can't be changed using the trackworker!")) - return - end - end - - -- check if the node is modify-protected - if advtrains.is_track_and_drives_on(minetest.get_node(pos).name, advtrains.all_tracktypes) then - -- is a track, we can query - local can_modify, reason = advtrains.can_dig_or_modify_track(pos) - if not can_modify then - local str = attrans("This track can not be changed!") - if reason then - str = str .. " " .. reason - end - minetest.chat_send_player(user:get_player_name(), str) - return + + -- New since 2.5: only the fields in the node definition are considered, no more hacky pattern matching on the nodename + + local ndef = minetest.registered_nodes[node.name] + + if not ndef.advtrains or not ndef.advtrains.trackworker_next_var then + minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be changed using the trackworker!")) + return + end + + -- check if the node is modify-protected + if advtrains.is_track(node.name) then + -- is a track, we can query + local can_modify, reason = advtrains.can_dig_or_modify_track(pos) + if not can_modify then + local str = attrans("This track can not be rotated!") + if reason then + str = str .. " " .. reason end + minetest.chat_send_player(placer:get_player_name(), str) + return end - - local nextsuffix=tp.tracks[nnprefix].twcycle[suffix] - advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..nextsuffix..rotation, param2=node.param2}) - - else - atprint(name, dump(tp.tracks)) end + + local new_node = {name = ndef.advtrains.trackworker_next_var, param2 = node.param2} + advtrains.ndb.swap_node(pos, new_node) + end end, }) diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index c415143..dc2d909 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -1,751 +1,287 @@ ---advtrains by orwell96, see readme.txt - ---dev-time settings: ---EDIT HERE ---If the old non-model rails on straight tracks should be replaced by the new... ---false: no ---true: yes -advtrains.register_replacement_lbms=false - ---[[TracksDefinition -nodename_prefix -texture_prefix -description -common={} -straight={} -straight45={} -curve={} -curve45={} -lswitchst={} -lswitchst45={} -rswitchst={} -rswitchst45={} -lswitchcr={} -lswitchcr45={} -rswitchcr={} -rswitchcr45={} -vert1={ - --you'll probably want to override mesh here -} -vert2={ - --you'll probably want to override mesh here -} -]]-- -advtrains.all_tracktypes={} - ---definition preparation -local function conns(c1, c2, r1, r2) return {{c=c1, y=r1}, {c=c2, y=r2}} end -local function conns3(c1, c2, c3, r1, r2, r3) return {{c=c1, y=r1}, {c=c2, y=r2}, {c=c3, y=r3}} end - -advtrains.ap={} -advtrains.ap.t_30deg_flat={ - regstep=1, - variant={ - st={ - conns = conns(0,8), - desc = "straight", - tpdouble = true, - tpsingle = true, - trackworker = "cr", - }, - cr={ - conns = conns(0,7), - desc = "curve", - tpdouble = true, - trackworker = "swlst", - }, - swlst={ - conns = conns3(0,8,7), - desc = "left switch (straight)", - trackworker = "swrst", - switchalt = "cr", - switchmc = "on", - switchst = "st", - switchprefix = "swl", - }, - swlcr={ - conns = conns3(0,7,8), - desc = "left switch (curve)", - trackworker = "swrcr", - switchalt = "st", - switchmc = "off", - switchst = "cr", - switchprefix = "swl", - }, - swrst={ - conns = conns3(0,8,9), - desc = "right switch (straight)", - trackworker = "st", - switchalt = "cr", - switchmc = "on", - switchst = "st", - switchprefix = "swr", - }, - swrcr={ - conns = conns3(0,9,8), - desc = "right switch (curve)", - trackworker = "st", - switchalt = "st", - switchmc = "off", - switchst = "cr", - switchprefix = "swr", - }, - }, - regtp=true, - tpdefault="st", - trackworker={ - ["swrcr"]="st", - ["swrst"]="st", - ["cr"]="swlst", - ["swlcr"]="swrcr", - ["swlst"]="swrst", - }, - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_yturnout={ - regstep=1, - variant={ - l={ - conns = conns3(0,7,9), - desc = "Y-turnout (left)", - switchalt = "r", - switchmc = "off", - switchst = "l", - switchprefix = "", - }, - r={ - conns = conns3(0,9,7), - desc = "Y-turnout (right)", - switchalt = "l", - switchmc = "on", - switchst = "r", - switchprefix = "", - } - }, - regtp=true, - tpdefault="l", - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_s3way={ - regstep=1, - variant={ - l={ - conns = { {c=0}, {c=7}, {c=8}, {c=9}, {c=0} }, - desc = "3-way turnout (left)", - switchalt = "s", - switchst="l", - switchprefix = "", - }, - s={ - conns = { {c=0}, {c=8}, {c=7}, {c=9}, {c=0} }, - desc = "3-way turnout (straight)", - switchalt ="r", - switchst = "s", - switchprefix = "", - }, - r={ - conns = { {c=0}, {c=9}, {c=8}, {c=7}, {c=0} }, - desc = "3-way turnout (right)", - switchalt = "l", - switchst="r", - switchprefix = "", - } - }, - regtp=true, - tpdefault="l", - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_30deg_slope={ - regstep=1, - variant={ - vst1={conns = conns(8,0,0,0.5), rail_y = 0.25, desc = "steep uphill 1/2", slope=true}, - vst2={conns = conns(8,0,0.5,1), rail_y = 0.75, desc = "steep uphill 2/2", slope=true}, - vst31={conns = conns(8,0,0,0.33), rail_y = 0.16, desc = "uphill 1/3", slope=true}, - vst32={conns = conns(8,0,0.33,0.66), rail_y = 0.5, desc = "uphill 2/3", slope=true}, - vst33={conns = conns(8,0,0.66,1), rail_y = 0.83, desc = "uphill 3/3", slope=true}, - }, - regsp=true, - slopeplacer={ - [2]={"vst1", "vst2"}, - [3]={"vst31", "vst32", "vst33"}, - max=3,--highest entry - }, - slopeplacer_45={ - [2]={"vst1_45", "vst2_45"}, - max=2, - }, - rotation={"", "_30", "_45", "_60"}, - trackworker={}, - increativeinv={}, -} -advtrains.ap.t_30deg_straightonly={ - regstep=1, - variant={ - st={ - conns = conns(0,8), - desc = "straight", - tpdouble = true, - tpsingle = true, - trackworker = "st", - }, - }, - regtp=true, - tpdefault="st", - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_30deg_straightonly_noplacer={ - regstep=1, - variant={ - st={ - conns = conns(0,8), - desc = "straight", - tpdouble = true, - tpsingle = true, - trackworker = "st", - }, - }, - tpdefault="st", - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_45deg={ - regstep=2, - variant={ - st={ - conns = conns(0,8), - desc = "straight", - tpdouble = true, - tpsingle = true, - trackworker = "cr", - }, - cr={ - conns = conns(0,6), - desc = "curve", - tpdouble = true, - trackworker = "swlst", - }, - swlst={ - conns = conns3(0,8,6), - desc = "left switch (straight)", - trackworker = "swrst", - switchalt = "cr", - switchmc = "on", - switchst = "st", - }, - swlcr={ - conns = conns3(0,6,8), - desc = "left switch (curve)", - trackworker = "swrcr", - switchalt = "st", - switchmc = "off", - switchst = "cr", - }, - swrst={ - conns = conns3(0,8,10), - desc = "right switch (straight)", - trackworker = "st", - switchalt = "cr", - switchmc = "on", - switchst = "st", - }, - swrcr={ - conns = conns3(0,10,8), - desc = "right switch (curve)", - trackworker = "st", - switchalt = "st", - switchmc = "off", - switchst = "cr", - }, - }, - regtp=true, - tpdefault="st", - trackworker={ - ["swrcr"]="st", - ["swrst"]="st", - ["cr"]="swlst", - ["swlcr"]="swrcr", - ["swlst"]="swrst", - }, - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_perpcrossing={ - regstep = 1, - variant={ - st={ - conns = { {c=0}, {c=8}, {c=4}, {c=12} }, - desc = "perpendicular crossing", - tpdouble = true, - tpsingle = true, - trackworker = "st", - }, - }, - regtp=true, - tpdefault="st", - rotation={"", "_30", "_45", "_60"}, -} -advtrains.ap.t_90plusx_crossing={ - regstep = 1, - variant={ - ["30l"]={ - conns = { {c=0}, {c=8}, {c=1}, {c=9} }, - desc = "30/90 degree crossing (left)", - tpdouble = true, - tpsingle = true, - trackworker = "45l" - }, - ["45l"]={ - conns = { {c=0}, {c=8}, {c=2}, {c=10} }, - desc = "45/90 degree crossing (left)", - tpdouble = true, - tpsingle = true, - trackworker = "60l", - }, - ["60l"]={ - conns = { {c=0}, {c=8}, {c=3}, {c=11}}, - desc = "60/90 degree crossing (left)", - tpdouble = true, - tpsingle = true, - trackworker = "60r", - }, - ["60r"]={ - conns = { {c=0}, {c=8}, {c=5}, {c=13} }, - desc = "60/90 degree crossing (right)", - tpdouble = true, - tpsingle = true, - trackworker = "45r" - }, - ["45r"]={ - conns = { {c=0}, {c=8}, {c=6}, {c=14} }, - desc = "45/90 degree crossing (right)", - tpdouble = true, - tpsingle = true, - trackworker = "30r", - }, - ["30r"]={ - conns = { {c=0}, {c=8}, {c=7}, {c=15}}, - desc = "30/90 degree crossing (right)", - tpdouble = true, - tpsingle = true, - trackworker = "30l", - }, - }, - regtp=true, - tpdefault="30l", - rotation={""}, - trackworker = { - ["30l"] = "45l", - ["45l"] = "60l", - ["60l"] = "60r", - ["60r"] = "45r", - ["45r"] = "30r", - ["30r"] = "30l", - } -} - -advtrains.ap.t_diagonalcrossing = { - regstep=1, - variant={ - ["30l45r"]={ - conns = {{c=1}, {c=9}, {c=6}, {c=14}}, - desc = "30left-45right diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="60l30l", - }, - ["60l30l"]={ - conns = {{c=3}, {c=11}, {c=1}, {c=9}}, - desc = "30left-60right diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="60l45r" - }, - ["60l45r"]={ - conns = {{c=3}, {c=11}, {c=6}, {c=14}}, - desc = "60left-45right diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="60l60r" - }, - ["60l60r"]={ - conns = {{c=3}, {c=11}, {c=5}, {c=13}}, - desc = "60left-60right diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="60r45l", - }, - --If 60l60r had a mirror image, it would be here, but it's symmetric. - -- 60l60r is also equivalent to 30l30r but rotated 90 degrees. - ["60r45l"]={ - conns = {{c=5}, {c=13}, {c=2}, {c=10}}, - desc = "60right-45left diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="60r30r", - }, - ["60r30r"]={ - conns = {{c=5}, {c=13}, {c=7}, {c=15}}, - desc = "60right-30right diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="30r45l", - }, - ["30r45l"]={ - conns = {{c=7}, {c=15}, {c=2}, {c=10}}, - desc = "30right-45left diagonal crossing", - tpdouble=true, - tpsingle=true, - trackworker="30l45r", - }, - - }, - regtp=true, - tpdefault="30l45r", - rotation={""}, - trackworker = { - ["30l45r"] = "60l30l", - ["60l30l"] = "60l45r", - ["60l45r"] = "60l60r", - ["60l60r"] = "60r45l", - ["60r45l"] = "60r30r", - ["60r30r"] = "30r45l", - ["30r45l"] = "30l45r", - } -} - -advtrains.trackpresets = advtrains.ap - ---definition format: ([] optional) ---[[{ - nodename_prefix - texture_prefix - [shared_texture] - models_prefix - models_suffix (with dot) - [shared_model] - formats={ - st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 - (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) - } - common={} change something on common rail appearance -} -[18.12.17] Note on new connection system: -In order to support real rail crossing nodes and finally make the trackplacer respect switches, I changed the connection system. -There can be a variable number of connections available. These are specified as tuples {c=, y=} -The table "at_conns" consists of {, ...} -the "at_rail_y" property holds the value that was previously called "railheight" -Depending on the number of connections: -2 conns: regular rail -3 conns: switch: - - when train passes in at conn1, will move out of conn2 - - when train passes in at conn2 or conn3, will move out of conn1 -4 conns: cross (or cross switch, depending on arrangement of conns): - - conn1 <> conn2 - - conn3 <> conn4 -]] - --- Notify the user if digging the rail is not allowed -local function can_dig_callback(pos, player) - local ok, reason = advtrains.can_dig_or_modify_track(pos) - if not ok and player then - minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed!") .. " " .. reason) - end - return ok -end - -function advtrains.register_tracks(tracktype, def, preset) - advtrains.trackplacer.register_tracktype(def.nodename_prefix, preset.tpdefault) - if preset.regtp then - advtrains.trackplacer.register_track_placer(def.nodename_prefix, def.texture_prefix, def.description, def) - end - if preset.regsp then - advtrains.slope.register_placer(def, preset) - end - for suffix, var in pairs(preset.variant) do - for rotid, rotation in ipairs(preset.rotation) do - if not def.formats[suffix] or def.formats[suffix][rotid] then - local img_suffix = suffix..rotation - local ndef = advtrains.merge_tables({ - description=def.description.."("..(var.desc or "any")..rotation..")", - drawtype = "mesh", - paramtype="light", - paramtype2="facedir", - walkable = false, - selection_box = { - type = "fixed", - fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2}, - }, - - mesh = def.shared_model or (def.models_prefix.."_"..img_suffix..def.models_suffix), - tiles = {def.shared_texture or (def.texture_prefix.."_"..img_suffix..".png"), def.second_texture}, - - groups = { - attached_node = advtrains.IGNORE_WORLD and 0 or 1, - advtrains_track=1, - ["advtrains_track_"..tracktype]=1, - save_in_at_nodedb=1, - dig_immediate=2, - not_in_creative_inventory=1, - not_blocking_trains=1, - }, - - can_dig = can_dig_callback, - after_dig_node=function(pos) - advtrains.ndb.update(pos) - end, - after_place_node=function(pos) - advtrains.ndb.update(pos) - end, - at_nnpref = def.nodename_prefix, - at_suffix = suffix, - at_rotation = rotation, - at_rail_y = var.rail_y - }, def.common or {}) - - if preset.regtp then - ndef.drop = def.nodename_prefix.."_placer" - end - if preset.regsp and var.slope then - ndef.drop = def.nodename_prefix.."_slopeplacer" - end - - --connections - ndef.at_conns = advtrains.rotate_conn_by(var.conns, (rotid-1)*preset.regstep) - - local ndef_avt_table - - if var.switchalt and var.switchst then - local switchfunc=function(pos, node, newstate) - newstate = newstate or var.switchalt -- support for 3 (or more) state switches - -- this code is only called from the internal setstate function, which - -- ensures that it is safe to switch the turnout - if newstate~=var.switchst then - advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..(var.switchprefix or "")..newstate..rotation, param2=node.param2}) - advtrains.invalidate_all_paths(pos) - end - end - ndef.on_rightclick = function(pos, node, player) - if advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then - advtrains.setstate(pos, nil, node) - advtrains.log("Switch", player:get_player_name(), pos) - end - end - if var.switchmc then - ndef.mesecons = {effector = { - ["action_"..var.switchmc] = function(pos, node) - advtrains.setstate(pos, nil, node) - end, - rules=advtrains.meseconrules - }} - end - ndef_avt_table = { - getstate = var.switchst, - setstate = switchfunc, - } - end - - local adef={} - if def.get_additional_definiton then - adef=def.get_additional_definiton(def, preset, suffix, rotation) - end - ndef = advtrains.merge_tables(ndef, adef) - - -- insert getstate/setstate functions after merging the additional definitions - if ndef_avt_table then - ndef.advtrains = advtrains.merge_tables(ndef.advtrains or {}, ndef_avt_table) - end - - minetest.register_node(":"..def.nodename_prefix.."_"..suffix..rotation, ndef) - --trackplacer - if preset.regtp then - local tpconns = {conn1=ndef.at_conns[1].c, conn2=ndef.at_conns[2].c} - if var.tpdouble then - advtrains.trackplacer.add_double_conn(def.nodename_prefix, suffix, rotation, tpconns) - end - if var.tpsingle then - advtrains.trackplacer.add_single_conn(def.nodename_prefix, suffix, rotation, tpconns) - end - end - advtrains.trackplacer.add_worked(def.nodename_prefix, suffix, rotation, var.trackworker) - end - end - end - advtrains.all_tracktypes[tracktype]=true -end - -function advtrains.is_track_and_drives_on(nodename, drives_on_p) - local drives_on = drives_on_p - if not drives_on then drives_on = advtrains.all_tracktypes end - local hasentry = false - for _,_ in pairs(drives_on) do - hasentry=true - end - if not hasentry then drives_on = advtrains.all_tracktypes end - - if not minetest.registered_nodes[nodename] then - return false - end - local nodedef=minetest.registered_nodes[nodename] - for k,v in pairs(drives_on) do - if nodedef.groups["advtrains_track_"..k] then - return true - end - end - return false -end - -function advtrains.get_track_connections(name, param2) - local nodedef=minetest.registered_nodes[name] - if not nodedef then atprint(" get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return nil end - local noderot=param2 - if not param2 then noderot=0 end - if noderot > 3 then atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end - - local tracktype - for k,_ in pairs(nodedef.groups) do - local tt=string.match(k, "^advtrains_track_(.+)$") - if tt then - tracktype=tt - end - end - return advtrains.rotate_conn_by(nodedef.at_conns, noderot*AT_CMAX/4), (nodedef.at_rail_y or 0), tracktype -end - --- Function called when a track is about to be dug or modified by the trackworker --- Returns either true (ok) or false,"translated string describing reason why it isn't allowed" -function advtrains.can_dig_or_modify_track(pos) - if advtrains.get_train_at_pos(pos) then - return false, attrans("Position is occupied by a train.") - end - -- interlocking: tcb, signal IP a.s.o. - if advtrains.interlocking then - -- TCB? - if advtrains.interlocking.db.get_tcb(pos) then - return false, attrans("There's a Track Circuit Break here.") - end - -- signal ip? - if advtrains.interlocking.db.is_ip_at(pos, true) then -- is_ip_at with purge parameter - return false, attrans("There's a Signal Influence Point here.") - end - end - return true -end - --- slope placer. Defined in register_tracks. ---crafted with rail and gravel -local sl={} -function sl.register_placer(def, preset) - minetest.register_craftitem(":"..def.nodename_prefix.."_slopeplacer",{ - description = attrans("@1 Slope", def.description), - inventory_image = def.texture_prefix.."_slopeplacer.png", - wield_image = def.texture_prefix.."_slopeplacer.png", - groups={}, - on_place = sl.create_slopeplacer_on_place(def, preset) - }) -end ---(itemstack, placer, pointed_thing) -function sl.create_slopeplacer_on_place(def, preset) - return function(istack, player, pt) - if not pt.type=="node" then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) - return istack - end - local pos=pt.above - if not pos then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) - return istack - end - local node=minetest.get_node(pos) - if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: space occupied!")) - return istack - end - if not advtrains.check_track_protection(pos, player:get_player_name()) then - minetest.record_protection_violation(pos, player:get_player_name()) - return istack - end - --determine player orientation (only horizontal component) - --get_look_horizontal may not be available - local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2) - - --rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5. - local dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} - --translate to direction to look up inside the preset table - local param2, rot45=({ - [-1]={ - [-1]=2, - [0]=3, - [1]=3, - }, - [0]={ - [-1]=2, - [1]=0, - }, - [1]={ - [-1]=1, - [0]=1, - [1]=0, - }, - })[dirvec.x][dirvec.z], dirvec.x~=0 and dirvec.z~=0 - local lookup=preset.slopeplacer - if rot45 then lookup=preset.slopeplacer_45 end - - --go unitvector forward and look how far the next node is - local step=1 - while step<=lookup.max do - local node=minetest.get_node(vector.add(pos, dirvec)) - --next node solid? - if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or advtrains.is_protected(pos, player:get_player_name()) then - --do slopes of this distance exist? - if lookup[step] then - if minetest.settings:get_bool("creative_mode") or istack:get_count()>=step then - --start placing - local placenodes=lookup[step] - while step>0 do - minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2}) - if not minetest.settings:get_bool("creative_mode") then - istack:take_item() - end - step=step-1 - pos=vector.subtract(pos, dirvec) - end - else - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: Not enough slope items left (@1 required)", step)) - end - else - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: There's no slope of length @1",step)) - end - return istack - end - step=step+1 - pos=vector.add(pos, dirvec) - end - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: no supporting node at upper end.")) - return itemstack - end -end - -advtrains.slope=sl - ---END code, BEGIN definition ---definition format: ([] optional) ---[[{ - nodename_prefix - texture_prefix - [shared_texture] - models_prefix - models_suffix (with dot) - [shared_model] - formats={ - st,cr,swlst,swlcr,swrst,swrcr,vst1,vst2 - (each a table with indices 0-3, for if to register a rail with this 'rotation' table entry. nil is assumed as 'all', set {} to not register at all) - } - common={} change something on common rail appearance -}]] - - - - - - - - - +-- tracks.lua +-- rewritten with advtrains 2.5 according to new track registration system + + +--[[ + +Tracks in advtrains are defined by the node definition. They must have at least 2 connections, but can have any number. +Switchable nodes (turnouts, single/double-slip switches) are implemented by having a separate node (node name) for each of the possible states. + + minetest.register_node(nodename, { + ... usual node definition ... + groups = { + advtrains_track = 1, + advtrains_track_=1 + ^- these groups tell that the node is a track + not_blocking_trains=1, + ^- this group tells that the node should not block trains although it's walkable. + }, + + at_rail_y = 0, + ^- Height of this rail node (the y position of a wagon that stands centered on this rail) + at_conns = { + [1] = { c=0..15, y=0..1 }, + [2] = { c=0..15, y=0..1 }, + ( [3] = { c=0..15, y=0..1 }, ) + ( [4] = { c=0..15, y=0..1 }, ) + ( ... ) + } + ^- Connections of this rail. There are two general cases: + a) SIMPLE TRACK - the track has exactly 2 connections, and does not feature a turnout, crossing or other contraption + For simple tracks, except for the at_conns table no further setup needs to be specified. A train entering on conn 1 will go out at conn 2 and vice versa. + A track with only one connection defined is not permitted. + b) COMPOUND TRACK - the track has more than 2 connections + This will be used for turnouts and crossings. Tracks with more than 2 conns MUST define 'at_conn_map'. + Switchable nodes, whose state can be changed (e.g. turnouts) MUST define a 'state_map' within the advtrains table as well. + This differs from the behavior up until 2.4.2, where the conn mapping was fixed. + ^- Connection definition: + - c is the direction of the connection (0-16). For the mapping to world directions see helpers.lua. + - Connections will be auto-rotated with param2 of the node (horizontal, param2 values 0-3 only) + - y is the height of the connection (rail will only connect when this matches) + ^- The index of a connection inside the conns table (1, 2, 3, ...) is referred throughout advtrains code as 'connid' + ^- IMPORTANT: For switchable nodes (any kind of turnout), it is crucial that for all of the node's variants the at_conns table stays the same. See below. + + at_conn_map = { + [1] = 2, + [2] = 1, + [3] = 1, + } + ^- Connection map of this rail. It specifies when a train enters the track on connid X, on which connid it will leave + This field MUST be specified when the number of connections in at_conns is greater than 2 + This field may, and obviously will, vary between nodes for switchable nodes. + + can_dig = advtrains.track_can_dig_callback + after_dig_node = advtrains.track_update_callback + after_place_node = advtrains.track_update_callback + ^- the code in these 3 default minetest API functions is required for advtrains to work, however you can add your own code + + on_rightclick = advtrains.state_node_on_rightclick_callback + ^- Must be added if the node is a turnout and if it should be switched by right-click. It will cause the turnout to be switched to next_state. + + advtrains = { + on_train_enter=function(pos, train_id, train, index) end + ^- called when a train enters the rail + on_train_leave=function(pos, train_id, train, index) end + ^- called when a train leaves the rail + + -- The following function is only in effect when interlocking is enabled: + on_train_approach = function(pos, train_id, train, index, has_entered, lzbdata) + ^- called when a train is approaching this position, called exactly once for every path recalculation (which can happen at any time) + ^- This is called so that if the train would start braking now, it would come to halt about(wide approx) 5 nodes before the rail. + ^- has_entered: when true, the train is already standing on this node with its front tip, and the enter callback has already been called. + Possibly, some actions need not to be taken in this case. Only set if it's the very first node the train is standing on. + ^- lzbdata should be ignored and nothing should be assigned to it + + -- The following information is required if the node is a turnout (e.g. can be switched into different positions) + node_state = "st" + ^- The name of the state this node represents + ^- Conventions for this field are as follows: + - Two-way straight/turn switches: 'st'=straight branch, 'cr'=diverting/turn branch + - 3-way turnouts, Y-turnouts: 'l'=left branch, 's'=straight branch, 'r'=right branch + + node_next_state = "cr" + ^- The name of the state that the turnout should be switched to when it is right-clicked + + node_fallback_state = "st" + ^- The name of the state that the turnout should "fall back" to when it is released + Only used by the interlocking system, when a route on the node is released it is switched back to this state. + + node_state_map = { + ["st"] = "", + ["cr"] = "", + ... etc ... + } + ^- Map of state name to the appropriate node name that should be set by advtrains when a switch is requested + Note that for all of those nodes, the at_conns table must be identical (however the conn_map will vary) + + node_on_switch_state = function(pos, node, oldstate, newstate) + ^- Called when the node state is switched by advtrains, after the node replacement has commenced. + + Turnout switching can happen programmatically via advtrains.setstate(pos, state), via user right_click or via the interlocking system. + In no other situation is it permissible to exchange track nodes in-place, unless both at_conns and at_conn_map stay identical. + + Note that the fields node_state, node_next_state and node_state_map completely replace the getstate/setstate functions. + There must be a one-to-one mapping between states and node names and no function can be defined for state switching. + This principle enables the seamless working of the interlocking autorouter and reduces failure points. + The node_state_* system can also be used as drop-in replacement for the passive-API-enabled nodes (andrews-cross, mesecon_switch etc.) + The advtrains API functions advtrains.getstate() and advtrains.setstate() remain the programmatic access points, but will now utilize the new state system. + + + trackworker_next_rot = , + ^- if set, right-click with trackworker will set this node + trackworker_rot_incr_param2 = true + ^- if set, trackworker will increase node param2 on rightclick + + trackworker_next_var = + ^- if set, left-click with trackworker will set this node + } + }) + +]]-- + +-- This file provides some utilities to register tracks, but tries to not get into the way too much + + +function advtrains.track_can_dig_callback(pos, player) + local ok, reason = advtrains.can_dig_or_modify_track(pos) + if not ok and player then + minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed!") .. " " .. reason) + end + return ok +end + +function advtrains.track_update_callback(pos) + advtrains.ndb.update(pos) +end + +function advtrains.state_node_on_rightclick_callback(pos, node, player) + if advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then + local ndef = minetest.registered_nodes[node.name] + if ndef and ndef.advtrains and ndef.advtrains.node_next_state then + advtrains.setstate(pos, ndef.advtrains.node_next_state, node) + advtrains.log("Switch", player:get_player_name(), pos) + end + end +end + +-- advtrains.register_node_4rot(name, nodedef) +-- Registers four rotations for the node defined by nodedef (0°, 30°, 45° and 60°; the 4 90°-steps are already handled by the param2, resulting in 16 directions total). +-- You must provide the definition for the base node, and certain fields are altered automatically for the 3 additional rotations: +-- name: appends the suffix "_30", "_45" or "_60" +-- description: appends the rotation (human-readable) in parenthesis +-- tiles_prefix: if defined, "tiles" field will be set as prefix..rotationExtension..".png" +-- mesh_prefix, mesh_suffix: if defined, "mesh" field will be set as prefix..rotationExtension..suffix +-- at_conns: are rotated according to the node rotation +-- node_state_map, trackworker_next_var: appends the suffix appropriately. +-- groups: applies save_in_at_nodedb and not_blocking_trains groups if not already present +-- The nodes are registered in the trackworker to be rotated with right-click. +-- definition_mangling_function is an optional parameter. For each of the 4 rotations, it gets passed the modified node definition and may perform final modifications to it. +-- signature: function definition_mangling_function(name, nodedef, rotationIndex, rotationSuffix) +-- Example usage: define the setstate function of turnouts (if that is not done via the "automatic" way of state_node_map) +local rotations = { + {i = 0, s = "", h = " (0)", n = "_30"}, + {i = 1, s = "_30", h = " (30)", n = "_45"}, + {i = 2, s = "_45", h = " (45)", n = "_60"}, + {i = 3, s = "_60", h = " (60)", n = ""}, +} +function advtrains.register_node_4rot(ori_name, ori_ndef, definition_mangling_function) + for _, rot in ipairs(rotations) do + local ndef = table.copy(ori_ndef) + if ori_ndef.advtrains then + -- make sure advtrains table is deep-copied because we may need to replace node_state_map + ndef.advtrains = table.copy(ori_ndef.advtrains) + else + ndef.advtrains = {} -- we need the table later for trackworker + end + -- Perform the name mangling + local suffix = rot.s + local name = ori_name..suffix + ndef.description = ori_ndef.description .. rot.h + if ori_ndef.tiles_prefix then + ndef.tiles = { ori_ndef.tiles_prefix .. suffix .. ".png" } + end + if ori_ndef.mesh_prefix then + ndef.mesh = ori_ndef.mesh_prefix .. suffix .. ori_ndef.mesh_suffix + end + -- rotate connections + if ori_ndef.at_conns then + ndef.at_conns = advtrains.rotate_conn_by(ori_ndef.at_conns, rot.i) + end + -- update node state map if present + if ori_ndef.advtrains then + if ori_ndef.advtrains.node_state_map then + local new_nsm = {} + for state, nname in pairs(ori_ndef.advtrains.node_state_map) do + new_nsm[state] = nname .. suffix + end + ndef.advtrains.node_state_map = new_nsm + end + if ori_ndef.advtrains.trackworker_next_var then + ndef.advtrains.trackworker_next_var = ori_ndef.advtrains.trackworker_next_var .. suffix + end + -- apply trackworker rot field + ndef.advtrains.trackworker_next_rot = ori_name .. rot.n + ndef.advtrains.trackworker_rot_incr_param2 = (rot.n=="") + end + -- apply groups + ndef.groups.save_in_at_nodedb = 1 + ndef.groups.not_blocking_trains = 1 + + -- give the definition mangling function an option to do some adjustments + if definition_mangling_function then + definition_mangling_function(name, ndef, rot.i, suffix) + end + + -- register node + atdebug("Registering: ",name, ndef) + minetest.register_node(":"..name, ndef) + + -- if this has the track_place_group set, register as a candidate for the track_place_group + if ndef.advtrains.track_place_group then + advtrains.trackplacer.register_candidate(ndef.advtrains.track_place_group, name, ndef, ndef.advtrains.track_place_single, true) + end + end +end + + +-- Registers an item to place and automatically connect nearby tracks +function advtrains.register_track_placer(...) + +end + +-- Registers an item to place and adjust slope tracks +function advtrains.register_slope_placer(...) + +end + + + +-- track-related helper functions + +function advtrains.is_track(nodename) + if not minetest.registered_nodes[nodename] then + return false + end + local nodedef=minetest.registered_nodes[nodename] + if nodedef and nodedef.groups.advtrains_track then + return true + end + return false +end + +function advtrains.get_track_connections(name, param2) + local nodedef=minetest.registered_nodes[name] + if not nodedef then atprint(" get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return nil end + local noderot=param2 + if not param2 then noderot=0 end + if noderot > 3 then atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end + + local tracktype + for k,_ in pairs(nodedef.groups) do + local tt=string.match(k, "^advtrains_track_(.+)$") + if tt then + tracktype=tt + end + end + return advtrains.rotate_conn_by(nodedef.at_conns, noderot*AT_CMAX/4), (nodedef.at_rail_y or 0), tracktype +end + +-- Function called when a track is about to be dug or modified by the trackworker +-- Returns either true (ok) or false,"translated string describing reason why it isn't allowed" +function advtrains.can_dig_or_modify_track(pos) + if advtrains.get_train_at_pos(pos) then + return false, attrans("Position is occupied by a train.") + end + -- interlocking: tcb, signal IP a.s.o. + if advtrains.interlocking then + -- TCB? + if advtrains.interlocking.db.get_tcb(pos) then + return false, attrans("There's a Track Circuit Break here.") + end + -- signal ip? + if advtrains.interlocking.db.is_ip_at(pos, true) then -- is_ip_at with purge parameter + return false, attrans("There's a Signal Influence Point here.") + end + end + return true +end \ No newline at end of file diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 288e224..c6762c9 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -283,7 +283,7 @@ function advtrains.train_ensure_init(id, train) assertdef(train, "id", id) - if not train.drives_on or not train.max_speed then + if not train.max_speed then --atprint("in ensure_init: missing properties, updating!") advtrains.update_trainpart_properties(id) end @@ -1034,10 +1034,9 @@ end -- Note: safe_decouple_wagon() has been moved to wagons.lua --- this function sets wagon's pos_in_train(parts) properties and train's max_speed and drives_on (and more) +-- this function sets wagon's pos_in_train(parts) properties and train's max_speed (and more) function advtrains.update_trainpart_properties(train_id, invert_flipstate) local train=advtrains.trains[train_id] - train.drives_on=advtrains.merge_tables(advtrains.all_tracktypes) --FIX: deep-copy the table!!! train.max_speed=20 train.extent_h = 0; @@ -1079,13 +1078,6 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate) end rel_pos=rel_pos+wagon.wagon_span - if wagon.drives_on then - for k,_ in pairs(train.drives_on) do - if not wagon.drives_on[k] then - train.drives_on[k]=nil - end - end - end train.max_speed=math.min(train.max_speed, wagon.max_speed) train.extent_h = math.max(train.extent_h, wagon.extent_h or 1); end diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index b0fb575..f231546 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1367,7 +1367,7 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati local node=minetest.get_node_or_nil(pointed_thing.under) if not node then atprint("[advtrains]Ignore at placer position") return itemstack end local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, prototype.drives_on)) then + if(not advtrains.is_track(nodename)) then atprint("no track here, not placing.") return itemstack end @@ -1382,7 +1382,7 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati local yaw = placer:get_look_horizontal() local plconnid = advtrains.yawToClosestConn(yaw, tconns) - local prevpos = advtrains.get_adjacent_rail(pointed_thing.under, tconns, plconnid, prototype.drives_on) + local prevpos = advtrains.get_adjacent_rail(pointed_thing.under, tconns, plconnid) if not prevpos then minetest.chat_send_player(pname, "The track you are trying to place the wagon on is not long enough!") return @@ -1407,7 +1407,6 @@ advtrains.register_wagon("advtrains:wagon_placeholder", { collisionbox = {-0.3,-0.3,-0.3, 0.3,0.3,0.3}, visual_size = {x=0.7, y=0.7}, initial_sprite_basepos = {x=0, y=0}, - drives_on = advtrains.all_tracktypes, max_speed = 5, seats = { }, diff --git a/advtrains_interlocking/init.lua b/advtrains_interlocking/init.lua index a2f5882..cc46b83 100644 --- a/advtrains_interlocking/init.lua +++ b/advtrains_interlocking/init.lua @@ -24,7 +24,9 @@ dofile(modpath.."tool.lua") dofile(modpath.."approach.lua") dofile(modpath.."ars.lua") -dofile(modpath.."tsr_rail.lua") + +--TODO reenable tsr rail +--dofile(modpath.."tsr_rail.lua") minetest.register_privilege("interlocking", {description = "Can set up track sections, routes and signals.", give_to_singleplayer = true}) diff --git a/advtrains_line_automation/init.lua b/advtrains_line_automation/init.lua index 7b758bc..cc8df3c 100644 --- a/advtrains_line_automation/init.lua +++ b/advtrains_line_automation/init.lua @@ -20,7 +20,9 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELI dofile(modpath.."railwaytime.lua") dofile(modpath.."scheduler.lua") -dofile(modpath.."stoprail.lua") + +--TODO reenable stop rail +--dofile(modpath.."stoprail.lua") function advtrains.lines.load(data) diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua index bdbd50d..99d059a 100755 --- a/advtrains_signals_ks/init.lua +++ b/advtrains_signals_ks/init.lua @@ -113,15 +113,6 @@ local suppasp_ra = { } } -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:hs") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:ra") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign_lf") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:sign_lf7") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:zs3") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:zs3v") -advtrains.trackplacer.register_tracktype("advtrains_signals_ks:mast") - for _, rtab in ipairs({ {rot = "0", sbox = {-1/8, -1/2, -1/2, 1/8, 1/2, -1/4}, ici=true}, {rot = "30", sbox = {-3/8, -1/2, -1/2, -1/8, 1/2, -1/4},}, @@ -201,7 +192,7 @@ for _, rtab in ipairs({ after_dig_node = advtrains.interlocking.signal_after_dig, }) -- rotatable by trackworker - advtrains.trackplacer.add_worked("advtrains_signals_ks:hs", typ, "_"..rot) + --TODO add rotation using trackworker end @@ -246,7 +237,7 @@ for _, rtab in ipairs({ after_dig_node = advtrains.interlocking.signal_after_dig, }) -- rotatable by trackworker - advtrains.trackplacer.add_worked("advtrains_signals_ks:ra", typ, "_"..rot) + --TODO add rotation using trackworker end -- Schilder: @@ -283,7 +274,7 @@ for _, rtab in ipairs({ after_dig_node = advtrains.interlocking.signal_after_dig, }) -- rotatable by trackworker - advtrains.trackplacer.add_worked("advtrains_signals_ks:"..prefix, typ, "_"..rot, nxt) + --TODO add rotation using trackworker end for typ, prts in pairs { @@ -378,7 +369,7 @@ for _, rtab in ipairs({ t.drop = "advtrains_signals_ks:zs3_off_0" t.selection_box.fixed[1][5] = 0 minetest.register_node("advtrains_signals_ks:zs3_"..typ.."_"..rot, t) - advtrains.trackplacer.add_worked("advtrains_signals_ks:zs3", typ, "_"..rot) + --TODO add rotation using trackworker -- Zs 3v local t = table.copy(def) @@ -387,7 +378,7 @@ for _, rtab in ipairs({ t.drop = "advtrains_signals_ks:zs3v_off_0" t.tiles[3] = t.tiles[3] .. "^[multiply:yellow" minetest.register_node("advtrains_signals_ks:zs3v_"..typ.."_"..rot, t) - advtrains.trackplacer.add_worked("advtrains_signals_ks:zs3v", typ, "_"..rot) + --TODO add rotation using trackworker end minetest.register_node("advtrains_signals_ks:mast_mast_"..rot, { @@ -412,7 +403,7 @@ for _, rtab in ipairs({ }, drop = "advtrains_signals_ks:mast_mast_0", }) - advtrains.trackplacer.add_worked("advtrains_signals_ks:mast","mast", "_"..rot) + --TODO add rotation using trackworker end -- Crafting diff --git a/advtrains_train_track/init.lua b/advtrains_train_track/init.lua index 5065155..55b1367 100755 --- a/advtrains_train_track/init.lua +++ b/advtrains_train_track/init.lua @@ -1,937 +1,172 @@ --- Default tracks for advtrains --- (c) orwell96 and contributors - -local default_boxen = { - ["st"] = { - [""] = { - selection_box = { - type = "fixed", - fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2}, - } - }, - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, - {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, - {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} - } - } - }, - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} - } - } - }, - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - }, - - ["cr"] = { - [""] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.5000, 0.6875, -0.3750, 0.5000}, - {-0.3750, -0.5000, -1.000, 1.000, -0.3750, 0.000} - } - } - }, - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.5000, 0.7500, -0.3750, 0.8750}, - {-0.3750, -0.5000, 0.8750, 0.2500, -0.3750, 1.188}, - {0.7500, -0.5000, 0.2500, 1.063, -0.3750, 0.8750} - } - } - }, - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.125, 0.5000, -0.3750, 0.6875}, - {-0.8750, -0.5000, -0.9375, -0.5000, -0.3750, 0.06250}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000} - } - } - }, - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.8125, -0.5000, -0.5000, 1.188, -0.3750, 0.5000}, - {-0.1875, -0.5000, 0.5000, 0.8750, -0.3125, 0.8750}, - {-0.2500, -0.5000, -0.9375, 0.3125, -0.3125, -0.5000} - } - } - }, - }, - - ["swlst"] = { - [""] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.5000, 0.6250, -0.3750, 0.5000}, - {-0.3125, -0.5000, -1.000, 0.9375, -0.3125, -0.06250} - } - } - }, - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, - {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, - {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} - } - } - }, - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.1875, 0.5000, -0.3750, 0.8750}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-0.8750, -0.5000, -0.8125, -0.5000, -0.3750, 0.5000} - } - } - }, - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - }, - - ["swrst"] = { - [""] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.5000, 0.6250, -0.3750, 0.5000}, - {-0.8125, -0.5000, -1.000, 0.4375, -0.3125, -0.06250} - } - } - }, - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, - {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, - {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} - } - } - }, - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.1875, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-0.5000, -0.5000, 0.5000, 0.5000, -0.3750, 0.8750}, - {-0.8125, -0.5000, -0.8750, 0.5000, -0.3750, -0.5000} - } - } - }, - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - }, -} - -default_boxen["swlcr"] = default_boxen["swlst"] -default_boxen["swrcr"] = default_boxen["swrst"] - ---flat -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("Track"), - formats={}, - - get_additional_definiton = function(def, preset, suffix, rotation) - if default_boxen[suffix] ~= nil and default_boxen[suffix][rotation] ~= nil then - return default_boxen[suffix][rotation] - else - return {} - end - end, -}, advtrains.ap.t_30deg_flat) - -minetest.register_craft({ - output = 'advtrains:dtrack_placer 50', - recipe = { - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - }, -}) - -local y3_boxen = { - [""] = { - selection_box = { - type = "fixed", - fixed = { - {-0.8750, -0.5000, -1.125, 0.8750, -0.3750, 0.4375} - } - } - }, - - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.875, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -0.4375, -0.5000, -0.3750, 0.5625}, - {0.5000, -0.5000, -0.2500, 0.8125, -0.3750, 1.000}, - } - } - }, - - --UX FIXME: - 3way - have to place straight route before l and r or the - --nodebox overlaps too much and can't place the straight track node. - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.1250, 0.5000, -0.3750, 0.8750}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-1.1250, -0.5000, -0.9375, -0.5000, -0.3750, 0.5000} - } - } - }, - - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - --{-0.5000, -0.5000, -0.875, 0.5000, -0.3750, 1.000}, - {-0.875, -0.5000, -0.5, 1.0, -0.3750, 0.5}, - --{-0.8750, -0.5000, -0.4375, -0.5000, -0.3750, 0.5625}, - {-0.4375, -0.5000, -0.8750, 0.5625, -0.3750, -0.5000}, - --{0.5000, -0.5000, -0.2500, 0.8125, -0.3750, 1.000}, - {-0.2500, -0.5000, -0.2500, 1.0000, -0.3750, 0.8125}, - } - } - }, -} - - -local function y3_turnouts_addef(def, preset, suffix, rotation) - return y3_boxen[rotation] or {} -end --- y-turnout -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_sy", - texture_prefix="advtrains_dtrack_sy", - models_prefix="advtrains_dtrack_sy", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("Y-turnout"), - formats = {}, - get_additional_definiton = y3_turnouts_addef, -}, advtrains.ap.t_yturnout) -minetest.register_craft({ - output = 'advtrains:dtrack_sy_placer 2', - recipe = { - {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}, - {'', 'advtrains:dtrack_placer', ''}, - {'', 'advtrains:dtrack_placer', ''}, - }, -}) ---3-way turnout -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_s3", - texture_prefix="advtrains_dtrack_s3", - models_prefix="advtrains_dtrack_s3", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("3-way turnout"), - formats = {}, - get_additional_definiton = y3_turnouts_addef, -}, advtrains.ap.t_s3way) -minetest.register_craft({ - output = 'advtrains:dtrack_s3_placer 1', - recipe = { - {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, - {'', 'advtrains:dtrack_placer', ''}, - {'', '', ''}, - }, -}) - --- Diamond Crossings - -local perp_boxen = { - [""] = {}, --default size - ["_30"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} - } - } - }, - ["_45"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.8125, -0.5000, -0.8125, 0.8125, -0.3750, 0.8125} - } - } - }, - ["_60"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} - } - } - }, -} - --- perpendicular -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_xing", - texture_prefix="advtrains_dtrack_xing", - models_prefix="advtrains_dtrack_xing", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("Perpendicular Diamond Crossing Track"), - formats = {}, - get_additional_definiton = function(def, preset, suffix, rotation) - return perp_boxen[rotation] or {} - end -}, advtrains.ap.t_perpcrossing) - -minetest.register_craft({ - output = 'advtrains:dtrack_xing_placer 3', - recipe = { - {'', 'advtrains:dtrack_placer', ''}, - {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, - {'', 'advtrains:dtrack_placer', ''} - } -}) - -local ninety_plus_boxen = { - ["30l"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, - {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, - {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} - } - } - }, - ["30r"] = { - selection_box = { - type = "fixed", - fixed = { - {0.5000, -0.5000, -1.000, -0.5000, -0.3750, 1.000}, - {0.8750, -0.5000, -1.000, 0.5000, -0.3750, 0.2500}, - {-0.5000, -0.5000, -0.2500, -0.8750, -0.3750, 1.000}, - {0.1250, -0.5000, -1.375, -0.1875, -0.3750, -1.000} - } - } - }, - ["45l"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} - } - } - }, - ["45r"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, - {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, - {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} - } - } - }, - ["60l"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - ["60r"] = { - selection_box = { - type = "fixed", - fixed = { - {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, - {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, - {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, - {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} - } - } - }, -} - --- 90plusx --- When you face east and param2=0, then this set of rails has a rail at 90 --- degrees to the viewer, plus another rail crossing at 30, 45 or 60 degrees. -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_xing90plusx", - texture_prefix="advtrains_dtrack_xing4590", - models_prefix="advtrains_dtrack_xing90plusx", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("90+Angle Diamond Crossing Track"), - formats = {}, - get_additional_definiton = function(def, preset, suffix, rotation) - return ninety_plus_boxen[suffix] or {} - end, -}, advtrains.ap.t_90plusx_crossing) -minetest.register_craft({ - output = 'advtrains:dtrack_xing90plusx_placer 2', - recipe = { - {'advtrains:dtrack_placer', '', ''}, - {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, - {'', '', 'advtrains:dtrack_placer'} - } -}) - --- Deprecate any rails using the old name scheme -minetest.register_lbm({ - label = "Upgrade legacy 4590 rails", - name = "advtrains_train_track:replace_legacy_4590", - nodenames = {"advtrains:dtrack_xing4590_st"}, - run_at_every_load = true, - action = function(pos, node) - minetest.log("actionPos!: " .. pos.x .. "," .. pos.y .. "," .. pos.z) - minetest.log("node!: " .. node.name .. "," .. node.param1 .. "," .. node.param2) - advtrains.ndb.swap_node(pos, - { - name="advtrains:dtrack_xing90plusx_45l", - param1=node.param1, - param2=node.param2, - }) - end -}) --- This will replace any items left in the inventory -minetest.register_alias("advtrains:dtrack_xing4590_placer", "advtrains:dtrack_xing90plusx_placer") - -local diagonal_boxen = { - ["30r45l"] = { - selection_box = { - type = "fixed", - fixed = { - {0.5000, -0.5000, -1.000, -0.5000, -0.3750, 1.000}, - {0.8750, -0.5000, -1.000, 0.5000, -0.3750, 0.2500}, - {-0.5000, -0.5000, -0.2500, -0.8750, -0.3750, 1.000}, - {0.1250, -0.5000, -1.375, -0.1875, -0.3750, -1.000} - } - } - }, - ["60l30l"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - ["60l60r"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} - } - } - }, - ["60r30r"] = { - selection_box = { - type = "fixed", - fixed = { - {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, - {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, - {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, - {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} - } - } - }, - ["30l45r"] = { - selection_box = { - type = "fixed", - fixed = { - {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, - {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, - {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, - {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} - } - } - }, - ["60l45r"] = { - selection_box = { - type = "fixed", - fixed = { - {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, - {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, - {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, - {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} - } - } - }, - ["60r45l"] = { - selection_box = { - type = "fixed", - fixed = { - {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, - {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, - {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, - {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} - } - } - }, -} - --- Diagonal --- This set of rail crossings is named based on the angle of each intersecting --- direction when facing east and param2=0. Rails with l/r swapped are mirror --- images. For example, 30r45l is the mirror image of 30l45r. -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_xingdiag", - texture_prefix="advtrains_dtrack_xingdiag", - models_prefix="advtrains_dtrack_xingdiag", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - description=attrans("Diagonal Diamond Crossing Track"), - formats = {}, - get_additional_definiton = function(def, preset, suffix, rotation) - return diagonal_boxen[suffix] or {} - end, -}, advtrains.ap.t_diagonalcrossing) -minetest.register_craft({ - output = 'advtrains:dtrack_xingdiag_placer 2', - recipe = { - {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}, - {'', 'advtrains:dtrack_placer', ''}, - {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'} - } -}) ----- Not included: very shallow crossings like (30/60)+45. ----- At an angle of only 18.4 degrees, the models would not ----- translate well to a block game. --- END crossings - ---slopes -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".obj", - shared_texture="advtrains_dtrack_shared.png", - second_texture="default_gravel.png", - description=attrans("Track"), - formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, -}, advtrains.ap.t_30deg_slope) - -minetest.register_craft({ - type = "shapeless", - output = 'advtrains:dtrack_slopeplacer 2', - recipe = { - "advtrains:dtrack_placer", - "advtrains:dtrack_placer", - "default:gravel", - }, -}) - - ---bumpers -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_bumper", - texture_prefix="advtrains_dtrack_bumper", - models_prefix="advtrains_dtrack_bumper", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_rail.png", - --bumpers still use the old texture until the models are redone. - description=attrans("Bumper"), - formats={}, -}, advtrains.ap.t_30deg_straightonly) -minetest.register_craft({ - output = 'advtrains:dtrack_bumper_placer 2', - recipe = { - {'group:wood', 'dye:red'}, - {'default:steel_ingot', 'default:steel_ingot'}, - {'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, - }, -}) ---legacy bumpers -for _,rot in ipairs({"", "_30", "_45", "_60"}) do - minetest.register_alias("advtrains:dtrack_bumper"..rot, "advtrains:dtrack_bumper_st"..rot) -end --- atc track -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_atc", - texture_prefix="advtrains_dtrack_atc", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_atc.png", - description=attrans("ATC controller"), - formats={}, - get_additional_definiton = advtrains.atc_function -}, advtrains.trackpresets.t_30deg_straightonly) - - --- Tracks for loading and unloading trains --- Copyright (C) 2017 Gabriel Pérez-Cerezo - -local function get_far_node(pos) - local node = minetest.get_node(pos) - if node.name == "ignore" then - minetest.get_voxel_manip():read_from_map(pos, pos) - node = minetest.get_node(pos) - end - return node -end - - -local function show_fc_formspec(pos,player) - local pname = player:get_player_name() - if minetest.is_protected(pos,pname) then - minetest.chat_send_player(pname, "Position is protected!") - return - end - - local meta = minetest.get_meta(pos) - local fc = meta:get_string("fc") or "" - - local form = 'formspec_version[4]'.. - 'size[10,5]'.. - 'label[0.5,0.4;Advtrains Loading/Unloading Track]'.. - 'label[0.5,1.1;Set the code to match against the wagon\'s freight code]'.. - 'label[0.5,1.6;A blank field matches all wagons (default)]'.. - 'label[0.5,2.1;Use code # to disable the track section]'.. - 'field[0.5,3;5.5,1;fc;FC;'..minetest.formspec_escape(fc)..']'.. - 'button[6.5,3;3,1;save;Submit]' - minetest.show_formspec(pname, "at_load_unload_"..advtrains.encode_pos(pos), form) -end - -minetest.register_on_player_receive_fields(function(player, formname, fields) - local pname = player:get_player_name() - local pe = string.match(formname, "^at_load_unload_(............)$") - local pos = advtrains.decode_pos(pe) - if pos then - if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, "Position is protected!") - return - end - - if fields.save then - minetest.get_meta(pos):set_string("fc",tostring(fields.fc)) - minetest.chat_send_player(pname,"Freight code set: "..tostring(fields.fc)) - show_fc_formspec(pos,player) - end - end -end) - - -local function train_load(pos, train_id, unload) - local train=advtrains.trains[train_id] - local below = get_far_node({x=pos.x, y=pos.y-1, z=pos.z}) - if not string.match(below.name, "chest") then - atprint("this is not a chest! at "..minetest.pos_to_string(pos)) - return - end - - local node_fc = minetest.get_meta(pos):get_string("fc") or "" - if node_fc == "#" then - --track section is disabled - return - end - - local inv = minetest.get_inventory({type="node", pos={x=pos.x, y=pos.y-1, z=pos.z}}) - if inv and train.velocity < 2 then - for k, v in ipairs(train.trainparts) do - local i=minetest.get_inventory({type="detached", name="advtrains_wgn_"..v}) - if i and i:get_list("box") then - - local wagon_data = advtrains.wagons[v] - local wagon_fc - if wagon_data.fc then - if not wagon_data.fcind then wagon_data.fcind = 1 end - wagon_fc = tostring(wagon_data.fc[wagon_data.fcind]) or "" - end - - if node_fc == "" or wagon_fc == node_fc then - if not unload then - for _, item in ipairs(inv:get_list("main")) do - if i:get_list("box") and i:room_for_item("box", item) then - i:add_item("box", item) - inv:remove_item("main", item) - end - end - else - for _, item in ipairs(i:get_list("box")) do - if inv:get_list("main") and inv:room_for_item("main", item) then - i:remove_item("box", item) - inv:add_item("main", item) - end - end - end - end - end - end - end -end - - - -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_unload", - texture_prefix="advtrains_dtrack_unload", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_unload.png", - description=attrans("Unloading Track"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.ndb.clear(pos) - end, - on_rightclick = function(pos, node, player) - show_fc_formspec(pos, player) - end, - advtrains = { - on_train_enter = function(pos, train_id) - train_load(pos, train_id, true) - end, - }, - } - end - }, advtrains.trackpresets.t_30deg_straightonly) -advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_load", - texture_prefix="advtrains_dtrack_load", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_load.png", - description=attrans("Loading Track"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - after_dig_node=function(pos) - advtrains.invalidate_all_paths() - advtrains.ndb.clear(pos) - end, - on_rightclick = function(pos, node, player) - show_fc_formspec(pos, player) - end, - advtrains = { - on_train_enter = function(pos, train_id) - train_load(pos, train_id, false) - end, - }, - } - end - }, advtrains.trackpresets.t_30deg_straightonly) - --- mod-dependent crafts -local loader_core = "default:mese_crystal" --fallback -if minetest.get_modpath("basic_materials") then - loader_core = "basic_materials:ic" -elseif minetest.get_modpath("technic") then - loader_core = "technic:control_logic_unit" -end ---print("Loader Core: "..loader_core) - -minetest.register_craft({ - type="shapeless", - output = 'advtrains:dtrack_load_placer', - recipe = { - "advtrains:dtrack_placer", - loader_core, - "default:chest" - }, -}) -loader_core = nil --nil the crafting variable - ---craft between load/unload tracks -minetest.register_craft({ - type="shapeless", - output = 'advtrains:dtrack_unload_placer', - recipe = { - "advtrains:dtrack_load_placer", - }, -}) -minetest.register_craft({ - type="shapeless", - output = 'advtrains:dtrack_load_placer', - recipe = { - "advtrains:dtrack_unload_placer", - }, -}) - - -if mesecon then - advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_detector_off", - texture_prefix="advtrains_dtrack_detector", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_detector_off.png", - description=attrans("Detector Rail"), - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - mesecons = { - receptor = { - state = mesecon.state.off, - rules = advtrains.meseconrules - } - }, - advtrains = { - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_off(pos, advtrains.meseconrules) - end, - on_train_enter=function(pos, train_id) - advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=advtrains.ndb.get_node(pos).param2}) - if advtrains.is_node_loaded(pos) then - mesecon.receptor_on(pos, advtrains.meseconrules) - end - end - } - } - end - }, advtrains.ap.t_30deg_straightonly) - advtrains.register_tracks("default", { - nodename_prefix="advtrains:dtrack_detector_on", - texture_prefix="advtrains_dtrack", - models_prefix="advtrains_dtrack", - models_suffix=".b3d", - shared_texture="advtrains_dtrack_shared_detector_on.png", - description="Detector(on)(you hacker you)", - formats={}, - get_additional_definiton = function(def, preset, suffix, rotation) - return { - mesecons = { - receptor = { - state = mesecon.state.on, - rules = advtrains.meseconrules - } - }, - advtrains = { - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_on(pos, advtrains.meseconrules) - end, - on_train_leave=function(pos, train_id) - advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=advtrains.ndb.get_node(pos).param2}) - if advtrains.is_node_loaded(pos) then - mesecon.receptor_off(pos, advtrains.meseconrules) - end - end - } - } - end - }, advtrains.ap.t_30deg_straightonly_noplacer) -minetest.register_craft({ - type="shapeless", - output = 'advtrains:dtrack_detector_off_placer', - recipe = { - "advtrains:dtrack_placer", - "mesecons:wire_00000000_off" - }, -}) -end ---TODO legacy ---I know lbms are better for this purpose -for name,rep in pairs({swl_st="swlst", swr_st="swrst", swl_cr="swlcr", swr_cr="swrcr", }) do - minetest.register_abm({ - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_"..name}, - interval = 1.0, -- Operation interval in seconds - chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep, param2=node.param2}) end, - }) - minetest.register_abm({ - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_"..name.."_45"}, - interval = 1.0, -- Operation interval in seconds - chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep.."_45", param2=node.param2}) end, - }) -end - -if advtrains.register_replacement_lbms then -minetest.register_lbm({ - name = "advtrains:ramp_replacement_1", --- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_vert1"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst1", param2=(node.param2+2)%4}) end, -}) -minetest.register_lbm({ - name = "advtrains:ramp_replacement_1", --- -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_vert2"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst2", param2=(node.param2+2)%4}) end, -}) - minetest.register_abm({ - name = "advtrains:st_rep_1", - -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_st"}, - interval=1, - chance=1, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st", param2=node.param2}) end, - }) - minetest.register_lbm({ - name = "advtrains:st_rep_1", - -- -- In the following two fields, also group:groupname will work. - nodenames = {"advtrains:track_st_45"}, - action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st_45", param2=node.param2}) end, - }) -end +-- advtrains_train_track +-- rewritten to work with advtrains 2.5 track system + +local function conns(c1, c2, r1, r2) return {{c=c1, y=r1}, {c=c2, y=r2}} end +local function conns3(c1, c2, c3, r1, r2, r3) return {{c=c1, y=r1}, {c=c2, y=r2}, {c=c3, y=r3}} end + + +local common_def = { + drawtype = "mesh", + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2}, + }, + + mesh_suffix = ".b3d", + tiles = { "advtrains_dtrack_shared.png" }, + + groups = { + advtrains_track=1, + advtrains_track_default=1, + dig_immediate=2, + --not_in_creative_inventory=1, + }, + + can_dig = advtrains.track_can_dig_callback, + after_dig_node = advtrains.track_update_callback, + after_place_node = advtrains.track_update_callback, + + drop = "advtrains:dtrack_placer" +} + +-- Normal tracks, straight and curved +advtrains.register_node_4rot("advtrains:dtrack_st", + advtrains.merge_tables(common_def, { + description=attrans("Track Straight"), + mesh_prefix="advtrains_dtrack_st", + at_conns = conns(0,8), + advtrains = { + trackworker_next_var = "advtrains:dtrack_cr", + track_place_group = "advtrains:dtrack", + track_place_single = true, + }, + }) +) + +advtrains.register_node_4rot("advtrains:dtrack_cr", + advtrains.merge_tables(common_def, { + description=attrans("Track Curve"), + mesh_prefix="advtrains_dtrack_cr", + at_conns = conns(0,7), + advtrains = { + trackworker_next_var = "advtrains:dtrack_swlst", + track_place_group = "advtrains:dtrack", + }, + }) +) + +-- simple turnouts left and right + +local stm_left = { + st = "advtrains:dtrack_swlst", + cr = "advtrains:dtrack_swlcr", +} + +advtrains.register_node_4rot("advtrains:dtrack_swlst", + advtrains.merge_tables(common_def, { + description=attrans("Track Turnout Left Straight"), + mesh_prefix="advtrains_dtrack_swlst", + at_conns = conns3(0,8,7), + at_conn_map = {2,1,1}, + on_rightclick = advtrains.state_node_on_rightclick_callback, + advtrains = { + node_state = "st", + node_next_state = "cr", + node_state_map = stm_left, + trackworker_next_var = "advtrains:dtrack_swrst" + }, + }) +) + +advtrains.register_node_4rot("advtrains:dtrack_swlcr", + advtrains.merge_tables(common_def, { + description=attrans("Track Turnout Left Curve"), + mesh_prefix="advtrains_dtrack_swlcr", + at_conns = conns3(0,8,7), -- note: conns must stay identical + at_conn_map = {3,1,1}, -- now points to curve branch + on_rightclick = advtrains.state_node_on_rightclick_callback, + advtrains = { + node_state = "cr", + node_next_state = "st", + node_state_map = stm_left, + trackworker_next_var = "advtrains:dtrack_swrcr" + }, + }) +) + +local stm_right = { + st = "advtrains:dtrack_swrst", + cr = "advtrains:dtrack_swrcr", +} + +advtrains.register_node_4rot("advtrains:dtrack_swrst", + advtrains.merge_tables(common_def, { + description=attrans("Track Turnout Right Straight"), + mesh_prefix="advtrains_dtrack_swrst", + at_conns = conns3(0,8,9), + at_conn_map = {2,1,1}, + on_rightclick = advtrains.state_node_on_rightclick_callback, + advtrains = { + node_state = "st", + node_next_state = "cr", + node_state_map = stm_right, + trackworker_next_var = "advtrains:dtrack_st" + }, + }) +) + +advtrains.register_node_4rot("advtrains:dtrack_swrcr", + advtrains.merge_tables(common_def, { + description=attrans("Track Turnout Right Curve"), + mesh_prefix="advtrains_dtrack_swrcr", + at_conns = conns3(0,8,9), -- note: conns must stay identical + at_conn_map = {3,1,1}, -- now points to curve branch + on_rightclick = advtrains.state_node_on_rightclick_callback, + advtrains = { + node_state = "cr", + node_next_state = "st", + node_state_map = stm_right, + trackworker_next_var = "advtrains:dtrack_st" + }, + }) +) + +-- register placer item +minetest.register_craftitem(":advtrains:dtrack_placer", { + description = attrans("Track"), + inventory_image = "advtrains_dtrack_placer.png", + wield_image = "advtrains_dtrack_placer.png", + groups={advtrains_trackplacer=1, digtron_on_place=1}, + liquids_pointable = false, + on_place = function(itemstack, placer, pointed_thing) + local name = placer:get_player_name() + if not name then + return itemstack, false + end + if pointed_thing.type=="node" then + local pos=pointed_thing.above + local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0}) + if not advtrains.check_track_protection(pos, name) then + return itemstack, false + end + if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to then + local s = minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable + if s then +-- minetest.chat_send_all(nnprefix) + local yaw = placer:get_look_horizontal() + advtrains.trackplacer.place_track(pos, "advtrains:dtrack", name, yaw) + if not advtrains.is_creative(name) then + itemstack:take_item() + end + end + end + end + return itemstack, true + end, +}) + + +--TODO restore mesecons! \ No newline at end of file diff --git a/advtrains_train_track/oldinit.lua b/advtrains_train_track/oldinit.lua new file mode 100644 index 0000000..5065155 --- /dev/null +++ b/advtrains_train_track/oldinit.lua @@ -0,0 +1,937 @@ +-- Default tracks for advtrains +-- (c) orwell96 and contributors + +local default_boxen = { + ["st"] = { + [""] = { + selection_box = { + type = "fixed", + fixed = {-1/2-1/16, -1/2, -1/2, 1/2+1/16, -1/2+2/16, 1/2}, + } + }, + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, + {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, + {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} + } + } + }, + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} + } + } + }, + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + }, + + ["cr"] = { + [""] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.5000, 0.6875, -0.3750, 0.5000}, + {-0.3750, -0.5000, -1.000, 1.000, -0.3750, 0.000} + } + } + }, + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.5000, 0.7500, -0.3750, 0.8750}, + {-0.3750, -0.5000, 0.8750, 0.2500, -0.3750, 1.188}, + {0.7500, -0.5000, 0.2500, 1.063, -0.3750, 0.8750} + } + } + }, + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.125, 0.5000, -0.3750, 0.6875}, + {-0.8750, -0.5000, -0.9375, -0.5000, -0.3750, 0.06250}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000} + } + } + }, + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.8125, -0.5000, -0.5000, 1.188, -0.3750, 0.5000}, + {-0.1875, -0.5000, 0.5000, 0.8750, -0.3125, 0.8750}, + {-0.2500, -0.5000, -0.9375, 0.3125, -0.3125, -0.5000} + } + } + }, + }, + + ["swlst"] = { + [""] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.5000, 0.6250, -0.3750, 0.5000}, + {-0.3125, -0.5000, -1.000, 0.9375, -0.3125, -0.06250} + } + } + }, + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, + {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, + {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} + } + } + }, + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.1875, 0.5000, -0.3750, 0.8750}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-0.8750, -0.5000, -0.8125, -0.5000, -0.3750, 0.5000} + } + } + }, + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + }, + + ["swrst"] = { + [""] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.5000, 0.6250, -0.3750, 0.5000}, + {-0.8125, -0.5000, -1.000, 0.4375, -0.3125, -0.06250} + } + } + }, + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, + {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, + {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} + } + } + }, + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.1875, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-0.5000, -0.5000, 0.5000, 0.5000, -0.3750, 0.8750}, + {-0.8125, -0.5000, -0.8750, 0.5000, -0.3750, -0.5000} + } + } + }, + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + }, +} + +default_boxen["swlcr"] = default_boxen["swlst"] +default_boxen["swrcr"] = default_boxen["swrst"] + +--flat +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("Track"), + formats={}, + + get_additional_definiton = function(def, preset, suffix, rotation) + if default_boxen[suffix] ~= nil and default_boxen[suffix][rotation] ~= nil then + return default_boxen[suffix][rotation] + else + return {} + end + end, +}, advtrains.ap.t_30deg_flat) + +minetest.register_craft({ + output = 'advtrains:dtrack_placer 50', + recipe = { + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + }, +}) + +local y3_boxen = { + [""] = { + selection_box = { + type = "fixed", + fixed = { + {-0.8750, -0.5000, -1.125, 0.8750, -0.3750, 0.4375} + } + } + }, + + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.875, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -0.4375, -0.5000, -0.3750, 0.5625}, + {0.5000, -0.5000, -0.2500, 0.8125, -0.3750, 1.000}, + } + } + }, + + --UX FIXME: - 3way - have to place straight route before l and r or the + --nodebox overlaps too much and can't place the straight track node. + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.1250, 0.5000, -0.3750, 0.8750}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-1.1250, -0.5000, -0.9375, -0.5000, -0.3750, 0.5000} + } + } + }, + + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + --{-0.5000, -0.5000, -0.875, 0.5000, -0.3750, 1.000}, + {-0.875, -0.5000, -0.5, 1.0, -0.3750, 0.5}, + --{-0.8750, -0.5000, -0.4375, -0.5000, -0.3750, 0.5625}, + {-0.4375, -0.5000, -0.8750, 0.5625, -0.3750, -0.5000}, + --{0.5000, -0.5000, -0.2500, 0.8125, -0.3750, 1.000}, + {-0.2500, -0.5000, -0.2500, 1.0000, -0.3750, 0.8125}, + } + } + }, +} + + +local function y3_turnouts_addef(def, preset, suffix, rotation) + return y3_boxen[rotation] or {} +end +-- y-turnout +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_sy", + texture_prefix="advtrains_dtrack_sy", + models_prefix="advtrains_dtrack_sy", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("Y-turnout"), + formats = {}, + get_additional_definiton = y3_turnouts_addef, +}, advtrains.ap.t_yturnout) +minetest.register_craft({ + output = 'advtrains:dtrack_sy_placer 2', + recipe = { + {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}, + {'', 'advtrains:dtrack_placer', ''}, + {'', 'advtrains:dtrack_placer', ''}, + }, +}) +--3-way turnout +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_s3", + texture_prefix="advtrains_dtrack_s3", + models_prefix="advtrains_dtrack_s3", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("3-way turnout"), + formats = {}, + get_additional_definiton = y3_turnouts_addef, +}, advtrains.ap.t_s3way) +minetest.register_craft({ + output = 'advtrains:dtrack_s3_placer 1', + recipe = { + {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, + {'', 'advtrains:dtrack_placer', ''}, + {'', '', ''}, + }, +}) + +-- Diamond Crossings + +local perp_boxen = { + [""] = {}, --default size + ["_30"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} + } + } + }, + ["_45"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.8125, -0.5000, -0.8125, 0.8125, -0.3750, 0.8125} + } + } + }, + ["_60"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} + } + } + }, +} + +-- perpendicular +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_xing", + texture_prefix="advtrains_dtrack_xing", + models_prefix="advtrains_dtrack_xing", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("Perpendicular Diamond Crossing Track"), + formats = {}, + get_additional_definiton = function(def, preset, suffix, rotation) + return perp_boxen[rotation] or {} + end +}, advtrains.ap.t_perpcrossing) + +minetest.register_craft({ + output = 'advtrains:dtrack_xing_placer 3', + recipe = { + {'', 'advtrains:dtrack_placer', ''}, + {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, + {'', 'advtrains:dtrack_placer', ''} + } +}) + +local ninety_plus_boxen = { + ["30l"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, + {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, + {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} + } + } + }, + ["30r"] = { + selection_box = { + type = "fixed", + fixed = { + {0.5000, -0.5000, -1.000, -0.5000, -0.3750, 1.000}, + {0.8750, -0.5000, -1.000, 0.5000, -0.3750, 0.2500}, + {-0.5000, -0.5000, -0.2500, -0.8750, -0.3750, 1.000}, + {0.1250, -0.5000, -1.375, -0.1875, -0.3750, -1.000} + } + } + }, + ["45l"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} + } + } + }, + ["45r"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -0.8750, 0.5000, -0.3750, 0.8750}, + {0.5000, -0.5000, -0.5000, 0.8750, -0.3750, 0.5000}, + {-0.8750, -0.5000, -0.5000, -0.5000, -0.3750, 0.5000} + } + } + }, + ["60l"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + ["60r"] = { + selection_box = { + type = "fixed", + fixed = { + {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, + {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, + {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, + {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} + } + } + }, +} + +-- 90plusx +-- When you face east and param2=0, then this set of rails has a rail at 90 +-- degrees to the viewer, plus another rail crossing at 30, 45 or 60 degrees. +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_xing90plusx", + texture_prefix="advtrains_dtrack_xing4590", + models_prefix="advtrains_dtrack_xing90plusx", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("90+Angle Diamond Crossing Track"), + formats = {}, + get_additional_definiton = function(def, preset, suffix, rotation) + return ninety_plus_boxen[suffix] or {} + end, +}, advtrains.ap.t_90plusx_crossing) +minetest.register_craft({ + output = 'advtrains:dtrack_xing90plusx_placer 2', + recipe = { + {'advtrains:dtrack_placer', '', ''}, + {'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, + {'', '', 'advtrains:dtrack_placer'} + } +}) + +-- Deprecate any rails using the old name scheme +minetest.register_lbm({ + label = "Upgrade legacy 4590 rails", + name = "advtrains_train_track:replace_legacy_4590", + nodenames = {"advtrains:dtrack_xing4590_st"}, + run_at_every_load = true, + action = function(pos, node) + minetest.log("actionPos!: " .. pos.x .. "," .. pos.y .. "," .. pos.z) + minetest.log("node!: " .. node.name .. "," .. node.param1 .. "," .. node.param2) + advtrains.ndb.swap_node(pos, + { + name="advtrains:dtrack_xing90plusx_45l", + param1=node.param1, + param2=node.param2, + }) + end +}) +-- This will replace any items left in the inventory +minetest.register_alias("advtrains:dtrack_xing4590_placer", "advtrains:dtrack_xing90plusx_placer") + +local diagonal_boxen = { + ["30r45l"] = { + selection_box = { + type = "fixed", + fixed = { + {0.5000, -0.5000, -1.000, -0.5000, -0.3750, 1.000}, + {0.8750, -0.5000, -1.000, 0.5000, -0.3750, 0.2500}, + {-0.5000, -0.5000, -0.2500, -0.8750, -0.3750, 1.000}, + {0.1250, -0.5000, -1.375, -0.1875, -0.3750, -1.000} + } + } + }, + ["60l30l"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + ["60l60r"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -1.000, 1.000, -0.3750, 1.000} + } + } + }, + ["60r30r"] = { + selection_box = { + type = "fixed", + fixed = { + {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, + {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, + {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, + {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} + } + } + }, + ["30l45r"] = { + selection_box = { + type = "fixed", + fixed = { + {-0.5000, -0.5000, -1.000, 0.5000, -0.3750, 1.000}, + {-0.8750, -0.5000, -1.000, -0.5000, -0.3750, 0.2500}, + {0.5000, -0.5000, -0.2500, 0.8750, -0.3750, 1.000}, + {-0.1250, -0.5000, -1.375, 0.1875, -0.3750, -1.000} + } + } + }, + ["60l45r"] = { + selection_box = { + type = "fixed", + fixed = { + {-1.000, -0.5000, -0.5000, 1.000, -0.3750, 0.5000}, + {-1.000, -0.5000, -0.8750, 0.2500, -0.3750, -0.5000}, + {-0.2500, -0.5000, 0.5000, 1.000, -0.3750, 0.8750}, + {-1.375, -0.5000, -0.1250, -1.000, -0.3750, 0.1875} + } + } + }, + ["60r45l"] = { + selection_box = { + type = "fixed", + fixed = { + {1.000, -0.5000, -0.5000, -1.000, -0.3750, 0.5000}, + {1.000, -0.5000, -0.8750, -0.2500, -0.3750, -0.5000}, + {0.2500, -0.5000, 0.5000, -1.000, -0.3750, 0.8750}, + {1.375, -0.5000, -0.1250, 1.000, -0.3750, 0.1875} + } + } + }, +} + +-- Diagonal +-- This set of rail crossings is named based on the angle of each intersecting +-- direction when facing east and param2=0. Rails with l/r swapped are mirror +-- images. For example, 30r45l is the mirror image of 30l45r. +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_xingdiag", + texture_prefix="advtrains_dtrack_xingdiag", + models_prefix="advtrains_dtrack_xingdiag", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + description=attrans("Diagonal Diamond Crossing Track"), + formats = {}, + get_additional_definiton = function(def, preset, suffix, rotation) + return diagonal_boxen[suffix] or {} + end, +}, advtrains.ap.t_diagonalcrossing) +minetest.register_craft({ + output = 'advtrains:dtrack_xingdiag_placer 2', + recipe = { + {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}, + {'', 'advtrains:dtrack_placer', ''}, + {'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'} + } +}) +---- Not included: very shallow crossings like (30/60)+45. +---- At an angle of only 18.4 degrees, the models would not +---- translate well to a block game. +-- END crossings + +--slopes +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".obj", + shared_texture="advtrains_dtrack_shared.png", + second_texture="default_gravel.png", + description=attrans("Track"), + formats={vst1={true, false, true}, vst2={true, false, true}, vst31={true}, vst32={true}, vst33={true}}, +}, advtrains.ap.t_30deg_slope) + +minetest.register_craft({ + type = "shapeless", + output = 'advtrains:dtrack_slopeplacer 2', + recipe = { + "advtrains:dtrack_placer", + "advtrains:dtrack_placer", + "default:gravel", + }, +}) + + +--bumpers +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_bumper", + texture_prefix="advtrains_dtrack_bumper", + models_prefix="advtrains_dtrack_bumper", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_rail.png", + --bumpers still use the old texture until the models are redone. + description=attrans("Bumper"), + formats={}, +}, advtrains.ap.t_30deg_straightonly) +minetest.register_craft({ + output = 'advtrains:dtrack_bumper_placer 2', + recipe = { + {'group:wood', 'dye:red'}, + {'default:steel_ingot', 'default:steel_ingot'}, + {'advtrains:dtrack_placer', 'advtrains:dtrack_placer'}, + }, +}) +--legacy bumpers +for _,rot in ipairs({"", "_30", "_45", "_60"}) do + minetest.register_alias("advtrains:dtrack_bumper"..rot, "advtrains:dtrack_bumper_st"..rot) +end +-- atc track +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_atc", + texture_prefix="advtrains_dtrack_atc", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_atc.png", + description=attrans("ATC controller"), + formats={}, + get_additional_definiton = advtrains.atc_function +}, advtrains.trackpresets.t_30deg_straightonly) + + +-- Tracks for loading and unloading trains +-- Copyright (C) 2017 Gabriel Pérez-Cerezo + +local function get_far_node(pos) + local node = minetest.get_node(pos) + if node.name == "ignore" then + minetest.get_voxel_manip():read_from_map(pos, pos) + node = minetest.get_node(pos) + end + return node +end + + +local function show_fc_formspec(pos,player) + local pname = player:get_player_name() + if minetest.is_protected(pos,pname) then + minetest.chat_send_player(pname, "Position is protected!") + return + end + + local meta = minetest.get_meta(pos) + local fc = meta:get_string("fc") or "" + + local form = 'formspec_version[4]'.. + 'size[10,5]'.. + 'label[0.5,0.4;Advtrains Loading/Unloading Track]'.. + 'label[0.5,1.1;Set the code to match against the wagon\'s freight code]'.. + 'label[0.5,1.6;A blank field matches all wagons (default)]'.. + 'label[0.5,2.1;Use code # to disable the track section]'.. + 'field[0.5,3;5.5,1;fc;FC;'..minetest.formspec_escape(fc)..']'.. + 'button[6.5,3;3,1;save;Submit]' + minetest.show_formspec(pname, "at_load_unload_"..advtrains.encode_pos(pos), form) +end + +minetest.register_on_player_receive_fields(function(player, formname, fields) + local pname = player:get_player_name() + local pe = string.match(formname, "^at_load_unload_(............)$") + local pos = advtrains.decode_pos(pe) + if pos then + if minetest.is_protected(pos, pname) then + minetest.chat_send_player(pname, "Position is protected!") + return + end + + if fields.save then + minetest.get_meta(pos):set_string("fc",tostring(fields.fc)) + minetest.chat_send_player(pname,"Freight code set: "..tostring(fields.fc)) + show_fc_formspec(pos,player) + end + end +end) + + +local function train_load(pos, train_id, unload) + local train=advtrains.trains[train_id] + local below = get_far_node({x=pos.x, y=pos.y-1, z=pos.z}) + if not string.match(below.name, "chest") then + atprint("this is not a chest! at "..minetest.pos_to_string(pos)) + return + end + + local node_fc = minetest.get_meta(pos):get_string("fc") or "" + if node_fc == "#" then + --track section is disabled + return + end + + local inv = minetest.get_inventory({type="node", pos={x=pos.x, y=pos.y-1, z=pos.z}}) + if inv and train.velocity < 2 then + for k, v in ipairs(train.trainparts) do + local i=minetest.get_inventory({type="detached", name="advtrains_wgn_"..v}) + if i and i:get_list("box") then + + local wagon_data = advtrains.wagons[v] + local wagon_fc + if wagon_data.fc then + if not wagon_data.fcind then wagon_data.fcind = 1 end + wagon_fc = tostring(wagon_data.fc[wagon_data.fcind]) or "" + end + + if node_fc == "" or wagon_fc == node_fc then + if not unload then + for _, item in ipairs(inv:get_list("main")) do + if i:get_list("box") and i:room_for_item("box", item) then + i:add_item("box", item) + inv:remove_item("main", item) + end + end + else + for _, item in ipairs(i:get_list("box")) do + if inv:get_list("main") and inv:room_for_item("main", item) then + i:remove_item("box", item) + inv:add_item("main", item) + end + end + end + end + end + end + end +end + + + +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_unload", + texture_prefix="advtrains_dtrack_unload", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_unload.png", + description=attrans("Unloading Track"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.ndb.clear(pos) + end, + on_rightclick = function(pos, node, player) + show_fc_formspec(pos, player) + end, + advtrains = { + on_train_enter = function(pos, train_id) + train_load(pos, train_id, true) + end, + }, + } + end + }, advtrains.trackpresets.t_30deg_straightonly) +advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_load", + texture_prefix="advtrains_dtrack_load", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_load.png", + description=attrans("Loading Track"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + after_dig_node=function(pos) + advtrains.invalidate_all_paths() + advtrains.ndb.clear(pos) + end, + on_rightclick = function(pos, node, player) + show_fc_formspec(pos, player) + end, + advtrains = { + on_train_enter = function(pos, train_id) + train_load(pos, train_id, false) + end, + }, + } + end + }, advtrains.trackpresets.t_30deg_straightonly) + +-- mod-dependent crafts +local loader_core = "default:mese_crystal" --fallback +if minetest.get_modpath("basic_materials") then + loader_core = "basic_materials:ic" +elseif minetest.get_modpath("technic") then + loader_core = "technic:control_logic_unit" +end +--print("Loader Core: "..loader_core) + +minetest.register_craft({ + type="shapeless", + output = 'advtrains:dtrack_load_placer', + recipe = { + "advtrains:dtrack_placer", + loader_core, + "default:chest" + }, +}) +loader_core = nil --nil the crafting variable + +--craft between load/unload tracks +minetest.register_craft({ + type="shapeless", + output = 'advtrains:dtrack_unload_placer', + recipe = { + "advtrains:dtrack_load_placer", + }, +}) +minetest.register_craft({ + type="shapeless", + output = 'advtrains:dtrack_load_placer', + recipe = { + "advtrains:dtrack_unload_placer", + }, +}) + + +if mesecon then + advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_detector_off", + texture_prefix="advtrains_dtrack_detector", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_detector_off.png", + description=attrans("Detector Rail"), + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + mesecons = { + receptor = { + state = mesecon.state.off, + rules = advtrains.meseconrules + } + }, + advtrains = { + on_updated_from_nodedb = function(pos, node) + mesecon.receptor_off(pos, advtrains.meseconrules) + end, + on_train_enter=function(pos, train_id) + advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_on".."_"..suffix..rotation, param2=advtrains.ndb.get_node(pos).param2}) + if advtrains.is_node_loaded(pos) then + mesecon.receptor_on(pos, advtrains.meseconrules) + end + end + } + } + end + }, advtrains.ap.t_30deg_straightonly) + advtrains.register_tracks("default", { + nodename_prefix="advtrains:dtrack_detector_on", + texture_prefix="advtrains_dtrack", + models_prefix="advtrains_dtrack", + models_suffix=".b3d", + shared_texture="advtrains_dtrack_shared_detector_on.png", + description="Detector(on)(you hacker you)", + formats={}, + get_additional_definiton = function(def, preset, suffix, rotation) + return { + mesecons = { + receptor = { + state = mesecon.state.on, + rules = advtrains.meseconrules + } + }, + advtrains = { + on_updated_from_nodedb = function(pos, node) + mesecon.receptor_on(pos, advtrains.meseconrules) + end, + on_train_leave=function(pos, train_id) + advtrains.ndb.swap_node(pos, {name="advtrains:dtrack_detector_off".."_"..suffix..rotation, param2=advtrains.ndb.get_node(pos).param2}) + if advtrains.is_node_loaded(pos) then + mesecon.receptor_off(pos, advtrains.meseconrules) + end + end + } + } + end + }, advtrains.ap.t_30deg_straightonly_noplacer) +minetest.register_craft({ + type="shapeless", + output = 'advtrains:dtrack_detector_off_placer', + recipe = { + "advtrains:dtrack_placer", + "mesecons:wire_00000000_off" + }, +}) +end +--TODO legacy +--I know lbms are better for this purpose +for name,rep in pairs({swl_st="swlst", swr_st="swrst", swl_cr="swlcr", swr_cr="swrcr", }) do + minetest.register_abm({ + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_"..name}, + interval = 1.0, -- Operation interval in seconds + chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep, param2=node.param2}) end, + }) + minetest.register_abm({ + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_"..name.."_45"}, + interval = 1.0, -- Operation interval in seconds + chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:track_"..rep.."_45", param2=node.param2}) end, + }) +end + +if advtrains.register_replacement_lbms then +minetest.register_lbm({ + name = "advtrains:ramp_replacement_1", +-- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_vert1"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst1", param2=(node.param2+2)%4}) end, +}) +minetest.register_lbm({ + name = "advtrains:ramp_replacement_1", +-- -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_vert2"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_vst2", param2=(node.param2+2)%4}) end, +}) + minetest.register_abm({ + name = "advtrains:st_rep_1", + -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_st"}, + interval=1, + chance=1, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st", param2=node.param2}) end, + }) + minetest.register_lbm({ + name = "advtrains:st_rep_1", + -- -- In the following two fields, also group:groupname will work. + nodenames = {"advtrains:track_st_45"}, + action = function(pos, node, active_object_count, active_object_count_wider) minetest.set_node(pos, {name="advtrains:dtrack_st_45", param2=node.param2}) end, + }) +end -- cgit v1.2.3 From 3526fc2e4afbc0b33269d061ff676dd8613f11a8 Mon Sep 17 00:00:00 2001 From: erstazi Date: Thu, 8 Aug 2024 17:40:43 -0400 Subject: Adding Train ID to Onboard Computer formspec so we know what the Train ID is without LuaATC --- advtrains/locale/advtrains.de.tr | 1 + advtrains/wagons.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/locale/advtrains.de.tr b/advtrains/locale/advtrains.de.tr index 6abbc12..cdebdde 100644 --- a/advtrains/locale/advtrains.de.tr +++ b/advtrains/locale/advtrains.de.tr @@ -74,4 +74,5 @@ Buffer and Chain Coupler=Schraubenkupplung Scharfenberg Coupler=Scharfenbergkupplung Japanese Train Inter-Wagon Connection=Waggonzwischenverbindung Japanischer Personenzug Can not couple: The couplers of the trains do not match (@1 and @2).=Kann nicht ankuppeln: Die Kupplungen der Züge passen nicht zueinander (@1 und @2) +Train ID=Zugnummer = diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 62e65af..730c623 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -970,7 +970,7 @@ function wagon:show_bordcom(pname) local data = advtrains.wagons[self.id] local linhei - local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1]" + local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1 | "..attrans("Train ID")..": "..(minetest.formspec_escape(self.id or "")).."]" form=form.."textarea[0.5,1.5;7,1;text_outside;"..attrans("Text displayed outside on train")..";"..(minetest.formspec_escape(train.text_outside or "")).."]" form=form.."textarea[0.5,3;7,1;text_inside;"..attrans("Text displayed inside train")..";"..(minetest.formspec_escape(train.text_inside or "")).."]" form=form.."field[7.5,1.75;3,1;line;"..attrans("Line")..";"..(minetest.formspec_escape(train.line or "")).."]" @@ -1487,4 +1487,4 @@ function advtrains.get_wagon_at_index(train_id, w_index) end -- nothing found, dist must be further back return nil -end \ No newline at end of file +end -- cgit v1.2.3 From 45e5ad3b378b17be7e0ce314ba964e01792d673d Mon Sep 17 00:00:00 2001 From: gpcf Date: Thu, 8 Aug 2024 23:53:29 +0200 Subject: Fix boardcom train id display, add command to teleport to train by id --- advtrains/init.lua | 15 +++++++++++++++ advtrains/wagons.lua | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index 33e5b1d..f7d3b13 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -738,6 +738,21 @@ minetest.register_chatcommand("at_whereis", end end, }) +minetest.register_chatcommand("at_tp", + { + params = "", + description = "Teleports you to the position of the train with the given id", + privs = {train_operator = true, teleport = true}, + func = function(name,param) + local train = advtrains.trains[param] + if not train or not train.last_pos then + return false, "Train "..param.." does not exist or is invalid" + else + minetest.get_player_by_name(name):set_pos(train.last_pos) + return true, "Teleporting to train "..param + end + end, +}) minetest.register_chatcommand("at_disable_step", { params = "", diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 730c623..677014a 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -970,7 +970,7 @@ function wagon:show_bordcom(pname) local data = advtrains.wagons[self.id] local linhei - local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1 | "..attrans("Train ID")..": "..(minetest.formspec_escape(self.id or "")).."]" + local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1 | "..attrans("Train ID")..": "..(minetest.formspec_escape(train.id or "")).."]" form=form.."textarea[0.5,1.5;7,1;text_outside;"..attrans("Text displayed outside on train")..";"..(minetest.formspec_escape(train.text_outside or "")).."]" form=form.."textarea[0.5,3;7,1;text_inside;"..attrans("Text displayed inside train")..";"..(minetest.formspec_escape(train.text_inside or "")).."]" form=form.."field[7.5,1.75;3,1;line;"..attrans("Line")..";"..(minetest.formspec_escape(train.line or "")).."]" -- cgit v1.2.3 From 9d7cec6151c0a9eca2454e9d6c85bc5596c5e946 Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Fri, 9 Aug 2024 19:47:27 +0800 Subject: Add Wagon Properties Tool Also added the Wagon ID to the Wagon Properties formspec --- advtrains/init.lua | 1 + advtrains/textures/advtrains_wagon_prop_tool.png | Bin 0 -> 779 bytes advtrains/wagonprop_tool.lua | 43 +++++++++++++++++++++++ advtrains/wagons.lua | 1 + 4 files changed, 45 insertions(+) create mode 100644 advtrains/textures/advtrains_wagon_prop_tool.png create mode 100644 advtrains/wagonprop_tool.lua (limited to 'advtrains/wagons.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index f7d3b13..06e456f 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -209,6 +209,7 @@ dofile(advtrains.modpath.."/trainlogic.lua") dofile(advtrains.modpath.."/trainhud.lua") dofile(advtrains.modpath.."/trackplacer.lua") dofile(advtrains.modpath.."/copytool.lua") +dofile(advtrains.modpath.."/wagonprop_tool.lua") dofile(advtrains.modpath.."/tracks.lua") dofile(advtrains.modpath.."/occupation.lua") dofile(advtrains.modpath.."/atc.lua") diff --git a/advtrains/textures/advtrains_wagon_prop_tool.png b/advtrains/textures/advtrains_wagon_prop_tool.png new file mode 100644 index 0000000..6352c55 Binary files /dev/null and b/advtrains/textures/advtrains_wagon_prop_tool.png differ diff --git a/advtrains/wagonprop_tool.lua b/advtrains/wagonprop_tool.lua new file mode 100644 index 0000000..2a4a9e2 --- /dev/null +++ b/advtrains/wagonprop_tool.lua @@ -0,0 +1,43 @@ +minetest.register_craftitem("advtrains:wagon_prop_tool",{ --craftitem because it does nothing on its own + description = attrans("Wagon Properties Tool\nPunch a wagon to view and edit the Wagon Properties"), + short_description = attrans("Wagon Properties Tool"), + groups = {}, + inventory_image = "advtrains_wagon_prop_tool.png", + wield_image = "advtrains_wagon_prop_tool.png", + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + local pname = user:get_player_name() + if not pname or pname == "" then + return + end + + --sanity checks in case of clicking the wrong entity/node/nothing + if pointed_thing.type ~= "object" then return end --not an entity + local object = pointed_thing.ref:get_luaentity() + if not object.id then return end --entity doesn't have an id field + + local wagon = advtrains.wagons[object.id] --check if wagon exists in advtrains + if not wagon then --not a wagon + return + end --end sanity checks + + --whitelist protection check + if not advtrains.check_driving_couple_protection(pname,wagon.owner,wagon.whitelist) then + minetest.chat_send_player(pname, attrans("Insufficient privileges to use this!")) + return + end + object:show_wagon_properties(pname) + return itemstack + end, +}) + +if minetest.get_modpath("default") then --register recipe + minetest.register_craft({ + output = "advtrains:wagon_prop_tool", + recipe = { + {"advtrains:dtrack_placer","dye:black","default:paper"}, + {"screwdriver:screwdriver","default:paper","default:paper"}, + {"","","group:wood"}, + } + }) +end \ No newline at end of file diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 677014a..73200a3 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -868,6 +868,7 @@ function wagon:show_wagon_properties(pname) ]] local data = advtrains.wagons[self.id] local form="size[5,5]" + form=form.."label[0.2,0;"..attrans("This Wagon ID")..": "..self.id.."]" form = form .. "field[0.5,1;4.5,1;whitelist;Allow these players to access your wagon:;"..minetest.formspec_escape(data.whitelist or "").."]" form = form .. "field[0.5,2;4.5,1;roadnumber;Wagon road number:;"..minetest.formspec_escape(data.roadnumber or "").."]" local fc = "" -- cgit v1.2.3 From 0c7e0f322b3f52f3a5f5071cd4c93c8aa7be893a Mon Sep 17 00:00:00 2001 From: erstazi Date: Thu, 15 Aug 2024 08:08:19 -0400 Subject: Move the Train ID information to a textarea[] without a name attribute so it remains transparent and the player can copy the Train ID. --- advtrains/wagons.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 73200a3..14bb58a 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -971,7 +971,8 @@ function wagon:show_bordcom(pname) local data = advtrains.wagons[self.id] local linhei - local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1 | "..attrans("Train ID")..": "..(minetest.formspec_escape(train.id or "")).."]" + local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1]" + form=form.."textarea[7.5,0.05;10,1;;"..attrans("Train ID")..": "..(minetest.formspec_escape(train.id or ""))..";]" form=form.."textarea[0.5,1.5;7,1;text_outside;"..attrans("Text displayed outside on train")..";"..(minetest.formspec_escape(train.text_outside or "")).."]" form=form.."textarea[0.5,3;7,1;text_inside;"..attrans("Text displayed inside train")..";"..(minetest.formspec_escape(train.text_inside or "")).."]" form=form.."field[7.5,1.75;3,1;line;"..attrans("Line")..";"..(minetest.formspec_escape(train.line or "")).."]" -- cgit v1.2.3 From 882108e8bf714200348bed2bd79b7f01ab6ffe7f Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Sat, 31 Aug 2024 22:58:38 +0800 Subject: Alias for wagon types --- advtrains/wagons.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 14bb58a..536c8d4 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -13,7 +13,20 @@ local GETOFF_TP_DELAY = 0.5 local IGNORE_WORLD = advtrains.IGNORE_WORLD advtrains.wagons = {} -advtrains.wagon_prototypes = {} +advtrains.wagon_alias = {} +advtrains.wagon_prototypes = setmetatable({}, { + __index = function(t, k) + local rtn_val = rawget(t, k) + if rtn_val ~= nil then + return rtn_val + end + local alias = advtrains.wagon_alias[k] + if alias then + return rawget(t, alias) + end + return nil + end +}) advtrains.wagon_objects = {} local unload_wgn_range = advtrains.wagon_load_range + 32 @@ -1326,6 +1339,10 @@ function advtrains.get_wagon_prototype(data) return wt, advtrains.wagon_prototypes[wt] end +function advtrains.register_wagon_alias(src, dst) + advtrains.wagon_alias[src] = dst +end + function advtrains.standard_inventory_formspec(self, pname, invname) --[[minetest.chat_send_player(pname, string.format("self=%s, pname=%s, invname=%s", self, pname, invname)) for k,v in pairs(self) do -- cgit v1.2.3 From eb0c5b78627505bcba409dc5f52dbb05891954c5 Mon Sep 17 00:00:00 2001 From: "Y. Wang" Date: Wed, 4 Oct 2023 22:14:18 +0200 Subject: Various translation improvements --- advtrains/atc.lua | 8 +- advtrains/copytool.lua | 10 +- advtrains/couple.lua | 4 +- advtrains/craft_items.lua | 2 +- advtrains/po/advtrains.pot | 632 +++++++++++++++++++++++ advtrains/po/de.po | 674 +++++++++++++++---------- advtrains/po/fr.po | 636 ++++++++++++++--------- advtrains/po/template.pot | 505 ------------------ advtrains/po/update-translations.sh | 14 +- advtrains/po/zh_CN.po | 604 +++++++++++++--------- advtrains/po/zh_TW.po | 604 +++++++++++++--------- advtrains/protection.lua | 8 +- advtrains/signals.lua | 6 +- advtrains/trackplacer.lua | 12 +- advtrains/tracks.lua | 14 +- advtrains/wagons.lua | 14 +- advtrains_interlocking/tsr_rail.lua | 12 +- advtrains_line_automation/stoprail.lua | 10 +- advtrains_luaautomation/active_common.lua | 20 +- advtrains_luaautomation/atc_rail.lua | 2 +- advtrains_luaautomation/init.lua | 6 +- advtrains_luaautomation/mesecon_controller.lua | 3 +- advtrains_luaautomation/operation_panel.lua | 3 +- advtrains_luaautomation/pcnaming.lua | 8 +- 24 files changed, 2255 insertions(+), 1556 deletions(-) create mode 100644 advtrains/po/advtrains.pot delete mode 100644 advtrains/po/template.pot (limited to 'advtrains/wagons.lua') 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 diff --git a/advtrains/copytool.lua b/advtrains/copytool.lua index 7ad4330..ca5cae1 100644 --- a/advtrains/copytool.lua +++ b/advtrains/copytool.lua @@ -38,7 +38,7 @@ minetest.register_tool("advtrains:copytool", { local prevpos = advtrains.get_adjacent_rail(pointed_thing.under, tconns, plconnid, {default=true}) if not prevpos then - minetest.chat_send_player(pname, attrans("The track you are trying to place the wagon on is not long enough!")) + minetest.chat_send_player(pname, attrans("The track you are trying to place the wagon on is not long enough.")) return end @@ -89,19 +89,19 @@ minetest.register_tool("advtrains:copytool", { local le = pointed_thing.ref:get_luaentity() if (le == nil) then - minetest.chat_send_player(user:get_player_name(), attrans("No such lua entity!")) + minetest.chat_send_player(user:get_player_name(), attrans("No such lua entity.")) return end local wagon = advtrains.wagons[le.id] if (not (le.id and advtrains.wagons[le.id])) then - minetest.chat_send_player(user:get_player_name(), attrans("No such wagon: @1", le.id)) + minetest.chat_send_player(user:get_player_name(), attrans("No such wagon: @1.", le.id)) return end local train = advtrains.trains[wagon.train_id] if (not train) then - minetest.chat_send_player(user:get_player_name(), attrans("No such train: @1", wagon.train_id)) + minetest.chat_send_player(user:get_player_name(), attrans("No such train: @1.", wagon.train_id)) return end @@ -177,7 +177,7 @@ minetest.register_tool("advtrains:copytool", { return end meta:set_string("clipboard", minetest.serialize(clipboard)) - minetest.chat_send_player(user:get_player_name(), attrans("Train copied!")) + minetest.chat_send_player(user:get_player_name(), attrans("Train copied.")) return itemstack end }) diff --git a/advtrains/couple.lua b/advtrains/couple.lua index d82e193..9474dcf 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -335,11 +335,11 @@ function advtrains.check_matching_coupler_types(t1, t1_front, t2, t2_front) for typ,_ in pairs(t1_cplt) do table.insert(t1_cplhr, advtrains.coupler_types[typ] or typ) end - if #t1_cplhr==0 then t1_cplhr[1]=attrans("") end + if #t1_cplhr==0 then t1_cplhr[1]=attrans("") end for typ,_ in pairs(t2_cplt) do table.insert(t2_cplhr, advtrains.coupler_types[typ] or typ) end - if #t2_cplhr==0 then t2_cplhr[1]=attrans("") end + if #t2_cplhr==0 then t2_cplhr[1]=attrans("") end return false, attrans("Can not couple: The couplers of the trains do not match (@1 and @2).", table.concat(t1_cplhr, ","), table.concat(t2_cplhr, ",")) end diff --git a/advtrains/craft_items.lua b/advtrains/craft_items.lua index 0e693eb..1188b64 100644 --- a/advtrains/craft_items.lua +++ b/advtrains/craft_items.lua @@ -6,7 +6,7 @@ core.register_craftitem("advtrains:boiler", { core.register_craftitem("advtrains:driver_cab", { - description = attrans("driver's cab"), + description = attrans("Driver's cab"), inventory_image = "advtrains_driver_cab.png", }) diff --git a/advtrains/po/advtrains.pot b/advtrains/po/advtrains.pot new file mode 100644 index 0000000..6fda1d7 --- /dev/null +++ b/advtrains/po/advtrains.pot @@ -0,0 +1,632 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the advtrains package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: advtrains\n" +"Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" +"POT-Creation-Date: 2023-10-09 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: advtrains/atc.lua:109 +msgid "Unconfigured ATC controller" +msgstr "" + +#: advtrains/atc.lua:150 +msgid "" +"ATC controller, mode @1\n" +"Command: @2" +msgstr "" + +#: advtrains/atc.lua:180 +msgid "Command" +msgstr "" + +#: advtrains/atc.lua:184 +msgid "Command (on)" +msgstr "" + +#: advtrains/atc.lua:187 +msgid "Digiline channel" +msgstr "" + +#: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 +#: advtrains_luaautomation/active_common.lua:48 +msgid "Save" +msgstr "" + +#: advtrains/atc.lua:236 +msgid "ATC Reverse command warning: didn't reverse train, train moving." +msgstr "" + +#: advtrains/atc.lua:248 +msgid "ATC Kick command warning: doors are closed." +msgstr "" + +#: advtrains/atc.lua:252 +msgid "ATC Kick command warning: train moving." +msgstr "" + +#: advtrains/atc.lua:322 +msgid "ATC command syntax error: I statement not closed: @1" +msgstr "" + +#: advtrains/atc.lua:385 +msgid "ATC command parse error: Unknown command: @1" +msgstr "" + +#: advtrains/copytool.lua:8 +msgid "" +"Train copy/paste tool\n" +"\n" +"Left-click: copy train\n" +"Right-click: paste train" +msgstr "" + +#: advtrains/copytool.lua:29 +msgid "You do not have the @1 privilege." +msgstr "" + +#: advtrains/copytool.lua:41 +msgid "The track you are trying to place the wagon on is not long enough." +msgstr "" + +#: advtrains/copytool.lua:47 +msgid "The clipboard couldn't access the metadata. Paste failed." +msgstr "" + +#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 +msgid "The clipboard is empty." +msgstr "" + +#: advtrains/copytool.lua:74 +msgid "Back of train would end up off track, cancelling." +msgstr "" + +#: advtrains/copytool.lua:92 +msgid "No such lua entity." +msgstr "" + +#: advtrains/copytool.lua:98 +msgid "No such wagon: @1." +msgstr "" + +#: advtrains/copytool.lua:104 +msgid "No such train: @1." +msgstr "" + +#: advtrains/copytool.lua:176 +msgid "The clipboard couldn't access the metadata. Copy failed." +msgstr "" + +#: advtrains/copytool.lua:180 +msgid "Train copied." +msgstr "" + +#: advtrains/couple.lua:28 +msgid "Buffer and Chain Coupler" +msgstr "" + +#: advtrains/couple.lua:29 +msgid "Scharfenberg Coupler" +msgstr "" + +#: advtrains/couple.lua:185 +msgid "" +"You are not allowed to couple trains without the train_operator privilege." +msgstr "" + +#: advtrains/couple.lua:329 advtrains/couple.lua:333 +msgid "" +msgstr "" + +#: advtrains/couple.lua:334 +msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +msgstr "" + +#: advtrains/craft_items.lua:3 +msgid "Boiler" +msgstr "" + +#: advtrains/craft_items.lua:9 +msgid "Driver's cab" +msgstr "" + +#: advtrains/craft_items.lua:15 +msgid "Wheel" +msgstr "" + +#: advtrains/craft_items.lua:21 +msgid "Chimney" +msgstr "" + +#: advtrains/misc_nodes.lua:16 +msgid "@1 Platform (low)" +msgstr "" + +#: advtrains/misc_nodes.lua:33 +msgid "@1 Platform (high)" +msgstr "" + +#: advtrains/misc_nodes.lua:59 +msgid "@1 Platform (45 degree)" +msgstr "" + +#: advtrains/misc_nodes.lua:81 +msgid "@1 Platform (low, 45 degree)" +msgstr "" + +#: advtrains/protection.lua:7 +msgid "Can place, remove and operate trains" +msgstr "" + +#: advtrains/protection.lua:12 +msgid "" +"Can place, remove and operate any train, regardless of owner, whitelist, or " +"protection" +msgstr "" + +#: advtrains/protection.lua:18 +msgid "Can place and dig tracks in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:24 +msgid "Can operate turnouts and signals in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build near tracks without the track_builder privilege." +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build tracks without the track_builder privilege." +msgstr "" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build near tracks at this protected position." +msgstr "" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build tracks at this protected position." +msgstr "" + +#: advtrains/protection.lua:184 +msgid "" +"You are not allowed to operate turnouts and signals without the " +"railway_operator privilege." +msgstr "" + +#: advtrains/signals.lua:63 +msgid "Lampless Signal" +msgstr "" + +#: advtrains/signals.lua:127 +msgid "Signal" +msgstr "" + +#: advtrains/signals.lua:191 +msgid "Wallmounted Signal (left)" +msgstr "" + +#: advtrains/signals.lua:192 +msgid "Wallmounted Signal (right)" +msgstr "" + +#: advtrains/signals.lua:193 +msgid "Wallmounted Signal (top)" +msgstr "" + +#: advtrains/signals.lua:281 advtrains/signals.lua:322 +msgid "Andrew's Cross" +msgstr "" + +#: advtrains/trackplacer.lua:313 +msgid "" +"Track Worker Tool\n" +"\n" +"Left-click: change rail type (straight/curve/switch)\n" +"Right-click: rotate object" +msgstr "" + +#: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 +msgid "This node can't be rotated using the trackworker." +msgstr "" + +#: advtrains/trackplacer.lua:350 +msgid "This track can not be rotated." +msgstr "" + +#: advtrains/trackplacer.lua:404 +msgid "This node can't be changed using the trackworker." +msgstr "" + +#: advtrains/trackplacer.lua:414 +msgid "This track can not be changed." +msgstr "" + +#: advtrains/tracks.lua:449 +msgid "This track can not be removed." +msgstr "" + +#: advtrains/tracks.lua:616 +msgid "Position is occupied by a train." +msgstr "" + +#: advtrains/tracks.lua:622 +msgid "There's a Track Circuit Break here." +msgstr "" + +#: advtrains/tracks.lua:626 +msgid "There's a Signal Influence Point here." +msgstr "" + +#: advtrains/tracks.lua:637 +msgid "@1 Slope" +msgstr "" + +#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 +msgid "Can't place slope: not pointing at node." +msgstr "" + +#: advtrains/tracks.lua:658 +msgid "Can't place slope: space occupied." +msgstr "" + +#: advtrains/tracks.lua:711 +msgid "Can't place slope: Not enough slope items left (@1 required)." +msgstr "" + +#: advtrains/tracks.lua:714 +msgid "Can't place slope: There's no slope of length @1." +msgstr "" + +#: advtrains/tracks.lua:721 +msgid "Can't place slope: no supporting node at upper end." +msgstr "" + +#: advtrains/trainhud.lua:305 +msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +msgstr "" + +#: advtrains/wagons.lua:179 +msgid "This wagon is owned by @1, you can't destroy it." +msgstr "" + +#: advtrains/wagons.lua:203 +msgid "The wagon's inventory is not empty." +msgstr "" + +#: advtrains/wagons.lua:210 +msgid "Wagon needs to be decoupled from other wagons in order to destroy it." +msgstr "" + +#: advtrains/wagons.lua:216 +msgid "" +"Warning: If you destroy this wagon, you only get some steel back! If you are " +"sure, hold Sneak and left-click the wagon." +msgstr "" + +#: advtrains/wagons.lua:649 advtrains/wagons.lua:850 +msgid "Show Inventory" +msgstr "" + +#: advtrains/wagons.lua:652 +msgid "Onboard Computer" +msgstr "" + +#: advtrains/wagons.lua:655 advtrains/wagons.lua:1328 +msgid "Wagon properties" +msgstr "" + +#: advtrains/wagons.lua:658 +msgid "Get off" +msgstr "" + +#: advtrains/wagons.lua:661 +msgid "Get off (forced)" +msgstr "" + +#: advtrains/wagons.lua:663 +msgid "(Doors closed)" +msgstr "" + +#: advtrains/wagons.lua:692 +msgid "This wagon has no seats." +msgstr "" + +#: advtrains/wagons.lua:703 +msgid "This wagon is full." +msgstr "" + +#: advtrains/wagons.lua:706 +msgid "Doors are closed! (Try holding sneak key!)" +msgstr "" + +#: advtrains/wagons.lua:712 +msgid "You can't get on this wagon." +msgstr "" + +#: advtrains/wagons.lua:838 +msgid "Select seat:" +msgstr "" + +#: advtrains/wagons.lua:880 +msgid "Save wagon properties" +msgstr "" + +#: advtrains/wagons.lua:965 +msgid "Text displayed outside on train" +msgstr "" + +#: advtrains/wagons.lua:966 +msgid "Text displayed inside train" +msgstr "" + +#: advtrains/wagons.lua:967 +msgid "Line" +msgstr "" + +#: advtrains/wagons.lua:968 +msgid "Routingcode" +msgstr "" + +#: advtrains/wagons.lua:1241 +msgid "" +"Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " +"off." +msgstr "" + +#: advtrains/wagons.lua:1250 +msgid "You are not allowed to access the driver stand." +msgstr "" + +#: advtrains_interlocking/tsr_rail.lua:13 +msgid "Point speed restriction: @1" +msgstr "" + +#: advtrains_interlocking/tsr_rail.lua:14 +msgid "Set point speed restriction:" +msgstr "" + +#: advtrains_interlocking/tsr_rail.lua:30 +msgid "You are not allowed to configure this track without the @1 privilege." +msgstr "" + +#: advtrains_interlocking/tsr_rail.lua:34 +#: advtrains_line_automation/stoprail.lua:31 +#: advtrains_line_automation/stoprail.lua:76 +msgid "You are not allowed to configure this track." +msgstr "" + +#: advtrains_interlocking/tsr_rail.lua:64 +msgid "Point Speed Restriction Track" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:54 +msgid "Station Code" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:55 +msgid "Station Name" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:56 +msgid "Door Delay" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:57 +msgid "Dep. Speed" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:58 advtrains_train_track/init.lua:11 +#: advtrains_train_track/init.lua:156 +msgid "Track" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:59 +msgid "Stop Time" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:60 +msgid "Door Side" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:62 +msgid "Reverse train" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:63 +msgid "Kick out passengers" +msgstr "" + +#: advtrains_line_automation/stoprail.lua:97 +msgid "Station code \"@1\" already exists and is owned by @2." +msgstr "" + +#: advtrains_line_automation/stoprail.lua:111 +msgid "This station is owned by @1. You are not allowed to edit its name." +msgstr "" + +#: advtrains_line_automation/stoprail.lua:221 +msgid "Station/Stop Track" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:17 +msgid "Unconfigured LuaATC component" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:46 +msgid "LuaATC Environment" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:49 +msgid "Clear Local Environment" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:50 +msgid "Code" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:64 +msgid "" +"You are not allowed to configure this LuaATC component without the @1 " +"privilege." +msgstr "" + +#: advtrains_luaautomation/active_common.lua:94 +msgid "LuaATC component assigned to environment '@1'" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:96 +msgid "LuaATC component assigned to an invalid environment" +msgstr "" + +#: advtrains_luaautomation/active_common.lua:171 +msgid "LuaATC component with error: @1" +msgstr "" + +#: advtrains_luaautomation/init.lua:13 +msgid "" +"Can place and configure LuaATC components, including execute potentially " +"harmful Lua code" +msgstr "" + +#: advtrains_luaautomation/mesecon_controller.lua:211 +msgid "LuaATC Mesecon Controller" +msgstr "" + +#: advtrains_luaautomation/operation_panel.lua:11 +msgid "LuaATC Operation Panel" +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:28 +msgid "" +"Passive Component Naming Tool\n" +"\n" +"Right-click to name a passive component." +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:39 +msgid "" +"You are not allowed to name LuaATC passive components without the @1 " +"privilege." +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:62 +msgid "Set name of component (empty to clear)" +msgstr "" + +#: advtrains_train_industrial/init.lua:10 +#: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 +#: advtrains_train_steam/init.lua:91 +msgid "Driver Stand (right)" +msgstr "" + +#: advtrains_train_industrial/init.lua:17 +#: advtrains_train_industrial/init.lua:56 advtrains_train_steam/init.lua:14 +#: advtrains_train_steam/init.lua:85 +msgid "Driver Stand (left)" +msgstr "" + +#: advtrains_train_industrial/init.lua:40 +msgid "Industrial Train Engine" +msgstr "" + +#: advtrains_train_industrial/init.lua:79 +msgid "Big Industrial Train Engine" +msgstr "" + +#: advtrains_train_industrial/init.lua:98 +msgid "Industrial tank wagon" +msgstr "" + +#: advtrains_train_industrial/init.lua:116 +msgid "Industrial wood wagon" +msgstr "" + +#: advtrains_train_japan/init.lua:4 +msgid "Japanese Train Inter-Wagon Connection" +msgstr "" + +#: advtrains_train_japan/init.lua:37 +msgid "Driver stand" +msgstr "" + +#: advtrains_train_japan/init.lua:101 +msgid "Japanese Train Engine" +msgstr "" + +#: advtrains_train_japan/init.lua:176 +msgid "Japanese Train Wagon" +msgstr "" + +#: advtrains_train_steam/init.lua:75 +msgid "Steam Engine" +msgstr "" + +#: advtrains_train_steam/init.lua:159 +msgid "Detailed Steam Engine" +msgstr "" + +#: advtrains_train_steam/init.lua:206 +msgid "Passenger Wagon" +msgstr "" + +#: advtrains_train_steam/init.lua:226 +msgid "Box Wagon" +msgstr "" + +#: advtrains_train_subway/init.lua:144 +msgid "Subway Passenger Wagon" +msgstr "" + +#: advtrains_train_track/init.lua:31 +msgid "Y-turnout" +msgstr "" + +#: advtrains_train_track/init.lua:49 +msgid "3-way turnout" +msgstr "" + +#: advtrains_train_track/init.lua:69 +msgid "Perpendicular Diamond Crossing Track" +msgstr "" + +#: advtrains_train_track/init.lua:91 +msgid "90+Angle Diamond Crossing Track" +msgstr "" + +#: advtrains_train_track/init.lua:132 +msgid "Diagonal Diamond Crossing Track" +msgstr "" + +#: advtrains_train_track/init.lua:179 +msgid "Bumper" +msgstr "" + +#: advtrains_train_track/init.lua:201 +msgid "ATC controller" +msgstr "" + +#: advtrains_train_track/init.lua:317 +msgid "Unloading Track" +msgstr "" + +#: advtrains_train_track/init.lua:342 +msgid "Loading Track" +msgstr "" + +#: advtrains_train_track/init.lua:406 +msgid "Detector Rail" +msgstr "" diff --git a/advtrains/po/de.po b/advtrains/po/de.po index ebd6339..8821fe3 100644 --- a/advtrains/po/de.po +++ b/advtrains/po/de.po @@ -2,18 +2,19 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2023-10-04 15:40+0200\n" -"PO-Revision-Date: 2022-11-02 15:08+0100\n" +"POT-Creation-Date: 2023-10-09 11:02+0200\n" +"PO-Revision-Date: 2023-10-09 11:18+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: German\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.3.2\n" #: advtrains/atc.lua:109 -msgid "ATC controller, unconfigured." -msgstr "Nicht konfiguierte Zugbeeinflussungsgleis" +msgid "Unconfigured ATC controller" +msgstr "Nicht konfiguiertes Zugbeeinflussungsgleis" #: advtrains/atc.lua:150 msgid "" @@ -36,21 +37,27 @@ msgid "Digiline channel" msgstr "Digiline-Kanal" #: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 +#: advtrains_luaautomation/active_common.lua:48 msgid "Save" msgstr "Speichern" #: advtrains/atc.lua:236 -msgid "ATC Reverse command warning: didn't reverse train, train moving!" +msgid "ATC Reverse command warning: didn't reverse train, train moving." msgstr "" -"Zugbeeinflussung: der Befehl „R“ wurde nicht ausgeführt, Zug in Bewegung!" +"Zugbeeinflussung: Der Zug befindet sich in Bewegung und kann nicht umgekehrt " +"werden." #: advtrains/atc.lua:248 -msgid "ATC Kick command warning: Doors closed" +msgid "ATC Kick command warning: doors are closed." msgstr "" +"Zugbeeinflussung: Wegen geschlossener Türen werden Fahrgäste nicht zum " +"Ausstieg gezwungen." #: advtrains/atc.lua:252 -msgid "ATC Kick command warning: Train moving" +msgid "ATC Kick command warning: train moving." msgstr "" +"Zugbeeinflussung: Der Zug befindet sich in Bewegung, Fahrgäste werden nicht " +"zum Ausstieg gezwungen." #: advtrains/atc.lua:322 msgid "ATC command syntax error: I statement not closed: @1" @@ -60,13 +67,92 @@ msgstr "Zugbeeinflussung: Unvollständiger I-Befehl: @1" msgid "ATC command parse error: Unknown command: @1" msgstr "Zugbeeinflussung: Unbekannter Befehl: @1" +#: advtrains/copytool.lua:8 +msgid "" +"Train copy/paste tool\n" +"\n" +"Left-click: copy train\n" +"Right-click: paste train" +msgstr "" +"Werkzeug zur Erstellung von Zugkopien\n" +"\n" +"Linksklick: Zug ins Clipboard kopieren\n" +"Right-click: Kopierten Zug einfügen" + +#: advtrains/copytool.lua:29 +msgid "You do not have the @1 privilege." +msgstr "Ihnen fehlt das „@1“-Privileg." + +#: advtrains/copytool.lua:41 +msgid "The track you are trying to place the wagon on is not long enough." +msgstr "Das Gleis, auf dem der Waggon platziert werden woll, ist zu kurz." + +#: advtrains/copytool.lua:47 +msgid "The clipboard couldn't access the metadata. Paste failed." +msgstr "" +"Wegen des fehlgeschlagenen Zugriffs auf die Metadaten konnte eine Kopie des " +"Zuges nicht eingefügt werden." + +#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 +msgid "The clipboard is empty." +msgstr "Das Clipboard ist leer." + +#: advtrains/copytool.lua:74 +msgid "Back of train would end up off track, cancelling." +msgstr "Der hinterer Teil dez Zuges wäre nicht auf dem Gleis." + +#: advtrains/copytool.lua:92 +msgid "No such lua entity." +msgstr "" +"Sie zeigen nicht auf einem Objekt, das mit diesem Werkzeug kopiert werden " +"kann." + +#: advtrains/copytool.lua:98 +msgid "No such wagon: @1." +msgstr "Es gibt keinen mit „@1“ identifizierbaren Waggon." + +#: advtrains/copytool.lua:104 +msgid "No such train: @1." +msgstr "Es gibt keinen mit „@1“ identifizierbaren Zug." + +#: advtrains/copytool.lua:176 +msgid "The clipboard couldn't access the metadata. Copy failed." +msgstr "" +"Wegen des fehlgeschlagenen Zugriffs auf die Metadaten konnte der Zug nicht " +"kopiert werden." + +#: advtrains/copytool.lua:180 +msgid "Train copied." +msgstr "Der Zug wurde Kopiert." + +#: advtrains/couple.lua:28 +msgid "Buffer and Chain Coupler" +msgstr "Schraubenkupplung" + +#: advtrains/couple.lua:29 +msgid "Scharfenberg Coupler" +msgstr "Scharfenbergkupplung" + +#: advtrains/couple.lua:185 +msgid "" +"You are not allowed to couple trains without the train_operator privilege." +msgstr "Sie dürfen ohne das „train_operator“-Privileg keine Züge ankuppeln." + +#: advtrains/couple.lua:329 advtrains/couple.lua:333 +msgid "" +msgstr "" + +#: advtrains/couple.lua:334 +msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +msgstr "Die Kupplungen der Züge passen nicht zueinander (@1 und @2)." + #: advtrains/craft_items.lua:3 msgid "Boiler" msgstr "" #: advtrains/craft_items.lua:9 -msgid "driver's cab" -msgstr "" +msgid "Driver's cab" +msgstr "Führerstand" #: advtrains/craft_items.lua:15 msgid "Wheel" @@ -92,44 +178,164 @@ msgstr "Hoher @1-Bahnsteig (45°)" msgid "@1 Platform (low, 45 degree)" msgstr "Niedriger @1-Bahnsteig (45°)" +#: advtrains/protection.lua:7 +msgid "Can place, remove and operate trains" +msgstr "" + +#: advtrains/protection.lua:12 +msgid "" +"Can place, remove and operate any train, regardless of owner, whitelist, or " +"protection" +msgstr "" + +#: advtrains/protection.lua:18 +msgid "Can place and dig tracks in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:24 +msgid "Can operate turnouts and signals in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build near tracks without the track_builder privilege." +msgstr "" +"Sie dürfen ohne das „track_builder“-Privileg nicht in der Nähe von Gleisen " +"bauen." + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build tracks without the track_builder privilege." +msgstr "Sie dürfen ohne das „track_builder“-Privileg kein Gleis bauen." + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build near tracks at this protected position." +msgstr "Sie dürfen an geschützten Stellen nicht in der Nähe von Gleisen bauen." + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build tracks at this protected position." +msgstr "Sie dürfen an geschützten Stellen kein Gleis bauen." + +#: advtrains/protection.lua:184 +msgid "" +"You are not allowed to operate turnouts and signals without the " +"railway_operator privilege." +msgstr "" +"Sie dürfen ohne das „railway_operator“-Privileg keine Bahnanlage operieren." + +#: advtrains/signals.lua:63 +msgid "Lampless Signal" +msgstr "Mechanisches Signal" + +#: advtrains/signals.lua:127 +msgid "Signal" +msgstr "Lichtsignal" + +#: advtrains/signals.lua:191 +msgid "Wallmounted Signal (left)" +msgstr "An der linken Seite montiertes Signal" + +#: advtrains/signals.lua:192 +msgid "Wallmounted Signal (right)" +msgstr "An der rechten Seite montiertes Signal" + +#: advtrains/signals.lua:193 +msgid "Wallmounted Signal (top)" +msgstr "An der Decke montiertes Signal" + +#: advtrains/signals.lua:281 advtrains/signals.lua:322 +msgid "Andrew's Cross" +msgstr "Andreaskreuz" + #: advtrains/trackplacer.lua:313 msgid "" "Track Worker Tool\n" "\n" "Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate rail/bumper/signal/etc." +"Right-click: rotate object" msgstr "" "Gleiswerkzeug\n" "\n" -"Linksklick: Gleistyp ändern, Rechtsklick: Objekt drehen." +"Linksklick: Gleistyp ändern\n" +"Rechtsklick: Objekt drehen" #: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 -msgid "This node can't be rotated using the trackworker!" +msgid "This node can't be rotated using the trackworker." msgstr "Dieser Block kann nicht mit dem Gleiswerkzeug gedreht werden." #: advtrains/trackplacer.lua:350 -msgid "This track can not be rotated!" -msgstr "Dieses Gleis kann nicht gedreht werden!" +msgid "This track can not be rotated." +msgstr "Dieses Gleis kann nicht gedreht werden." #: advtrains/trackplacer.lua:404 -msgid "This node can't be changed using the trackworker!" +msgid "This node can't be changed using the trackworker." msgstr "Dieser Block kann nicht mit dem Gleiswerkzeug bearbeitet werden." #: advtrains/trackplacer.lua:414 -msgid "This track can not be changed!" -msgstr "Dieses Gleis kann nicht geändert werden!" +msgid "This track can not be changed." +msgstr "Dieses Gleis kann nicht geändert werden." + +#: advtrains/tracks.lua:449 +msgid "This track can not be removed." +msgstr "Dieses Gleis kann nicht entfernt werden." + +#: advtrains/tracks.lua:616 +msgid "Position is occupied by a train." +msgstr "Ein Zug steht an dieser Position." + +#: advtrains/tracks.lua:622 +msgid "There's a Track Circuit Break here." +msgstr "Hier ist eine Gleisabschnittsgrenze (TCB)." + +#: advtrains/tracks.lua:626 +msgid "There's a Signal Influence Point here." +msgstr "Hier ist ein Signal-Beeinflussungspunkt." + +#: advtrains/tracks.lua:637 +msgid "@1 Slope" +msgstr "@1 Steigung" + +#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 +msgid "Can't place slope: not pointing at node." +msgstr "Es kann nicht platziert werden: Sie zeigen nicht auf einem Block." + +#: advtrains/tracks.lua:658 +msgid "Can't place slope: space occupied." +msgstr "Es kann nicht platziert werden: Diese Position ist besetzt." + +#: advtrains/tracks.lua:711 +msgid "Can't place slope: Not enough slope items left (@1 required)." +msgstr "" +"Es kann nicht platziert werden: Sie haben nicht genug Steigungsblöcke, es " +"werden insgesamt @1 benötigt." + +#: advtrains/tracks.lua:714 +msgid "Can't place slope: There's no slope of length @1." +msgstr "" +"Es kann nicht platziert werden: die Steigung der Länge @1 ist nicht " +"definiert." + +#: advtrains/tracks.lua:721 +msgid "Can't place slope: no supporting node at upper end." +msgstr "" +"Es kann nicht platziert werden: es gibt keinen unterstützenden Block am Ende " +"der Steigung." + +#: advtrains/trainhud.lua:305 +msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +msgstr "" #: advtrains/wagons.lua:179 msgid "This wagon is owned by @1, you can't destroy it." msgstr "Dieser Waggon gehört @1, Sie dürfen ihn nicht abbauen." #: advtrains/wagons.lua:203 -msgid "The wagon's inventory is not empty!" -msgstr "Das Inventar dieses Waggons ist nicht leer!" +msgid "The wagon's inventory is not empty." +msgstr "Das Inventar dieses Waggons ist nicht leer." #: advtrains/wagons.lua:210 msgid "Wagon needs to be decoupled from other wagons in order to destroy it." -msgstr "" +msgstr "Der Waggon muss abgekoppelt sein, damit Sie ihn abbauen können." #: advtrains/wagons.lua:216 msgid "" @@ -163,9 +369,21 @@ msgstr "Ausstieg zwingen" msgid "(Doors closed)" msgstr "(Türen geschlossen)" +#: advtrains/wagons.lua:692 +msgid "This wagon has no seats." +msgstr "In diesem Waggon ist kein Sitzplatz vorhanden." + +#: advtrains/wagons.lua:703 +msgid "This wagon is full." +msgstr "Der Waggon ist voll." + +#: advtrains/wagons.lua:706 +msgid "Doors are closed! (Try holding sneak key!)" +msgstr "Die Türen sind geschlossen." + #: advtrains/wagons.lua:712 -msgid "Can't get on: " -msgstr "" +msgid "You can't get on this wagon." +msgstr "Sie können nicht in diesen Waggon einsteigen." #: advtrains/wagons.lua:838 msgid "Select seat:" @@ -193,195 +411,41 @@ msgstr "" #: advtrains/wagons.lua:1241 msgid "" -"Doors are closed! Use Sneak+rightclick to ignore the closed doors and get " -"off!" +"Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " +"off." msgstr "" "Die Türen sind geschlossen. Nutzen Sie Schleichen+Rechtsklick, um trotz " "geschlossener Türen auszusteigen." -#: advtrains/trainhud.lua:305 -msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." -msgstr "" - -#: advtrains/tracks.lua:449 -msgid "This track can not be removed!" -msgstr "Dieses Gleis kann nicht entfernt werden!" - -#: advtrains/tracks.lua:616 -msgid "Position is occupied by a train." -msgstr "Ein Zug steht an dieser Position." - -#: advtrains/tracks.lua:622 -msgid "There's a Track Circuit Break here." -msgstr "Hier ist eine Gleisabschnittsgrenze (TCB)." - -#: advtrains/tracks.lua:626 -msgid "There's a Signal Influence Point here." -msgstr "Hier ist ein Signal-Beeinflussungspunkt." - -#: advtrains/tracks.lua:637 -msgid "@1 Slope" -msgstr "@1 Steigung" - -#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 -msgid "Can't place: not pointing at node" -msgstr "Es kann nicht platziert werden: Sie zeigen nicht auf einem Block." - -#: advtrains/tracks.lua:658 -msgid "Can't place: space occupied!" -msgstr "Es kann nicht platziert werden: diese Position ist besetzt." - -#: advtrains/tracks.lua:711 -msgid "Can't place: Not enough slope items left (@1 required)" -msgstr "" -"Es kann nicht platziert werden: Sie haben nicht genug Steigungsblöcke, es " -"werden insgesamt @1 benötigt." - -#: advtrains/tracks.lua:714 -msgid "Can't place: There's no slope of length @1" -msgstr "" -"Es kann nicht platziert werden: die Steigung der Länge @1 ist nicht " -"definiert." - -#: advtrains/tracks.lua:721 -msgid "Can't place: no supporting node at upper end." -msgstr "" -"Es kann nicht platziert werden: es gibt keinen unterstützenden Block am Ende " -"der Steigung." - -#: advtrains/signals.lua:63 -msgid "Lampless Signal" -msgstr "Mechanisches Signal" - -#: advtrains/signals.lua:127 -msgid "Signal" -msgstr "Lichtsignal" - -#: advtrains/signals.lua:191 -msgid "Wallmounted Signal (l)" -msgstr "An der linken Seite montiertes Signal" - -#: advtrains/signals.lua:192 -msgid "Wallmounted Signal (r)" -msgstr "An der rechten Seite montiertes Signal" - -#: advtrains/signals.lua:193 -msgid "Wallmounted Signal (t)" -msgstr "An der Decke montiertes Signal" - -#: advtrains/signals.lua:281 advtrains/signals.lua:322 -msgid "Andrew's Cross" -msgstr "" - -#: advtrains/couple.lua:28 -msgid "Buffer and Chain Coupler" -msgstr "Schraubenkupplung" - -#: advtrains/couple.lua:29 -msgid "Scharfenberg Coupler" -msgstr "Scharfenbergkupplung" - -#: advtrains/couple.lua:185 -msgid "" -"You are not allowed to couple trains without the train_operator privilege." -msgstr "Sie dürfen ohne das „train_builder“-Privileg keine Züge ankuppeln." - -#: advtrains/couple.lua:329 advtrains/couple.lua:333 -msgid "" -msgstr "" - -#: advtrains/couple.lua:334 -msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." -msgstr "Die Kupplungen der Züge passen nicht zueinander (@1 und @2)." - -#: advtrains/copytool.lua:8 -msgid "" -"Train copy/paste tool\n" -"\n" -"Left-click: copy train\n" -"Right-click: paste train" -msgstr "" -"Werkzeug zur Erstellung von Zugkopien\n" -"\n" -"Linksklick: Zug ins Clipboard kopieren\n" -"Right-click: Kopierten Zug einfügen" - -#: advtrains/copytool.lua:29 -msgid "You do not have the @1 privilege." -msgstr "Ihnen fehlt das „@1“-Privileg." - -#: advtrains/copytool.lua:41 -msgid "The track you are trying to place the wagon on is not long enough!" -msgstr "Das Gleis, auf dem der Waggon platziert werden woll, ist zu kurz." - -#: advtrains/copytool.lua:47 -msgid "The clipboard couldn't access the metadata. Paste failed." -msgstr "" -"Wegen des fehlgeschlagenen Zugriffs auf die Metadaten konnte eine Kopie des " -"Zuges nicht eingefügt werden." - -#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 -msgid "The clipboard is empty." -msgstr "Das Clipboard ist leer." - -#: advtrains/copytool.lua:74 -msgid "Back of train would end up off track, cancelling." -msgstr "Der hinterer Teil dez Zuges wäre nicht auf dem Gleis." - -#: advtrains/copytool.lua:92 -msgid "No such lua entity!" -msgstr "" -"Sie zeigen nicht auf einem Objekt, das mit diesem Werkzeug kopiert werden " -"kann." - -#: advtrains/copytool.lua:98 -msgid "No such wagon: @1" -msgstr "Es gibt keinen mit „@1“ identifizierbaren Waggon." - -#: advtrains/copytool.lua:104 -msgid "No such train: @1" -msgstr "Es gibt keinen mit „@1“ identifizierbaren Zug." - -#: advtrains/copytool.lua:176 -msgid "The clipboard couldn't access the metadata. Copy failed." -msgstr "" -"Wegen des fehlgeschlagenen Zugriffs auf die Metadaten konnte der Zug nicht " -"kopiert werden." +#: advtrains/wagons.lua:1250 +msgid "You are not allowed to access the driver stand." +msgstr "Sie haben keinen Zugang zum Führerstand." -#: advtrains/copytool.lua:180 -msgid "Train copied!" -msgstr "Der Zug wurde Kopiert." +#: advtrains_interlocking/tsr_rail.lua:13 +msgid "Point speed restriction: @1" +msgstr "Geschwindigkeitskontrolle: @1" -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build near tracks without the track_builder privilege." +#: advtrains_interlocking/tsr_rail.lua:14 +msgid "Set point speed restriction:" msgstr "" -"Sie dürfen ohne das „track_builder“-Privileg nicht in der Nähe von Gleisen " -"bauen." -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build tracks without the track_builder privilege." -msgstr "Sie dürfen ohne das „track_builder“-Privileg kein Gleis bauen." +#: advtrains_interlocking/tsr_rail.lua:30 +msgid "You are not allowed to configure this track without the @1 privilege." +msgstr "Sie dürfen ohne das „@1“-Privileg dieses Gleis nicht konfigurieren." -#: advtrains/protection.lua:153 -msgid "You are not allowed to build near tracks at this protected position." -msgstr "Sie dürfen an geschützten Stellen nicht in der Nähe von Gleisen bauen." +#: advtrains_interlocking/tsr_rail.lua:34 +#: advtrains_line_automation/stoprail.lua:31 +#: advtrains_line_automation/stoprail.lua:76 +msgid "You are not allowed to configure this track." +msgstr "Sie dürfen dieses Gleis nicht konfigurieren." -#: advtrains/protection.lua:153 -msgid "You are not allowed to build tracks at this protected position." -msgstr "Sie dürfen an geschützten Stellen kein Gleis bauen." - -#: advtrains/protection.lua:184 -msgid "" -"You are not allowed to operate turnouts and signals without the " -"railway_operator privilege." -msgstr "" -"Sie dürfen ohne das „railway_operator“-Privileg keine Bahnanlage operieren." +#: advtrains_interlocking/tsr_rail.lua:64 +msgid "Point Speed Restriction Track" +msgstr "Geschwindigkeitskontrollgleis" #: advtrains_line_automation/stoprail.lua:54 msgid "Station Code" -msgstr "Code der Haltestelle" +msgstr "Kennzeichen der Haltestelle" #: advtrains_line_automation/stoprail.lua:55 msgid "Station Name" @@ -406,65 +470,101 @@ msgstr "Wartezeit" #: advtrains_line_automation/stoprail.lua:60 msgid "Door Side" -msgstr "" +msgstr "Türseite" #: advtrains_line_automation/stoprail.lua:62 msgid "Reverse train" -msgstr "" +msgstr "Zug Umkehren" #: advtrains_line_automation/stoprail.lua:63 msgid "Kick out passengers" +msgstr "Fahrgäste zum Ausstieg zwingen" + +#: advtrains_line_automation/stoprail.lua:97 +msgid "Station code \"@1\" already exists and is owned by @2." msgstr "" +"Die Haltestelle mit dem Kennzeichen „@1“ ist bereits vorhanden und wird von " +"@2 verwaltet." -#: advtrains_luaautomation/pcnaming.lua:26 -msgid "" -"Passive Component Naming Tool\n" -"\n" -"Right-click to name a passive component." +#: advtrains_line_automation/stoprail.lua:111 +msgid "This station is owned by @1. You are not allowed to edit its name." msgstr "" -"PC-Benennungswerkzeug\n" -"\n" -"Rechtsklick zur Benennung der passiven Komponente" +"Diese Haltestelle wird von @1 verwaltet. Sie dürfen sie nicht umbenennen." -#: advtrains_train_track/init.lua:31 -msgid "Y-turnout" -msgstr "Y-Weiche" +#: advtrains_line_automation/stoprail.lua:221 +msgid "Station/Stop Track" +msgstr "Gleis zur Kennzeichnung einer Haltestelle" -#: advtrains_train_track/init.lua:49 -msgid "3-way turnout" -msgstr "Dreiwegweiche" +#: advtrains_luaautomation/active_common.lua:17 +msgid "Unconfigured LuaATC component" +msgstr "Nicht konfiguierter LuaATC-Bauteil" -#: advtrains_train_track/init.lua:69 -msgid "Perpendicular Diamond Crossing Track" -msgstr "Kreuzung mit zueinander orthogonalen Gleisen" +#: advtrains_luaautomation/active_common.lua:46 +msgid "LuaATC Environment" +msgstr "" -#: advtrains_train_track/init.lua:91 -msgid "90+Angle Diamond Crossing Track" -msgstr "Kreuzung mit einem achsenparallelen Gleis" +#: advtrains_luaautomation/active_common.lua:49 +msgid "Clear Local Environment" +msgstr "" -#: advtrains_train_track/init.lua:132 -msgid "Diagonal Diamond Crossing Track" -msgstr "Diagonale Gleiskreuzung" +#: advtrains_luaautomation/active_common.lua:50 +msgid "Code" +msgstr "" -#: advtrains_train_track/init.lua:179 -msgid "Bumper" -msgstr "Prellbock" +#: advtrains_luaautomation/active_common.lua:64 +msgid "" +"You are not allowed to configure this LuaATC component without the @1 " +"privilege." +msgstr "" +"Sie dürfen ohne das „@1“-Privileg diesen LuaATC-Bauteil nicht konfigurieren." -#: advtrains_train_track/init.lua:201 -msgid "ATC controller" -msgstr "Zugbeeinflussungsgleis" +#: advtrains_luaautomation/active_common.lua:94 +msgid "LuaATC component assigned to environment '@1'" +msgstr "" -#: advtrains_train_track/init.lua:317 -msgid "Unloading Track" -msgstr "Abladungsgleis" +#: advtrains_luaautomation/active_common.lua:96 +msgid "LuaATC component assigned to an invalid environment" +msgstr "" -#: advtrains_train_track/init.lua:342 -msgid "Loading Track" -msgstr "Beladungsgleis" +#: advtrains_luaautomation/active_common.lua:171 +msgid "LuaATC component with error: @1" +msgstr "LuaATC-Bauteil mit Fehlermeldung: @1" -#: advtrains_train_track/init.lua:406 -msgid "Detector Rail" -msgstr "Detektorgleis" +#: advtrains_luaautomation/init.lua:13 +msgid "" +"Can place and configure LuaATC components, including execute potentially " +"harmful Lua code" +msgstr "" +"Kann LuaATC-Bauteile platzieren und konfigurieren (auch evtl. schädliche " +"Programme ausführen)" + +#: advtrains_luaautomation/mesecon_controller.lua:211 +msgid "LuaATC Mesecon Controller" +msgstr "" + +#: advtrains_luaautomation/operation_panel.lua:11 +msgid "LuaATC Operation Panel" +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:28 +msgid "" +"Passive Component Naming Tool\n" +"\n" +"Right-click to name a passive component." +msgstr "" +"PC-Benennungswerkzeug\n" +"\n" +"Rechtsklick zur Benennung der passiven Komponente." + +#: advtrains_luaautomation/pcnaming.lua:39 +msgid "" +"You are not allowed to name LuaATC passive components without the @1 " +"privilege." +msgstr "Sie dürfen ohne das „@1“ keinen passiven LuaATC-Bauteil benennen." + +#: advtrains_luaautomation/pcnaming.lua:62 +msgid "Set name of component (empty to clear)" +msgstr "" #: advtrains_train_industrial/init.lua:10 #: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 @@ -516,7 +616,7 @@ msgstr "Dampflokomotive" #: advtrains_train_steam/init.lua:159 msgid "Detailed Steam Engine" -msgstr "detaillierte Dampflokomotive" +msgstr "Detaillierte Dampflokomotive" #: advtrains_train_steam/init.lua:206 msgid "Passenger Wagon" @@ -530,27 +630,45 @@ msgstr "Güterwaggon" msgid "Subway Passenger Wagon" msgstr "U-Bahn-Waggon" -#~ msgid "This position is protected!" -#~ msgstr "Diese Position ist geschützt!" +#: advtrains_train_track/init.lua:31 +msgid "Y-turnout" +msgstr "Y-Weiche" -#~ msgid "Can't place: protected position!" -#~ msgstr "Es kann nicht platziert werden: diese Position ist geschützt." +#: advtrains_train_track/init.lua:49 +msgid "3-way turnout" +msgstr "Dreiwegweiche" -#~ msgid "Deprecated Track" -#~ msgstr "ausrangiertes Gleis, nicht verwenden." +#: advtrains_train_track/init.lua:69 +msgid "Perpendicular Diamond Crossing Track" +msgstr "Kreuzung mit zueinander orthogonalen Gleisen" -#~ msgid "Can't get on: wagon full or doors closed!" -#~ msgstr "" -#~ "Sie können nicht einsteigen: der Waggon ist voll oder die Türen sind " -#~ "geschlossen." +#: advtrains_train_track/init.lua:91 +msgid "90+Angle Diamond Crossing Track" +msgstr "Kreuzung mit einem achsenparallelen Gleis" -#~ msgid "Use Sneak+rightclick to bypass closed doors!" -#~ msgstr "" -#~ "Nutzen Sie Schleichen+Rechtsklick, um trotz geschlossener Türen " -#~ "einzusteigen." +#: advtrains_train_track/init.lua:132 +msgid "Diagonal Diamond Crossing Track" +msgstr "Diagonale Gleiskreuzung" -#~ msgid "Access to @1" -#~ msgstr "Zugang zu @1" +#: advtrains_train_track/init.lua:179 +msgid "Bumper" +msgstr "Prellbock" + +#: advtrains_train_track/init.lua:201 +msgid "ATC controller" +msgstr "Zugbeeinflussungsgleis" + +#: advtrains_train_track/init.lua:317 +msgid "Unloading Track" +msgstr "Abladungsgleis" + +#: advtrains_train_track/init.lua:342 +msgid "Loading Track" +msgstr "Beladungsgleis" + +#: advtrains_train_track/init.lua:406 +msgid "Detector Rail" +msgstr "Detektorgleis" #~ msgid "" #~ "ATC controller, mode @1\n" @@ -559,13 +677,28 @@ msgstr "U-Bahn-Waggon" #~ "Zugbeeinflussungsgleis in Betriebsart „@1“\n" #~ "Kanal: @2" -#~ msgid "Lock couples" -#~ msgstr "Kupplungen sperren" +#~ msgid "Access to @1" +#~ msgstr "Zugang zu @1" -#~ msgid "" -#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgid "Can't get on: wagon full or doors closed!" #~ msgstr "" -#~ "Sie müssen Besitzer eines angrenzenden Waggons sein, um hier abzukuppeln." +#~ "Sie können nicht einsteigen: der Waggon ist voll oder die Türen sind " +#~ "geschlossen." + +#~ msgid "Can't place: protected position!" +#~ msgstr "Es kann nicht platziert werden: diese Position ist geschützt." + +#~ msgid "Default Seat" +#~ msgstr "Standardsitzplatz" + +#~ msgid "Default Seat (driver stand)" +#~ msgstr "Standardsitzplatz (Führerstand)" + +#~ msgid "Deprecated Track" +#~ msgstr "ausrangiertes Gleis, nicht verwenden." + +#~ msgid "Lock couples" +#~ msgstr "Kupplungen sperren" #~ msgid "Speed:" #~ msgstr "Geschw.:" @@ -573,8 +706,19 @@ msgstr "U-Bahn-Waggon" #~ msgid "Target:" #~ msgstr "Zielges.:" -#~ msgid "Default Seat" -#~ msgstr "Standardsitzplatz" +#~ msgid "This position is protected!" +#~ msgstr "Diese Position ist geschützt!" -#~ msgid "Default Seat (driver stand)" -#~ msgstr "Standardsitzplatz (Führerstand)" +#~ msgid "Use Sneak+rightclick to bypass closed doors!" +#~ msgstr "" +#~ "Nutzen Sie Schleichen+Rechtsklick, um trotz geschlossener Türen " +#~ "einzusteigen." + +#, fuzzy +#~ msgid "You are not allowed to modify this protected track." +#~ msgstr "Sie dürfen an geschützten Stellen kein Gleis bauen." + +#~ msgid "" +#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgstr "" +#~ "Sie müssen Besitzer eines angrenzenden Waggons sein, um hier abzukuppeln." diff --git a/advtrains/po/fr.po b/advtrains/po/fr.po index 9a16799..3cb68b0 100644 --- a/advtrains/po/fr.po +++ b/advtrains/po/fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2023-10-04 15:40+0200\n" +"POT-Creation-Date: 2023-10-09 11:02+0200\n" "PO-Revision-Date: 2022-07-05 10:11+0200\n" "Last-Translator: Tanavit \n" "Language-Team: French\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: advtrains/atc.lua:109 -msgid "ATC controller, unconfigured." +msgid "Unconfigured ATC controller" msgstr "Controlleur ATC, non-configuré " #: advtrains/atc.lua:150 @@ -36,20 +36,22 @@ msgid "Digiline channel" msgstr "Canal Digiline" #: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 +#: advtrains_luaautomation/active_common.lua:48 msgid "Save" msgstr "Sauvegarder" #: advtrains/atc.lua:236 -msgid "ATC Reverse command warning: didn't reverse train, train moving!" +#, fuzzy +msgid "ATC Reverse command warning: didn't reverse train, train moving." msgstr "" "Attention : Commande ATC de renversement impossible car le train se déplace !" #: advtrains/atc.lua:248 -msgid "ATC Kick command warning: Doors closed" +msgid "ATC Kick command warning: doors are closed." msgstr "" #: advtrains/atc.lua:252 -msgid "ATC Kick command warning: Train moving" +msgid "ATC Kick command warning: train moving." msgstr "" #: advtrains/atc.lua:322 @@ -60,12 +62,89 @@ msgstr "Erreur de syntaxe de commande ATC : instruction \"I\" incomplète : @1" msgid "ATC command parse error: Unknown command: @1" msgstr "Erreur d'analyse de commande ATC : Commande inconnue : @1" +#: advtrains/copytool.lua:8 +msgid "" +"Train copy/paste tool\n" +"\n" +"Left-click: copy train\n" +"Right-click: paste train" +msgstr "" +"Outil de copie/collage de train\n" +"\n" +"Clic-Gauche : copie\n" +"\n" +"Clic-Droit : collage" + +#: advtrains/copytool.lua:29 +msgid "You do not have the @1 privilege." +msgstr "Vous ne possédez pas le privilège \"@1\"." + +#: advtrains/copytool.lua:41 +#, fuzzy +msgid "The track you are trying to place the wagon on is not long enough." +msgstr "La voie sur laquelle vous tentez de placer le wagon est trop courte !" + +#: advtrains/copytool.lua:47 +msgid "The clipboard couldn't access the metadata. Paste failed." +msgstr "Le presse-papier ne peut accéder aux métadonnées. Échec du collage." + +#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 +msgid "The clipboard is empty." +msgstr "Le presse-papier est vide." + +#: advtrains/copytool.lua:74 +msgid "Back of train would end up off track, cancelling." +msgstr "La fin du train serait hors voie : annulation." + +#: advtrains/copytool.lua:92 +msgid "No such lua entity." +msgstr "Pas de telle entité lua." + +#: advtrains/copytool.lua:98 +msgid "No such wagon: @1." +msgstr "Pas de tel wagon : @1." + +#: advtrains/copytool.lua:104 +msgid "No such train: @1." +msgstr "Pas de tel train : @1." + +#: advtrains/copytool.lua:176 +msgid "The clipboard couldn't access the metadata. Copy failed." +msgstr "Le presse-papier ne peut accéder aux métadonnées. Échec de la copie." + +#: advtrains/copytool.lua:180 +msgid "Train copied." +msgstr "Train copié." + +#: advtrains/couple.lua:28 +msgid "Buffer and Chain Coupler" +msgstr "Attelage à tampon et vis" + +#: advtrains/couple.lua:29 +msgid "Scharfenberg Coupler" +msgstr "Attelage Scharfenberg" + +#: advtrains/couple.lua:185 +msgid "" +"You are not allowed to couple trains without the train_operator privilege." +msgstr "" + +#: advtrains/couple.lua:329 advtrains/couple.lua:333 +msgid "" +msgstr "" + +#: advtrains/couple.lua:334 +msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +msgstr "" +"Accouplement impossible: les attelages des trains ne concordent pas (@1 et " +"@2)." + #: advtrains/craft_items.lua:3 msgid "Boiler" msgstr "Chaudière à vapeur" #: advtrains/craft_items.lua:9 -msgid "driver's cab" +msgid "Driver's cab" msgstr "Cabine de pilotage" #: advtrains/craft_items.lua:15 @@ -92,12 +171,86 @@ msgstr "Quai @1 (haut, 45°)" msgid "@1 Platform (low, 45 degree)" msgstr "Quai @1 (bas, 45°)" +#: advtrains/protection.lua:7 +msgid "Can place, remove and operate trains" +msgstr "" + +#: advtrains/protection.lua:12 +msgid "" +"Can place, remove and operate any train, regardless of owner, whitelist, or " +"protection" +msgstr "" + +#: advtrains/protection.lua:18 +msgid "Can place and dig tracks in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:24 +msgid "Can operate turnouts and signals in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build near tracks without the track_builder privilege." +msgstr "" +"Vous ne pouvez pas construire à proximité d'une voie sans le privilège " +"\"track_builder\" (?)" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build tracks without the track_builder privilege." +msgstr "" +"Vous ne pouvez pas construire une voie sans le privilège \"track_builder\"" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build near tracks at this protected position." +msgstr "" +"Vous ne pouvez pas construire à proximité d'une voie à cet emplacement " +"protégé" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build tracks at this protected position." +msgstr "Vous ne pouvez pas construire une voie à cet emplacement protégé" + +#: advtrains/protection.lua:184 +msgid "" +"You are not allowed to operate turnouts and signals without the " +"railway_operator privilege." +msgstr "" +"Vous ne pouvez pas actionner les aiguillages ou les signaux (privilège " +"\"railway_operator\" manquant)" + +#: advtrains/signals.lua:63 +msgid "Lampless Signal" +msgstr "Sémaphore" + +#: advtrains/signals.lua:127 +msgid "Signal" +msgstr "" + +#: advtrains/signals.lua:191 +msgid "Wallmounted Signal (left)" +msgstr "Signal mural (gauche)" + +#: advtrains/signals.lua:192 +msgid "Wallmounted Signal (right)" +msgstr "Signal mural (droit)" + +#: advtrains/signals.lua:193 +msgid "Wallmounted Signal (top)" +msgstr "Signal mural (plafond)" + +#: advtrains/signals.lua:281 advtrains/signals.lua:322 +msgid "Andrew's Cross" +msgstr "Croix de Saint André" + #: advtrains/trackplacer.lua:313 +#, fuzzy msgid "" "Track Worker Tool\n" "\n" "Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate rail/bumper/signal/etc." +"Right-click: rotate object" msgstr "" "Outil \"Trackworker\"\n" "\n" @@ -106,28 +259,80 @@ msgstr "" "Clic-Droit : tourne le rail/butoir/signal/etc..." #: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 -msgid "This node can't be rotated using the trackworker!" +#, fuzzy +msgid "This node can't be rotated using the trackworker." msgstr "Ce nœud ne peut être tourné avec l'outil \"Trackworker\" !" #: advtrains/trackplacer.lua:350 -msgid "This track can not be rotated!" -msgstr "Cette voie ne peut pas être tournée !" +msgid "This track can not be rotated." +msgstr "Cette voie ne peut pas être tournée." #: advtrains/trackplacer.lua:404 -msgid "This node can't be changed using the trackworker!" +#, fuzzy +msgid "This node can't be changed using the trackworker." msgstr "Ce nœud ne peut être modifié avec l'outil \"Trackworker\" !" #: advtrains/trackplacer.lua:414 -msgid "This track can not be changed!" -msgstr "Cette voie ne peut pas être modifiée !" +msgid "This track can not be changed." +msgstr "Cette voie ne peut pas être modifiée." + +#: advtrains/tracks.lua:449 +msgid "This track can not be removed." +msgstr "Cette voie ne peut pas être enlevée." + +#: advtrains/tracks.lua:616 +msgid "Position is occupied by a train." +msgstr "Cet emplacement est occupé par un train." + +#: advtrains/tracks.lua:622 +msgid "There's a Track Circuit Break here." +msgstr "Il y a un \"Track Circuit Break\" ici." + +#: advtrains/tracks.lua:626 +msgid "There's a Signal Influence Point here." +msgstr "Il y a un \"Signal Influence Point\" ici." + +#: advtrains/tracks.lua:637 +msgid "@1 Slope" +msgstr "Pente @1" + +#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 +#, fuzzy +msgid "Can't place slope: not pointing at node." +msgstr "Placement impossible : ne pointe pas un nœud" + +#: advtrains/tracks.lua:658 +#, fuzzy +msgid "Can't place slope: space occupied." +msgstr "Placement impossible : espace occupé" + +#: advtrains/tracks.lua:711 +#, fuzzy +msgid "Can't place slope: Not enough slope items left (@1 required)." +msgstr "" +"Placement impossible : quantité insuffisante de voie pentue (@1 manquant)" + +#: advtrains/tracks.lua:714 +#, fuzzy +msgid "Can't place slope: There's no slope of length @1." +msgstr "Placement impossible : il n'y a pas de voie pentue de longueur @1" + +#: advtrains/tracks.lua:721 +#, fuzzy +msgid "Can't place slope: no supporting node at upper end." +msgstr "Placement impossible : pas de nœud d'appui à l'extrémité supérieure" + +#: advtrains/trainhud.lua:305 +msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +msgstr "" #: advtrains/wagons.lua:179 msgid "This wagon is owned by @1, you can't destroy it." msgstr "Ce wagon est la propriété de @1, vous ne pouvez pas le détruire." #: advtrains/wagons.lua:203 -msgid "The wagon's inventory is not empty!" -msgstr "Le stock de ce wagon n'est pas vide !" +msgid "The wagon's inventory is not empty." +msgstr "Le stock de ce wagon n'est pas vide." #: advtrains/wagons.lua:210 msgid "Wagon needs to be decoupled from other wagons in order to destroy it." @@ -166,8 +371,20 @@ msgstr "Débarquer (de force)" msgid "(Doors closed)" msgstr "(Portes closes)" +#: advtrains/wagons.lua:692 +msgid "This wagon has no seats." +msgstr "" + +#: advtrains/wagons.lua:703 +msgid "This wagon is full." +msgstr "" + +#: advtrains/wagons.lua:706 +msgid "Doors are closed! (Try holding sneak key!)" +msgstr "" + #: advtrains/wagons.lua:712 -msgid "Can't get on: " +msgid "You can't get on this wagon." msgstr "" #: advtrains/wagons.lua:838 @@ -195,188 +412,39 @@ msgid "Routingcode" msgstr "Code de routage" #: advtrains/wagons.lua:1241 +#, fuzzy msgid "" -"Doors are closed! Use Sneak+rightclick to ignore the closed doors and get " -"off!" +"Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " +"off." msgstr "" "Portes closes ! Utilisez \"Marcher lentement (Sneak)\" et Clic-Droit pour " "franchir les portes et débarquer !" -#: advtrains/trainhud.lua:305 -msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." -msgstr "" - -#: advtrains/tracks.lua:449 -msgid "This track can not be removed!" -msgstr "Cette voie ne peut pas être enlevée !" - -#: advtrains/tracks.lua:616 -msgid "Position is occupied by a train." -msgstr "Cet emplacement est occupé par un train." - -#: advtrains/tracks.lua:622 -msgid "There's a Track Circuit Break here." -msgstr "Il y a un \"Track Circuit Break\" ici." - -#: advtrains/tracks.lua:626 -msgid "There's a Signal Influence Point here." -msgstr "Il y a un \"Signal Influence Point\" ici." - -#: advtrains/tracks.lua:637 -msgid "@1 Slope" -msgstr "Pente @1" - -#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 -msgid "Can't place: not pointing at node" -msgstr "Placement impossible : ne pointe pas un nœud" - -#: advtrains/tracks.lua:658 -msgid "Can't place: space occupied!" -msgstr "Placement impossible : espace occupé" - -#: advtrains/tracks.lua:711 -msgid "Can't place: Not enough slope items left (@1 required)" -msgstr "" -"Placement impossible : quantité insuffisante de voie pentue (@1 manquant)" - -#: advtrains/tracks.lua:714 -msgid "Can't place: There's no slope of length @1" -msgstr "Placement impossible : il n'y a pas de voie pentue de longueur @1" - -#: advtrains/tracks.lua:721 -msgid "Can't place: no supporting node at upper end." -msgstr "Placement impossible : pas de nœud d'appui à l'extrémité supérieure" - -#: advtrains/signals.lua:63 -msgid "Lampless Signal" -msgstr "Sémaphore" - -#: advtrains/signals.lua:127 -msgid "Signal" -msgstr "" - -#: advtrains/signals.lua:191 -msgid "Wallmounted Signal (l)" -msgstr "Signal mural (gauche)" - -#: advtrains/signals.lua:192 -msgid "Wallmounted Signal (r)" -msgstr "Signal mural (droit)" - -#: advtrains/signals.lua:193 -msgid "Wallmounted Signal (t)" -msgstr "Signal mural (plafond)" - -#: advtrains/signals.lua:281 advtrains/signals.lua:322 -msgid "Andrew's Cross" -msgstr "Croix de Saint André" - -#: advtrains/couple.lua:28 -msgid "Buffer and Chain Coupler" -msgstr "Attelage à tampon et vis" - -#: advtrains/couple.lua:29 -msgid "Scharfenberg Coupler" -msgstr "Attelage Scharfenberg" - -#: advtrains/couple.lua:185 -msgid "" -"You are not allowed to couple trains without the train_operator privilege." +#: advtrains/wagons.lua:1250 +msgid "You are not allowed to access the driver stand." msgstr "" -#: advtrains/couple.lua:329 advtrains/couple.lua:333 -msgid "" +#: advtrains_interlocking/tsr_rail.lua:13 +msgid "Point speed restriction: @1" msgstr "" -#: advtrains/couple.lua:334 -msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +#: advtrains_interlocking/tsr_rail.lua:14 +msgid "Set point speed restriction:" msgstr "" -"Accouplement impossible: les attelages des trains ne concordent pas (@1 et " -"@2)." -#: advtrains/copytool.lua:8 -msgid "" -"Train copy/paste tool\n" -"\n" -"Left-click: copy train\n" -"Right-click: paste train" +#: advtrains_interlocking/tsr_rail.lua:30 +msgid "You are not allowed to configure this track without the @1 privilege." msgstr "" -"Outil de copie/collage de train\n" -"\n" -"Clic-Gauche : copie\n" -"\n" -"Clic-Droit : collage" - -#: advtrains/copytool.lua:29 -msgid "You do not have the @1 privilege." -msgstr "Vous ne possédez pas le privilège \"@1\"." - -#: advtrains/copytool.lua:41 -msgid "The track you are trying to place the wagon on is not long enough!" -msgstr "La voie sur laquelle vous tentez de placer le wagon est trop courte !" - -#: advtrains/copytool.lua:47 -msgid "The clipboard couldn't access the metadata. Paste failed." -msgstr "Le presse-papier ne peut accéder aux métadonnées. Échec du collage." -#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 -msgid "The clipboard is empty." -msgstr "Le presse-papier est vide." - -#: advtrains/copytool.lua:74 -msgid "Back of train would end up off track, cancelling." -msgstr "La fin du train serait hors voie : annulation." - -#: advtrains/copytool.lua:92 -msgid "No such lua entity!" -msgstr "Pas de telle entité lua !" - -#: advtrains/copytool.lua:98 -msgid "No such wagon: @1" -msgstr "Pas de tel wagon : @1" - -#: advtrains/copytool.lua:104 -msgid "No such train: @1" -msgstr "Pas de tel train : @1" - -#: advtrains/copytool.lua:176 -msgid "The clipboard couldn't access the metadata. Copy failed." -msgstr "Le presse-papier ne peut accéder aux métadonnées. Échec de la copie." - -#: advtrains/copytool.lua:180 -msgid "Train copied!" -msgstr "Train copié !" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build near tracks without the track_builder privilege." +#: advtrains_interlocking/tsr_rail.lua:34 +#: advtrains_line_automation/stoprail.lua:31 +#: advtrains_line_automation/stoprail.lua:76 +msgid "You are not allowed to configure this track." msgstr "" -"Vous ne pouvez pas construire à proximité d'une voie sans le privilège " -"\"track_builder\" (?)" -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build tracks without the track_builder privilege." +#: advtrains_interlocking/tsr_rail.lua:64 +msgid "Point Speed Restriction Track" msgstr "" -"Vous ne pouvez pas construire une voie sans le privilège \"track_builder\"" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build near tracks at this protected position." -msgstr "" -"Vous ne pouvez pas construire à proximité d'une voie à cet emplacement " -"protégé" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build tracks at this protected position." -msgstr "Vous ne pouvez pas construire une voie à cet emplacement protégé" - -#: advtrains/protection.lua:184 -msgid "" -"You are not allowed to operate turnouts and signals without the " -"railway_operator privilege." -msgstr "" -"Vous ne pouvez pas actionner les aiguillages ou les signaux (privilège " -"\"railway_operator\" manquant)" #: advtrains_line_automation/stoprail.lua:54 msgid "Station Code" @@ -415,55 +483,85 @@ msgstr "" msgid "Kick out passengers" msgstr "" -#: advtrains_luaautomation/pcnaming.lua:26 -msgid "" -"Passive Component Naming Tool\n" -"\n" -"Right-click to name a passive component." +#: advtrains_line_automation/stoprail.lua:97 +msgid "Station code \"@1\" already exists and is owned by @2." msgstr "" -"Outil de nommage de composant passif\n" -"\n" -"Clic-Droit pour nommer un composant passif." -#: advtrains_train_track/init.lua:31 -msgid "Y-turnout" -msgstr "Embranchement en Y" +#: advtrains_line_automation/stoprail.lua:111 +msgid "This station is owned by @1. You are not allowed to edit its name." +msgstr "" -#: advtrains_train_track/init.lua:49 -msgid "3-way turnout" -msgstr "Embranchement triple" +#: advtrains_line_automation/stoprail.lua:221 +msgid "Station/Stop Track" +msgstr "" -#: advtrains_train_track/init.lua:69 -msgid "Perpendicular Diamond Crossing Track" -msgstr "Croisement perpendiculaire" +#: advtrains_luaautomation/active_common.lua:17 +msgid "Unconfigured LuaATC component" +msgstr "" -#: advtrains_train_track/init.lua:91 -msgid "90+Angle Diamond Crossing Track" -msgstr "Croisement perpendiculo-diagonal" +#: advtrains_luaautomation/active_common.lua:46 +msgid "LuaATC Environment" +msgstr "" -#: advtrains_train_track/init.lua:132 -msgid "Diagonal Diamond Crossing Track" -msgstr "Croisement diagonal" +#: advtrains_luaautomation/active_common.lua:49 +msgid "Clear Local Environment" +msgstr "" -#: advtrains_train_track/init.lua:179 -msgid "Bumper" -msgstr "Heurtoir" +#: advtrains_luaautomation/active_common.lua:50 +msgid "Code" +msgstr "" -#: advtrains_train_track/init.lua:201 -msgid "ATC controller" -msgstr "Controlleur ATC" +#: advtrains_luaautomation/active_common.lua:64 +msgid "" +"You are not allowed to configure this LuaATC component without the @1 " +"privilege." +msgstr "" -#: advtrains_train_track/init.lua:317 -msgid "Unloading Track" -msgstr "Voie de Déchargement" +#: advtrains_luaautomation/active_common.lua:94 +msgid "LuaATC component assigned to environment '@1'" +msgstr "" -#: advtrains_train_track/init.lua:342 -msgid "Loading Track" -msgstr "Voie de Chargement" +#: advtrains_luaautomation/active_common.lua:96 +msgid "LuaATC component assigned to an invalid environment" +msgstr "" -#: advtrains_train_track/init.lua:406 -msgid "Detector Rail" -msgstr "Voie détectrice" +#: advtrains_luaautomation/active_common.lua:171 +msgid "LuaATC component with error: @1" +msgstr "" + +#: advtrains_luaautomation/init.lua:13 +msgid "" +"Can place and configure LuaATC components, including execute potentially " +"harmful Lua code" +msgstr "" + +#: advtrains_luaautomation/mesecon_controller.lua:211 +msgid "LuaATC Mesecon Controller" +msgstr "" + +#: advtrains_luaautomation/operation_panel.lua:11 +msgid "LuaATC Operation Panel" +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:28 +msgid "" +"Passive Component Naming Tool\n" +"\n" +"Right-click to name a passive component." +msgstr "" +"Outil de nommage de composant passif\n" +"\n" +"Clic-Droit pour nommer un composant passif." + +#: advtrains_luaautomation/pcnaming.lua:39 +msgid "" +"You are not allowed to name LuaATC passive components without the @1 " +"privilege." +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:62 +msgid "Set name of component (empty to clear)" +msgstr "" #: advtrains_train_industrial/init.lua:10 #: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 @@ -529,26 +627,45 @@ msgstr "Wagon de frêt" msgid "Subway Passenger Wagon" msgstr "Voiture de Métropolitain" -#~ msgid "This position is protected!" -#~ msgstr "Cet emplacement est protégé !" +#: advtrains_train_track/init.lua:31 +msgid "Y-turnout" +msgstr "Embranchement en Y" -#~ msgid "Can't place: protected position!" -#~ msgstr "Placement impossible : emplacement protégé" +#: advtrains_train_track/init.lua:49 +msgid "3-way turnout" +msgstr "Embranchement triple" -#~ msgid "Deprecated Track" -#~ msgstr "Voie déconseillée" +#: advtrains_train_track/init.lua:69 +msgid "Perpendicular Diamond Crossing Track" +msgstr "Croisement perpendiculaire" -#~ msgid "Can't get on: wagon full or doors closed!" -#~ msgstr "" -#~ "Embarquement impossible : le wagon est plein ou ses portes sont closes !" +#: advtrains_train_track/init.lua:91 +msgid "90+Angle Diamond Crossing Track" +msgstr "Croisement perpendiculo-diagonal" -#~ msgid "Use Sneak+rightclick to bypass closed doors!" -#~ msgstr "" -#~ "Utilisez \"Marcher lentement (Sneak)\" et Clic-Droit pour franchir les " -#~ "portes closes !" +#: advtrains_train_track/init.lua:132 +msgid "Diagonal Diamond Crossing Track" +msgstr "Croisement diagonal" -#~ msgid "Access to @1" -#~ msgstr "Accès à @1" +#: advtrains_train_track/init.lua:179 +msgid "Bumper" +msgstr "Heurtoir" + +#: advtrains_train_track/init.lua:201 +msgid "ATC controller" +msgstr "Controlleur ATC" + +#: advtrains_train_track/init.lua:317 +msgid "Unloading Track" +msgstr "Voie de Déchargement" + +#: advtrains_train_track/init.lua:342 +msgid "Loading Track" +msgstr "Voie de Chargement" + +#: advtrains_train_track/init.lua:406 +msgid "Detector Rail" +msgstr "Voie détectrice" #~ msgid "" #~ "ATC controller, mode @1\n" @@ -557,14 +674,27 @@ msgstr "Voiture de Métropolitain" #~ "Controlleur ATC, mode @1\n" #~ "Canal : @2" -#~ msgid "Lock couples" -#~ msgstr "Verrouiller l'accouplement" +#~ msgid "Access to @1" +#~ msgstr "Accès à @1" -#~ msgid "" -#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgid "Can't get on: wagon full or doors closed!" #~ msgstr "" -#~ "Vous devez être propriétaire d'au moins un wagon voisin pour supprimer " -#~ "cet attelage." +#~ "Embarquement impossible : le wagon est plein ou ses portes sont closes !" + +#~ msgid "Can't place: protected position!" +#~ msgstr "Placement impossible : emplacement protégé" + +#~ msgid "Default Seat" +#~ msgstr "Siège par défaut" + +#~ msgid "Default Seat (driver stand)" +#~ msgstr "Siège par défaut (poste de pilotage)" + +#~ msgid "Deprecated Track" +#~ msgstr "Voie déconseillée" + +#~ msgid "Lock couples" +#~ msgstr "Verrouiller l'accouplement" #~ msgid "Speed:" #~ msgstr "Vitesse : " @@ -572,8 +702,24 @@ msgstr "Voiture de Métropolitain" #~ msgid "Target:" #~ msgstr "Destination : " -#~ msgid "Default Seat" -#~ msgstr "Siège par défaut" +#, fuzzy +#~ msgid "This node can't be rotated using the trackworker," +#~ msgstr "Ce nœud ne peut être tourné avec l'outil \"Trackworker\" !" -#~ msgid "Default Seat (driver stand)" -#~ msgstr "Siège par défaut (poste de pilotage)" +#~ msgid "This position is protected!" +#~ msgstr "Cet emplacement est protégé !" + +#~ msgid "Use Sneak+rightclick to bypass closed doors!" +#~ msgstr "" +#~ "Utilisez \"Marcher lentement (Sneak)\" et Clic-Droit pour franchir les " +#~ "portes closes !" + +#, fuzzy +#~ msgid "You are not allowed to modify this protected track." +#~ msgstr "Vous ne pouvez pas construire une voie à cet emplacement protégé" + +#~ msgid "" +#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgstr "" +#~ "Vous devez être propriétaire d'au moins un wagon voisin pour supprimer " +#~ "cet attelage." diff --git a/advtrains/po/template.pot b/advtrains/po/template.pot deleted file mode 100644 index 23aaa6a..0000000 --- a/advtrains/po/template.pot +++ /dev/null @@ -1,505 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the advtrains package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: advtrains\n" -"Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2023-10-04 15:40+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: advtrains/atc.lua:109 -msgid "ATC controller, unconfigured." -msgstr "" - -#: advtrains/atc.lua:150 -msgid "" -"ATC controller, mode @1\n" -"Command: @2" -msgstr "" - -#: advtrains/atc.lua:180 -msgid "Command" -msgstr "" - -#: advtrains/atc.lua:184 -msgid "Command (on)" -msgstr "" - -#: advtrains/atc.lua:187 -msgid "Digiline channel" -msgstr "" - -#: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 -msgid "Save" -msgstr "" - -#: advtrains/atc.lua:236 -msgid "ATC Reverse command warning: didn't reverse train, train moving!" -msgstr "" - -#: advtrains/atc.lua:248 -msgid "ATC Kick command warning: Doors closed" -msgstr "" - -#: advtrains/atc.lua:252 -msgid "ATC Kick command warning: Train moving" -msgstr "" - -#: advtrains/atc.lua:322 -msgid "ATC command syntax error: I statement not closed: @1" -msgstr "" - -#: advtrains/atc.lua:385 -msgid "ATC command parse error: Unknown command: @1" -msgstr "" - -#: advtrains/craft_items.lua:3 -msgid "Boiler" -msgstr "" - -#: advtrains/craft_items.lua:9 -msgid "driver's cab" -msgstr "" - -#: advtrains/craft_items.lua:15 -msgid "Wheel" -msgstr "" - -#: advtrains/craft_items.lua:21 -msgid "Chimney" -msgstr "" - -#: advtrains/misc_nodes.lua:16 -msgid "@1 Platform (low)" -msgstr "" - -#: advtrains/misc_nodes.lua:33 -msgid "@1 Platform (high)" -msgstr "" - -#: advtrains/misc_nodes.lua:59 -msgid "@1 Platform (45 degree)" -msgstr "" - -#: advtrains/misc_nodes.lua:81 -msgid "@1 Platform (low, 45 degree)" -msgstr "" - -#: advtrains/trackplacer.lua:313 -msgid "" -"Track Worker Tool\n" -"\n" -"Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate rail/bumper/signal/etc." -msgstr "" - -#: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 -msgid "This node can't be rotated using the trackworker!" -msgstr "" - -#: advtrains/trackplacer.lua:350 -msgid "This track can not be rotated!" -msgstr "" - -#: advtrains/trackplacer.lua:404 -msgid "This node can't be changed using the trackworker!" -msgstr "" - -#: advtrains/trackplacer.lua:414 -msgid "This track can not be changed!" -msgstr "" - -#: advtrains/wagons.lua:179 -msgid "This wagon is owned by @1, you can't destroy it." -msgstr "" - -#: advtrains/wagons.lua:203 -msgid "The wagon's inventory is not empty!" -msgstr "" - -#: advtrains/wagons.lua:210 -msgid "Wagon needs to be decoupled from other wagons in order to destroy it." -msgstr "" - -#: advtrains/wagons.lua:216 -msgid "" -"Warning: If you destroy this wagon, you only get some steel back! If you are " -"sure, hold Sneak and left-click the wagon." -msgstr "" - -#: advtrains/wagons.lua:649 advtrains/wagons.lua:850 -msgid "Show Inventory" -msgstr "" - -#: advtrains/wagons.lua:652 -msgid "Onboard Computer" -msgstr "" - -#: advtrains/wagons.lua:655 advtrains/wagons.lua:1328 -msgid "Wagon properties" -msgstr "" - -#: advtrains/wagons.lua:658 -msgid "Get off" -msgstr "" - -#: advtrains/wagons.lua:661 -msgid "Get off (forced)" -msgstr "" - -#: advtrains/wagons.lua:663 -msgid "(Doors closed)" -msgstr "" - -#: advtrains/wagons.lua:712 -msgid "Can't get on: " -msgstr "" - -#: advtrains/wagons.lua:838 -msgid "Select seat:" -msgstr "" - -#: advtrains/wagons.lua:880 -msgid "Save wagon properties" -msgstr "" - -#: advtrains/wagons.lua:965 -msgid "Text displayed outside on train" -msgstr "" - -#: advtrains/wagons.lua:966 -msgid "Text displayed inside train" -msgstr "" - -#: advtrains/wagons.lua:967 -msgid "Line" -msgstr "" - -#: advtrains/wagons.lua:968 -msgid "Routingcode" -msgstr "" - -#: advtrains/wagons.lua:1241 -msgid "" -"Doors are closed! Use Sneak+rightclick to ignore the closed doors and get " -"off!" -msgstr "" - -#: advtrains/trainhud.lua:305 -msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." -msgstr "" - -#: advtrains/tracks.lua:449 -msgid "This track can not be removed!" -msgstr "" - -#: advtrains/tracks.lua:616 -msgid "Position is occupied by a train." -msgstr "" - -#: advtrains/tracks.lua:622 -msgid "There's a Track Circuit Break here." -msgstr "" - -#: advtrains/tracks.lua:626 -msgid "There's a Signal Influence Point here." -msgstr "" - -#: advtrains/tracks.lua:637 -msgid "@1 Slope" -msgstr "" - -#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 -msgid "Can't place: not pointing at node" -msgstr "" - -#: advtrains/tracks.lua:658 -msgid "Can't place: space occupied!" -msgstr "" - -#: advtrains/tracks.lua:711 -msgid "Can't place: Not enough slope items left (@1 required)" -msgstr "" - -#: advtrains/tracks.lua:714 -msgid "Can't place: There's no slope of length @1" -msgstr "" - -#: advtrains/tracks.lua:721 -msgid "Can't place: no supporting node at upper end." -msgstr "" - -#: advtrains/signals.lua:63 -msgid "Lampless Signal" -msgstr "" - -#: advtrains/signals.lua:127 -msgid "Signal" -msgstr "" - -#: advtrains/signals.lua:191 -msgid "Wallmounted Signal (l)" -msgstr "" - -#: advtrains/signals.lua:192 -msgid "Wallmounted Signal (r)" -msgstr "" - -#: advtrains/signals.lua:193 -msgid "Wallmounted Signal (t)" -msgstr "" - -#: advtrains/signals.lua:281 advtrains/signals.lua:322 -msgid "Andrew's Cross" -msgstr "" - -#: advtrains/couple.lua:28 -msgid "Buffer and Chain Coupler" -msgstr "" - -#: advtrains/couple.lua:29 -msgid "Scharfenberg Coupler" -msgstr "" - -#: advtrains/couple.lua:185 -msgid "" -"You are not allowed to couple trains without the train_operator privilege." -msgstr "" - -#: advtrains/couple.lua:329 advtrains/couple.lua:333 -msgid "" -msgstr "" - -#: advtrains/couple.lua:334 -msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." -msgstr "" - -#: advtrains/copytool.lua:8 -msgid "" -"Train copy/paste tool\n" -"\n" -"Left-click: copy train\n" -"Right-click: paste train" -msgstr "" - -#: advtrains/copytool.lua:29 -msgid "You do not have the @1 privilege." -msgstr "" - -#: advtrains/copytool.lua:41 -msgid "The track you are trying to place the wagon on is not long enough!" -msgstr "" - -#: advtrains/copytool.lua:47 -msgid "The clipboard couldn't access the metadata. Paste failed." -msgstr "" - -#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 -msgid "The clipboard is empty." -msgstr "" - -#: advtrains/copytool.lua:74 -msgid "Back of train would end up off track, cancelling." -msgstr "" - -#: advtrains/copytool.lua:92 -msgid "No such lua entity!" -msgstr "" - -#: advtrains/copytool.lua:98 -msgid "No such wagon: @1" -msgstr "" - -#: advtrains/copytool.lua:104 -msgid "No such train: @1" -msgstr "" - -#: advtrains/copytool.lua:176 -msgid "The clipboard couldn't access the metadata. Copy failed." -msgstr "" - -#: advtrains/copytool.lua:180 -msgid "Train copied!" -msgstr "" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build near tracks without the track_builder privilege." -msgstr "" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build tracks without the track_builder privilege." -msgstr "" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build near tracks at this protected position." -msgstr "" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build tracks at this protected position." -msgstr "" - -#: advtrains/protection.lua:184 -msgid "" -"You are not allowed to operate turnouts and signals without the " -"railway_operator privilege." -msgstr "" - -#: advtrains_line_automation/stoprail.lua:54 -msgid "Station Code" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:55 -msgid "Station Name" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:56 -msgid "Door Delay" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:57 -msgid "Dep. Speed" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:58 advtrains_train_track/init.lua:11 -#: advtrains_train_track/init.lua:156 -msgid "Track" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:59 -msgid "Stop Time" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:60 -msgid "Door Side" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:62 -msgid "Reverse train" -msgstr "" - -#: advtrains_line_automation/stoprail.lua:63 -msgid "Kick out passengers" -msgstr "" - -#: advtrains_luaautomation/pcnaming.lua:26 -msgid "" -"Passive Component Naming Tool\n" -"\n" -"Right-click to name a passive component." -msgstr "" - -#: advtrains_train_track/init.lua:31 -msgid "Y-turnout" -msgstr "" - -#: advtrains_train_track/init.lua:49 -msgid "3-way turnout" -msgstr "" - -#: advtrains_train_track/init.lua:69 -msgid "Perpendicular Diamond Crossing Track" -msgstr "" - -#: advtrains_train_track/init.lua:91 -msgid "90+Angle Diamond Crossing Track" -msgstr "" - -#: advtrains_train_track/init.lua:132 -msgid "Diagonal Diamond Crossing Track" -msgstr "" - -#: advtrains_train_track/init.lua:179 -msgid "Bumper" -msgstr "" - -#: advtrains_train_track/init.lua:201 -msgid "ATC controller" -msgstr "" - -#: advtrains_train_track/init.lua:317 -msgid "Unloading Track" -msgstr "" - -#: advtrains_train_track/init.lua:342 -msgid "Loading Track" -msgstr "" - -#: advtrains_train_track/init.lua:406 -msgid "Detector Rail" -msgstr "" - -#: advtrains_train_industrial/init.lua:10 -#: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 -#: advtrains_train_steam/init.lua:91 -msgid "Driver Stand (right)" -msgstr "" - -#: advtrains_train_industrial/init.lua:17 -#: advtrains_train_industrial/init.lua:56 advtrains_train_steam/init.lua:14 -#: advtrains_train_steam/init.lua:85 -msgid "Driver Stand (left)" -msgstr "" - -#: advtrains_train_industrial/init.lua:40 -msgid "Industrial Train Engine" -msgstr "" - -#: advtrains_train_industrial/init.lua:79 -msgid "Big Industrial Train Engine" -msgstr "" - -#: advtrains_train_industrial/init.lua:98 -msgid "Industrial tank wagon" -msgstr "" - -#: advtrains_train_industrial/init.lua:116 -msgid "Industrial wood wagon" -msgstr "" - -#: advtrains_train_japan/init.lua:4 -msgid "Japanese Train Inter-Wagon Connection" -msgstr "" - -#: advtrains_train_japan/init.lua:37 -msgid "Driver stand" -msgstr "" - -#: advtrains_train_japan/init.lua:101 -msgid "Japanese Train Engine" -msgstr "" - -#: advtrains_train_japan/init.lua:176 -msgid "Japanese Train Wagon" -msgstr "" - -#: advtrains_train_steam/init.lua:75 -msgid "Steam Engine" -msgstr "" - -#: advtrains_train_steam/init.lua:159 -msgid "Detailed Steam Engine" -msgstr "" - -#: advtrains_train_steam/init.lua:206 -msgid "Passenger Wagon" -msgstr "" - -#: advtrains_train_steam/init.lua:226 -msgid "Box Wagon" -msgstr "" - -#: advtrains_train_subway/init.lua:144 -msgid "Subway Passenger Wagon" -msgstr "" diff --git a/advtrains/po/update-translations.sh b/advtrains/po/update-translations.sh index d86c568..3a56c7c 100755 --- a/advtrains/po/update-translations.sh +++ b/advtrains/po/update-translations.sh @@ -1,24 +1,28 @@ #!/bin/sh # NOTE: Please make sure you also have basic_trains installed, as it uses attrans for historical reasons -ATDIR=`dirname "$0"`/../.. -BTDIR="$ATDIR"/../basic_trains +PODIR=`dirname "$0"` +ATDIR="$PODIR/../.." +BTDIR="$ATDIR/../basic_trains" +POTFILE="$PODIR/advtrains.pot" xgettext \ -D "$ATDIR" \ -D "$BTDIR" \ -d advtrains \ + -o "$POTFILE" \ -p . \ -L lua \ --from-code=UTF-8 \ + --sort-by-file \ --keyword='attrans' \ --keyword='S' \ --package-name='advtrains' \ --msgid-bugs-address='advtrains-discuss@lists.sr.ht' \ `find $ATDIR $BTDIR -name '*.lua' -printf '%P\n'` \ && -mv advtrains.po template.pot && -for i in *.po; do +for i in "$PODIR"/*.po; do msgmerge -U \ - $i template.pot + --sort-by-file \ + $i "$POTFILE" done diff --git a/advtrains/po/zh_CN.po b/advtrains/po/zh_CN.po index c81cf6c..5bcc316 100644 --- a/advtrains/po/zh_CN.po +++ b/advtrains/po/zh_CN.po @@ -2,17 +2,18 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2023-10-04 15:40+0200\n" -"PO-Revision-Date: 2022-11-02 15:08+0100\n" +"POT-Creation-Date: 2023-10-09 11:02+0200\n" +"PO-Revision-Date: 2023-10-09 11:24+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: Chinese (Simplified)\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.3.2\n" #: advtrains/atc.lua:109 -msgid "ATC controller, unconfigured." +msgid "Unconfigured ATC controller" msgstr "ATC 控制器 (未配置)" #: advtrains/atc.lua:150 @@ -37,20 +38,21 @@ msgid "Digiline channel" msgstr "Digiline 频道" #: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 +#: advtrains_luaautomation/active_common.lua:48 msgid "Save" msgstr "保存" #: advtrains/atc.lua:236 -msgid "ATC Reverse command warning: didn't reverse train, train moving!" -msgstr "ATC 警告:未执行“R”命令,火车在移动" +msgid "ATC Reverse command warning: didn't reverse train, train moving." +msgstr "ATC 警告:火车正在移动,无法改变行车方向。" #: advtrains/atc.lua:248 -msgid "ATC Kick command warning: Doors closed" -msgstr "" +msgid "ATC Kick command warning: doors are closed." +msgstr "ATC 警告:车门已关闭,无法踢出乘客。" #: advtrains/atc.lua:252 -msgid "ATC Kick command warning: Train moving" -msgstr "" +msgid "ATC Kick command warning: train moving." +msgstr "ATC 警告:火车正在移动,无法踢出乘客。" #: advtrains/atc.lua:322 msgid "ATC command syntax error: I statement not closed: @1" @@ -60,12 +62,85 @@ msgstr "ATC 语法错误:“I”命令不完整:@1" msgid "ATC command parse error: Unknown command: @1" msgstr "ATC 语法错误:未知命令:@1" +#: advtrains/copytool.lua:8 +msgid "" +"Train copy/paste tool\n" +"\n" +"Left-click: copy train\n" +"Right-click: paste train" +msgstr "" +"火车复制工具\n" +"\n" +"左键单击:复制\n" +"右键单击:粘帖" + +#: advtrains/copytool.lua:29 +msgid "You do not have the @1 privilege." +msgstr "您没有“@1”权限。" + +#: advtrains/copytool.lua:41 +msgid "The track you are trying to place the wagon on is not long enough." +msgstr "轨道太短。" + +#: advtrains/copytool.lua:47 +msgid "The clipboard couldn't access the metadata. Paste failed." +msgstr "无法粘贴:剪贴板无法访问元数据。" + +#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 +msgid "The clipboard is empty." +msgstr "剪贴板是空的。" + +#: advtrains/copytool.lua:74 +msgid "Back of train would end up off track, cancelling." +msgstr "火车后部不在轨道上。" + +#: advtrains/copytool.lua:92 +msgid "No such lua entity." +msgstr "您没有指向一个可以用火车复制工具复制的物体。" + +#: advtrains/copytool.lua:98 +msgid "No such wagon: @1." +msgstr "ID 为“@1”的车厢不存在。" + +#: advtrains/copytool.lua:104 +msgid "No such train: @1." +msgstr "ID 为“@1”的列车不存在。" + +#: advtrains/copytool.lua:176 +msgid "The clipboard couldn't access the metadata. Copy failed." +msgstr "无法复制:剪贴板无法访问元数据。" + +#: advtrains/copytool.lua:180 +msgid "Train copied." +msgstr "已复制列车。" + +#: advtrains/couple.lua:28 +msgid "Buffer and Chain Coupler" +msgstr "链式车钩" + +#: advtrains/couple.lua:29 +msgid "Scharfenberg Coupler" +msgstr "Scharfenberg 式车钩" + +#: advtrains/couple.lua:185 +msgid "" +"You are not allowed to couple trains without the train_operator privilege." +msgstr "您没有“train_operator”权限,不能连接这两节车厢。" + +#: advtrains/couple.lua:329 advtrains/couple.lua:333 +msgid "" +msgstr "<没有车钩>" + +#: advtrains/couple.lua:334 +msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +msgstr "您无法连接这两节车厢:这两节车厢使用不同的车钩 (@1和@2)。" + #: advtrains/craft_items.lua:3 msgid "Boiler" msgstr "锅炉" #: advtrains/craft_items.lua:9 -msgid "driver's cab" +msgid "Driver's cab" msgstr "驾驶室" #: advtrains/craft_items.lua:15 @@ -92,12 +167,78 @@ msgstr "较高的@1站台 (45°)" msgid "@1 Platform (low, 45 degree)" msgstr "较低的@1站台 (45°)" +#: advtrains/protection.lua:7 +msgid "Can place, remove and operate trains" +msgstr "" + +#: advtrains/protection.lua:12 +msgid "" +"Can place, remove and operate any train, regardless of owner, whitelist, or " +"protection" +msgstr "" + +#: advtrains/protection.lua:18 +msgid "Can place and dig tracks in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:24 +msgid "Can operate turnouts and signals in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build near tracks without the track_builder privilege." +msgstr "您没有“train_operator”权限,不能在铁路附近建任何东西。" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build tracks without the track_builder privilege." +msgstr "您没有“train_operator”权限,不能在这里建造铁路。" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build near tracks at this protected position." +msgstr "这里已被保护,您不能在这里的铁路附近建任何东西。" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build tracks at this protected position." +msgstr "这里已被保护,您不能在这里建造铁路。" + +#: advtrains/protection.lua:184 +msgid "" +"You are not allowed to operate turnouts and signals without the " +"railway_operator privilege." +msgstr "您没有“railway_operator”权限,不能控制铁路设施。" + +#: advtrains/signals.lua:63 +msgid "Lampless Signal" +msgstr "臂板信号机" + +#: advtrains/signals.lua:127 +msgid "Signal" +msgstr "信号灯" + +#: advtrains/signals.lua:191 +msgid "Wallmounted Signal (left)" +msgstr "壁挂式信号灯 (左侧)" + +#: advtrains/signals.lua:192 +msgid "Wallmounted Signal (right)" +msgstr "壁挂式信号灯 (右侧)" + +#: advtrains/signals.lua:193 +msgid "Wallmounted Signal (top)" +msgstr "悬挂式信号灯" + +#: advtrains/signals.lua:281 advtrains/signals.lua:322 +msgid "Andrew's Cross" +msgstr "铁路道口信号灯" + #: advtrains/trackplacer.lua:313 msgid "" "Track Worker Tool\n" "\n" "Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate rail/bumper/signal/etc." +"Right-click: rotate object" msgstr "" "铁路调整工具\n" "\n" @@ -105,27 +246,71 @@ msgstr "" "右键单击:旋转方块" #: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 -msgid "This node can't be rotated using the trackworker!" +msgid "This node can't be rotated using the trackworker." msgstr "您不能使用铁路调整工具旋转这个方块。" #: advtrains/trackplacer.lua:350 -msgid "This track can not be rotated!" +msgid "This track can not be rotated." msgstr "您不能旋转这段轨道。" #: advtrains/trackplacer.lua:404 -msgid "This node can't be changed using the trackworker!" +msgid "This node can't be changed using the trackworker." msgstr "您不能使用铁路调整工具调整这个方块。" #: advtrains/trackplacer.lua:414 -msgid "This track can not be changed!" +msgid "This track can not be changed." msgstr "您不能调整这段轨道。" +#: advtrains/tracks.lua:449 +msgid "This track can not be removed." +msgstr "您不能移除这段轨道。" + +#: advtrains/tracks.lua:616 +msgid "Position is occupied by a train." +msgstr "" + +#: advtrains/tracks.lua:622 +msgid "There's a Track Circuit Break here." +msgstr "" + +#: advtrains/tracks.lua:626 +msgid "There's a Signal Influence Point here." +msgstr "" + +#: advtrains/tracks.lua:637 +msgid "@1 Slope" +msgstr "@1斜坡" + +#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 +msgid "Can't place slope: not pointing at node." +msgstr "无法放置斜坡:您没有选择任何方块。" + +#: advtrains/tracks.lua:658 +msgid "Can't place slope: space occupied." +msgstr "无法放置斜坡:此区域已被占用。" + +#: advtrains/tracks.lua:711 +msgid "Can't place slope: Not enough slope items left (@1 required)." +msgstr "无法放置斜坡:您没有足够的铁路斜坡放置工具 (您总共需要@1个)" + +#: advtrains/tracks.lua:714 +msgid "Can't place slope: There's no slope of length @1." +msgstr "无法放置斜坡:advtrains 不支持长度为@1米的斜坡。" + +#: advtrains/tracks.lua:721 +msgid "Can't place slope: no supporting node at upper end." +msgstr "无法放置斜坡:较高端没有支撑方块。" + +#: advtrains/trainhud.lua:305 +msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +msgstr "" + #: advtrains/wagons.lua:179 msgid "This wagon is owned by @1, you can't destroy it." msgstr "这是 @1 的车厢,您不能摧毁它。" #: advtrains/wagons.lua:203 -msgid "The wagon's inventory is not empty!" +msgid "The wagon's inventory is not empty." msgstr "" #: advtrains/wagons.lua:210 @@ -164,13 +349,25 @@ msgstr "强制下车" msgid "(Doors closed)" msgstr "(车门已关闭)" +#: advtrains/wagons.lua:692 +msgid "This wagon has no seats." +msgstr "这节车厢没有座位。" + +#: advtrains/wagons.lua:703 +msgid "This wagon is full." +msgstr "车厢已满。" + +#: advtrains/wagons.lua:706 +msgid "Doors are closed! (Try holding sneak key!)" +msgstr "" + #: advtrains/wagons.lua:712 -msgid "Can't get on: " +msgid "You can't get on this wagon." msgstr "" #: advtrains/wagons.lua:838 msgid "Select seat:" -msgstr "请选择座位" +msgstr "请选择座位:" #: advtrains/wagons.lua:880 msgid "Save wagon properties" @@ -194,174 +391,35 @@ msgstr "路由码" #: advtrains/wagons.lua:1241 msgid "" -"Doors are closed! Use Sneak+rightclick to ignore the closed doors and get " -"off!" +"Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " +"off." msgstr "车门已关闭,请使用潜行+右键单击下车。" -#: advtrains/trainhud.lua:305 -msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +#: advtrains/wagons.lua:1250 +msgid "You are not allowed to access the driver stand." msgstr "" -#: advtrains/tracks.lua:449 -msgid "This track can not be removed!" -msgstr "您不能移除这段轨道。" - -#: advtrains/tracks.lua:616 -msgid "Position is occupied by a train." +#: advtrains_interlocking/tsr_rail.lua:13 +msgid "Point speed restriction: @1" msgstr "" -#: advtrains/tracks.lua:622 -msgid "There's a Track Circuit Break here." +#: advtrains_interlocking/tsr_rail.lua:14 +msgid "Set point speed restriction:" msgstr "" -#: advtrains/tracks.lua:626 -msgid "There's a Signal Influence Point here." -msgstr "" - -#: advtrains/tracks.lua:637 -msgid "@1 Slope" -msgstr "@1斜坡" - -#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 -msgid "Can't place: not pointing at node" -msgstr "无法放置:您没有选择任何方块。" - -#: advtrains/tracks.lua:658 -msgid "Can't place: space occupied!" -msgstr "无法放置:此区域已被占用。" - -#: advtrains/tracks.lua:711 -msgid "Can't place: Not enough slope items left (@1 required)" -msgstr "无法放置:您没有足够的铁路斜坡放置工具 (您总共需要@1个)" - -#: advtrains/tracks.lua:714 -msgid "Can't place: There's no slope of length @1" -msgstr "无法放置:advtrains 不支持长度为@1米的斜坡。" - -#: advtrains/tracks.lua:721 -msgid "Can't place: no supporting node at upper end." -msgstr "无法放置:较高端没有支撑方块。" - -#: advtrains/signals.lua:63 -msgid "Lampless Signal" -msgstr "臂板信号机" - -#: advtrains/signals.lua:127 -msgid "Signal" -msgstr "信号灯" - -#: advtrains/signals.lua:191 -msgid "Wallmounted Signal (l)" -msgstr "壁挂式信号灯 (左侧)" - -#: advtrains/signals.lua:192 -msgid "Wallmounted Signal (r)" -msgstr "壁挂式信号灯 (右侧)" - -#: advtrains/signals.lua:193 -msgid "Wallmounted Signal (t)" -msgstr "悬挂式信号灯" - -#: advtrains/signals.lua:281 advtrains/signals.lua:322 -msgid "Andrew's Cross" -msgstr "铁路道口信号灯" - -#: advtrains/couple.lua:28 -msgid "Buffer and Chain Coupler" -msgstr "链式车钩" - -#: advtrains/couple.lua:29 -msgid "Scharfenberg Coupler" -msgstr "Scharfenberg 式车钩" - -#: advtrains/couple.lua:185 -msgid "" -"You are not allowed to couple trains without the train_operator privilege." -msgstr "您没有“train_operator”权限,不能连接这两节车厢。" - -#: advtrains/couple.lua:329 advtrains/couple.lua:333 -msgid "" -msgstr "" +#: advtrains_interlocking/tsr_rail.lua:30 +msgid "You are not allowed to configure this track without the @1 privilege." +msgstr "您没有“@1”权限,不能调整这段轨道。" -#: advtrains/couple.lua:334 -msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." -msgstr "您无法连接这两节车厢:这两节车厢使用不同的车钩 (@1和@2)。" +#: advtrains_interlocking/tsr_rail.lua:34 +#: advtrains_line_automation/stoprail.lua:31 +#: advtrains_line_automation/stoprail.lua:76 +msgid "You are not allowed to configure this track." +msgstr "您不能调整这段轨道。" -#: advtrains/copytool.lua:8 -msgid "" -"Train copy/paste tool\n" -"\n" -"Left-click: copy train\n" -"Right-click: paste train" +#: advtrains_interlocking/tsr_rail.lua:64 +msgid "Point Speed Restriction Track" msgstr "" -"火车复制工具\n" -"\n" -"左键单击:复制\n" -"右键单击:粘帖" - -#: advtrains/copytool.lua:29 -msgid "You do not have the @1 privilege." -msgstr "您没有“@1”权限。" - -#: advtrains/copytool.lua:41 -msgid "The track you are trying to place the wagon on is not long enough!" -msgstr "轨道太短。" - -#: advtrains/copytool.lua:47 -msgid "The clipboard couldn't access the metadata. Paste failed." -msgstr "无法粘贴:剪贴板无法访问元数据。" - -#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 -msgid "The clipboard is empty." -msgstr "剪贴板是空的。" - -#: advtrains/copytool.lua:74 -msgid "Back of train would end up off track, cancelling." -msgstr "火车后部不在轨道上。" - -#: advtrains/copytool.lua:92 -msgid "No such lua entity!" -msgstr "您没有指向一个可以用火车复制工具复制的物体。" - -#: advtrains/copytool.lua:98 -msgid "No such wagon: @1" -msgstr "ID 为“@1”的车厢不存在。" - -#: advtrains/copytool.lua:104 -msgid "No such train: @1" -msgstr "ID 为“@1”的列车不存在。" - -#: advtrains/copytool.lua:176 -msgid "The clipboard couldn't access the metadata. Copy failed." -msgstr "无法复制:剪贴板无法访问元数据。" - -#: advtrains/copytool.lua:180 -msgid "Train copied!" -msgstr "已复制" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build near tracks without the track_builder privilege." -msgstr "您没有“train_operator”权限,不能在铁路附近建任何东西。" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build tracks without the track_builder privilege." -msgstr "您没有“train_operator”权限,不能在这里建造铁路。" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build near tracks at this protected position." -msgstr "这里已被保护,您不能在这里的铁路附近建任何东西。" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build tracks at this protected position." -msgstr "这里已被保护,您不能在这里建造铁路。" - -#: advtrains/protection.lua:184 -msgid "" -"You are not allowed to operate turnouts and signals without the " -"railway_operator privilege." -msgstr "您没有“railway_operator”权限,不能控制铁路设施。" #: advtrains_line_automation/stoprail.lua:54 msgid "Station Code" @@ -394,61 +452,91 @@ msgstr "" #: advtrains_line_automation/stoprail.lua:62 msgid "Reverse train" -msgstr "" +msgstr "改变行车方向" #: advtrains_line_automation/stoprail.lua:63 msgid "Kick out passengers" +msgstr "踢出乘客" + +#: advtrains_line_automation/stoprail.lua:97 +msgid "Station code \"@1\" already exists and is owned by @2." msgstr "" -#: advtrains_luaautomation/pcnaming.lua:26 -msgid "" -"Passive Component Naming Tool\n" -"\n" -"Right-click to name a passive component." +#: advtrains_line_automation/stoprail.lua:111 +msgid "This station is owned by @1. You are not allowed to edit its name." msgstr "" -"被动元件命名工具\n" -"\n" -"右键单击命名所选元件" -#: advtrains_train_track/init.lua:31 -msgid "Y-turnout" -msgstr "对称道岔" +#: advtrains_line_automation/stoprail.lua:221 +msgid "Station/Stop Track" +msgstr "车站轨道" -#: advtrains_train_track/init.lua:49 -msgid "3-way turnout" -msgstr "三开道岔" +#: advtrains_luaautomation/active_common.lua:17 +msgid "Unconfigured LuaATC component" +msgstr "LuaATC 部件 (未配置)" -#: advtrains_train_track/init.lua:69 -msgid "Perpendicular Diamond Crossing Track" -msgstr "垂直交叉轨道" +#: advtrains_luaautomation/active_common.lua:46 +msgid "LuaATC Environment" +msgstr "" -#: advtrains_train_track/init.lua:91 -msgid "90+Angle Diamond Crossing Track" -msgstr "交叉轨道 (其中一条轨道与坐标轴平行)" +#: advtrains_luaautomation/active_common.lua:49 +msgid "Clear Local Environment" +msgstr "" -#: advtrains_train_track/init.lua:132 -msgid "Diagonal Diamond Crossing Track" -msgstr "交叉轨道" +#: advtrains_luaautomation/active_common.lua:50 +msgid "Code" +msgstr "" -#: advtrains_train_track/init.lua:179 -msgid "Bumper" -msgstr "保险杠" +#: advtrains_luaautomation/active_common.lua:64 +msgid "" +"You are not allowed to configure this LuaATC component without the @1 " +"privilege." +msgstr "您没有“@1”权限,不能配置这个 LuaATC 部件。" -#: advtrains_train_track/init.lua:201 -msgid "ATC controller" -msgstr "ATC 控制器" +#: advtrains_luaautomation/active_common.lua:94 +msgid "LuaATC component assigned to environment '@1'" +msgstr "" -#: advtrains_train_track/init.lua:317 -msgid "Unloading Track" -msgstr "卸货轨道" +#: advtrains_luaautomation/active_common.lua:96 +msgid "LuaATC component assigned to an invalid environment" +msgstr "" -#: advtrains_train_track/init.lua:342 -msgid "Loading Track" -msgstr "装货轨道" +#: advtrains_luaautomation/active_common.lua:171 +msgid "LuaATC component with error: @1" +msgstr "" -#: advtrains_train_track/init.lua:406 -msgid "Detector Rail" -msgstr "探测轨道" +#: advtrains_luaautomation/init.lua:13 +msgid "" +"Can place and configure LuaATC components, including execute potentially " +"harmful Lua code" +msgstr "" + +#: advtrains_luaautomation/mesecon_controller.lua:211 +msgid "LuaATC Mesecon Controller" +msgstr "" + +#: advtrains_luaautomation/operation_panel.lua:11 +msgid "LuaATC Operation Panel" +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:28 +msgid "" +"Passive Component Naming Tool\n" +"\n" +"Right-click to name a passive component." +msgstr "" +"被动元件命名工具\n" +"\n" +"右键单击命名所选元件。" + +#: advtrains_luaautomation/pcnaming.lua:39 +msgid "" +"You are not allowed to name LuaATC passive components without the @1 " +"privilege." +msgstr "您没有“@1”权限,不能命名被动元件。" + +#: advtrains_luaautomation/pcnaming.lua:62 +msgid "Set name of component (empty to clear)" +msgstr "" #: advtrains_train_industrial/init.lua:10 #: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 @@ -514,23 +602,45 @@ msgstr "货运车厢" msgid "Subway Passenger Wagon" msgstr "地铁车厢" -#~ msgid "This position is protected!" -#~ msgstr "这里已被保护。" +#: advtrains_train_track/init.lua:31 +msgid "Y-turnout" +msgstr "对称道岔" -#~ msgid "Can't place: protected position!" -#~ msgstr "无法放置:此区域已被保护。" +#: advtrains_train_track/init.lua:49 +msgid "3-way turnout" +msgstr "三开道岔" -#~ msgid "Deprecated Track" -#~ msgstr "请不要使用" +#: advtrains_train_track/init.lua:69 +msgid "Perpendicular Diamond Crossing Track" +msgstr "垂直交叉轨道" -#~ msgid "Can't get on: wagon full or doors closed!" -#~ msgstr "无法上车:车门已关闭或车厢已满。" +#: advtrains_train_track/init.lua:91 +msgid "90+Angle Diamond Crossing Track" +msgstr "交叉轨道 (其中一条轨道与坐标轴平行)" -#~ msgid "Use Sneak+rightclick to bypass closed doors!" -#~ msgstr "请使用潜行+右键上车。" +#: advtrains_train_track/init.lua:132 +msgid "Diagonal Diamond Crossing Track" +msgstr "交叉轨道" -#~ msgid "Access to @1" -#~ msgstr "可前往@1" +#: advtrains_train_track/init.lua:179 +msgid "Bumper" +msgstr "保险杠" + +#: advtrains_train_track/init.lua:201 +msgid "ATC controller" +msgstr "ATC 控制器" + +#: advtrains_train_track/init.lua:317 +msgid "Unloading Track" +msgstr "卸货轨道" + +#: advtrains_train_track/init.lua:342 +msgid "Loading Track" +msgstr "装货轨道" + +#: advtrains_train_track/init.lua:406 +msgid "Detector Rail" +msgstr "探测轨道" #~ msgid "" #~ "ATC controller, mode @1\n" @@ -540,21 +650,47 @@ msgstr "地铁车厢" #~ "模式:@1\n" #~ "频道:@2" +#~ msgid "Access to @1" +#~ msgstr "可前往@1" + +#~ msgid "Can't get on: wagon full or doors closed!" +#~ msgstr "无法上车:车门已关闭或车厢已满。" + +#~ msgid "Can't place: protected position!" +#~ msgstr "无法放置:此区域已被保护。" + +#~ msgid "Default Seat" +#~ msgstr "默认座位" + +#~ msgid "Default Seat (driver stand)" +#~ msgstr "默认座位 (司机座位)" + +#~ msgid "Deprecated Track" +#~ msgstr "请不要使用" + #~ msgid "Lock couples" #~ msgstr "锁定连接处" -#~ msgid "" -#~ "You need to own at least one neighboring wagon to destroy this couple." -#~ msgstr "您必须至少拥有其中一节车厢才能分开这两节车厢。" - #~ msgid "Speed:" #~ msgstr "速度" #~ msgid "Target:" #~ msgstr "目标速度" -#~ msgid "Default Seat" -#~ msgstr "默认座位" +#, fuzzy +#~ msgid "This node can't be rotated using the trackworker," +#~ msgstr "您不能使用铁路调整工具旋转这个方块。" -#~ msgid "Default Seat (driver stand)" -#~ msgstr "默认座位 (司机座位)" +#~ msgid "This position is protected!" +#~ msgstr "这里已被保护。" + +#~ msgid "Use Sneak+rightclick to bypass closed doors!" +#~ msgstr "请使用潜行+右键上车。" + +#, fuzzy +#~ msgid "You are not allowed to modify this protected track." +#~ msgstr "这里已被保护,您不能在这里建造铁路。" + +#~ msgid "" +#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgstr "您必须至少拥有其中一节车厢才能分开这两节车厢。" diff --git a/advtrains/po/zh_TW.po b/advtrains/po/zh_TW.po index 91a205f..ece82c3 100644 --- a/advtrains/po/zh_TW.po +++ b/advtrains/po/zh_TW.po @@ -2,17 +2,18 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2023-10-04 15:40+0200\n" -"PO-Revision-Date: 2022-11-02 15:08+0100\n" +"POT-Creation-Date: 2023-10-09 11:02+0200\n" +"PO-Revision-Date: 2023-10-09 11:31+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: Chinese (Traditional)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.3.2\n" #: advtrains/atc.lua:109 -msgid "ATC controller, unconfigured." +msgid "Unconfigured ATC controller" msgstr "ATC 控制器 (未配置)" #: advtrains/atc.lua:150 @@ -37,20 +38,21 @@ msgid "Digiline channel" msgstr "Digiline 頻道" #: advtrains/atc.lua:189 advtrains_line_automation/stoprail.lua:65 +#: advtrains_luaautomation/active_common.lua:48 msgid "Save" msgstr "儲存" #: advtrains/atc.lua:236 -msgid "ATC Reverse command warning: didn't reverse train, train moving!" -msgstr "ATC 警告:未執行「R」命令,火車在移動" +msgid "ATC Reverse command warning: didn't reverse train, train moving." +msgstr "ATC 警告:火車正在移動,無法改變行車方向。" #: advtrains/atc.lua:248 -msgid "ATC Kick command warning: Doors closed" -msgstr "" +msgid "ATC Kick command warning: doors are closed." +msgstr "ATC 警告:車門已關閉,無法踢出乘客。" #: advtrains/atc.lua:252 -msgid "ATC Kick command warning: Train moving" -msgstr "" +msgid "ATC Kick command warning: train moving." +msgstr "ATC 警告:火車正在移動,無法踢出乘客。" #: advtrains/atc.lua:322 msgid "ATC command syntax error: I statement not closed: @1" @@ -60,12 +62,85 @@ msgstr "ATC 語法錯誤:「I」命令不完整:@1" msgid "ATC command parse error: Unknown command: @1" msgstr "ATC 語法錯誤:未知命令:@1" +#: advtrains/copytool.lua:8 +msgid "" +"Train copy/paste tool\n" +"\n" +"Left-click: copy train\n" +"Right-click: paste train" +msgstr "" +"火車複製工具\n" +"\n" +"左鍵單擊:複製\n" +"右鍵單擊:粘帖" + +#: advtrains/copytool.lua:29 +msgid "You do not have the @1 privilege." +msgstr "您沒有「@1」許可權。" + +#: advtrains/copytool.lua:41 +msgid "The track you are trying to place the wagon on is not long enough." +msgstr "軌道太短。" + +#: advtrains/copytool.lua:47 +msgid "The clipboard couldn't access the metadata. Paste failed." +msgstr "無法貼上:剪貼簿無法訪問元資料。" + +#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 +msgid "The clipboard is empty." +msgstr "剪貼簿是空的。" + +#: advtrains/copytool.lua:74 +msgid "Back of train would end up off track, cancelling." +msgstr "火車後部不在軌道上。" + +#: advtrains/copytool.lua:92 +msgid "No such lua entity." +msgstr "您沒有指向一個可以用火車複製工具複製的物體。" + +#: advtrains/copytool.lua:98 +msgid "No such wagon: @1." +msgstr "ID 為「@1」的車廂不存在。" + +#: advtrains/copytool.lua:104 +msgid "No such train: @1." +msgstr "ID 為「@1」的列車不存在。" + +#: advtrains/copytool.lua:176 +msgid "The clipboard couldn't access the metadata. Copy failed." +msgstr "無法複製:剪貼簿無法訪問元資料。" + +#: advtrains/copytool.lua:180 +msgid "Train copied." +msgstr "已複製火車。" + +#: advtrains/couple.lua:28 +msgid "Buffer and Chain Coupler" +msgstr "鏈式連結器" + +#: advtrains/couple.lua:29 +msgid "Scharfenberg Coupler" +msgstr "Scharfenberg 式連結器" + +#: advtrains/couple.lua:185 +msgid "" +"You are not allowed to couple trains without the train_operator privilege." +msgstr "您沒有「train_operator」許可權,不能連結這兩節車廂。" + +#: advtrains/couple.lua:329 advtrains/couple.lua:333 +msgid "" +msgstr "<無連結器>" + +#: advtrains/couple.lua:334 +msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." +msgstr "您無法連結這兩節車廂:這兩節車廂使用不同的連結器 (@1和@2)。" + #: advtrains/craft_items.lua:3 msgid "Boiler" msgstr "鍋爐" #: advtrains/craft_items.lua:9 -msgid "driver's cab" +msgid "Driver's cab" msgstr "駕駛室" #: advtrains/craft_items.lua:15 @@ -92,12 +167,78 @@ msgstr "較高的@1月臺 (45°)" msgid "@1 Platform (low, 45 degree)" msgstr "較低的@1月臺 (45°)" +#: advtrains/protection.lua:7 +msgid "Can place, remove and operate trains" +msgstr "" + +#: advtrains/protection.lua:12 +msgid "" +"Can place, remove and operate any train, regardless of owner, whitelist, or " +"protection" +msgstr "" + +#: advtrains/protection.lua:18 +msgid "Can place and dig tracks in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:24 +msgid "Can operate turnouts and signals in unprotected areas" +msgstr "" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build near tracks without the track_builder privilege." +msgstr "您沒有「train_operator」許可權,不能在鐵路附近建任何東西。" + +#: advtrains/protection.lua:148 +msgid "" +"You are not allowed to build tracks without the track_builder privilege." +msgstr "您沒有「train_operator」許可權,不能在這裡建造鐵路。" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build near tracks at this protected position." +msgstr "這裡已被保護,您不能在這裡的鐵路附近建任何東西。" + +#: advtrains/protection.lua:153 +msgid "You are not allowed to build tracks at this protected position." +msgstr "這裡已被保護,您不能在這裡建造鐵路。" + +#: advtrains/protection.lua:184 +msgid "" +"You are not allowed to operate turnouts and signals without the " +"railway_operator privilege." +msgstr "您沒有「railway_operator」許可權,不能控制鐵路設施。" + +#: advtrains/signals.lua:63 +msgid "Lampless Signal" +msgstr "臂木式號誌機" + +#: advtrains/signals.lua:127 +msgid "Signal" +msgstr "色燈號誌機" + +#: advtrains/signals.lua:191 +msgid "Wallmounted Signal (left)" +msgstr "壁掛式色燈號誌機 (左側)" + +#: advtrains/signals.lua:192 +msgid "Wallmounted Signal (right)" +msgstr "壁掛式色燈號誌機 (右側)" + +#: advtrains/signals.lua:193 +msgid "Wallmounted Signal (top)" +msgstr "懸掛式色燈號誌機" + +#: advtrains/signals.lua:281 advtrains/signals.lua:322 +msgid "Andrew's Cross" +msgstr "平交道號誌燈" + #: advtrains/trackplacer.lua:313 msgid "" "Track Worker Tool\n" "\n" "Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate rail/bumper/signal/etc." +"Right-click: rotate object" msgstr "" "鐵路調整工具\n" "\n" @@ -105,27 +246,71 @@ msgstr "" "右鍵單擊:旋轉方塊" #: advtrains/trackplacer.lua:340 advtrains/trackplacer.lua:377 -msgid "This node can't be rotated using the trackworker!" +msgid "This node can't be rotated using the trackworker." msgstr "您不能使用鐵路調整工具旋轉這個方塊。" #: advtrains/trackplacer.lua:350 -msgid "This track can not be rotated!" +msgid "This track can not be rotated." msgstr "您不能旋轉這段軌道。" #: advtrains/trackplacer.lua:404 -msgid "This node can't be changed using the trackworker!" +msgid "This node can't be changed using the trackworker." msgstr "您不能使用鐵路調整工具調整這個方塊。" #: advtrains/trackplacer.lua:414 -msgid "This track can not be changed!" +msgid "This track can not be changed." msgstr "您不能調整這段軌道。" +#: advtrains/tracks.lua:449 +msgid "This track can not be removed." +msgstr "您不能移除這段軌道。" + +#: advtrains/tracks.lua:616 +msgid "Position is occupied by a train." +msgstr "" + +#: advtrains/tracks.lua:622 +msgid "There's a Track Circuit Break here." +msgstr "" + +#: advtrains/tracks.lua:626 +msgid "There's a Signal Influence Point here." +msgstr "" + +#: advtrains/tracks.lua:637 +msgid "@1 Slope" +msgstr "@1斜坡" + +#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 +msgid "Can't place slope: not pointing at node." +msgstr "無法放置斜坡:您沒有選擇任何方塊。" + +#: advtrains/tracks.lua:658 +msgid "Can't place slope: space occupied." +msgstr "無法放置斜坡:此區域已被佔用。" + +#: advtrains/tracks.lua:711 +msgid "Can't place slope: Not enough slope items left (@1 required)." +msgstr "無法放置斜坡:您沒有足夠的鐵路斜坡放置工具 (您總共需要@1個)" + +#: advtrains/tracks.lua:714 +msgid "Can't place slope: There's no slope of length @1." +msgstr "無法放置斜坡:advtrains 不支援長度為@1米的斜坡。" + +#: advtrains/tracks.lua:721 +msgid "Can't place slope: no supporting node at upper end." +msgstr "無法放置斜坡:較高階沒有支撐方塊。" + +#: advtrains/trainhud.lua:305 +msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +msgstr "" + #: advtrains/wagons.lua:179 msgid "This wagon is owned by @1, you can't destroy it." msgstr "這是 @1 的車廂,您不能摧毀它。" #: advtrains/wagons.lua:203 -msgid "The wagon's inventory is not empty!" +msgid "The wagon's inventory is not empty." msgstr "" #: advtrains/wagons.lua:210 @@ -164,13 +349,25 @@ msgstr "強制下車" msgid "(Doors closed)" msgstr "(車門已關閉)" +#: advtrains/wagons.lua:692 +msgid "This wagon has no seats." +msgstr "這節車廂沒有座位。" + +#: advtrains/wagons.lua:703 +msgid "This wagon is full." +msgstr "車廂已滿。" + +#: advtrains/wagons.lua:706 +msgid "Doors are closed! (Try holding sneak key!)" +msgstr "" + #: advtrains/wagons.lua:712 -msgid "Can't get on: " +msgid "You can't get on this wagon." msgstr "" #: advtrains/wagons.lua:838 msgid "Select seat:" -msgstr "請選擇座位" +msgstr "請選擇座位:" #: advtrains/wagons.lua:880 msgid "Save wagon properties" @@ -194,174 +391,35 @@ msgstr "路由碼" #: advtrains/wagons.lua:1241 msgid "" -"Doors are closed! Use Sneak+rightclick to ignore the closed doors and get " -"off!" +"Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " +"off." msgstr "車門已關閉,請使用潛行+右鍵單擊下車。" -#: advtrains/trainhud.lua:305 -msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." +#: advtrains/wagons.lua:1250 +msgid "You are not allowed to access the driver stand." msgstr "" -#: advtrains/tracks.lua:449 -msgid "This track can not be removed!" -msgstr "您不能移除這段軌道。" - -#: advtrains/tracks.lua:616 -msgid "Position is occupied by a train." +#: advtrains_interlocking/tsr_rail.lua:13 +msgid "Point speed restriction: @1" msgstr "" -#: advtrains/tracks.lua:622 -msgid "There's a Track Circuit Break here." +#: advtrains_interlocking/tsr_rail.lua:14 +msgid "Set point speed restriction:" msgstr "" -#: advtrains/tracks.lua:626 -msgid "There's a Signal Influence Point here." -msgstr "" - -#: advtrains/tracks.lua:637 -msgid "@1 Slope" -msgstr "@1斜坡" - -#: advtrains/tracks.lua:648 advtrains/tracks.lua:653 -msgid "Can't place: not pointing at node" -msgstr "無法放置:您沒有選擇任何方塊。" - -#: advtrains/tracks.lua:658 -msgid "Can't place: space occupied!" -msgstr "無法放置:此區域已被佔用。" - -#: advtrains/tracks.lua:711 -msgid "Can't place: Not enough slope items left (@1 required)" -msgstr "無法放置:您沒有足夠的鐵路斜坡放置工具 (您總共需要@1個)" - -#: advtrains/tracks.lua:714 -msgid "Can't place: There's no slope of length @1" -msgstr "無法放置:advtrains 不支援長度為@1米的斜坡。" - -#: advtrains/tracks.lua:721 -msgid "Can't place: no supporting node at upper end." -msgstr "無法放置:較高階沒有支撐方塊。" - -#: advtrains/signals.lua:63 -msgid "Lampless Signal" -msgstr "臂木式號誌機" - -#: advtrains/signals.lua:127 -msgid "Signal" -msgstr "色燈號誌機" - -#: advtrains/signals.lua:191 -msgid "Wallmounted Signal (l)" -msgstr "壁掛式色燈號誌機 (左側)" - -#: advtrains/signals.lua:192 -msgid "Wallmounted Signal (r)" -msgstr "壁掛式色燈號誌機 (右側)" - -#: advtrains/signals.lua:193 -msgid "Wallmounted Signal (t)" -msgstr "懸掛式色燈號誌機" - -#: advtrains/signals.lua:281 advtrains/signals.lua:322 -msgid "Andrew's Cross" -msgstr "平交道號誌燈" - -#: advtrains/couple.lua:28 -msgid "Buffer and Chain Coupler" -msgstr "鏈式連結器" - -#: advtrains/couple.lua:29 -msgid "Scharfenberg Coupler" -msgstr "Scharfenberg 式連結器" - -#: advtrains/couple.lua:185 -msgid "" -"You are not allowed to couple trains without the train_operator privilege." -msgstr "您沒有「train_operator」許可權,不能連結這兩節車廂。" - -#: advtrains/couple.lua:329 advtrains/couple.lua:333 -msgid "" -msgstr "" +#: advtrains_interlocking/tsr_rail.lua:30 +msgid "You are not allowed to configure this track without the @1 privilege." +msgstr "您沒有「@1」許可權,不能調整這段軌道。" -#: advtrains/couple.lua:334 -msgid "Can not couple: The couplers of the trains do not match (@1 and @2)." -msgstr "您無法連結這兩節車廂:這兩節車廂使用不同的連結器 (@1和@2)。" +#: advtrains_interlocking/tsr_rail.lua:34 +#: advtrains_line_automation/stoprail.lua:31 +#: advtrains_line_automation/stoprail.lua:76 +msgid "You are not allowed to configure this track." +msgstr "您不能調整這段軌道。" -#: advtrains/copytool.lua:8 -msgid "" -"Train copy/paste tool\n" -"\n" -"Left-click: copy train\n" -"Right-click: paste train" +#: advtrains_interlocking/tsr_rail.lua:64 +msgid "Point Speed Restriction Track" msgstr "" -"火車複製工具\n" -"\n" -"左鍵單擊:複製\n" -"右鍵單擊:粘帖" - -#: advtrains/copytool.lua:29 -msgid "You do not have the @1 privilege." -msgstr "您沒有「@1」許可權。" - -#: advtrains/copytool.lua:41 -msgid "The track you are trying to place the wagon on is not long enough!" -msgstr "軌道太短。" - -#: advtrains/copytool.lua:47 -msgid "The clipboard couldn't access the metadata. Paste failed." -msgstr "無法貼上:剪貼簿無法訪問元資料。" - -#: advtrains/copytool.lua:52 advtrains/copytool.lua:57 -msgid "The clipboard is empty." -msgstr "剪貼簿是空的。" - -#: advtrains/copytool.lua:74 -msgid "Back of train would end up off track, cancelling." -msgstr "火車後部不在軌道上。" - -#: advtrains/copytool.lua:92 -msgid "No such lua entity!" -msgstr "您沒有指向一個可以用火車複製工具複製的物體。" - -#: advtrains/copytool.lua:98 -msgid "No such wagon: @1" -msgstr "ID 為「@1」的車廂不存在。" - -#: advtrains/copytool.lua:104 -msgid "No such train: @1" -msgstr "ID 為「@1」的列車不存在。" - -#: advtrains/copytool.lua:176 -msgid "The clipboard couldn't access the metadata. Copy failed." -msgstr "無法複製:剪貼簿無法訪問元資料。" - -#: advtrains/copytool.lua:180 -msgid "Train copied!" -msgstr "已複製" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build near tracks without the track_builder privilege." -msgstr "您沒有「train_operator」許可權,不能在鐵路附近建任何東西。" - -#: advtrains/protection.lua:148 -msgid "" -"You are not allowed to build tracks without the track_builder privilege." -msgstr "您沒有「train_operator」許可權,不能在這裡建造鐵路。" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build near tracks at this protected position." -msgstr "這裡已被保護,您不能在這裡的鐵路附近建任何東西。" - -#: advtrains/protection.lua:153 -msgid "You are not allowed to build tracks at this protected position." -msgstr "這裡已被保護,您不能在這裡建造鐵路。" - -#: advtrains/protection.lua:184 -msgid "" -"You are not allowed to operate turnouts and signals without the " -"railway_operator privilege." -msgstr "您沒有「railway_operator」許可權,不能控制鐵路設施。" #: advtrains_line_automation/stoprail.lua:54 msgid "Station Code" @@ -394,61 +452,91 @@ msgstr "" #: advtrains_line_automation/stoprail.lua:62 msgid "Reverse train" -msgstr "" +msgstr "改變行車方向" #: advtrains_line_automation/stoprail.lua:63 msgid "Kick out passengers" +msgstr "踢出乘客" + +#: advtrains_line_automation/stoprail.lua:97 +msgid "Station code \"@1\" already exists and is owned by @2." msgstr "" -#: advtrains_luaautomation/pcnaming.lua:26 -msgid "" -"Passive Component Naming Tool\n" -"\n" -"Right-click to name a passive component." +#: advtrains_line_automation/stoprail.lua:111 +msgid "This station is owned by @1. You are not allowed to edit its name." msgstr "" -"被動元件命名工具\n" -"\n" -"右鍵單擊命名所選元件" -#: advtrains_train_track/init.lua:31 -msgid "Y-turnout" -msgstr "對稱道岔" +#: advtrains_line_automation/stoprail.lua:221 +msgid "Station/Stop Track" +msgstr "車站軌道" -#: advtrains_train_track/init.lua:49 -msgid "3-way turnout" -msgstr "三開道岔" +#: advtrains_luaautomation/active_common.lua:17 +msgid "Unconfigured LuaATC component" +msgstr "LuaATC 元件 (未配置)" -#: advtrains_train_track/init.lua:69 -msgid "Perpendicular Diamond Crossing Track" -msgstr "垂直交叉軌道" +#: advtrains_luaautomation/active_common.lua:46 +msgid "LuaATC Environment" +msgstr "" -#: advtrains_train_track/init.lua:91 -msgid "90+Angle Diamond Crossing Track" -msgstr "交叉軌道 (其中一條軌道與座標軸平行)" +#: advtrains_luaautomation/active_common.lua:49 +msgid "Clear Local Environment" +msgstr "" -#: advtrains_train_track/init.lua:132 -msgid "Diagonal Diamond Crossing Track" -msgstr "交叉軌道" +#: advtrains_luaautomation/active_common.lua:50 +msgid "Code" +msgstr "" -#: advtrains_train_track/init.lua:179 -msgid "Bumper" -msgstr "保險槓" +#: advtrains_luaautomation/active_common.lua:64 +msgid "" +"You are not allowed to configure this LuaATC component without the @1 " +"privilege." +msgstr "您沒有「@1」許可權,不能配置這個 LuaATC 元件。" -#: advtrains_train_track/init.lua:201 -msgid "ATC controller" -msgstr "ATC 控制器" +#: advtrains_luaautomation/active_common.lua:94 +msgid "LuaATC component assigned to environment '@1'" +msgstr "" -#: advtrains_train_track/init.lua:317 -msgid "Unloading Track" -msgstr "卸貨軌道" +#: advtrains_luaautomation/active_common.lua:96 +msgid "LuaATC component assigned to an invalid environment" +msgstr "" -#: advtrains_train_track/init.lua:342 -msgid "Loading Track" -msgstr "裝貨軌道" +#: advtrains_luaautomation/active_common.lua:171 +msgid "LuaATC component with error: @1" +msgstr "" -#: advtrains_train_track/init.lua:406 -msgid "Detector Rail" -msgstr "探測軌道" +#: advtrains_luaautomation/init.lua:13 +msgid "" +"Can place and configure LuaATC components, including execute potentially " +"harmful Lua code" +msgstr "" + +#: advtrains_luaautomation/mesecon_controller.lua:211 +msgid "LuaATC Mesecon Controller" +msgstr "" + +#: advtrains_luaautomation/operation_panel.lua:11 +msgid "LuaATC Operation Panel" +msgstr "" + +#: advtrains_luaautomation/pcnaming.lua:28 +msgid "" +"Passive Component Naming Tool\n" +"\n" +"Right-click to name a passive component." +msgstr "" +"被動元件命名工具\n" +"\n" +"右鍵單擊命名所選元件。" + +#: advtrains_luaautomation/pcnaming.lua:39 +msgid "" +"You are not allowed to name LuaATC passive components without the @1 " +"privilege." +msgstr "您沒有「@1」許可權,不能命名這個元件。" + +#: advtrains_luaautomation/pcnaming.lua:62 +msgid "Set name of component (empty to clear)" +msgstr "" #: advtrains_train_industrial/init.lua:10 #: advtrains_train_industrial/init.lua:49 advtrains_train_steam/init.lua:20 @@ -514,23 +602,45 @@ msgstr "貨運車廂" msgid "Subway Passenger Wagon" msgstr "地鐵車廂" -#~ msgid "This position is protected!" -#~ msgstr "這裡已被保護。" +#: advtrains_train_track/init.lua:31 +msgid "Y-turnout" +msgstr "對稱道岔" -#~ msgid "Can't place: protected position!" -#~ msgstr "無法放置:此區域已被保護。" +#: advtrains_train_track/init.lua:49 +msgid "3-way turnout" +msgstr "三開道岔" -#~ msgid "Deprecated Track" -#~ msgstr "請不要使用" +#: advtrains_train_track/init.lua:69 +msgid "Perpendicular Diamond Crossing Track" +msgstr "垂直交叉軌道" -#~ msgid "Can't get on: wagon full or doors closed!" -#~ msgstr "無法上車:車門已關閉或車廂已滿。" +#: advtrains_train_track/init.lua:91 +msgid "90+Angle Diamond Crossing Track" +msgstr "交叉軌道 (其中一條軌道與座標軸平行)" -#~ msgid "Use Sneak+rightclick to bypass closed doors!" -#~ msgstr "請使用潛行+右鍵上車。" +#: advtrains_train_track/init.lua:132 +msgid "Diagonal Diamond Crossing Track" +msgstr "交叉軌道" -#~ msgid "Access to @1" -#~ msgstr "可前往@1" +#: advtrains_train_track/init.lua:179 +msgid "Bumper" +msgstr "保險槓" + +#: advtrains_train_track/init.lua:201 +msgid "ATC controller" +msgstr "ATC 控制器" + +#: advtrains_train_track/init.lua:317 +msgid "Unloading Track" +msgstr "卸貨軌道" + +#: advtrains_train_track/init.lua:342 +msgid "Loading Track" +msgstr "裝貨軌道" + +#: advtrains_train_track/init.lua:406 +msgid "Detector Rail" +msgstr "探測軌道" #~ msgid "" #~ "ATC controller, mode @1\n" @@ -540,21 +650,47 @@ msgstr "地鐵車廂" #~ "模式:@1\n" #~ "頻道:@2" +#~ msgid "Access to @1" +#~ msgstr "可前往@1" + +#~ msgid "Can't get on: wagon full or doors closed!" +#~ msgstr "無法上車:車門已關閉或車廂已滿。" + +#~ msgid "Can't place: protected position!" +#~ msgstr "無法放置:此區域已被保護。" + +#~ msgid "Default Seat" +#~ msgstr "預設座位" + +#~ msgid "Default Seat (driver stand)" +#~ msgstr "預設座位 (司機座位)" + +#~ msgid "Deprecated Track" +#~ msgstr "請不要使用" + #~ msgid "Lock couples" #~ msgstr "鎖定連結處" -#~ msgid "" -#~ "You need to own at least one neighboring wagon to destroy this couple." -#~ msgstr "您必須至少擁有其中一節車廂才能分開這兩節車廂。" - #~ msgid "Speed:" #~ msgstr "速度" #~ msgid "Target:" #~ msgstr "目標速度" -#~ msgid "Default Seat" -#~ msgstr "預設座位" +#, fuzzy +#~ msgid "This node can't be rotated using the trackworker," +#~ msgstr "您不能使用鐵路調整工具旋轉這個方塊。" -#~ msgid "Default Seat (driver stand)" -#~ msgstr "預設座位 (司機座位)" +#~ msgid "This position is protected!" +#~ msgstr "這裡已被保護。" + +#~ msgid "Use Sneak+rightclick to bypass closed doors!" +#~ msgstr "請使用潛行+右鍵上車。" + +#, fuzzy +#~ msgid "You are not allowed to modify this protected track." +#~ msgstr "這裡已被保護,您不能在這裡建造鐵路。" + +#~ msgid "" +#~ "You need to own at least one neighboring wagon to destroy this couple." +#~ msgstr "您必須至少擁有其中一節車廂才能分開這兩節車廂。" diff --git a/advtrains/protection.lua b/advtrains/protection.lua index 89e15eb..ac1cd66 100644 --- a/advtrains/protection.lua +++ b/advtrains/protection.lua @@ -4,24 +4,24 @@ -- Privileges to control TRAIN DRIVING/COUPLING minetest.register_privilege("train_operator", { - description = "Without this privilege, a player can't do anything about trains, neither place or remove them nor drive or couple them (but he can build tracks if he has track_builder)", + description = attrans("Can place, remove and operate trains"), give_to_singleplayer= true, }); minetest.register_privilege("train_admin", { - description = "Player may drive, place or remove any trains from/to anywhere, regardless of owner, whitelist or protection", + description = attrans("Can place, remove and operate any train, regardless of owner, whitelist, or protection"), give_to_singleplayer= true, }); -- Privileges to control TRACK BUILDING minetest.register_privilege("track_builder", { - description = "Player can place and/or dig rails not protected from him. If he also has protection_bypass, he can place/dig any rails", + description = attrans("Can place and dig tracks in unprotected areas"), give_to_singleplayer= true, }); -- Privileges to control OPERATING TURNOUTS/SIGNALS minetest.register_privilege("railway_operator", { - description = "Player can operate turnouts and signals not protected from him. If he also has protection_bypass, he can operate any turnouts/signals", + description = attrans("Can operate turnouts and signals in unprotected areas"), give_to_singleplayer= true, }); diff --git a/advtrains/signals.lua b/advtrains/signals.lua index 74841d3..c03afbf 100644 --- a/advtrains/signals.lua +++ b/advtrains/signals.lua @@ -188,9 +188,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", --tunnel signals. no rotations. local swdesc = { -- needed for xgettext - l = attrans("Wallmounted Signal (l)"), - r = attrans("Wallmounted Signal (r)"), - t = attrans("Wallmounted Signal (t)"), + l = attrans("Wallmounted Signal (left)"), + r = attrans("Wallmounted Signal (right)"), + t = attrans("Wallmounted Signal (top)"), } for loc, sbox in pairs({l={-1/2, -1/2, -1/4, 0, 1/2, 1/4}, r={0, -1/2, -1/4, 1/2, 1/2, 1/4}, t={-1/2, 0, -1/4, 1/2, 1/2, 1/4}}) do minetest.register_node("advtrains:signal_wall_"..loc.."_"..r, { diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua index fe76290..9f97171 100644 --- a/advtrains/trackplacer.lua +++ b/advtrains/trackplacer.lua @@ -310,7 +310,7 @@ end minetest.register_craftitem("advtrains:trackworker",{ - description = attrans("Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate rail/bumper/signal/etc."), + description = attrans("Track Worker Tool\n\nLeft-click: change rail type (straight/curve/switch)\nRight-click: rotate object"), groups = {cracky=1}, -- key=name, value=rating; rating=1..3. inventory_image = "advtrains_trackworker.png", wield_image = "advtrains_trackworker.png", @@ -337,7 +337,7 @@ minetest.register_craftitem("advtrains:trackworker",{ nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") rotation = "" if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twrotate[suffix] then - minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker!")) + minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker.")) return end end @@ -347,7 +347,7 @@ minetest.register_craftitem("advtrains:trackworker",{ -- is a track, we can query local can_modify, reason = advtrains.can_dig_or_modify_track(pos) if not can_modify then - local str = attrans("This track can not be rotated!") + local str = attrans("This track can not be rotated.") if reason then str = str .. " " .. reason end @@ -374,7 +374,7 @@ minetest.register_craftitem("advtrains:trackworker",{ if v==rotation then modpos=k end end if not modpos then - minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker!")) + minetest.chat_send_player(placer:get_player_name(), attrans("This node can't be rotated using the trackworker.")) return end advtrains.ndb.swap_node(pos, {name=nnprefix.."_"..suffix..modext[modpos+1], param2=node.param2}) @@ -401,7 +401,7 @@ minetest.register_craftitem("advtrains:trackworker",{ nnprefix, suffix=string.match(node.name, "^(.+)_([^_]+)$") rotation = "" if not tp.tracks[nnprefix] or not tp.tracks[nnprefix].twcycle[suffix] then - minetest.chat_send_player(user:get_player_name(), attrans("This node can't be changed using the trackworker!")) + minetest.chat_send_player(user:get_player_name(), attrans("This node can't be changed using the trackworker.")) return end end @@ -411,7 +411,7 @@ minetest.register_craftitem("advtrains:trackworker",{ -- is a track, we can query local can_modify, reason = advtrains.can_dig_or_modify_track(pos) if not can_modify then - local str = attrans("This track can not be changed!") + local str = attrans("This track can not be changed.") if reason then str = str .. " " .. reason end diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index 3959232..ee82426 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -446,7 +446,7 @@ Depending on the number of connections: local function can_dig_callback(pos, player) local ok, reason = advtrains.can_dig_or_modify_track(pos) if not ok and player then - minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed!") .. " " .. reason) + minetest.chat_send_player(player:get_player_name(), attrans("This track can not be removed.") .. " " .. reason) end return ok end @@ -646,17 +646,17 @@ end function sl.create_slopeplacer_on_place(def, preset) return function(istack, player, pt) if not pt.type=="node" then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: not pointing at node.")) return istack end local pos=pt.above if not pos then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: not pointing at node")) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: not pointing at node.")) return istack end local node=minetest.get_node(pos) if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to then - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: space occupied!")) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: space occupied.")) return istack end if not advtrains.check_track_protection(pos, player:get_player_name()) then @@ -709,17 +709,17 @@ function sl.create_slopeplacer_on_place(def, preset) pos=vector.subtract(pos, dirvec) end else - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: Not enough slope items left (@1 required)", step)) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: Not enough slope items left (@1 required).", step)) end else - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: There's no slope of length @1",step)) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: There's no slope of length @1.",step)) end return istack end step=step+1 pos=vector.add(pos, dirvec) end - minetest.chat_send_player(player:get_player_name(), attrans("Can't place: no supporting node at upper end.")) + minetest.chat_send_player(player:get_player_name(), attrans("Can't place slope: no supporting node at upper end.")) return itemstack end end diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 536c8d4..993d7d3 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -213,7 +213,7 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct end for listname, _ in pairs(inv:get_lists()) do if not inv:is_empty(listname) then - minetest.chat_send_player(puncher:get_player_name(), attrans("The wagon's inventory is not empty!")); + minetest.chat_send_player(puncher:get_player_name(), attrans("The wagon's inventory is not empty.")); return end end @@ -711,7 +711,7 @@ function wagon:on_rightclick(clicker) end local doors_open = self:train().door_open~=0 or clicker:get_player_control().sneak - local allow, rsn=false, "Wagon has no seats!" + local allow, rsn=false, attrans("This wagon has no seats.") for _,sgr in ipairs(self.assign_to_seat_group) do allow, rsn = self:check_seat_group_access(pname, sgr) if allow then @@ -722,16 +722,16 @@ function wagon:on_rightclick(clicker) self:get_on(clicker, seatid) return else - rsn="Wagon is full." + rsn=attrans("This wagon is full.") end else - rsn="Doors are closed! (try holding sneak key!)" + rsn=attrans("Doors are closed! (Try holding sneak key!)") end end end end end - minetest.chat_send_player(pname, attrans("Can't get on: "..rsn)) + minetest.chat_send_player(pname, rsn or attrans("You can't get on this wagon.")) else self:show_get_on_form(pname) end @@ -1262,7 +1262,7 @@ function wagon:seating_from_key_helper(pname, fields, no) self:show_bordcom(pname) end if fields.dcwarn then - minetest.chat_send_player(pname, attrans("Doors are closed! Use Sneak+rightclick to ignore the closed doors and get off!")) + minetest.chat_send_player(pname, attrans("Doors are closed. Use Sneak+rightclick to ignore the closed doors and get off.")) end if fields.off then self:get_off(no) @@ -1271,7 +1271,7 @@ end function wagon:check_seat_group_access(pname, sgr) local data = advtrains.wagons[self.id] if self.seat_groups[sgr].driving_ctrl_access and not (advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist)) then - return false, "Not allowed to access a driver stand!" + return false, attrans("You are not allowed to access the driver stand.") end if self.seat_groups[sgr].driving_ctrl_access then advtrains.log("Drive", pname, self.object:getpos(), self:train().text_outside) diff --git a/advtrains_interlocking/tsr_rail.lua b/advtrains_interlocking/tsr_rail.lua index f302540..c1e3c1c 100644 --- a/advtrains_interlocking/tsr_rail.lua +++ b/advtrains_interlocking/tsr_rail.lua @@ -3,13 +3,15 @@ -- Simple rail whose only purpose is to place a TSR on the position, as a temporary solution until the timetable system covers everything. -- This code resembles the code in lines/stoprail.lua +local S = attrans + local function updateform(pos) local meta = minetest.get_meta(pos) local pe = advtrains.encode_pos(pos) local npr = advtrains.interlocking.npr_rails[pe] or 2 - meta:set_string("infotext", "Point speed restriction: "..npr) - meta:set_string("formspec", "field[npr;Set point speed restriction:;"..npr.."]") + meta:set_string("infotext", S("Point speed restriction: @1",npr)) + meta:set_string("formspec", "field[npr;"..S("Set point speed restriction:")..";"..npr.."]") end @@ -25,11 +27,11 @@ local adefunc = function(def, preset, suffix, rotation) on_receive_fields = function(pos, formname, fields, player) local pname = player:get_player_name() if not minetest.check_player_privs(pname, {interlocking=true}) then - minetest.chat_send_player(pname, "Interlocking privilege required!") + minetest.chat_send_player(pname, S("You are not allowed to configure this track without the @1 privilege.", "interlocking")) return end if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, "This rail is protected!") + minetest.chat_send_player(pname, S("You are not allowed to configure this track.")) minetest.record_protection_violation(pos, pname) return end @@ -59,7 +61,7 @@ if minetest.get_modpath("advtrains_train_track") ~= nil then models_prefix="advtrains_dtrack", models_suffix=".b3d", shared_texture="advtrains_dtrack_shared_npr.png", - description="Point Speed Restriction Rail", + description=S("Point Speed Restriction Track"), formats={}, get_additional_definiton = adefunc, }, advtrains.trackpresets.t_30deg_straightonly) diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua index 55a4785..6c74a3d 100644 --- a/advtrains_line_automation/stoprail.lua +++ b/advtrains_line_automation/stoprail.lua @@ -28,7 +28,7 @@ local function show_stoprailform(pos, player) local pe = advtrains.encode_pos(pos) local pname = player:get_player_name() if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, "Position is protected!") + minetest.chat_send_player(pname, attrans("You are not allowed to configure this track.")) return end @@ -73,7 +73,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local pos = advtrains.decode_pos(pe) if pos then if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, "Position is protected!") + minetest.chat_send_player(pname, attrans("You are not allowed to configure this track.")) return end @@ -94,7 +94,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then stdata.stn = fields.stn else - minetest.chat_send_player(pname, "Station code '"..fields.stn.."' does already exist and is owned by "..stn.owner) + minetest.chat_send_player(pname, attrans("Station code \"@1\" already exists and is owned by @2.", fields.stn, stn.owner)) show_stoprailform(pos,player) return end @@ -108,7 +108,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then stn.name = fields.stnname else - minetest.chat_send_player(pname, "Not allowed to edit station name, owned by "..stn.owner) + minetest.chat_send_player(pname, attrans("This station is owned by @1. You are not allowed to edit its name.", stn.owner)) end end @@ -218,7 +218,7 @@ if minetest.get_modpath("advtrains_train_track") ~= nil then models_prefix="advtrains_dtrack", models_suffix=".b3d", shared_texture="advtrains_dtrack_shared_stop.png", - description="Station/Stop Rail", + description=attrans("Station/Stop Track"), formats={}, get_additional_definiton = adefunc, }, advtrains.trackpresets.t_30deg_straightonly) diff --git a/advtrains_luaautomation/active_common.lua b/advtrains_luaautomation/active_common.lua index 50fb2bc..1a7009f 100644 --- a/advtrains_luaautomation/active_common.lua +++ b/advtrains_luaautomation/active_common.lua @@ -1,4 +1,4 @@ - +local S = atltrans local ac = {nodes={}} @@ -14,7 +14,7 @@ end function ac.after_place_node(pos, player) local meta=minetest.get_meta(pos) meta:set_string("formspec", ac.getform(pos, meta)) - meta:set_string("infotext", "LuaATC component, unconfigured.") + meta:set_string("infotext", S("Unconfigured LuaATC component")) local ph=minetest.pos_to_string(pos) --just get first available key! for en,_ in pairs(atlatc.envs) do @@ -43,11 +43,11 @@ function ac.getform(pos, meta_p) end local form = "size["..atlatc.CODE_FORM_SIZE.."]" .."style[code;font=mono]" - .."label[0,-0.1;Environment]" + .."label[0,-0.1;"..S("LuaATC Environment").."]" .."dropdown[0,0.3;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" - .."button[5,0.2;2,1;save;Save]" - .."button[7,0.2;3,1;cle;Clear Local Env.]" - .."textarea[0.3,1.5;"..atlatc.CODE_FORM_SIZE..";code;Code;"..minetest.formspec_escape(code).."]" + .."button[5,0.2;2,1;save;"..S("Save").."]" + .."button[7,0.2;3,1;cle;"..S("Clear Local Environment").."]" + .."textarea[0.3,1.5;"..atlatc.CODE_FORM_SIZE..";code;"..S("Code")..";"..minetest.formspec_escape(code).."]" .."label["..atlatc.CODE_FORM_ERRLABELPOS..";"..err.."]" return form end @@ -61,7 +61,7 @@ end function ac.on_receive_fields(pos, formname, fields, player) if not minetest.check_player_privs(player:get_player_name(), {atlatc=true}) then - minetest.chat_send_player(player:get_player_name(), "Missing privilege: atlatc - Operation cancelled!") + minetest.chat_send_player(player:get_player_name(), S("You are not allowed to configure this LuaATC component without the @1 privilege.", "atlatc")) return end @@ -91,9 +91,9 @@ function ac.on_receive_fields(pos, formname, fields, player) meta:set_string("formspec", ac.getform(pos, meta)) if nodetbl.env then - meta:set_string("infotext", "LuaATC component, assigned to environment '"..nodetbl.env.."'") + meta:set_string("infotext", S("LuaATC component assigned to environment '@1'", nodetbl.env)) else - meta:set_string("infotext", "LuaATC component, invalid enviroment set!") + meta:set_string("infotext", S("LuaATC component assigned to an invalid environment")) end end @@ -168,7 +168,7 @@ function ac.run_in_env(pos, evtdata, customfct_p, ignore_no_code) atlatc.active.nodes[ph].err=dataout env:log("error", "LuaATC component at",ph,": LUA Error:",dataout) if meta then - meta:set_string("infotext", "LuaATC component, ERROR:"..dataout) + meta:set_string("infotext", S("LuaATC component with error: @1", dataout)) end --TODO temporary --if customfct.atc_id then diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua index b98648e..f6a7823 100644 --- a/advtrains_luaautomation/atc_rail.lua +++ b/advtrains_luaautomation/atc_rail.lua @@ -220,7 +220,7 @@ advtrains.register_tracks("default", { models_prefix="advtrains_dtrack", models_suffix=".b3d", shared_texture="advtrains_dtrack_shared_atc.png", - description=atltrans("LuaATC Rail"), + description=atltrans("LuaATC Track"), formats={}, get_additional_definiton = function(def, preset, suffix, rotation) return { diff --git a/advtrains_luaautomation/init.lua b/advtrains_luaautomation/init.lua index c51aa71..b359142 100644 --- a/advtrains_luaautomation/init.lua +++ b/advtrains_luaautomation/init.lua @@ -2,15 +2,15 @@ -- Lua automation features for advtrains -- Uses global table 'atlatc' (AdvTrains_LuaATC) ---TODO: re-add localization (if merging localization, discard this hunk please) -atltrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end +atltrans = attrans +local S = atltrans --Privilege --Only trusted players should be enabled to build stuff which can break the server. atlatc = { envs = {}} -minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false }) +minetest.register_privilege("atlatc", { description = S("Can place and configure LuaATC components, including execute potentially harmful Lua code"), give_to_singleplayer = false, default= false }) --Size of code input forms in X,Y notation. Must be at least 10x10 atlatc.CODE_FORM_SIZE = "15,12" diff --git a/advtrains_luaautomation/mesecon_controller.lua b/advtrains_luaautomation/mesecon_controller.lua index bffff84..6981839 100644 --- a/advtrains_luaautomation/mesecon_controller.lua +++ b/advtrains_luaautomation/mesecon_controller.lua @@ -6,6 +6,7 @@ -- From Mesecons mod https://mesecons.net/ -- (c) Jeija and Contributors +local S = atltrans local BASENAME = "advtrains_luaautomation:mesecon_controller" local rules = { @@ -207,7 +208,7 @@ for d = 0, 1 do } minetest.register_node(node_name, { - description = "LuaATC Mesecon Controller", + description = S("LuaATC Mesecon Controller"), drawtype = "nodebox", tiles = { top, diff --git a/advtrains_luaautomation/operation_panel.lua b/advtrains_luaautomation/operation_panel.lua index c118ff3..8e12651 100644 --- a/advtrains_luaautomation/operation_panel.lua +++ b/advtrains_luaautomation/operation_panel.lua @@ -1,3 +1,4 @@ +local S = atltrans local function on_punch(pos,node,player) atlatc.interrupt.add(0, pos, {type="punch", punch=true, name=player:get_player_name()}) @@ -7,7 +8,7 @@ end minetest.register_node("advtrains_luaautomation:oppanel", { drawtype = "normal", tiles={"atlatc_oppanel.png"}, - description = "LuaATC operation panel", + description = S("LuaATC Operation Panel"), groups = { cracky = 1, save_in_at_nodedb=1, diff --git a/advtrains_luaautomation/pcnaming.lua b/advtrains_luaautomation/pcnaming.lua index 5624b74..0089ae7 100644 --- a/advtrains_luaautomation/pcnaming.lua +++ b/advtrains_luaautomation/pcnaming.lua @@ -2,6 +2,8 @@ --a.k.a Passive component naming --Allows to assign names to passive components, so they can be called like: --setstate("iamasignal", "green") +local S = atltrans + atlatc.pcnaming={name_map={}} function atlatc.pcnaming.load(stuff) if type(stuff)=="table" then @@ -26,7 +28,7 @@ end local pcrename = {} minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ - description = attrans("Passive Component Naming Tool\n\nRight-click to name a passive component."), + description = S("Passive Component Naming Tool\n\nRight-click to name a passive component."), groups = {cracky=1}, -- key=name, value=rating; rating=1..3. inventory_image = "atlatc_pcnaming.png", wield_image = "atlatc_pcnaming.png", @@ -37,7 +39,7 @@ minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ return end if not minetest.check_player_privs(pname, {atlatc=true}) then - minetest.chat_send_player(pname, "Missing privilege: atlatc") + minetest.chat_send_player(pname, S("You are not allowed to name LuaATC passive components without the @1 privilege.", "atlatc")) return end if pointed_thing.type=="node" then @@ -62,7 +64,7 @@ minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ end end pcrename[pname] = pos - minetest.show_formspec(pname, "atlatc_naming", "field[pn;Set name of component (empty to clear);"..minetest.formspec_escape(pn).."]") + minetest.show_formspec(pname, "atlatc_naming", "field[pn;"..S("Set name of component (empty to clear)")..";"..minetest.formspec_escape(pn).."]") end end end, -- cgit v1.2.3 From 6d3c5a5f38d66a74c7b2bc219ee16f258ba50a2b Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Tue, 22 Oct 2024 06:59:16 +0800 Subject: Wagon iterator, lookup by id, and use them in code --- advtrains/trainlogic.lua | 19 +++------ advtrains/wagons.lua | 108 ++++++++++++++++++++++++++++++----------------- 2 files changed, 75 insertions(+), 52 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index f136577..ce646da 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -142,13 +142,8 @@ minetest.register_on_joinplayer(function(player) local pname = player:get_player_name() local id=advtrains.player_to_train_mapping[pname] if id then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id then - local wdata = advtrains.wagons[wagon.id] - if wdata and wdata.train_id == id then - wagon:reattach_all() - end - end + for _, wagon in advtrains.wagon_entity_pairs_in_train(id) do + wagon:reattach_all() end end end) @@ -160,12 +155,10 @@ minetest.register_on_dieplayer(function(player) if id then local train=advtrains.trains[id] if not train then advtrains.player_to_train_mapping[pname]=nil return end - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.train_id==id then - --when player dies, detach him from the train - --call get_off_plr on every wagon since we don't know which one he's on. - wagon:get_off_plr(pname) - end + for _, wagon in advtrains.wagon_entity_pairs_in_train(id) do + --when player dies, detach him from the train + --call get_off_plr on every wagon since we don't know which one he's on. + wagon:get_off_plr(pname) end -- just in case no wagon felt responsible for this player: clear train mapping advtrains.player_to_train_mapping[pname] = nil diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 993d7d3..ddff2f5 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1103,12 +1103,11 @@ function wagon:handle_bordcom_fields(pname, formname, fields) for i, tpid in ipairs(train.trainparts) do if fields["dcpl_"..i] then advtrains.safe_decouple_wagon(tpid, pname) - elseif fields["wgprp"..i] then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id==tpid and data.owner==pname then - wagon:show_wagon_properties(pname) - return - end + elseif fields["wgprp"..i] and data.owner==pname then + local wagon = advtrains.get_wagon_entity(tpid) + if wagon then + wagon:show_wagon_properties(pname) + return end end end @@ -1154,44 +1153,48 @@ end minetest.register_on_player_receive_fields(function(player, formname, fields) local uid=string.match(formname, "^advtrains_geton_(.+)$") if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id==uid then - local data = advtrains.wagons[wagon.id] - if fields.inv then - if wagon.has_inventory and wagon.get_inventory_formspec then - minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..uid, wagon:get_inventory_formspec(player:get_player_name(), make_inv_name(uid))) - end - elseif fields.seat then - local val=minetest.explode_textlist_event(fields.seat) - if val and val.type~="INV" and not data.seatp[player:get_player_name()] then - --get on - wagon:get_on(player, val.index) - --will work with the new close_formspec functionality. close exactly this formspec. - minetest.show_formspec(player:get_player_name(), formname, "") - end + local wagon = advtrains.get_wagon_entity(uid) + if wagon then + local data = advtrains.wagons[wagon.id] + if fields.inv then + if wagon.has_inventory and wagon.get_inventory_formspec then + minetest.show_formspec(player:get_player_name(), "advtrains_inv_"..uid, wagon:get_inventory_formspec(player:get_player_name(), make_inv_name(uid))) + end + elseif fields.seat then + local val=minetest.explode_textlist_event(fields.seat) + if val and val.type~="INV" and not data.seatp[player:get_player_name()] then + --get on + wagon:get_on(player, val.index) + --will work with the new close_formspec functionality. close exactly this formspec. + minetest.show_formspec(player:get_player_name(), formname, "") end end end + return true end + uid=string.match(formname, "^advtrains_seating_(.+)$") if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id==uid then - local pname=player:get_player_name() - local no=wagon:get_seatno(pname) - if no then - if wagon.seat_groups then - wagon:seating_from_key_helper(pname, fields, no) - end + local wagon = advtrains.get_wagon_entity(uid) + if wagon then + local pname=player:get_player_name() + local no=wagon:get_seatno(pname) + if no then + if wagon.seat_groups then + wagon:seating_from_key_helper(pname, fields, no) end end end + return true end + uid=string.match(formname, "^advtrains_prop_(.+)$") if uid then local pname=player:get_player_name() local data = advtrains.wagons[uid] - if pname~=data.owner and not minetest.check_player_privs(pname, {train_admin = true}) then + if not data then + return true + elseif pname~=data.owner and not minetest.check_player_privs(pname, {train_admin = true}) then return true end if fields.save or not fields.quit then @@ -1213,29 +1216,32 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) wagon.show_wagon_properties({id=uid}, pname) end end + return true end uid=string.match(formname, "^advtrains_bordcom_(.+)$") if uid then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id==uid then - wagon:handle_bordcom_fields(player:get_player_name(), formname, fields) - end + local wagon = advtrains.get_wagon_entity(uid) + if wagon then + wagon:handle_bordcom_fields(player:get_player_name(), formname, fields) end + return true end + uid=string.match(formname, "^advtrains_inv_(.+)$") if uid then local pname=player:get_player_name() local data = advtrains.wagons[uid] if fields.prop and data.owner==pname then - for _,wagon in pairs(minetest.luaentities) do - if wagon.is_wagon and wagon.initialized and wagon.id==uid and data.owner==pname then - wagon:show_wagon_properties(pname) - --wagon:handle_bordcom_fields(player:get_player_name(), formname, fields) - end + local wagon = advtrains.get_wagon_entity(uid) + if wagon then + wagon:show_wagon_properties(pname) + --wagon:handle_bordcom_fields(player:get_player_name(), formname, fields) end end + return true end end) + function wagon:seating_from_key_helper(pname, fields, no) local data = advtrains.wagons[self.id] local sgr=self.seats[no].group @@ -1507,3 +1513,27 @@ function advtrains.get_wagon_at_index(train_id, w_index) -- nothing found, dist must be further back return nil end + +function advtrains.get_wagon_entity(wagon_id) + if not advtrains.wagons[wagon_id] then return end + local object = advtrains.wagon_objects[wagon_id] + if object then + return object:get_luaentity() + end +end + +function advtrains.next_wagon_entity_in_train(train, i) + local wagon_id = train.trainparts[i + 1] + if wagon_id then + local wagon = advtrains.get_wagon_entity(wagon_id) + if wagon then + return i + 1, wagon + end + end +end + +function advtrains.wagon_entity_pairs_in_train(train_id) + local train = advtrains.trains[train_id] + if not train then return function() end end + return advtrains.next_wagon_entity_in_train, train, 0 +end -- cgit v1.2.3 From 671cb16e9599f9989cf5b12f76f1eb0a21252172 Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Sun, 8 Sep 2024 08:57:32 +0800 Subject: Allow operate on_rightclick nodes with track placers and wagon placers Press sneak to force default behavior. --- advtrains/trackplacer.lua | 21 +++++++++++++++++---- advtrains/wagons.lua | 22 ++++++++++++++++------ 2 files changed, 33 insertions(+), 10 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua index 9f97171..2588088 100644 --- a/advtrains/trackplacer.lua +++ b/advtrains/trackplacer.lua @@ -275,11 +275,24 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname, def) groups={advtrains_trackplacer=1, digtron_on_place=1}, liquids_pointable = def.liquids_pointable, on_place = function(itemstack, placer, pointed_thing) - local name = placer:get_player_name() - if not name then - return itemstack, false - end if pointed_thing.type=="node" then + do + local pointed_pos = pointed_thing.under + local pointed_node = minetest.get_node(pointed_pos) + local pointed_def = minetest.registered_nodes[pointed_node.name] + if pointed_def and pointed_def.on_rightclick then + local controls = placer:get_player_control() + if not controls.sneak then + return pointed_def.on_rightclick(pointed_pos, pointed_node, placer, itemstack, pointed_thing) + end + end + end + + local name = placer:get_player_name() + if not name then + return itemstack, false + end + local pos=pointed_thing.above local upos=vector.subtract(pointed_thing.above, {x=0, y=1, z=0}) if not advtrains.check_track_protection(pos, name) then diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index ddff2f5..50ce4ab 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1393,13 +1393,23 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati groups = wagon_groups, on_place = function(itemstack, placer, pointed_thing) - if not pointed_thing.type == "node" then + if pointed_thing.type ~= "node" then return end + + local pos = pointed_thing.under + local node = minetest.get_node(pos) + local pointed_def = minetest.registered_nodes[node.name] + if pointed_def and pointed_def.on_rightclick then + local controls = placer:get_player_control() + if not controls.sneak then + return pointed_def.on_rightclick(pos, node, placer, itemstack, pointed_thing) + end + end + local pname = placer:get_player_name() - local node=minetest.get_node_or_nil(pointed_thing.under) - if not node then atprint("[advtrains]Ignore at placer position") return itemstack end + if node.name == "ignore" then atprint("[advtrains]Ignore at placer position") return itemstack end local nodename=node.name if(not advtrains.is_track_and_drives_on(nodename, prototype.drives_on)) then atprint("no track here, not placing.") @@ -1409,14 +1419,14 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati minetest.chat_send_player(pname, "You don't have the train_operator privilege.") return itemstack end - if not minetest.check_player_privs(placer, {train_admin = true }) and minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + if not minetest.check_player_privs(placer, {train_admin = true }) and minetest.is_protected(pos, placer:get_player_name()) then return itemstack end local tconns=advtrains.get_track_connections(node.name, node.param2) local yaw = placer:get_look_horizontal() local plconnid = advtrains.yawToClosestConn(yaw, tconns) - local prevpos = advtrains.get_adjacent_rail(pointed_thing.under, tconns, plconnid, prototype.drives_on) + local prevpos = advtrains.get_adjacent_rail(pos, tconns, plconnid, prototype.drives_on) if not prevpos then minetest.chat_send_player(pname, "The track you are trying to place the wagon on is not long enough!") return @@ -1424,7 +1434,7 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati local wid = advtrains.create_wagon(sysname, pname) - local id=advtrains.create_new_train_at(pointed_thing.under, plconnid, 0, {wid}) + local id=advtrains.create_new_train_at(pos, plconnid, 0, {wid}) if not advtrains.is_creative(pname) then itemstack:take_item() -- cgit v1.2.3 From 66868e2eefe97b7a6d35fa3fecc895b9c7bbc4cc Mon Sep 17 00:00:00 2001 From: "Y. Wang" Date: Thu, 19 Sep 2024 18:39:19 +0000 Subject: Address wagon aliasing issues As it turns out, not fully testing new features is not necessarily a good idea ... This patch follows up 1F616EMO's patch by * Making get_wagon_prototype return the resolved alias, * Handling recursive wagon alises (in particular, loops), and * Adding (partial) unittest for the wagon aliasing system. [v2]: The testcases are complemented a bit more to cover situations where the alias resolution system should return nil. [v2]: This patch should hopefully also warn about not spawning wagons. Note that this only warns about the missing wagon entity and does _not_ actually fix the issue. How to test: * In a world with both advtrains_train_subway and advtrains_train_japan enabled, place a subway wagon, a Japanese engine, and a regular Japanese wagon. * Add the test mod to the world; do NOT remove advtrains_train_japan. * Restart the world. Notice that the Japanese wagons still appear as Japanese wagons despite being aliased to subway wagons. * Restart the world without the advtrains_train_japan mod. Notice that the engine appears as the subway wagon while the regular Japanese wagon appears as the wagon placeholder. [v2]: Also note that the warning message about the missing wagon prototype still mentions the regular Japanese wagon. * Restart the world again with the advtrains_train_japan mod. Notice that both type of Japanese wagons reappear as Japanese wagons. * Observe that unittests work. Test mod: advtrains.register_wagon_alias("advtrains:engine_japan", "advtrains:subway_wagon") advtrains.register_wagon_alias("advtrains:wagon_japan", "advtrains:wagon_japan") --- advtrains/spec/wagons_spec.lua | 40 ++++++++++++++++++++++++++++++++++++++++ advtrains/trainlogic.lua | 13 +++++++++++-- advtrains/wagons.lua | 35 +++++++++++++++++++++++------------ 3 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 advtrains/spec/wagons_spec.lua (limited to 'advtrains/wagons.lua') diff --git a/advtrains/spec/wagons_spec.lua b/advtrains/spec/wagons_spec.lua new file mode 100644 index 0000000..df0687b --- /dev/null +++ b/advtrains/spec/wagons_spec.lua @@ -0,0 +1,40 @@ +require "mineunit" +mineunit "core" + +_G.advtrains = { + wagon_load_range = 32 +} +sourcefile "wagons" + +local myproto = {_test = true} +advtrains.register_wagon(":mywagon", myproto, "My wagon", "", false) +advtrains.register_wagon_alias(":myalias", ":mywagon") +advtrains.register_wagon_alias(":myotheralias", ":myalias") + +local myotherproto = {_other = true} +advtrains.register_wagon(":noalias", myotherproto, "Not aliased wagon", "", false) +advtrains.register_wagon_alias(":noalias", ":mywagon") + +advtrains.register_wagon_alias(":nilalias", ":nil") + +advtrains.register_wagon_alias(":R1", ":R2") +advtrains.register_wagon_alias(":R2", ":R3") +advtrains.register_wagon_alias(":R3", ":R1") + +describe("wagon alias system", function() + it("should work", function() + assert.same({":mywagon", myproto}, {advtrains.resolve_wagon_alias(":myalias")}) + assert.equal(myproto, advtrains.wagon_prototypes[":myalias"]) + assert.same({":mywagon", myproto}, {advtrains.resolve_wagon_alias(":myotheralias")}) + end) + it("should respect wagon registration", function() + assert.same({":noalias", myotherproto}, {advtrains.resolve_wagon_alias(":noalias")}) + end) + it("should handle recursive loops", function() + assert.same({}, {advtrains.resolve_wagon_alias(":R1")}) + end) + it("should return nil for missing entries", function() + assert.same({}, {advtrains.resolve_wagon_alias(":what")}) + assert.same({}, {advtrains.resolve_wagon_alias(":nilalias")}) + end) +end) diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 796aae9..3b006d2 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -1113,8 +1113,17 @@ function advtrains.spawn_wagons(train_id) if advtrains.position_in_range(pos, ablkrng) then --atdebug("wagon",w_id,"spawning") local wt = advtrains.get_wagon_prototype(data) - local wagon = minetest.add_entity(pos, wt):get_luaentity() - wagon:set_id(w_id) + local wobj = minetest.add_entity(pos, wt) + if not wobj then + atwarn("Failed to spawn wagon", w_id, "of type", wt) + else + local wagon = wobj:get_luaentity() + if not wagon then + atwarn("Wagon", w_id, "of type", wt, "spawned with nil luaentity") + else + wagon:set_id(w_id) + end + end end end else diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 50ce4ab..8bb12ee 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -16,15 +16,8 @@ advtrains.wagons = {} advtrains.wagon_alias = {} advtrains.wagon_prototypes = setmetatable({}, { __index = function(t, k) - local rtn_val = rawget(t, k) - if rtn_val ~= nil then - return rtn_val - end - local alias = advtrains.wagon_alias[k] - if alias then - return rawget(t, alias) - end - return nil + local _, proto = advtrains.resolve_wagon_alias(k) + return proto end }) advtrains.wagon_objects = {} @@ -1338,17 +1331,35 @@ function advtrains.get_wagon_prototype(data) data.type = data.entity_name data.entity_name = nil end - if not wt or not advtrains.wagon_prototypes[wt] then + local rt, proto = advtrains.resolve_wagon_alias(wt) + if not rt then atwarn("Unable to load wagon type",wt,", using placeholder") - wt="advtrains:wagon_placeholder" + rt = "advtrains:wagon_placeholder" + proto = advtrains.wagon_prototypes[rt] end - return wt, advtrains.wagon_prototypes[wt] + return rt, proto end function advtrains.register_wagon_alias(src, dst) advtrains.wagon_alias[src] = dst end +local function recursive_resolve_alias(name, seen) + local prototype = rawget(advtrains.wagon_prototypes, name) + if prototype then + return name, prototype + end + local resolved = advtrains.wagon_alias[name] + if resolved and not seen[resolved] then + seen[name] = true + return recursive_resolve_alias(resolved, seen) + end +end + +function advtrains.resolve_wagon_alias(name) + return recursive_resolve_alias(name, {}) +end + function advtrains.standard_inventory_formspec(self, pname, invname) --[[minetest.chat_send_player(pname, string.format("self=%s, pname=%s, invname=%s", self, pname, invname)) for k,v in pairs(self) do -- cgit v1.2.3 From e53670904127c8493e13b587e507407f2beac8b3 Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Sun, 29 Sep 2024 06:37:40 +0800 Subject: Fix depercated functions --- advtrains/couple.lua | 6 +++--- advtrains/trainhud.lua | 12 +++++++----- advtrains/wagons.lua | 10 +++++----- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/couple.lua b/advtrains/couple.lua index cbeb661..795419c 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -453,7 +453,7 @@ minetest.register_entity("advtrains:discouple", { self.object:remove() return end - --getyaw seems to be a reliable method to check if an object is loaded...if it returns nil, it is not. + --get_yaw seems to be a reliable method to check if an object is loaded...if it returns nil, it is not. if not self.wagon.object:get_yaw() then self.object:remove() return @@ -500,7 +500,7 @@ minetest.register_entity("advtrains:couple", { self.object:remove() end, on_step=function(self, dtime) - if advtrains.wagon_outside_range(self.object:getpos()) then + if advtrains.wagon_outside_range(self.object:get_pos()) then --atdebug("Couple Removing outside range") self.object:remove() return @@ -539,7 +539,7 @@ minetest.register_entity("advtrains:couple", { tp2=advtrains.path_get_interpolated(train2, train2.end_index) end local pos_median=advtrains.pos_median(tp1, tp2) - if not vector.equals(pos_median, self.object:getpos()) then + if not vector.equals(pos_median, self.object:get_pos()) then self.object:set_pos(pos_median) end self.position_set=true diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua index f9f4876..ce4b913 100644 --- a/advtrains/trainhud.lua +++ b/advtrains/trainhud.lua @@ -10,6 +10,8 @@ advtrains.hud[player:get_player_name()] = nil advtrains.hhud[player:get_player_name()] = nil end) +local hud_type_key = minetest.features.hud_def_type_field and "type" or "hud_elem_type" + local mletter={[1]="F", [-1]="R", [0]="N"} function advtrains.on_control_change(pc, train, flip) @@ -105,7 +107,7 @@ function advtrains.set_trainhud(name, text, driver) end local drivertext = driver or "" local driverhud = { - hud_elem_type = "image", + [hud_type_key] = "image", name = "ADVTRAINS_DRIVER", position = {x=0.5, y=1}, offset = {x=0,y=-170}, @@ -116,8 +118,8 @@ function advtrains.set_trainhud(name, text, driver) if not hud then hud = {} advtrains.hud[name] = hud - hud.id = player:hud_add { - hud_elem_type = "text", + hud.id = player:hud_add({ + [hud_type_key] = "text", name = "ADVTRAINS", number = 0xFFFFFF, position = {x=0.5, y=1}, @@ -125,7 +127,7 @@ function advtrains.set_trainhud(name, text, driver) text = text, scale = {x=200, y=60}, alignment = {x=0, y=-1}, - } + }) hud.driver = player:hud_add(driverhud) hud.oldText = text hud.oldDriver = drivertext @@ -156,7 +158,7 @@ function advtrains.set_help_hud(name, text) hud = {} advtrains.hhud[name] = hud hud.id = player:hud_add({ - hud_elem_type = "text", + [hud_type_key] = "text", name = "ADVTRAINS_HELP", number = 0xFFFFFF, position = {x=1, y=0.3}, diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 8bb12ee..cf15871 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -286,7 +286,7 @@ function wagon:on_step(dtime) local data = advtrains.wagons[self.id] if not pos then - --atdebug("["..self.id.."][fatal] missing position (object:getpos() returned nil)") + --atdebug("["..self.id.."][fatal] missing position (object:get_pos() returned nil)") return end @@ -820,8 +820,8 @@ function wagon:get_off(seatno) end --if not door_entry, or paths missing, fall back to old method --atdebug("using fallback") - local objpos=advtrains.round_vector_floor_y(self.object:getpos()) - local yaw=self.object:getyaw() + local objpos=advtrains.round_vector_floor_y(self.object:get_pos()) + local yaw=self.object:get_yaw() local isx=(yaw < math.pi/4) or (yaw > 3*math.pi/4 and yaw < 5*math.pi/4) or (yaw > 7*math.pi/4) local offp --abuse helper function @@ -899,7 +899,7 @@ end --BordCom local function checkcouple(ent) - if not ent or not ent:getyaw() then + if not ent or not ent:get_yaw() then return nil end local le = ent:get_luaentity() @@ -1273,7 +1273,7 @@ function wagon:check_seat_group_access(pname, sgr) return false, attrans("You are not allowed to access the driver stand.") end if self.seat_groups[sgr].driving_ctrl_access then - advtrains.log("Drive", pname, self.object:getpos(), self:train().text_outside) + advtrains.log("Drive", pname, self.object:get_pos(), self:train().text_outside) end return true end -- cgit v1.2.3 From 8c91ce1ec178d6d49f3ddefc57d99eecd0caef3c Mon Sep 17 00:00:00 2001 From: orwell Date: Thu, 9 Jan 2025 00:57:32 +0100 Subject: Various bugfixes found in lunixforks debug --- advtrains/occupation.lua | 4 ++-- advtrains/trainlogic.lua | 4 ++-- advtrains/wagons.lua | 2 +- advtrains_interlocking/database.lua | 9 +++++---- advtrains_interlocking/route_ui.lua | 2 +- advtrains_interlocking/routesetting.lua | 9 ++++++--- advtrains_interlocking/signal_api.lua | 1 + advtrains_interlocking/tcb_ts_ui.lua | 5 ++++- advtrains_luaautomation/environment.lua | 10 +++++++--- 9 files changed, 29 insertions(+), 17 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/occupation.lua b/advtrains/occupation.lua index 26e1f79..20a986e 100644 --- a/advtrains/occupation.lua +++ b/advtrains/occupation.lua @@ -89,8 +89,8 @@ function o.set_item(train_id, pos, idx) assert(idx) local i = 1 while t[i] do - if t[i]==train_id and t[i+1]==index then - break + if t[i]==train_id and t[i+1]==idx then + return end i = i + 2 end diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index e4939df..0e588c7 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -630,7 +630,7 @@ function advtrains.train_step_b(id, train, dtime) local ocn = otrn.path_cn[ob_idx] local ocp = otrn.path_cp[ob_idx] - local target_is_inside, ref_index, facing + local target_is_inside, ref_index, facing, same_dir if base_cn == ocn then -- same direction @@ -1049,7 +1049,7 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate) if not wagon then local ent = advtrains.wagon_objects[w_id] local pdesc - if ent then + if ent and ent:get_pos() then pdesc = "at " .. minetest.pos_to_string(ent:get_pos()) elseif train.last_pos then pdesc = "near " .. minetest.pos_to_string(train.last_pos) diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index ef057e5..01c60ec 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1333,7 +1333,7 @@ function advtrains.get_wagon_prototype(data) end local rt, proto = advtrains.resolve_wagon_alias(wt) if not rt then - atwarn("Unable to load wagon type",wt,", using placeholder") + --atwarn("Unable to load wagon type",wt,", using placeholder") rt = "advtrains:wagon_placeholder" proto = advtrains.wagon_prototypes[rt] end diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua index 9c72a72..d80fb76 100644 --- a/advtrains_interlocking/database.lua +++ b/advtrains_interlocking/database.lua @@ -84,7 +84,7 @@ function ildb.load(data) if pos then -- that was a pos_to_string local epos = advtrains.encode_pos(pos) - --atdebug("ILDB converting TCB position format",pts,"->",epos) + atdebug("ILDB converting TCB position format",pts,"->",epos) track_circuit_breaks[epos] = tcb else -- keep entry, it is already new @@ -100,7 +100,7 @@ function ildb.load(data) local lpos = minetest.string_to_pos(lpts) if lpos then local epos = advtrains.encode_pos(lpos) - --atdebug("ILDB converting tcb",pts,"side",t_side,"route",t_route,"lock position format",lpts,"->",epos) + atdebug("ILDB converting tcb",pts,"side",t_side,"route",t_route,"lock position format",lpts,"->",epos) locks_n[epos] = state else -- already correct format @@ -131,7 +131,7 @@ function ildb.load(data) if pos then -- that was a pos_to_string local epos = advtrains.encode_pos(pos) - --atdebug("ILDB converting Route Lock position format",pts,"->",epos) + atdebug("ILDB converting Route Lock position format",pts,"->",epos) advtrains.interlocking.route.rte_locks[epos] = lta else -- keep entry, it is already new @@ -412,6 +412,7 @@ function ildb.check_and_repair_ts_at_pos(pos, tcb_connid, notify_pname, force_cr return ildb.repair_ts_merge_all(all_tcbs, force_create, notify_pname) end --tsrepair_notify(notify_pname, "Found section", ts.name or ts_id, "here.") + ildb.update_rs_cache(ts_id) return ts_id end @@ -457,7 +458,7 @@ function ildb.get_all_tcbs_adjacent(inipos, inidir, per_track_callback) pos, connid = ti:next_branch() --atdebug("get_all_tcbs_adjacent: BRANCH: ",pos, connid) bconnid = nil - is_branch_start = true + local is_branch_start = true repeat -- callback if per_track_callback then diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua index 7dddc6e..3c7bd64 100644 --- a/advtrains_interlocking/route_ui.lua +++ b/advtrains_interlocking/route_ui.lua @@ -67,7 +67,7 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx) if c_rseg.locks then for pts, state in pairs(c_rseg.locks) do - local pos = minetest.string_to_pos(pts) + local pos = advtrains.decode_pos(pts) itab(i, "L "..pts.." -> "..state, "lock", pos) if not advtrains.is_passive(pos) then itab(i, "-!- No passive component at "..pts..". Please reconfigure route!", "err", nil) diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index 28c8c3c..0668e62 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -104,7 +104,7 @@ function ilrs.set_route(signal, route, try) end for lp, state in pairs(c_locks) do - local confl = ilrs.has_route_lock(pts, state) + local confl = ilrs.has_route_lock(lp, state) local pos = advtrains.decode_pos(lp) if advtrains.is_passive(pos) then @@ -131,7 +131,8 @@ function ilrs.set_route(signal, route, try) local nvar = c_rseg.next if nvar then local re_tcbs = ildb.get_tcbs({p = nvar.p, s = (nvar.s==1) and 2 or 1}) - if not re_tcbs or not re_tcbs.ts_id or re_tcbs.ts_id~=c_ts_id then + if (not re_tcbs or not re_tcbs.ts_id or re_tcbs.ts_id~=c_ts_id) + and route[i+1] then --FIX 2025-01-08: in old worlds the final TCB may be wrong (it didn't matter back then), don't error out here (route still shown invalid in UI) if not try then atwarn("Encountered inconsistent ts (front~=back) while a real run of routesetting routine, at position",pts,"while setting route",rtename,"of",signal) end return false, "TCB at "..minetest.pos_to_string(nvar.p).." has different section than previous TCB. Please update track section or reconfigure route!" end @@ -413,7 +414,9 @@ function ilrs.update_route(sigd, tcbs, newrte, cancel) -- set_route now sets the signal aspects --has_changed_aspect = true -- route success. apply default_autoworking flag if requested - tcbs.route_auto = route.default_autoworking + if route.default_autoworking then + tcbs.route_auto = true --FIX 2025-01-08: never set it to false if it was true! + end end end if has_changed_aspect then diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua index b607750..e92658d 100644 --- a/advtrains_interlocking/signal_api.lua +++ b/advtrains_interlocking/signal_api.lua @@ -375,6 +375,7 @@ function signal.reapply_aspect(pts) local rem_aspt = signal.aspects[remote] --atdebug("resolving remote",advtrains.decode_pos(remote),"aspt",rem_aspt) local rem_pos = advtrains.decode_pos(remote) + local _,rem_ndef rem_masp, _, _, rem_ndef = signal.get_aspect_internal(rem_pos, rem_aspt) if rem_masp then if rem_ndef.advtrains and rem_ndef.advtrains.get_aspect_info then diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua index 59d3be4..814a11a 100755 --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -776,7 +776,7 @@ function advtrains.interlocking.check_route_valid(route, sigd) if c_rseg.locks then for pts, state in pairs(c_rseg.locks) do - local pos = minetest.string_to_pos(pts) + local pos = advtrains.decode_pos(pts) if not advtrains.is_passive(pos) then return false, "No passive component for lock at "..pts end @@ -795,6 +795,9 @@ function advtrains.interlocking.check_route_valid(route, sigd) i = i + 1 end -- check end TCB + if not c_sigd then + return false, "Final TCBS unset (legacy-style buffer route)" + end c_tcbs = ildb.get_tcbs(c_sigd) if not c_tcbs then return false, "Final TCBS missing at "..sigd_to_string(c_sigd) diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua index b54d45c..a6ed2c7 100644 --- a/advtrains_luaautomation/environment.lua +++ b/advtrains_luaautomation/environment.lua @@ -226,11 +226,15 @@ if advtrains.interlocking then end static_env.get_aspect = function(signal) local pos = atlatc.pcnaming.resolve_pos(signal) - return advtrains.interlocking.signal_get_aspect(pos) + return advtrains.interlocking.signal.get_aspect_info(pos) end - static_env.set_aspect = function(signal, asp) + static_env.set_aspect = function(signal, main_asp, rem_signal) + if type(main_asp) == "table" then + error("set_aspect: Parameters of this method have changed to (signal, main_asp, rem_signal) with introduction of distant signalling: parameter 2 is now the main aspect name (a string)") + end local pos = atlatc.pcnaming.resolve_pos(signal) - return advtrains.interlocking.signal_set_aspect(pos,asp) + local rem_pos = rem_signal and atlatc.pcnaming.resolve_pos(rem_signal) + return advtrains.interlocking.signal_set_aspect(pos, main_asp, rem_pos) end --section_occupancy() -- cgit v1.2.3 From 6566e6fbca46ad16552a11ef9d7a22ae21698e3d Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Tue, 24 Dec 2024 21:05:17 +0800 Subject: Allow boarding wagons with irregular width from the platform (i.e. width ~= 3) Extends detection to the whole span of the wagon's width (to be consistent with previous behaviors, the middle is only included if width = 1). --- advtrains/wagons.lua | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 01c60ec..1a7e1f0 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -461,26 +461,34 @@ function wagon:on_step(dtime) --needs to know index and path if train.velocity==0 and self.door_entry and train.door_open and train.door_open~=0 then --using the mapping created by the trainlogic globalstep + local platform_offset = math.floor(self.wagon_width / 2) for i, ino in ipairs(self.door_entry) do --fct is the flipstate flag from door animation above local aci = advtrains.path_get_index_by_offset(train, index, ino*fct) local ix1, ix2 = advtrains.path_get_adjacent(train, aci) -- the two wanted positions are ix1 and ix2 + (2nd-1st rotated by 90deg) -- (x z) rotated by 90deg is (-z x) (http://stackoverflow.com/a/4780141) - local add = { x = (ix2.z-ix1.z)*train.door_open, y = 0, z = (ix1.x-ix2.x)*train.door_open } - local pts1=vector.round(vector.add(ix1, add)) - local pts2=vector.round(vector.add(ix2, add)) - if minetest.get_item_group(minetest.get_node(pts1).name, "platform")>0 then - local ckpts={ - pts1, - pts2, - vector.add(pts1, {x=0, y=1, z=0}), - vector.add(pts2, {x=0, y=1, z=0}), - } - for _,ckpos in ipairs(ckpts) do - local cpp=minetest.pos_to_string(ckpos) - if advtrains.playersbypts[cpp] then - self:on_rightclick(advtrains.playersbypts[cpp]) + local add = { + x = atround((ix2.z-ix1.z)*train.door_open), + y = 0, + z = atround((ix1.x-ix2.x)*train.door_open) + } + for offset = (platform_offset == 0 and 0 or 1), platform_offset do + local scaled_add = vector.multiply(add, offset) + local pts1=vector.add(ix1, scaled_add) + local pts2=vector.add(ix2, scaled_add) + if minetest.get_item_group(minetest.get_node(pts1).name, "platform")>0 then + local ckpts={ + pts1, + pts2, + vector.add(pts1, {x=0, y=1, z=0}), + vector.add(pts2, {x=0, y=1, z=0}), + } + for _,ckpos in ipairs(ckpts) do + local cpp=minetest.pos_to_string(ckpos) + if advtrains.playersbypts[cpp] then + self:on_rightclick(advtrains.playersbypts[cpp]) + end end end end -- cgit v1.2.3 From 7f085d194d403f60732caa2228ea7024d060042d Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Mon, 24 Mar 2025 22:55:22 +0100 Subject: Add wagon owner to Wagon Properties formspec --- advtrains/wagons.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 1a7e1f0..52d39b7 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -881,8 +881,8 @@ function wagon:show_wagon_properties(pname) button: save ]] local data = advtrains.wagons[self.id] - local form="size[5,5]" - form=form.."label[0.2,0;"..attrans("This Wagon ID")..": "..self.id.."]" + local form = "size[5,5]" + form = form.."label[0.2,0;"..attrans("This Wagon ID")..": "..self.id.." ("..data.owner..")]" form = form .. "field[0.5,1;4.5,1;whitelist;Allow these players to access your wagon:;"..minetest.formspec_escape(data.whitelist or "").."]" form = form .. "field[0.5,2;4.5,1;roadnumber;Wagon road number:;"..minetest.formspec_escape(data.roadnumber or "").."]" local fc = "" -- cgit v1.2.3 From a4a0151504c5764c183830fc0b71c777f75e7119 Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Fri, 7 Feb 2025 22:43:19 +0800 Subject: Add /at_chown to allow changing wagon ownership --- advtrains/wagons.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 52d39b7..10576c3 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -1565,3 +1565,32 @@ function advtrains.wagon_entity_pairs_in_train(train_id) if not train then return function() end end return advtrains.next_wagon_entity_in_train, train, 0 end + +minetest.register_chatcommand("at_chown", { + params = " ", + description = "Change the owner of an advtrains wagon", + privs = {train_admin=true}, + func = function(name, param) + local params = string.split(param," ") + local wid = params[1] + local new_owner = params[2] + if not wid then return false end --no params added + --player name checks + if not new_owner then return false, attrans("Please specify a player name to transfer ownership to.") end --no player name argument + if not core.player_exists(new_owner) then return false, attrans("That player does not exist!") end --is a valid player + --wagon id checks + if not wid:match("%d%d%d%d%d%d") then return false, attrans("Not a valid wagon id.") end -- invalid wagon id + local w_data = advtrains.wagons[wid] + if not w_data then return false, attrans("That wagon does not exist!") end + -- actually chown the wagon + local curr_owner = w_data.owner + w_data.owner = new_owner + advtrains.wagons[wid] = w_data + advtrains.log("Chown", name, core.get_player_by_name(name):get_pos(), "wid="..wid..", from="..curr_owner..", to="..new_owner) + + if name ~= new_owner then + core.chat_send_player(new_owner, attrans("You have been given ownership of wagon @1", wid)) + end + return true, attrans("Wagon @1 ownership changed from @2 to @3", wid, curr_owner, new_owner) + end +}) \ No newline at end of file -- cgit v1.2.3 From c08896f9f5cccc08f49f14944c1a9c0c8c0b5796 Mon Sep 17 00:00:00 2001 From: Tanavit Date: Wed, 26 Mar 2025 10:57:05 +0100 Subject: Translations improvement. File : - advtrains : init.lua wagons.lua - advtrains_line_automation : scheduler.lua stoprail.lua Actions : - Conversion of attrans() to S() - Insertion of S() function calls where needed. Miscellaneous : - Removing of personnal tries on update-translastions.sh which should not have been committed. # Third and last patch of a serie of three to be applied to the master branch of advtrains on commit #0b7fdc6 # # ATTENTION : # # 1. These patches come from a derivation of the l10n branch which, afaik, is not yet merged in the master branch. # I guess that applying these patches will shortcut the l10n branch. # 2. These patches contain translations strings of for the modification I proposed some month ago for basic_trains which, # afaik, are not yet merged in its master branch. --- advtrains/init.lua | 50 ++-- advtrains/po/advtrains.pot | 366 +++++++++++++++++++++++++--- advtrains/po/de.po | 400 +++++++++++++++++++++++++++---- advtrains/po/fr.po | 413 ++++++++++++++++++++++++++++---- advtrains/po/update-translations.sh | 1 - advtrains/po/zh_CN.po | 388 +++++++++++++++++++++++++++--- advtrains/po/zh_TW.po | 388 +++++++++++++++++++++++++++--- advtrains/wagons.lua | 121 +++++----- advtrains_line_automation/scheduler.lua | 2 +- advtrains_line_automation/stoprail.lua | 44 ++-- 10 files changed, 1870 insertions(+), 303 deletions(-) (limited to 'advtrains/wagons.lua') diff --git a/advtrains/init.lua b/advtrains/init.lua index 0d76ec0..91b2b58 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -73,7 +73,7 @@ end local no_action=false local function reload_saves() - atwarn("Restoring saved state in 1 second...") + atwarn(S("Restoring saved state in 1 second...")) no_action=true advtrains.lock_path_inval = false --read last save state and continue, as if server was restarted @@ -84,7 +84,7 @@ local function reload_saves() end minetest.after(1, function() advtrains.load() - atwarn("Reload successful!") + atwarn(S("Reload successful!")) advtrains.ndb.restore_all() end) end @@ -349,7 +349,7 @@ function advtrains.avt_load() end end for wid, _ in pairs(todel) do - atwarn("Removing unused wagon", wid, "from wagon_save table.") + atwarn(S("Removing unused wagon"), wid, S("from wagon_save table.")) advtrains.wagon_save[wid]=nil end else @@ -414,7 +414,7 @@ function advtrains.load_version_4() end end for wid, _ in pairs(todel) do - atwarn("Removing unused wagon", wid, "from wagon_save table.") + atwarn(S("Removing unused wagon"), wid, S("from wagon_save table.")) advtrains.wagon_save[wid]=nil end end @@ -502,7 +502,7 @@ advtrains.avt_save = function(remove_players_from_wagons) --then save it tmp_trains[id]=v else - atwarn("Train",id,"had no wagons left because of some bug. It is being deleted. Wave it goodbye!") + atwarn(S("Train"),id,S("had no wagons left because of some bug. It is being deleted. Wave it goodbye!")) advtrains.remove_train(id) end end @@ -583,7 +583,7 @@ advtrains.avt_save = function(remove_players_from_wagons) local succ, err = serialize_lib.save_atomic_multiple(parts_table, advtrains.fpath.."_", callbacks_table) if not succ then - atwarn("Saving failed: "..err) + atwarn(S("Saving failed: ")..err) else -- store version advtrains.save_component(4, "version") @@ -686,7 +686,7 @@ end function advtrains.save(remove_players_from_wagons) if not init_load then --wait... we haven't loaded yet?! - atwarn("Instructed to save() but load() was never called!") + atwarn(S("Instructed to save() but load() was never called!")) return end @@ -715,7 +715,7 @@ function advtrains.save(remove_players_from_wagons) end minetest.register_on_shutdown(function() if within_mainstep then - atwarn("Crash during advtrains main step - skipping the shutdown save operation to not save inconsistent data!") + atwarn(S("Crash during advtrains main step - skipping the shutdown save operation to not save inconsistent data!")) else advtrains.save() end @@ -727,10 +727,10 @@ end) minetest.register_chatcommand("at_empty_seats", { params = "", -- Short parameter description - description = "Detach all players, especially the offline ones, from all trains. Use only when no one serious is on a train.", -- Full description + description = S("Detach all players, especially the offline ones, from all trains. Use only when no one serious is on a train."), -- Full description privs = {train_operator=true, server=true}, -- Require the "privs" privilege to run func = function(name, param) - atwarn("Data is being saved. While saving, advtrains will remove the players from trains. Save files will be reloaded afterwards!") + atwarn(S("Data is being saved. While saving, advtrains will remove the players from trains. Save files will be reloaded afterwards!")) advtrains.save(true) reload_saves() end, @@ -739,60 +739,60 @@ minetest.register_chatcommand("at_empty_seats", minetest.register_chatcommand("at_reroute", { params = "", - description = "Delete all train routes, force them to recalculate", + description = S("Delete all train routes, force them to recalculate"), privs = {train_operator=true}, -- Only train operator is required, since this is relatively safe. func = function(name, param) advtrains.invalidate_all_paths() - return true, "Successfully invalidated train routes" + return true, S("Successfully invalidated train routes") end, }) minetest.register_chatcommand("at_whereis", { params = "", - description = "Returns the position of the train with the given id", + description = S("Returns the position of the train with the given id"), privs = {train_operator = true}, func = function(name,param) local train = advtrains.trains[param] if not train or not train.last_pos then - return false, "Train "..param.." does not exist or is invalid" + return false, S("Train ")..param..S(" does not exist or is invalid") else - return true, "Train "..param.." is at "..minetest.pos_to_string(train.last_pos) + return true, S("Train ")..param..S(" is at ")..minetest.pos_to_string(train.last_pos) end end, }) minetest.register_chatcommand("at_tp", { params = "", - description = "Teleports you to the position of the train with the given id", + description = S("Teleports you to the position of the train with the given id"), privs = {train_operator = true, teleport = true}, func = function(name,param) local train = advtrains.trains[param] if not train or not train.last_pos then - return false, "Train "..param.." does not exist or is invalid" + return false, S("Train ")..param..S(" does not exist or is invalid") else minetest.get_player_by_name(name):set_pos(train.last_pos) - return true, "Teleporting to train "..param + return true, S("Teleporting to train ")..param end end, }) minetest.register_chatcommand("at_disable_step", { params = "", - description = "Disable the advtrains globalstep temporarily", + description = S("Disable the advtrains globalstep temporarily"), privs = {server=true}, func = function(name, param) if minetest.is_yes(param) then -- disable everything, and turn off saving no_action = true; - atwarn("The advtrains globalstep has been disabled. Trains are not moving, and no data is saved! Run '/at_disable_step no' to enable again!") - return true, "Disabled advtrains successfully" + atwarn(S("The advtrains globalstep has been disabled. Trains are not moving, and no data is saved! Run '/at_disable_step no' to enable again!")) + return true, S("Disabled advtrains successfully") elseif no_action then - atwarn("Re-enabling advtrains globalstep...") + atwarn(S("Re-enabling advtrains globalstep...")) reload_saves() return true else - return false, "Advtrains is already running normally!" + return false, S("Advtrains is already running normally!") end end, }) @@ -800,10 +800,10 @@ minetest.register_chatcommand("at_disable_step", minetest.register_chatcommand("at_status", { params = "", - description = "Print advtrains status info", + description = S("Print advtrains status info"), privs = {train_operator = true}, func = function(name, param) - return true, advtrains.print_concat_table({"Advtrains Status: no_action",no_action,"slowdown",advtrains.global_slowdown,"(log",math.log(advtrains.global_slowdown),")"}) + return true, advtrains.print_concat_table({S("Advtrains Status: no_action"),no_action,S("slowdown"),advtrains.global_slowdown,S("(log"),math.log(advtrains.global_slowdown),")"}) end, }) diff --git a/advtrains/po/advtrains.pot b/advtrains/po/advtrains.pot index ade6a33..cd6ea75 100644 --- a/advtrains/po/advtrains.pot +++ b/advtrains/po/advtrains.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2024-12-08 15:21+0100\n" +"POT-Creation-Date: 2025-03-25 15:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,7 +39,8 @@ msgstr "" msgid "Digiline channel" msgstr "" -#: advtrains/atc.lua advtrains_line_automation/stoprail.lua +#: advtrains/atc.lua advtrains/wagons.lua +#: advtrains_line_automation/stoprail.lua #: advtrains_luaautomation/active_common.lua msgid "Save" msgstr "" @@ -149,6 +150,127 @@ msgstr "" msgid "Chimney" msgstr "" +#: advtrains/init.lua +msgid "Restoring saved state in 1 second..." +msgstr "" + +#: advtrains/init.lua +msgid "Reload successful!" +msgstr "" + +#: advtrains/init.lua +msgid "Removing unused wagon" +msgstr "" + +#: advtrains/init.lua +msgid "from wagon_save table." +msgstr "" + +#: advtrains/init.lua +msgid "Train" +msgstr "" + +#: advtrains/init.lua +msgid "" +"had no wagons left because of some bug. It is being deleted. Wave it goodbye!" +msgstr "" + +#: advtrains/init.lua +msgid "Saving failed: " +msgstr "" + +#: advtrains/init.lua +msgid "Instructed to save() but load() was never called!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Crash during advtrains main step - skipping the shutdown save operation to " +"not save inconsistent data!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Detach all players, especially the offline ones, from all trains. Use only " +"when no one serious is on a train." +msgstr "" + +#: advtrains/init.lua +msgid "" +"Data is being saved. While saving, advtrains will remove the players from " +"trains. Save files will be reloaded afterwards!" +msgstr "" + +#: advtrains/init.lua +msgid "Delete all train routes, force them to recalculate" +msgstr "" + +#: advtrains/init.lua +msgid "Successfully invalidated train routes" +msgstr "" + +#: advtrains/init.lua +msgid "Returns the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid " does not exist or is invalid" +msgstr "" + +#: advtrains/init.lua +msgid "Train " +msgstr "" + +#: advtrains/init.lua +msgid " is at " +msgstr "" + +#: advtrains/init.lua +msgid "Teleports you to the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "Teleporting to train " +msgstr "" + +#: advtrains/init.lua +msgid "Disable the advtrains globalstep temporarily" +msgstr "" + +#: advtrains/init.lua +msgid "" +"The advtrains globalstep has been disabled. Trains are not moving, and no " +"data is saved! Run '/at_disable_step no' to enable again!" +msgstr "" + +#: advtrains/init.lua +msgid "Disabled advtrains successfully" +msgstr "" + +#: advtrains/init.lua +msgid "Re-enabling advtrains globalstep..." +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains is already running normally!" +msgstr "" + +#: advtrains/init.lua +msgid "Print advtrains status info" +msgstr "" + +#: advtrains/init.lua +msgid "(log" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains Status: no_action" +msgstr "" + +#: advtrains/init.lua +msgid "slowdown" +msgstr "" + #: advtrains/misc_nodes.lua msgid "@1 Platform (low)" msgstr "" @@ -231,68 +353,64 @@ msgstr "" msgid "Andrew's Cross" msgstr "" -#: advtrains/trackplacer.lua -msgid "" -"Track Worker Tool\n" -"\n" -"Left-click: change rail type (straight/curve/switch)\n" -"Right-click: rotate object" -msgstr "" - -#: advtrains/trackplacer.lua -msgid "This node can't be rotated using the trackworker." +#: advtrains/track_reg_helper.lua advtrains/tracks.lua +msgid "This track can not be removed!" msgstr "" -#: advtrains/trackplacer.lua -msgid "This track can not be rotated." +#: advtrains/track_reg_helper.lua +msgid "@1 Slope" msgstr "" -#: advtrains/trackplacer.lua -msgid "This node can't be changed using the trackworker." +#: advtrains/track_reg_helper.lua +msgid "Can't place: not pointing at node" msgstr "" -#: advtrains/trackplacer.lua -msgid "This track can not be changed." +#: advtrains/track_reg_helper.lua +msgid "Can't place: space occupied!" msgstr "" -#: advtrains/tracks.lua -msgid "This track can not be removed." +#: advtrains/track_reg_helper.lua +msgid "Can't place: Not enough slope items left (@1 required)" msgstr "" -#: advtrains/tracks.lua -msgid "Position is occupied by a train." +#: advtrains/track_reg_helper.lua +msgid "Can't place: There's no slope of length @1" msgstr "" -#: advtrains/tracks.lua -msgid "There's a Track Circuit Break here." +#: advtrains/track_reg_helper.lua +msgid "Can't place: no supporting node at upper end." msgstr "" -#: advtrains/tracks.lua -msgid "There's a Signal Influence Point here." +#: advtrains/trackplacer.lua +msgid "" +"Track Worker Tool\n" +"\n" +"Left-click: change rail type (straight/curve/switch)\n" +"Right-click: rotate object" msgstr "" -#: advtrains/tracks.lua -msgid "@1 Slope" +#: advtrains/trackplacer.lua +msgid "This node can't be rotated using the trackworker!" msgstr "" -#: advtrains/tracks.lua -msgid "Can't place slope: not pointing at node." +#: advtrains/trackplacer.lua +msgid "This track can not be rotated!" msgstr "" -#: advtrains/tracks.lua -msgid "Can't place slope: space occupied." +#: advtrains/trackplacer.lua +msgid "This node can't be changed using the trackworker!" msgstr "" #: advtrains/tracks.lua -msgid "Can't place slope: Not enough slope items left (@1 required)." +msgid "Position is occupied by a train." msgstr "" #: advtrains/tracks.lua -msgid "Can't place slope: There's no slope of length @1." +msgid "There's a Track Circuit Break here." msgstr "" #: advtrains/tracks.lua -msgid "Can't place slope: no supporting node at upper end." +msgid "There's a Signal Influence Point here." msgstr "" #: advtrains/trainhud.lua @@ -313,10 +431,24 @@ msgstr "" msgid "Insufficient privileges to use this!" msgstr "" +#: advtrains/wagons.lua +msgid "Uninitialized init=" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized, removing" +msgstr "" + #: advtrains/wagons.lua msgid "This wagon is owned by @1, you can't destroy it." msgstr "" +#: advtrains/wagons.lua +msgid "" +"Destroying wagon with inventory, but inventory is not found? Shouldn't " +"happen!" +msgstr "" + #: advtrains/wagons.lua msgid "The wagon's inventory is not empty." msgstr "" @@ -331,6 +463,26 @@ msgid "" "sure, hold Sneak and left-click the wagon." msgstr "" +#: advtrains/wagons.lua +msgid " wagon:destroy(): data is not set!" +msgstr "" + +#: advtrains/wagons.lua +msgid "!!! Train off track !!!" +msgstr "" + +#: advtrains/wagons.lua +msgid " units" +msgstr "" + +#: advtrains/wagons.lua +msgid "Liquid: " +msgstr "" + +#: advtrains/wagons.lua +msgid "Liquid: empty" +msgstr "" + #: advtrains/wagons.lua msgid "Show Inventory" msgstr "" @@ -379,6 +531,30 @@ msgstr "" msgid "This Wagon ID" msgstr "" +#: advtrains/wagons.lua +msgid "Allow these players to access your wagon:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Wagon road number:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Freight Code:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Prev FC" +msgstr "" + +#: advtrains/wagons.lua +msgid "Current FC: " +msgstr "" + +#: advtrains/wagons.lua +msgid "Next FC:" +msgstr "" + #: advtrains/wagons.lua msgid "Save wagon properties" msgstr "" @@ -403,6 +579,22 @@ msgstr "" msgid "Routingcode" msgstr "" +#: advtrains/wagons.lua +msgid "Train overview /coupling control:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Train overview / coupling control is only shown when the train stands." +msgstr "" + +#: advtrains/wagons.lua +msgid "Remote Routesetting" +msgstr "" + +#: advtrains/wagons.lua +msgid "Clear 'Disable ARS' flag" +msgstr "" + #: advtrains/wagons.lua msgid "" "Doors are closed. Use Sneak+rightclick to ignore the closed doors and get " @@ -413,6 +605,46 @@ msgstr "" msgid "You are not allowed to access the driver stand." msgstr "" +#: advtrains/wagons.lua +msgid "Missing train_operator privilege" +msgstr "" + +#: advtrains/wagons.lua +msgid "Not allowed to do this." +msgstr "" + +#: advtrains/wagons.lua +msgid "You don't have the train_operator privilege." +msgstr "" + +#: advtrains/wagons.lua +msgid "The track you are trying to place the wagon on is not long enough!" +msgstr "" + +#: advtrains/wagons.lua +msgid "Please specify a player name to transfer ownership to." +msgstr "" + +#: advtrains/wagons.lua +msgid "That player does not exist!" +msgstr "" + +#: advtrains/wagons.lua +msgid "Not a valid wagon id." +msgstr "" + +#: advtrains/wagons.lua +msgid "That wagon does not exist!" +msgstr "" + +#: advtrains/wagons.lua +msgid "You have been given ownership of wagon @1" +msgstr "" + +#: advtrains/wagons.lua +msgid "Wagon @1 ownership changed from @2 to @3" +msgstr "" + #: advtrains_interlocking/routesetting.lua msgid "Route state changed." msgstr "" @@ -437,6 +669,10 @@ msgstr "" msgid "Point Speed Restriction Track" msgstr "" +#: advtrains_line_automation/scheduler.lua +msgid "No callback to handle schedule" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station Code" msgstr "" @@ -465,6 +701,18 @@ msgstr "" msgid "Door Side" msgstr "" +#: advtrains_line_automation/stoprail.lua +msgid "Closed" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Left" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Right" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Reverse train" msgstr "" @@ -473,6 +721,14 @@ msgstr "" msgid "Kick out passengers" msgstr "" +#: advtrains_line_automation/stoprail.lua +msgid "Wait for signal to clear" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Trains stopping here (ARS rules)" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station code \"@1\" already exists and is owned by @2." msgstr "" @@ -481,6 +737,14 @@ msgstr "" msgid "This station is owned by @1. You are not allowed to edit its name." msgstr "" +#: advtrains_line_automation/stoprail.lua +msgid "Unknown Station" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Next Stop:\n" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station/Stop Track" msgstr "" @@ -550,6 +814,38 @@ msgstr "" msgid "Set name of component (empty to clear)" msgstr "" +#: advtrains_signals_japan/init.lua +msgid "Japanese signal pole" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Clear (proceed)" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Reduced speed" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Caution" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Restricted speed" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Danger (halt)" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Distant Signal (" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Main Signal (" +msgstr "" + #: advtrains_train_industrial/init.lua advtrains_train_steam/init.lua msgid "Driver Stand (right)" msgstr "" diff --git a/advtrains/po/de.po b/advtrains/po/de.po index 8a7e009..458e701 100644 --- a/advtrains/po/de.po +++ b/advtrains/po/de.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2024-12-08 15:21+0100\n" +"POT-Creation-Date: 2025-03-25 15:40+0100\n" "PO-Revision-Date: 2023-10-09 11:18+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: German\n" @@ -58,7 +58,8 @@ msgstr "Befehl (wenn aktiviert)" msgid "Digiline channel" msgstr "Digiline-Kanal" -#: advtrains/atc.lua advtrains_line_automation/stoprail.lua +#: advtrains/atc.lua advtrains/wagons.lua +#: advtrains_line_automation/stoprail.lua #: advtrains_luaautomation/active_common.lua msgid "Save" msgstr "Speichern" @@ -162,6 +163,128 @@ msgstr "Führerstand" msgid "Wheel" msgstr "" +#: advtrains/init.lua +msgid " does not exist or is invalid" +msgstr "" + +#: advtrains/init.lua +msgid " is at " +msgstr "" + +#: advtrains/init.lua +msgid "(log" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains Status: no_action" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains is already running normally!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Crash during advtrains main step - skipping the shutdown save operation to " +"not save inconsistent data!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Data is being saved. While saving, advtrains will remove the players from " +"trains. Save files will be reloaded afterwards!" +msgstr "" + +#: advtrains/init.lua +msgid "Delete all train routes, force them to recalculate" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Detach all players, especially the offline ones, from all trains. Use only " +"when no one serious is on a train." +msgstr "" + +#: advtrains/init.lua +msgid "Disable the advtrains globalstep temporarily" +msgstr "" + +#: advtrains/init.lua +msgid "Disabled advtrains successfully" +msgstr "" + +#: advtrains/init.lua +msgid "Instructed to save() but load() was never called!" +msgstr "" + +#: advtrains/init.lua +msgid "Print advtrains status info" +msgstr "" + +#: advtrains/init.lua +msgid "Re-enabling advtrains globalstep..." +msgstr "" + +#: advtrains/init.lua +msgid "Reload successful!" +msgstr "" + +#: advtrains/init.lua +msgid "Removing unused wagon" +msgstr "" + +#: advtrains/init.lua +msgid "Restoring saved state in 1 second..." +msgstr "" + +#: advtrains/init.lua +msgid "Returns the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "Saving failed: " +msgstr "" + +#: advtrains/init.lua +msgid "Successfully invalidated train routes" +msgstr "" + +#: advtrains/init.lua +msgid "Teleporting to train " +msgstr "" + +#: advtrains/init.lua +msgid "Teleports you to the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "" +"The advtrains globalstep has been disabled. Trains are not moving, and no " +"data is saved! Run '/at_disable_step no' to enable again!" +msgstr "" + +#: advtrains/init.lua +msgid "Train" +msgstr "" + +#: advtrains/init.lua +#, fuzzy +msgid "Train " +msgstr "Der Zug wurde Kopiert." + +#: advtrains/init.lua +msgid "from wagon_save table." +msgstr "" + +#: advtrains/init.lua +msgid "" +"had no wagons left because of some bug. It is being deleted. Wave it goodbye!" +msgstr "" + +#: advtrains/init.lua +msgid "slowdown" +msgstr "" + #: advtrains/misc_nodes.lua msgid "@1 Platform (45 degree)" msgstr "Hoher @1-Bahnsteig (45°)" @@ -247,20 +370,59 @@ msgstr "An der rechten Seite montiertes Signal" msgid "Wallmounted Signal (top)" msgstr "An der Decke montiertes Signal" +#: advtrains/track_reg_helper.lua +msgid "@1 Slope" +msgstr "@1 Steigung" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: Not enough slope items left (@1 required)" +msgstr "" +"Es kann nicht platziert werden: Sie haben nicht genug Steigungsblöcke, es " +"werden insgesamt @1 benötigt." + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: There's no slope of length @1" +msgstr "" +"Es kann nicht platziert werden: die Steigung der Länge @1 ist nicht " +"definiert." + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: no supporting node at upper end." +msgstr "" +"Es kann nicht platziert werden: es gibt keinen unterstützenden Block am Ende " +"der Steigung." + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: not pointing at node" +msgstr "Es kann nicht platziert werden: Sie zeigen nicht auf einem Block." + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: space occupied!" +msgstr "Es kann nicht platziert werden: Diese Position ist besetzt." + +#: advtrains/track_reg_helper.lua advtrains/tracks.lua +#, fuzzy +msgid "This track can not be removed!" +msgstr "Dieses Gleis kann nicht entfernt werden." + #: advtrains/trackplacer.lua -msgid "This node can't be changed using the trackworker." +#, fuzzy +msgid "This node can't be changed using the trackworker!" msgstr "Dieser Block kann nicht mit dem Gleiswerkzeug bearbeitet werden." #: advtrains/trackplacer.lua -msgid "This node can't be rotated using the trackworker." +#, fuzzy +msgid "This node can't be rotated using the trackworker!" msgstr "Dieser Block kann nicht mit dem Gleiswerkzeug gedreht werden." #: advtrains/trackplacer.lua -msgid "This track can not be changed." -msgstr "Dieses Gleis kann nicht geändert werden." - -#: advtrains/trackplacer.lua -msgid "This track can not be rotated." +#, fuzzy +msgid "This track can not be rotated!" msgstr "Dieses Gleis kann nicht gedreht werden." #: advtrains/trackplacer.lua @@ -275,36 +437,6 @@ msgstr "" "Linksklick: Gleistyp ändern\n" "Rechtsklick: Objekt drehen" -#: advtrains/tracks.lua -msgid "@1 Slope" -msgstr "@1 Steigung" - -#: advtrains/tracks.lua -msgid "Can't place slope: Not enough slope items left (@1 required)." -msgstr "" -"Es kann nicht platziert werden: Sie haben nicht genug Steigungsblöcke, es " -"werden insgesamt @1 benötigt." - -#: advtrains/tracks.lua -msgid "Can't place slope: There's no slope of length @1." -msgstr "" -"Es kann nicht platziert werden: die Steigung der Länge @1 ist nicht " -"definiert." - -#: advtrains/tracks.lua -msgid "Can't place slope: no supporting node at upper end." -msgstr "" -"Es kann nicht platziert werden: es gibt keinen unterstützenden Block am Ende " -"der Steigung." - -#: advtrains/tracks.lua -msgid "Can't place slope: not pointing at node." -msgstr "Es kann nicht platziert werden: Sie zeigen nicht auf einem Block." - -#: advtrains/tracks.lua -msgid "Can't place slope: space occupied." -msgstr "Es kann nicht platziert werden: Diese Position ist besetzt." - #: advtrains/tracks.lua msgid "Position is occupied by a train." msgstr "Ein Zug steht an dieser Position." @@ -317,10 +449,6 @@ msgstr "Hier ist ein Signal-Beeinflussungspunkt." msgid "There's a Track Circuit Break here." msgstr "Hier ist eine Gleisabschnittsgrenze (TCB)." -#: advtrains/tracks.lua -msgid "This track can not be removed." -msgstr "Dieses Gleis kann nicht entfernt werden." - #: advtrains/trainhud.lua msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." msgstr "" @@ -340,10 +468,40 @@ msgid "" "Punch a wagon to view and edit the Wagon Properties" msgstr "" +#: advtrains/wagons.lua +msgid " units" +msgstr "" + +#: advtrains/wagons.lua +msgid " wagon:destroy(): data is not set!" +msgstr "" + +#: advtrains/wagons.lua +msgid "!!! Train off track !!!" +msgstr "" + #: advtrains/wagons.lua msgid "(Doors closed)" msgstr "(Türen geschlossen)" +#: advtrains/wagons.lua +msgid "Allow these players to access your wagon:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Clear 'Disable ARS' flag" +msgstr "" + +#: advtrains/wagons.lua +msgid "Current FC: " +msgstr "" + +#: advtrains/wagons.lua +msgid "" +"Destroying wagon with inventory, but inventory is not found? Shouldn't " +"happen!" +msgstr "" + #: advtrains/wagons.lua msgid "Doors are closed! (Try holding sneak key!)" msgstr "Die Türen sind geschlossen." @@ -356,6 +514,10 @@ msgstr "" "Die Türen sind geschlossen. Nutzen Sie Schleichen+Rechtsklick, um trotz " "geschlossener Türen auszusteigen." +#: advtrains/wagons.lua +msgid "Freight Code:" +msgstr "" + #: advtrains/wagons.lua msgid "Get off" msgstr "Aussteigen" @@ -368,10 +530,47 @@ msgstr "Ausstieg zwingen" msgid "Line" msgstr "Linie" +#: advtrains/wagons.lua +msgid "Liquid: " +msgstr "" + +#: advtrains/wagons.lua +msgid "Liquid: empty" +msgstr "" + +#: advtrains/wagons.lua +msgid "Missing train_operator privilege" +msgstr "" + +#: advtrains/wagons.lua +msgid "Next FC:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Not a valid wagon id." +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "Not allowed to do this." +msgstr "Sie dürfen dieses Gleis nicht konfigurieren." + #: advtrains/wagons.lua msgid "Onboard Computer" msgstr "" +#: advtrains/wagons.lua +msgid "Please specify a player name to transfer ownership to." +msgstr "" + +#: advtrains/wagons.lua +msgid "Prev FC" +msgstr "" + +#: advtrains/wagons.lua +msgid "Remote Routesetting" +msgstr "" + #: advtrains/wagons.lua msgid "Routingcode" msgstr "" @@ -396,6 +595,20 @@ msgstr "Innere Anzeige" msgid "Text displayed outside on train" msgstr "Äußere Anzeige" +#: advtrains/wagons.lua +msgid "That player does not exist!" +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "That wagon does not exist!" +msgstr "In diesem Waggon ist kein Sitzplatz vorhanden." + +#: advtrains/wagons.lua +#, fuzzy +msgid "The track you are trying to place the wagon on is not long enough!" +msgstr "Das Gleis, auf dem der Waggon platziert werden woll, ist zu kurz." + #: advtrains/wagons.lua msgid "The wagon's inventory is not empty." msgstr "Das Inventar dieses Waggons ist nicht leer." @@ -421,6 +634,26 @@ msgstr "Dieser Waggon gehört @1, Sie dürfen ihn nicht abbauen." msgid "Train ID" msgstr "" +#: advtrains/wagons.lua +msgid "Train overview / coupling control is only shown when the train stands." +msgstr "" + +#: advtrains/wagons.lua +msgid "Train overview /coupling control:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized init=" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized, removing" +msgstr "" + +#: advtrains/wagons.lua +msgid "Wagon @1 ownership changed from @2 to @3" +msgstr "" + #: advtrains/wagons.lua msgid "Wagon needs to be decoupled from other wagons in order to destroy it." msgstr "Der Waggon muss abgekoppelt sein, damit Sie ihn abbauen können." @@ -429,6 +662,10 @@ msgstr "Der Waggon muss abgekoppelt sein, damit Sie ihn abbauen können." msgid "Wagon properties" msgstr "Waggon-Einstellungen" +#: advtrains/wagons.lua +msgid "Wagon road number:" +msgstr "" + #: advtrains/wagons.lua msgid "" "Warning: If you destroy this wagon, you only get some steel back! If you are " @@ -445,6 +682,15 @@ msgstr "Sie haben keinen Zugang zum Führerstand." msgid "You can't get on this wagon." msgstr "Sie können nicht in diesen Waggon einsteigen." +#: advtrains/wagons.lua +#, fuzzy +msgid "You don't have the train_operator privilege." +msgstr "Ihnen fehlt das „@1“-Privileg." + +#: advtrains/wagons.lua +msgid "You have been given ownership of wagon @1" +msgstr "" + #: advtrains_interlocking/routesetting.lua msgid "Route state changed." msgstr "" @@ -469,6 +715,14 @@ msgstr "Sie dürfen ohne das „@1“-Privileg dieses Gleis nicht konfigurieren. msgid "You are not allowed to configure this track." msgstr "Sie dürfen dieses Gleis nicht konfigurieren." +#: advtrains_line_automation/scheduler.lua +msgid "No callback to handle schedule" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Closed" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Dep. Speed" msgstr "Zielgeschwindigkeit bei Abfahrt" @@ -485,10 +739,22 @@ msgstr "Türseite" msgid "Kick out passengers" msgstr "Fahrgäste zum Ausstieg zwingen" +#: advtrains_line_automation/stoprail.lua +msgid "Left" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Next Stop:\n" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Reverse train" msgstr "Zug Umkehren" +#: advtrains_line_automation/stoprail.lua +msgid "Right" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station Code" msgstr "Kennzeichen der Haltestelle" @@ -520,6 +786,18 @@ msgstr "" msgid "Track" msgstr "Gleis" +#: advtrains_line_automation/stoprail.lua +msgid "Trains stopping here (ARS rules)" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Unknown Station" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Wait for signal to clear" +msgstr "" + #: advtrains_luaautomation/active_common.lua msgid "Clear Local Environment" msgstr "" @@ -591,6 +869,39 @@ msgid "" "privilege." msgstr "Sie dürfen ohne das „@1“ keinen passiven LuaATC-Bauteil benennen." +#: advtrains_signals_japan/init.lua +msgid "Caution" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Clear (proceed)" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Danger (halt)" +msgstr "" + +#: advtrains_signals_japan/init.lua +#, fuzzy +msgid "Japanese signal pole" +msgstr "Japanischer Personenzug-Passagierwaggon" + +#: advtrains_signals_japan/init.lua +msgid "Reduced speed" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Restricted speed" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Distant Signal (" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Main Signal (" +msgstr "" + #: advtrains_train_industrial/init.lua msgid "Big Industrial Train Engine" msgstr "Große Industrielle Lokomotive" @@ -742,6 +1053,9 @@ msgstr "Y-Weiche" #~ msgid "This position is protected!" #~ msgstr "Diese Position ist geschützt!" +#~ msgid "This track can not be changed." +#~ msgstr "Dieses Gleis kann nicht geändert werden." + #~ msgid "Use Sneak+rightclick to bypass closed doors!" #~ msgstr "" #~ "Nutzen Sie Schleichen+Rechtsklick, um trotz geschlossener Türen " diff --git a/advtrains/po/fr.po b/advtrains/po/fr.po index 3c8f5f6..d773a98 100644 --- a/advtrains/po/fr.po +++ b/advtrains/po/fr.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2024-12-08 15:21+0100\n" -"PO-Revision-Date: 2024-12-04 15:55+0100\n" +"POT-Creation-Date: 2025-03-25 15:40+0100\n" +"PO-Revision-Date: 2025-03-25 15:06+0100\n" "Last-Translator: Tanavit \n" "Language-Team: French\n" "Language: fr\n" @@ -53,7 +53,8 @@ msgstr "Commande (marche)" msgid "Digiline channel" msgstr "Canal Digiline" -#: advtrains/atc.lua advtrains_line_automation/stoprail.lua +#: advtrains/atc.lua advtrains/wagons.lua +#: advtrains_line_automation/stoprail.lua #: advtrains_luaautomation/active_common.lua msgid "Save" msgstr "Sauvegarder" @@ -156,6 +157,141 @@ msgstr "Cabine de pilotage" msgid "Wheel" msgstr "Roue" +#: advtrains/init.lua +msgid " does not exist or is invalid" +msgstr " n'existe pas ou est invalide" + +#: advtrains/init.lua +msgid " is at " +msgstr " est à la position " + +#: advtrains/init.lua +msgid "(log" +msgstr "(log" + +#: advtrains/init.lua +msgid "Advtrains Status: no_action" +msgstr "État d'advtrains : aucune action" + +#: advtrains/init.lua +msgid "Advtrains is already running normally!" +msgstr "Advtrains fonctionne déjà correctement !" + +#: advtrains/init.lua +msgid "" +"Crash during advtrains main step - skipping the shutdown save operation to " +"not save inconsistent data!" +msgstr "" +"Crash durant le pas principal d'advtrains - saut de l'opération de " +"sauvegarde de terminaison pour éviter l'enregistrement de données " +"corrompues !" + +#: advtrains/init.lua +msgid "" +"Data is being saved. While saving, advtrains will remove the players from " +"trains. Save files will be reloaded afterwards!" +msgstr "" +"Données en cours de sauvegarde. Durant cette phase, advtrains débarquera les " +"joueurs des trains. Les fichiers de sauvegarde seront ultérieurement " +"rechargés !" + +# Routage est il le bon terme ? +#: advtrains/init.lua +msgid "Delete all train routes, force them to recalculate" +msgstr "Suppression et recalcul de tous les routages" + +#: advtrains/init.lua +msgid "" +"Detach all players, especially the offline ones, from all trains. Use only " +"when no one serious is on a train." +msgstr "" +"Débarque tous les joueurs, en particulier ceux déconnectés, de tous les " +"trains. À n'utiliser que quand aucun joueur sérieux n'a embarqué." + +#: advtrains/init.lua +msgid "Disable the advtrains globalstep temporarily" +msgstr "Désactive temporairement le pas global d'advtrains" + +#: advtrains/init.lua +msgid "Disabled advtrains successfully" +msgstr "Succès de la désactivation d'advtrains" + +#: advtrains/init.lua +msgid "Instructed to save() but load() was never called!" +msgstr "Appel de save() requis sans appel préalable de load() !" + +#: advtrains/init.lua +msgid "Print advtrains status info" +msgstr "Affiche les informations d'état d'advtrains" + +#: advtrains/init.lua +msgid "Re-enabling advtrains globalstep..." +msgstr "Réacivation du pas global d'advtrains..." + +#: advtrains/init.lua +msgid "Reload successful!" +msgstr "Succès du rechargement !" + +#: advtrains/init.lua +msgid "Removing unused wagon" +msgstr "Suppression d'un wagon inutilisé" + +#: advtrains/init.lua +msgid "Restoring saved state in 1 second..." +msgstr "Restauration du l'état sauvegardé dans une seconde..." + +#: advtrains/init.lua +msgid "Returns the position of the train with the given id" +msgstr "Affiche la position du train identifié" + +#: advtrains/init.lua +msgid "Saving failed: " +msgstr "Échec de sauvegarde : " + +# Routage est il le bon terme ? +#: advtrains/init.lua +msgid "Successfully invalidated train routes" +msgstr "Succès d'invalidation des routages des trains" + +#: advtrains/init.lua +msgid "Teleporting to train " +msgstr "Téléportation au train " + +#: advtrains/init.lua +msgid "Teleports you to the position of the train with the given id" +msgstr "Vous téléporte à la position du train identifié" + +#: advtrains/init.lua +msgid "" +"The advtrains globalstep has been disabled. Trains are not moving, and no " +"data is saved! Run '/at_disable_step no' to enable again!" +msgstr "" +"Le pas global d'advtrains est désactivé. Les trains sont immobiles et aucune " +"donnée n'est sauvegardée. Exécutez '/at_disable_step no ' pour le réactiver !" + +#: advtrains/init.lua +msgid "Train" +msgstr "Identificateur du train" + +#: advtrains/init.lua +msgid "Train " +msgstr "Identificateur du train " + +#: advtrains/init.lua +msgid "from wagon_save table." +msgstr "de la table wagon_save." + +#: advtrains/init.lua +msgid "" +"had no wagons left because of some bug. It is being deleted. Wave it goodbye!" +msgstr "" +"n'a plus de wagon à cause d'un bug quelconque. Il est détruit. Faites lui " +"coucou !" + +#: advtrains/init.lua +msgid "slowdown" +msgstr "ralentissement" + #: advtrains/misc_nodes.lua msgid "@1 Platform (45 degree)" msgstr "Quai @1 (haut, 45°)" @@ -249,21 +385,46 @@ msgstr "Signal mural (droit)" msgid "Wallmounted Signal (top)" msgstr "Signal mural (plafond)" -#: advtrains/trackplacer.lua -msgid "This node can't be changed using the trackworker." -msgstr "Ce nœud ne peut être modifié avec l'outil \"Trackworker\"." +#: advtrains/track_reg_helper.lua +msgid "@1 Slope" +msgstr "Pente @1" + +#: advtrains/track_reg_helper.lua +msgid "Can't place: Not enough slope items left (@1 required)" +msgstr "" +"Placement impossible : quantité insuffisante de voie pentue (@1 manquant)" + +#: advtrains/track_reg_helper.lua +msgid "Can't place: There's no slope of length @1" +msgstr "Placement impossible : il n'y a pas de voie pentue de longueur @1" + +#: advtrains/track_reg_helper.lua +msgid "Can't place: no supporting node at upper end." +msgstr "Placement impossible : pas de nœud d'appui à l'extrémité supérieure." + +#: advtrains/track_reg_helper.lua +msgid "Can't place: not pointing at node" +msgstr "Placement impossible : ne pointe pas un nœud" + +#: advtrains/track_reg_helper.lua +msgid "Can't place: space occupied!" +msgstr "Placement impossible : espace occupé !" + +#: advtrains/track_reg_helper.lua advtrains/tracks.lua +msgid "This track can not be removed!" +msgstr "Cette voie ne peut pas être enlevée !" #: advtrains/trackplacer.lua -msgid "This node can't be rotated using the trackworker." -msgstr "Ce nœud ne peut être tourné avec l'outil \"Trackworker\"." +msgid "This node can't be changed using the trackworker!" +msgstr "Ce nœud ne peut être modifié avec l'outil \"Trackworker\" !" #: advtrains/trackplacer.lua -msgid "This track can not be changed." -msgstr "Cette voie ne peut pas être modifiée." +msgid "This node can't be rotated using the trackworker!" +msgstr "Ce nœud ne peut être tourné avec l'outil \"Trackworker\" !" #: advtrains/trackplacer.lua -msgid "This track can not be rotated." -msgstr "Cette voie ne peut pas être tournée." +msgid "This track can not be rotated!" +msgstr "Cette voie ne peut pas être tournée !" #: advtrains/trackplacer.lua msgid "" @@ -278,31 +439,6 @@ msgstr "" "\n" "Clic-Droit : tourne l'objet" -#: advtrains/tracks.lua -msgid "@1 Slope" -msgstr "Pente @1" - -#: advtrains/tracks.lua -msgid "Can't place slope: Not enough slope items left (@1 required)." -msgstr "" -"Placement impossible : quantité insuffisante de voie pentue (@1 manquant)." - -#: advtrains/tracks.lua -msgid "Can't place slope: There's no slope of length @1." -msgstr "Placement impossible : il n'y a pas de voie pentue de longueur @1." - -#: advtrains/tracks.lua -msgid "Can't place slope: no supporting node at upper end." -msgstr "Placement impossible : pas de nœud d'appui à l'extrémité supérieure." - -#: advtrains/tracks.lua -msgid "Can't place slope: not pointing at node." -msgstr "Placement impossible : ne pointe pas un nœud." - -#: advtrains/tracks.lua -msgid "Can't place slope: space occupied." -msgstr "Placement impossible : espace occupé." - #: advtrains/tracks.lua msgid "Position is occupied by a train." msgstr "Cet emplacement est occupé par un train." @@ -315,10 +451,6 @@ msgstr "Il y a un \"Signal Influence Point\" ici." msgid "There's a Track Circuit Break here." msgstr "Il y a un \"Track Circuit Break\" ici." -#: advtrains/tracks.lua -msgid "This track can not be removed." -msgstr "Cette voie ne peut pas être enlevée." - #: advtrains/trainhud.lua msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." msgstr "" @@ -341,10 +473,40 @@ msgstr "" "Outil de propriété du wagon\n" "Frappez un wagon pour voir et modifier ses propriétés" +#: advtrains/wagons.lua +msgid " units" +msgstr " Unités" + +#: advtrains/wagons.lua +msgid " wagon:destroy(): data is not set!" +msgstr " Appel de wagon:destroy() : données non définies !" + +#: advtrains/wagons.lua +msgid "!!! Train off track !!!" +msgstr "!!! Train hors voie !!!" + #: advtrains/wagons.lua msgid "(Doors closed)" msgstr "(Portes closes)" +#: advtrains/wagons.lua +msgid "Allow these players to access your wagon:" +msgstr "Autoriser ces joueurs à embarquer :" + +#: advtrains/wagons.lua +msgid "Clear 'Disable ARS' flag" +msgstr "Effacer le drapeau \"Désactiver l'ARS\"" + +#: advtrains/wagons.lua +msgid "Current FC: " +msgstr "Code de fret courant: " + +#: advtrains/wagons.lua +msgid "" +"Destroying wagon with inventory, but inventory is not found? Shouldn't " +"happen!" +msgstr "Desctruction d'un wagon avec inventaire introuvable ? Anomalie !" + #: advtrains/wagons.lua msgid "Doors are closed! (Try holding sneak key!)" msgstr "Portes closes : (Essayez la \"sneak key\"!\")" @@ -357,6 +519,10 @@ msgstr "" "Portes closes ! Utilisez \"Marcher lentement (Sneak)\" et Clic-Droit pour " "franchir les portes et débarquer." +#: advtrains/wagons.lua +msgid "Freight Code:" +msgstr "Code de frêt :" + #: advtrains/wagons.lua msgid "Get off" msgstr "Débarquer" @@ -369,10 +535,47 @@ msgstr "Débarquer (de force)" msgid "Line" msgstr "Ligne" +#: advtrains/wagons.lua +msgid "Liquid: " +msgstr "Liquide : " + +#: advtrains/wagons.lua +msgid "Liquid: empty" +msgstr "Liquide : vide" + +#: advtrains/wagons.lua +msgid "Missing train_operator privilege" +msgstr "Privilège \"train_operator\" manquant" + +#: advtrains/wagons.lua +msgid "Next FC:" +msgstr "Code de fret suivant :" + +#: advtrains/wagons.lua +msgid "Not a valid wagon id." +msgstr "Identificateur de wagon invalide." + +#: advtrains/wagons.lua +msgid "Not allowed to do this." +msgstr "Vous n'êtes pas autorisé effectuer ceci." + #: advtrains/wagons.lua msgid "Onboard Computer" msgstr "Ordinateur embarqué" +#: advtrains/wagons.lua +msgid "Please specify a player name to transfer ownership to." +msgstr "" +"Spécifiez le nom du joueur à qui la propriété doit être transférée, SVP." + +#: advtrains/wagons.lua +msgid "Prev FC" +msgstr "Code de fret précédent" + +#: advtrains/wagons.lua +msgid "Remote Routesetting" +msgstr "Routage à distance" + #: advtrains/wagons.lua msgid "Routingcode" msgstr "Code de routage" @@ -397,6 +600,18 @@ msgstr "Texte affiché à l'intérieur du train" msgid "Text displayed outside on train" msgstr "Texte affiché à l'extérieur du train" +#: advtrains/wagons.lua +msgid "That player does not exist!" +msgstr "Ce joueur n'existe pas !" + +#: advtrains/wagons.lua +msgid "That wagon does not exist!" +msgstr "Ce wagon n'a pas de siège !" + +#: advtrains/wagons.lua +msgid "The track you are trying to place the wagon on is not long enough!" +msgstr "La voie sur laquelle vous tentez de placer le wagon est trop courte !" + #: advtrains/wagons.lua msgid "The wagon's inventory is not empty." msgstr "Le stock de ce wagon n'est pas vide." @@ -421,6 +636,28 @@ msgstr "Ce wagon est la propriété de @1, vous ne pouvez pas le détruire." msgid "Train ID" msgstr "Identificateur du train" +#: advtrains/wagons.lua +msgid "Train overview / coupling control is only shown when the train stands." +msgstr "" +"Aperçu du train / commande d'accouplement montré uniquement à l'arrêt du " +"train." + +#: advtrains/wagons.lua +msgid "Train overview /coupling control:" +msgstr "Aperçu du train / commande d'accouplement :" + +#: advtrains/wagons.lua +msgid "Uninitialized init=" +msgstr "Variable init non initialisée" + +#: advtrains/wagons.lua +msgid "Uninitialized, removing" +msgstr "Non initialisé, retiré" + +#: advtrains/wagons.lua +msgid "Wagon @1 ownership changed from @2 to @3" +msgstr "La propriété du wagon @1 a été transférée de @2 à @3" + #: advtrains/wagons.lua msgid "Wagon needs to be decoupled from other wagons in order to destroy it." msgstr "" @@ -430,6 +667,10 @@ msgstr "" msgid "Wagon properties" msgstr "Propriétés du wagon" +#: advtrains/wagons.lua +msgid "Wagon road number:" +msgstr "Immatriculation du wagon :" + #: advtrains/wagons.lua msgid "" "Warning: If you destroy this wagon, you only get some steel back! If you are " @@ -447,9 +688,17 @@ msgstr "Accès interdit au poste de pilotage." msgid "You can't get on this wagon." msgstr "Montée impossible dans ce wagon." +#: advtrains/wagons.lua +msgid "You don't have the train_operator privilege." +msgstr "Vous ne possédez pas le privilège \"train_operator\"." + +#: advtrains/wagons.lua +msgid "You have been given ownership of wagon @1" +msgstr "La propriété du wagon @1 vous a été transférée" + #: advtrains_interlocking/routesetting.lua msgid "Route state changed." -msgstr "" +msgstr "Changement d'état de l'itinéraire." #: advtrains_interlocking/tsr_rail.lua msgid "Point Speed Restriction Track" @@ -471,9 +720,17 @@ msgstr "Vous n'êtes pas autorisé à configurer cette voie sans le privilège @ msgid "You are not allowed to configure this track." msgstr "Vous n'êtes pas autorisé à configurer cette voie." +#: advtrains_line_automation/scheduler.lua +msgid "No callback to handle schedule" +msgstr "Absence de fonction de gestion de planning" + +#: advtrains_line_automation/stoprail.lua +msgid "Closed" +msgstr "Fermé" + #: advtrains_line_automation/stoprail.lua msgid "Dep. Speed" -msgstr "Vitesse de départ" +msgstr "Vit. de départ" #: advtrains_line_automation/stoprail.lua msgid "Door Delay" @@ -481,16 +738,28 @@ msgstr "Durée d'ouverture des portes" #: advtrains_line_automation/stoprail.lua msgid "Door Side" -msgstr "Coté d'ouvertures des portes" +msgstr "Ouv. des portes coté" #: advtrains_line_automation/stoprail.lua msgid "Kick out passengers" msgstr "Éjecter les passagers" +#: advtrains_line_automation/stoprail.lua +msgid "Left" +msgstr "Gauche" + +#: advtrains_line_automation/stoprail.lua +msgid "Next Stop:\n" +msgstr "Prochain arrêt :\n" + #: advtrains_line_automation/stoprail.lua msgid "Reverse train" msgstr "Inversion du sens de marche" +#: advtrains_line_automation/stoprail.lua +msgid "Right" +msgstr "Droit" + #: advtrains_line_automation/stoprail.lua msgid "Station Code" msgstr "Code de Station" @@ -521,6 +790,18 @@ msgstr "" msgid "Track" msgstr "Voie" +#: advtrains_line_automation/stoprail.lua +msgid "Trains stopping here (ARS rules)" +msgstr "Trains marquant l'arrêt (règles ARS)" + +#: advtrains_line_automation/stoprail.lua +msgid "Unknown Station" +msgstr "Gare inconnue" + +#: advtrains_line_automation/stoprail.lua +msgid "Wait for signal to clear" +msgstr "En attente de signal d'autorisation" + #: advtrains_luaautomation/active_common.lua msgid "Clear Local Environment" msgstr "Effacer l'environnement LuaATC" @@ -591,6 +872,38 @@ msgid "" "privilege." msgstr "Vous ne pouvez nommer un composant LuaATC passif sans le privilege @1." +#: advtrains_signals_japan/init.lua +msgid "Caution" +msgstr "Attention" + +#: advtrains_signals_japan/init.lua +msgid "Clear (proceed)" +msgstr "Autorisation (procédez)" + +#: advtrains_signals_japan/init.lua +msgid "Danger (halt)" +msgstr "Danger (stop)" + +#: advtrains_signals_japan/init.lua +msgid "Japanese signal pole" +msgstr "Voiture Japonaise" + +#: advtrains_signals_japan/init.lua +msgid "Reduced speed" +msgstr "Vitesse réduite" + +#: advtrains_signals_japan/init.lua +msgid "Restricted speed" +msgstr "Vitesse limitée" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Distant Signal (" +msgstr "Signal distant métro de Munich (" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Main Signal (" +msgstr "Signal principal métro de Munich (" + #: advtrains_train_industrial/init.lua msgid "Big Industrial Train Engine" msgstr "Grosse locomotive industrielle" @@ -701,6 +1014,9 @@ msgstr "Voie de Déchargement" msgid "Y-turnout" msgstr "Embranchement en Y" +#~ msgid ", using placeholder" +#~ msgstr ", dans un espace réservé" + #~ msgid "" #~ "ATC controller, mode @1\n" #~ "Channel: @2" @@ -727,6 +1043,9 @@ msgstr "Embranchement en Y" #~ msgid "Deprecated Track" #~ msgstr "Voie déconseillée" +#~ msgid "Left,Right,Closed;" +#~ msgstr "Gauche,Droit,Fermé;" + #~ msgid "Lock couples" #~ msgstr "Verrouiller l'accouplement" @@ -743,6 +1062,12 @@ msgstr "Embranchement en Y" #~ msgid "This position is protected!" #~ msgstr "Cet emplacement est protégé !" +#~ msgid "This track can not be changed." +#~ msgstr "Cette voie ne peut pas être modifiée." + +#~ msgid "Unable to load wagon type" +#~ msgstr "Impossible de charger le type du wagon" + #~ msgid "Use Sneak+rightclick to bypass closed doors!" #~ msgstr "" #~ "Utilisez \"Marcher lentement (Sneak)\" et Clic-Droit pour franchir les " diff --git a/advtrains/po/update-translations.sh b/advtrains/po/update-translations.sh index 1b919d9..4c22c85 100755 --- a/advtrains/po/update-translations.sh +++ b/advtrains/po/update-translations.sh @@ -7,7 +7,6 @@ BTDIR="$ATDIR/../basic_trains" POTFILE="$PODIR/advtrains.pot" xgettext \ - -v -v -v \ -D "$ATDIR" \ -D "$BTDIR" \ -d advtrains \ diff --git a/advtrains/po/zh_CN.po b/advtrains/po/zh_CN.po index 1dbf08f..f1a3c0f 100644 --- a/advtrains/po/zh_CN.po +++ b/advtrains/po/zh_CN.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2024-12-08 15:21+0100\n" +"POT-Creation-Date: 2025-03-25 15:40+0100\n" "PO-Revision-Date: 2023-10-09 11:24+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: Chinese (Simplified)\n" @@ -53,7 +53,8 @@ msgstr "命令 (激活时)" msgid "Digiline channel" msgstr "Digiline 频道" -#: advtrains/atc.lua advtrains_line_automation/stoprail.lua +#: advtrains/atc.lua advtrains/wagons.lua +#: advtrains_line_automation/stoprail.lua #: advtrains_luaautomation/active_common.lua msgid "Save" msgstr "保存" @@ -151,6 +152,128 @@ msgstr "驾驶室" msgid "Wheel" msgstr "车轮" +#: advtrains/init.lua +msgid " does not exist or is invalid" +msgstr "" + +#: advtrains/init.lua +msgid " is at " +msgstr "" + +#: advtrains/init.lua +msgid "(log" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains Status: no_action" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains is already running normally!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Crash during advtrains main step - skipping the shutdown save operation to " +"not save inconsistent data!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Data is being saved. While saving, advtrains will remove the players from " +"trains. Save files will be reloaded afterwards!" +msgstr "" + +#: advtrains/init.lua +msgid "Delete all train routes, force them to recalculate" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Detach all players, especially the offline ones, from all trains. Use only " +"when no one serious is on a train." +msgstr "" + +#: advtrains/init.lua +msgid "Disable the advtrains globalstep temporarily" +msgstr "" + +#: advtrains/init.lua +msgid "Disabled advtrains successfully" +msgstr "" + +#: advtrains/init.lua +msgid "Instructed to save() but load() was never called!" +msgstr "" + +#: advtrains/init.lua +msgid "Print advtrains status info" +msgstr "" + +#: advtrains/init.lua +msgid "Re-enabling advtrains globalstep..." +msgstr "" + +#: advtrains/init.lua +msgid "Reload successful!" +msgstr "" + +#: advtrains/init.lua +msgid "Removing unused wagon" +msgstr "" + +#: advtrains/init.lua +msgid "Restoring saved state in 1 second..." +msgstr "" + +#: advtrains/init.lua +msgid "Returns the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "Saving failed: " +msgstr "" + +#: advtrains/init.lua +msgid "Successfully invalidated train routes" +msgstr "" + +#: advtrains/init.lua +msgid "Teleporting to train " +msgstr "" + +#: advtrains/init.lua +msgid "Teleports you to the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "" +"The advtrains globalstep has been disabled. Trains are not moving, and no " +"data is saved! Run '/at_disable_step no' to enable again!" +msgstr "" + +#: advtrains/init.lua +msgid "Train" +msgstr "" + +#: advtrains/init.lua +#, fuzzy +msgid "Train " +msgstr "已复制列车。" + +#: advtrains/init.lua +msgid "from wagon_save table." +msgstr "" + +#: advtrains/init.lua +msgid "" +"had no wagons left because of some bug. It is being deleted. Wave it goodbye!" +msgstr "" + +#: advtrains/init.lua +msgid "slowdown" +msgstr "" + #: advtrains/misc_nodes.lua msgid "@1 Platform (45 degree)" msgstr "较高的@1站台 (45°)" @@ -233,20 +356,53 @@ msgstr "壁挂式信号灯 (右侧)" msgid "Wallmounted Signal (top)" msgstr "悬挂式信号灯" +#: advtrains/track_reg_helper.lua +msgid "@1 Slope" +msgstr "@1斜坡" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: Not enough slope items left (@1 required)" +msgstr "无法放置斜坡:您没有足够的铁路斜坡放置工具 (您总共需要@1个)" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: There's no slope of length @1" +msgstr "无法放置斜坡:advtrains 不支持长度为@1米的斜坡。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: no supporting node at upper end." +msgstr "无法放置斜坡:较高端没有支撑方块。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: not pointing at node" +msgstr "无法放置斜坡:您没有选择任何方块。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: space occupied!" +msgstr "无法放置斜坡:此区域已被占用。" + +#: advtrains/track_reg_helper.lua advtrains/tracks.lua +#, fuzzy +msgid "This track can not be removed!" +msgstr "您不能移除这段轨道。" + #: advtrains/trackplacer.lua -msgid "This node can't be changed using the trackworker." +#, fuzzy +msgid "This node can't be changed using the trackworker!" msgstr "您不能使用铁路调整工具调整这个方块。" #: advtrains/trackplacer.lua -msgid "This node can't be rotated using the trackworker." +#, fuzzy +msgid "This node can't be rotated using the trackworker!" msgstr "您不能使用铁路调整工具旋转这个方块。" #: advtrains/trackplacer.lua -msgid "This track can not be changed." -msgstr "您不能调整这段轨道。" - -#: advtrains/trackplacer.lua -msgid "This track can not be rotated." +#, fuzzy +msgid "This track can not be rotated!" msgstr "您不能旋转这段轨道。" #: advtrains/trackplacer.lua @@ -261,30 +417,6 @@ msgstr "" "左键单击:切换轨道类型\n" "右键单击:旋转方块" -#: advtrains/tracks.lua -msgid "@1 Slope" -msgstr "@1斜坡" - -#: advtrains/tracks.lua -msgid "Can't place slope: Not enough slope items left (@1 required)." -msgstr "无法放置斜坡:您没有足够的铁路斜坡放置工具 (您总共需要@1个)" - -#: advtrains/tracks.lua -msgid "Can't place slope: There's no slope of length @1." -msgstr "无法放置斜坡:advtrains 不支持长度为@1米的斜坡。" - -#: advtrains/tracks.lua -msgid "Can't place slope: no supporting node at upper end." -msgstr "无法放置斜坡:较高端没有支撑方块。" - -#: advtrains/tracks.lua -msgid "Can't place slope: not pointing at node." -msgstr "无法放置斜坡:您没有选择任何方块。" - -#: advtrains/tracks.lua -msgid "Can't place slope: space occupied." -msgstr "无法放置斜坡:此区域已被占用。" - #: advtrains/tracks.lua msgid "Position is occupied by a train." msgstr "" @@ -297,10 +429,6 @@ msgstr "" msgid "There's a Track Circuit Break here." msgstr "" -#: advtrains/tracks.lua -msgid "This track can not be removed." -msgstr "您不能移除这段轨道。" - #: advtrains/trainhud.lua msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." msgstr "" @@ -320,10 +448,40 @@ msgid "" "Punch a wagon to view and edit the Wagon Properties" msgstr "" +#: advtrains/wagons.lua +msgid " units" +msgstr "" + +#: advtrains/wagons.lua +msgid " wagon:destroy(): data is not set!" +msgstr "" + +#: advtrains/wagons.lua +msgid "!!! Train off track !!!" +msgstr "" + #: advtrains/wagons.lua msgid "(Doors closed)" msgstr "(车门已关闭)" +#: advtrains/wagons.lua +msgid "Allow these players to access your wagon:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Clear 'Disable ARS' flag" +msgstr "" + +#: advtrains/wagons.lua +msgid "Current FC: " +msgstr "" + +#: advtrains/wagons.lua +msgid "" +"Destroying wagon with inventory, but inventory is not found? Shouldn't " +"happen!" +msgstr "" + #: advtrains/wagons.lua msgid "Doors are closed! (Try holding sneak key!)" msgstr "" @@ -334,6 +492,10 @@ msgid "" "off." msgstr "车门已关闭,请使用潜行+右键单击下车。" +#: advtrains/wagons.lua +msgid "Freight Code:" +msgstr "" + #: advtrains/wagons.lua msgid "Get off" msgstr "下车" @@ -346,10 +508,47 @@ msgstr "强制下车" msgid "Line" msgstr "火车线路" +#: advtrains/wagons.lua +msgid "Liquid: " +msgstr "" + +#: advtrains/wagons.lua +msgid "Liquid: empty" +msgstr "" + +#: advtrains/wagons.lua +msgid "Missing train_operator privilege" +msgstr "" + +#: advtrains/wagons.lua +msgid "Next FC:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Not a valid wagon id." +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "Not allowed to do this." +msgstr "您不能调整这段轨道。" + #: advtrains/wagons.lua msgid "Onboard Computer" msgstr "" +#: advtrains/wagons.lua +msgid "Please specify a player name to transfer ownership to." +msgstr "" + +#: advtrains/wagons.lua +msgid "Prev FC" +msgstr "" + +#: advtrains/wagons.lua +msgid "Remote Routesetting" +msgstr "" + #: advtrains/wagons.lua msgid "Routingcode" msgstr "路由码" @@ -374,6 +573,20 @@ msgstr "车厢内部显示" msgid "Text displayed outside on train" msgstr "车厢外部显示" +#: advtrains/wagons.lua +msgid "That player does not exist!" +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "That wagon does not exist!" +msgstr "这节车厢没有座位。" + +#: advtrains/wagons.lua +#, fuzzy +msgid "The track you are trying to place the wagon on is not long enough!" +msgstr "轨道太短。" + #: advtrains/wagons.lua msgid "The wagon's inventory is not empty." msgstr "" @@ -399,6 +612,26 @@ msgstr "这是 @1 的车厢,您不能摧毁它。" msgid "Train ID" msgstr "" +#: advtrains/wagons.lua +msgid "Train overview / coupling control is only shown when the train stands." +msgstr "" + +#: advtrains/wagons.lua +msgid "Train overview /coupling control:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized init=" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized, removing" +msgstr "" + +#: advtrains/wagons.lua +msgid "Wagon @1 ownership changed from @2 to @3" +msgstr "" + #: advtrains/wagons.lua msgid "Wagon needs to be decoupled from other wagons in order to destroy it." msgstr "" @@ -407,6 +640,10 @@ msgstr "" msgid "Wagon properties" msgstr "车厢属性" +#: advtrains/wagons.lua +msgid "Wagon road number:" +msgstr "" + #: advtrains/wagons.lua msgid "" "Warning: If you destroy this wagon, you only get some steel back! If you are " @@ -423,6 +660,15 @@ msgstr "" msgid "You can't get on this wagon." msgstr "" +#: advtrains/wagons.lua +#, fuzzy +msgid "You don't have the train_operator privilege." +msgstr "您没有“@1”权限。" + +#: advtrains/wagons.lua +msgid "You have been given ownership of wagon @1" +msgstr "" + #: advtrains_interlocking/routesetting.lua msgid "Route state changed." msgstr "" @@ -447,6 +693,14 @@ msgstr "您没有“@1”权限,不能调整这段轨道。" msgid "You are not allowed to configure this track." msgstr "您不能调整这段轨道。" +#: advtrains_line_automation/scheduler.lua +msgid "No callback to handle schedule" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Closed" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Dep. Speed" msgstr "出发速度" @@ -463,10 +717,22 @@ msgstr "" msgid "Kick out passengers" msgstr "踢出乘客" +#: advtrains_line_automation/stoprail.lua +msgid "Left" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Next Stop:\n" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Reverse train" msgstr "改变行车方向" +#: advtrains_line_automation/stoprail.lua +msgid "Right" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station Code" msgstr "车站代码" @@ -495,6 +761,18 @@ msgstr "" msgid "Track" msgstr "轨道" +#: advtrains_line_automation/stoprail.lua +msgid "Trains stopping here (ARS rules)" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Unknown Station" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Wait for signal to clear" +msgstr "" + #: advtrains_luaautomation/active_common.lua msgid "Clear Local Environment" msgstr "" @@ -563,6 +841,39 @@ msgid "" "privilege." msgstr "您没有“@1”权限,不能命名被动元件。" +#: advtrains_signals_japan/init.lua +msgid "Caution" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Clear (proceed)" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Danger (halt)" +msgstr "" + +#: advtrains_signals_japan/init.lua +#, fuzzy +msgid "Japanese signal pole" +msgstr "高速列车车厢" + +#: advtrains_signals_japan/init.lua +msgid "Reduced speed" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Restricted speed" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Distant Signal (" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Main Signal (" +msgstr "" + #: advtrains_train_industrial/init.lua msgid "Big Industrial Train Engine" msgstr "大型工业用火车头" @@ -717,6 +1028,9 @@ msgstr "对称道岔" #~ msgid "This position is protected!" #~ msgstr "这里已被保护。" +#~ msgid "This track can not be changed." +#~ msgstr "您不能调整这段轨道。" + #~ msgid "Use Sneak+rightclick to bypass closed doors!" #~ msgstr "请使用潜行+右键上车。" diff --git a/advtrains/po/zh_TW.po b/advtrains/po/zh_TW.po index 56b6531..ec65737 100644 --- a/advtrains/po/zh_TW.po +++ b/advtrains/po/zh_TW.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: advtrains\n" "Report-Msgid-Bugs-To: advtrains-discuss@lists.sr.ht\n" -"POT-Creation-Date: 2024-12-08 15:21+0100\n" +"POT-Creation-Date: 2025-03-25 15:40+0100\n" "PO-Revision-Date: 2023-10-09 11:31+0200\n" "Last-Translator: Y. Wang \n" "Language-Team: Chinese (Traditional)\n" @@ -53,7 +53,8 @@ msgstr "命令 (啟用時)" msgid "Digiline channel" msgstr "Digiline 頻道" -#: advtrains/atc.lua advtrains_line_automation/stoprail.lua +#: advtrains/atc.lua advtrains/wagons.lua +#: advtrains_line_automation/stoprail.lua #: advtrains_luaautomation/active_common.lua msgid "Save" msgstr "儲存" @@ -151,6 +152,128 @@ msgstr "駕駛室" msgid "Wheel" msgstr "車輪" +#: advtrains/init.lua +msgid " does not exist or is invalid" +msgstr "" + +#: advtrains/init.lua +msgid " is at " +msgstr "" + +#: advtrains/init.lua +msgid "(log" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains Status: no_action" +msgstr "" + +#: advtrains/init.lua +msgid "Advtrains is already running normally!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Crash during advtrains main step - skipping the shutdown save operation to " +"not save inconsistent data!" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Data is being saved. While saving, advtrains will remove the players from " +"trains. Save files will be reloaded afterwards!" +msgstr "" + +#: advtrains/init.lua +msgid "Delete all train routes, force them to recalculate" +msgstr "" + +#: advtrains/init.lua +msgid "" +"Detach all players, especially the offline ones, from all trains. Use only " +"when no one serious is on a train." +msgstr "" + +#: advtrains/init.lua +msgid "Disable the advtrains globalstep temporarily" +msgstr "" + +#: advtrains/init.lua +msgid "Disabled advtrains successfully" +msgstr "" + +#: advtrains/init.lua +msgid "Instructed to save() but load() was never called!" +msgstr "" + +#: advtrains/init.lua +msgid "Print advtrains status info" +msgstr "" + +#: advtrains/init.lua +msgid "Re-enabling advtrains globalstep..." +msgstr "" + +#: advtrains/init.lua +msgid "Reload successful!" +msgstr "" + +#: advtrains/init.lua +msgid "Removing unused wagon" +msgstr "" + +#: advtrains/init.lua +msgid "Restoring saved state in 1 second..." +msgstr "" + +#: advtrains/init.lua +msgid "Returns the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "Saving failed: " +msgstr "" + +#: advtrains/init.lua +msgid "Successfully invalidated train routes" +msgstr "" + +#: advtrains/init.lua +msgid "Teleporting to train " +msgstr "" + +#: advtrains/init.lua +msgid "Teleports you to the position of the train with the given id" +msgstr "" + +#: advtrains/init.lua +msgid "" +"The advtrains globalstep has been disabled. Trains are not moving, and no " +"data is saved! Run '/at_disable_step no' to enable again!" +msgstr "" + +#: advtrains/init.lua +msgid "Train" +msgstr "" + +#: advtrains/init.lua +#, fuzzy +msgid "Train " +msgstr "已複製火車。" + +#: advtrains/init.lua +msgid "from wagon_save table." +msgstr "" + +#: advtrains/init.lua +msgid "" +"had no wagons left because of some bug. It is being deleted. Wave it goodbye!" +msgstr "" + +#: advtrains/init.lua +msgid "slowdown" +msgstr "" + #: advtrains/misc_nodes.lua msgid "@1 Platform (45 degree)" msgstr "較高的@1月臺 (45°)" @@ -233,20 +356,53 @@ msgstr "壁掛式色燈號誌機 (右側)" msgid "Wallmounted Signal (top)" msgstr "懸掛式色燈號誌機" +#: advtrains/track_reg_helper.lua +msgid "@1 Slope" +msgstr "@1斜坡" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: Not enough slope items left (@1 required)" +msgstr "無法放置斜坡:您沒有足夠的鐵路斜坡放置工具 (您總共需要@1個)" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: There's no slope of length @1" +msgstr "無法放置斜坡:advtrains 不支援長度為@1米的斜坡。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: no supporting node at upper end." +msgstr "無法放置斜坡:較高階沒有支撐方塊。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: not pointing at node" +msgstr "無法放置斜坡:您沒有選擇任何方塊。" + +#: advtrains/track_reg_helper.lua +#, fuzzy +msgid "Can't place: space occupied!" +msgstr "無法放置斜坡:此區域已被佔用。" + +#: advtrains/track_reg_helper.lua advtrains/tracks.lua +#, fuzzy +msgid "This track can not be removed!" +msgstr "您不能移除這段軌道。" + #: advtrains/trackplacer.lua -msgid "This node can't be changed using the trackworker." +#, fuzzy +msgid "This node can't be changed using the trackworker!" msgstr "您不能使用鐵路調整工具調整這個方塊。" #: advtrains/trackplacer.lua -msgid "This node can't be rotated using the trackworker." +#, fuzzy +msgid "This node can't be rotated using the trackworker!" msgstr "您不能使用鐵路調整工具旋轉這個方塊。" #: advtrains/trackplacer.lua -msgid "This track can not be changed." -msgstr "您不能調整這段軌道。" - -#: advtrains/trackplacer.lua -msgid "This track can not be rotated." +#, fuzzy +msgid "This track can not be rotated!" msgstr "您不能旋轉這段軌道。" #: advtrains/trackplacer.lua @@ -261,30 +417,6 @@ msgstr "" "左鍵單擊:切換軌道型別\n" "右鍵單擊:旋轉方塊" -#: advtrains/tracks.lua -msgid "@1 Slope" -msgstr "@1斜坡" - -#: advtrains/tracks.lua -msgid "Can't place slope: Not enough slope items left (@1 required)." -msgstr "無法放置斜坡:您沒有足夠的鐵路斜坡放置工具 (您總共需要@1個)" - -#: advtrains/tracks.lua -msgid "Can't place slope: There's no slope of length @1." -msgstr "無法放置斜坡:advtrains 不支援長度為@1米的斜坡。" - -#: advtrains/tracks.lua -msgid "Can't place slope: no supporting node at upper end." -msgstr "無法放置斜坡:較高階沒有支撐方塊。" - -#: advtrains/tracks.lua -msgid "Can't place slope: not pointing at node." -msgstr "無法放置斜坡:您沒有選擇任何方塊。" - -#: advtrains/tracks.lua -msgid "Can't place slope: space occupied." -msgstr "無法放置斜坡:此區域已被佔用。" - #: advtrains/tracks.lua msgid "Position is occupied by a train." msgstr "" @@ -297,10 +429,6 @@ msgstr "" msgid "There's a Track Circuit Break here." msgstr "" -#: advtrains/tracks.lua -msgid "This track can not be removed." -msgstr "您不能移除這段軌道。" - #: advtrains/trainhud.lua msgid "OVERRUN RED SIGNAL! Examine situation and reverse train to move again." msgstr "" @@ -320,10 +448,40 @@ msgid "" "Punch a wagon to view and edit the Wagon Properties" msgstr "" +#: advtrains/wagons.lua +msgid " units" +msgstr "" + +#: advtrains/wagons.lua +msgid " wagon:destroy(): data is not set!" +msgstr "" + +#: advtrains/wagons.lua +msgid "!!! Train off track !!!" +msgstr "" + #: advtrains/wagons.lua msgid "(Doors closed)" msgstr "(車門已關閉)" +#: advtrains/wagons.lua +msgid "Allow these players to access your wagon:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Clear 'Disable ARS' flag" +msgstr "" + +#: advtrains/wagons.lua +msgid "Current FC: " +msgstr "" + +#: advtrains/wagons.lua +msgid "" +"Destroying wagon with inventory, but inventory is not found? Shouldn't " +"happen!" +msgstr "" + #: advtrains/wagons.lua msgid "Doors are closed! (Try holding sneak key!)" msgstr "" @@ -334,6 +492,10 @@ msgid "" "off." msgstr "車門已關閉,請使用潛行+右鍵單擊下車。" +#: advtrains/wagons.lua +msgid "Freight Code:" +msgstr "" + #: advtrains/wagons.lua msgid "Get off" msgstr "下車" @@ -346,10 +508,47 @@ msgstr "強制下車" msgid "Line" msgstr "火車線路" +#: advtrains/wagons.lua +msgid "Liquid: " +msgstr "" + +#: advtrains/wagons.lua +msgid "Liquid: empty" +msgstr "" + +#: advtrains/wagons.lua +msgid "Missing train_operator privilege" +msgstr "" + +#: advtrains/wagons.lua +msgid "Next FC:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Not a valid wagon id." +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "Not allowed to do this." +msgstr "您不能調整這段軌道。" + #: advtrains/wagons.lua msgid "Onboard Computer" msgstr "" +#: advtrains/wagons.lua +msgid "Please specify a player name to transfer ownership to." +msgstr "" + +#: advtrains/wagons.lua +msgid "Prev FC" +msgstr "" + +#: advtrains/wagons.lua +msgid "Remote Routesetting" +msgstr "" + #: advtrains/wagons.lua msgid "Routingcode" msgstr "路由碼" @@ -374,6 +573,20 @@ msgstr "車廂內部顯示" msgid "Text displayed outside on train" msgstr "車廂外部顯示" +#: advtrains/wagons.lua +msgid "That player does not exist!" +msgstr "" + +#: advtrains/wagons.lua +#, fuzzy +msgid "That wagon does not exist!" +msgstr "這節車廂沒有座位。" + +#: advtrains/wagons.lua +#, fuzzy +msgid "The track you are trying to place the wagon on is not long enough!" +msgstr "軌道太短。" + #: advtrains/wagons.lua msgid "The wagon's inventory is not empty." msgstr "" @@ -399,6 +612,26 @@ msgstr "這是 @1 的車廂,您不能摧毀它。" msgid "Train ID" msgstr "" +#: advtrains/wagons.lua +msgid "Train overview / coupling control is only shown when the train stands." +msgstr "" + +#: advtrains/wagons.lua +msgid "Train overview /coupling control:" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized init=" +msgstr "" + +#: advtrains/wagons.lua +msgid "Uninitialized, removing" +msgstr "" + +#: advtrains/wagons.lua +msgid "Wagon @1 ownership changed from @2 to @3" +msgstr "" + #: advtrains/wagons.lua msgid "Wagon needs to be decoupled from other wagons in order to destroy it." msgstr "" @@ -407,6 +640,10 @@ msgstr "" msgid "Wagon properties" msgstr "車廂屬性" +#: advtrains/wagons.lua +msgid "Wagon road number:" +msgstr "" + #: advtrains/wagons.lua msgid "" "Warning: If you destroy this wagon, you only get some steel back! If you are " @@ -423,6 +660,15 @@ msgstr "" msgid "You can't get on this wagon." msgstr "" +#: advtrains/wagons.lua +#, fuzzy +msgid "You don't have the train_operator privilege." +msgstr "您沒有「@1」許可權。" + +#: advtrains/wagons.lua +msgid "You have been given ownership of wagon @1" +msgstr "" + #: advtrains_interlocking/routesetting.lua msgid "Route state changed." msgstr "" @@ -447,6 +693,14 @@ msgstr "您沒有「@1」許可權,不能調整這段軌道。" msgid "You are not allowed to configure this track." msgstr "您不能調整這段軌道。" +#: advtrains_line_automation/scheduler.lua +msgid "No callback to handle schedule" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Closed" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Dep. Speed" msgstr "出發速度" @@ -463,10 +717,22 @@ msgstr "" msgid "Kick out passengers" msgstr "踢出乘客" +#: advtrains_line_automation/stoprail.lua +msgid "Left" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Next Stop:\n" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Reverse train" msgstr "改變行車方向" +#: advtrains_line_automation/stoprail.lua +msgid "Right" +msgstr "" + #: advtrains_line_automation/stoprail.lua msgid "Station Code" msgstr "車站碼" @@ -495,6 +761,18 @@ msgstr "" msgid "Track" msgstr "軌道" +#: advtrains_line_automation/stoprail.lua +msgid "Trains stopping here (ARS rules)" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Unknown Station" +msgstr "" + +#: advtrains_line_automation/stoprail.lua +msgid "Wait for signal to clear" +msgstr "" + #: advtrains_luaautomation/active_common.lua msgid "Clear Local Environment" msgstr "" @@ -563,6 +841,39 @@ msgid "" "privilege." msgstr "您沒有「@1」許可權,不能命名這個元件。" +#: advtrains_signals_japan/init.lua +msgid "Caution" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Clear (proceed)" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Danger (halt)" +msgstr "" + +#: advtrains_signals_japan/init.lua +#, fuzzy +msgid "Japanese signal pole" +msgstr "高速列車車廂" + +#: advtrains_signals_japan/init.lua +msgid "Reduced speed" +msgstr "" + +#: advtrains_signals_japan/init.lua +msgid "Restricted speed" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Distant Signal (" +msgstr "" + +#: advtrains_signals_muc_ubahn/init.lua +msgid "Munich U-Bahn Main Signal (" +msgstr "" + #: advtrains_train_industrial/init.lua msgid "Big Industrial Train Engine" msgstr "大型工業用火車頭" @@ -717,6 +1028,9 @@ msgstr "對稱道岔" #~ msgid "This position is protected!" #~ msgstr "這裡已被保護。" +#~ msgid "This track can not be changed." +#~ msgstr "您不能調整這段軌道。" + #~ msgid "Use Sneak+rightclick to bypass closed doors!" #~ msgstr "請使用潛行+右鍵上車。" diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index 10576c3..760c7da 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -7,6 +7,9 @@ -- An entity is ONLY spawned by update_trainpart_properties when it finds it useful. -- Only data that are only important to the entity itself are stored in the luaentity +-- Translation +S = attrans + -- TP delay when getting off wagon local GETOFF_TP_DELAY = 0.5 @@ -154,12 +157,12 @@ function wagon:ensure_init() end end if not self.noninitticks then - atwarn("wagon",self.id,"uninitialized init=",self.initialized) + atwarn("Wagon",self.id,S("Uninitialized init="),self.initialized) self.noninitticks=0 end self.noninitticks=self.noninitticks+1 if self.noninitticks>20 then - atwarn("wagon",self.id,"uninitialized, removing") + atwarn("Wagon",self.id,S("Uninitialized, removing")) self:destroy() else self.object:set_velocity({x=0,y=0,z=0}) @@ -182,7 +185,7 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct return end if data.owner and puncher:get_player_name()~=data.owner and (not minetest.check_player_privs(puncher, {train_admin = true })) then - minetest.chat_send_player(puncher:get_player_name(), attrans("This wagon is owned by @1, you can't destroy it.", data.owner)); + minetest.chat_send_player(puncher:get_player_name(), S("This wagon is owned by @1, you can't destroy it.", data.owner)); return end @@ -201,25 +204,25 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct if self.has_inventory then local inv=minetest.get_inventory({type="detached", name="advtrains_wgn_"..self.id}) if not inv then -- inventory is not initialized when wagon was never loaded - should never happen - atwarn("Destroying wagon with inventory, but inventory is not found? Shouldn't happen!") + atwarn(S("Destroying wagon with inventory, but inventory is not found? Shouldn't happen!")) return end for listname, _ in pairs(inv:get_lists()) do if not inv:is_empty(listname) then - minetest.chat_send_player(puncher:get_player_name(), attrans("The wagon's inventory is not empty.")); + minetest.chat_send_player(puncher:get_player_name(), S("The wagon's inventory is not empty.")); return end end end if #(self:train().trainparts)>1 then - minetest.chat_send_player(puncher:get_player_name(), attrans("Wagon needs to be decoupled from other wagons in order to destroy it.")); + minetest.chat_send_player(puncher:get_player_name(), S("Wagon needs to be decoupled from other wagons in order to destroy it.")); return end local pc=puncher:get_player_control() if not pc.sneak then - minetest.chat_send_player(puncher:get_player_name(), attrans("Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click the wagon.")) + minetest.chat_send_player(puncher:get_player_name(), S("Warning: If you destroy this wagon, you only get some steel back! If you are sure, hold Sneak and left-click the wagon.")) return end @@ -240,7 +243,7 @@ function wagon:destroy() if self.id then local data = advtrains.wagons[self.id] if not data then - atwarn("wagon:destroy(): data is not set!") + atwarn(S(" wagon:destroy(): data is not set!")) return end @@ -367,15 +370,15 @@ function wagon:on_step(dtime) --show off-track information in outside text instead of notifying the whole server about this if train.off_track then - outside = outside .."\n!!! Train off track !!!" + outside = outside .."\n"..S("!!! Train off track !!!") end -- liquid container: display liquid contents in infotext if self.techage_liquid_capacity then if data.techage_liquid and data.techage_liquid.name then - outside = outside .."\nLiquid: "..data.techage_liquid.name..", "..data.techage_liquid.amount.." units" + outside = outside .."\n"..S("Liquid: ")..data.techage_liquid.name..", "..data.techage_liquid.amount..S(" units") else - outside = outside .."\nLiquid: empty" + outside = outside .."\n"..S("Liquid: empty") end end @@ -669,21 +672,21 @@ function wagon:on_rightclick(clicker) end end if self.has_inventory and self.get_inventory_formspec and advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist) then - poss[#poss+1]={name=attrans("Show Inventory"), key="inv"} + poss[#poss+1]={name=S("Show Inventory"), key="inv"} end if self.seat_groups[sgr].driving_ctrl_access and advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist) then - poss[#poss+1]={name=attrans("Onboard Computer"), key="bordcom"} + poss[#poss+1]={name=S("Onboard Computer"), key="bordcom"} end if data.owner==pname then - poss[#poss+1]={name=attrans("Wagon properties"), key="prop"} + poss[#poss+1]={name=S("Wagon properties"), key="prop"} end if not self.seat_groups[sgr].require_doors_open or self:train().door_open~=0 then - poss[#poss+1]={name=attrans("Get off"), key="off"} + poss[#poss+1]={name=S("Get off"), key="off"} else if clicker:get_player_control().sneak then - poss[#poss+1]={name=attrans("Get off (forced)"), key="off"} + poss[#poss+1]={name=S("Get off (forced)"), key="off"} else - poss[#poss+1]={name=attrans("(Doors closed)"), key="dcwarn"} + poss[#poss+1]={name=S("(Doors closed)"), key="dcwarn"} end end if #poss==0 then @@ -693,7 +696,7 @@ function wagon:on_rightclick(clicker) else local form = "size[5,"..1+(#poss).."]" for pos,ent in ipairs(poss) do - form = form .. "button_exit[0.5,"..(pos-0.5)..";4,1;"..ent.key..";"..ent.name.."]" + form = form.. "button_exit[0.5,"..(pos-0.5)..";4,1;"..ent.key..";"..ent.name.."]" end minetest.show_formspec(pname, "advtrains_seating_"..self.id, form) end @@ -712,7 +715,7 @@ function wagon:on_rightclick(clicker) end local doors_open = self:train().door_open~=0 or clicker:get_player_control().sneak - local allow, rsn=false, attrans("This wagon has no seats.") + local allow, rsn=false, S("This wagon has no seats.") for _,sgr in ipairs(self.assign_to_seat_group) do allow, rsn = self:check_seat_group_access(pname, sgr) if allow then @@ -723,16 +726,16 @@ function wagon:on_rightclick(clicker) self:get_on(clicker, seatid) return else - rsn=attrans("This wagon is full.") + rsn=S("This wagon is full.") end else - rsn=attrans("Doors are closed! (Try holding sneak key!)") + rsn=S("Doors are closed! (Try holding sneak key!)") end end end end end - minetest.chat_send_player(pname, rsn or attrans("You can't get on this wagon.")) + minetest.chat_send_player(pname, rsn or S("You can't get on this wagon.")) else self:show_get_on_form(pname) end @@ -858,7 +861,7 @@ function wagon:show_get_on_form(pname) end return end - local form, comma="size[5,8]label[0.5,0.5;"..attrans("Select seat:").."]textlist[0.5,1;4,6;seat;", "" + local form, comma="size[5,8]label[0.5,0.5;"..S("Select seat:").."]textlist[0.5,1;4,6;seat;", "" for seatno, seattbl in ipairs(self.seats) do local addtext, colorcode="", "" if data.seatp and data.seatp[seatno] then @@ -870,7 +873,7 @@ function wagon:show_get_on_form(pname) end form=form..";0,false]" if self.has_inventory and self.get_inventory_formspec then - form=form.."button_exit[1,7;3,1;inv;"..attrans("Show Inventory").."]" + form=form.."button_exit[1,7;3,1;inv;"..S("Show Inventory").."]" end minetest.show_formspec(pname, "advtrains_geton_"..self.id, form) end @@ -881,27 +884,27 @@ function wagon:show_wagon_properties(pname) button: save ]] local data = advtrains.wagons[self.id] - local form = "size[5,5]" - form = form.."label[0.2,0;"..attrans("This Wagon ID")..": "..self.id.." ("..data.owner..")]" - form = form .. "field[0.5,1;4.5,1;whitelist;Allow these players to access your wagon:;"..minetest.formspec_escape(data.whitelist or "").."]" - form = form .. "field[0.5,2;4.5,1;roadnumber;Wagon road number:;"..minetest.formspec_escape(data.roadnumber or "").."]" + local form="size[5,5]" + form=form.."label[0.2,0;"..S("This Wagon ID")..": "..self.id.." ("..data.owner..")]" + form = form.."field[0.5,1;4.5,1;whitelist;"..S("Allow these players to access your wagon:")..";"..minetest.formspec_escape(data.whitelist or "").."]" + form = form.."field[0.5,2;4.5,1;roadnumber;"..S("Wagon road number:")..";"..minetest.formspec_escape(data.roadnumber or "").."]" local fc = "" if data.fc then fc = table.concat(data.fc, "!") end - form = form .. "field[0.5,3;4.5,1;fc;Freight Code:;"..fc.."]" + form = form.. "field[0.5,3;4.5,1;fc;"..S("Freight Code:")..";"..fc.."]" if data.fc then if not data.fcind then data.fcind = 1 end if data.fcind > 1 then - form=form.."button[0.5,3.5;1,1;fcp;prev FC]" + form=form.."button[0.5,3.5;1,1;fcp;"..S("Prev FC").."]" end - form=form.."label[1.5,3.5;Current FC:]" + form=form.."label[1.5,3.5;"..S("Current FC: ").."]" local cur = data.fc[data.fcind] or "" form=form.."label[1.5,3.75;"..minetest.formspec_escape(cur).."]" - form=form.."button[3.5,3.5;1,1;fcn;next FC]" + form=form.."button[3.5,3.5;1,1;fcn;"..S("Next FC:").."]" end - form=form.."button_exit[0.5,4.5;4,1;save;"..attrans("Save wagon properties").."]" + form=form.."button_exit[0.5,4.5;4,1;save;"..S("Save wagon properties").."]" minetest.show_formspec(pname, "advtrains_prop_"..self.id, form) end @@ -986,30 +989,30 @@ function wagon:show_bordcom(pname) local linhei local form = "size[11,9]label[0.5,0;AdvTrains Boardcom v0.1]" - form=form.."textarea[7.5,0.05;10,1;;"..attrans("Train ID")..": "..(minetest.formspec_escape(train.id or ""))..";]" - form=form.."textarea[0.5,1.5;7,1;text_outside;"..attrans("Text displayed outside on train")..";"..(minetest.formspec_escape(train.text_outside or "")).."]" - form=form.."textarea[0.5,3;7,1;text_inside;"..attrans("Text displayed inside train")..";"..(minetest.formspec_escape(train.text_inside or "")).."]" - form=form.."field[7.5,1.75;3,1;line;"..attrans("Line")..";"..(minetest.formspec_escape(train.line or "")).."]" - form=form.."field[7.5,3.25;3,1;routingcode;"..attrans("Routingcode")..";"..(minetest.formspec_escape(train.routingcode or "")).."]" + form=form.."textarea[7.5,0.05;10,1;;"..S("Train ID")..": "..(minetest.formspec_escape(train.id or ""))..";]" + form=form.."textarea[0.5,1.5;7,1;text_outside;"..S("Text displayed outside on train")..";"..(minetest.formspec_escape(train.text_outside or "")).."]" + form=form.."textarea[0.5,3;7,1;text_inside;"..S("Text displayed inside train")..";"..(minetest.formspec_escape(train.text_inside or "")).."]" + form=form.."field[7.5,1.75;3,1;line;"..S("Line")..";"..(minetest.formspec_escape(train.line or "")).."]" + form=form.."field[7.5,3.25;3,1;routingcode;"..S("Routingcode")..";"..(minetest.formspec_escape(train.routingcode or "")).."]" --row 5 : train overview and autocoupling if train.velocity==0 then - form=form.."label[0.5,4;Train overview /coupling control:]" + form=form.."label[0.5,4;"..S("Train overview /coupling control:").."])" linhei=5 local pre_own, pre_wl, owns_any = nil, nil, minetest.check_player_privs(pname, "train_admin") for i, tpid in ipairs(train.trainparts) do local ent = advtrains.wagons[tpid] if ent then local roadnumber = ent.roadnumber or "" - form = form .. string.format("button[%d,%d;%d,%d;%s;%s]", i, linhei, 1, 0.2, "wgprp"..i, roadnumber) + form = form.. string.format("button[%d,%d;%d,%d;%s;%s]", i, linhei, 1, 0.2, "wgprp"..i, roadnumber) local ename = ent.type - form = form .. "item_image["..i..","..(linhei+0.5)..";1,1;"..ename.."]" + form = form.. "item_image["..i..","..(linhei+0.5)..";1,1;"..ename.."]" if i~=1 then if checklock(pname, ent.owner, pre_own, ent.whitelist, pre_wl) then - form = form .. "image_button["..(i-0.5)..","..(linhei+1.5)..";1,1;advtrains_discouple.png;dcpl_"..i..";]" + form = form.. "image_button["..(i-0.5)..","..(linhei+1.5)..";1,1;advtrains_discouple.png;dcpl_"..i..";]" end end if i == data.pos_in_trainparts then - form = form .. "box["..(i-0.1)..","..(linhei+0.4)..";1,1;green]" + form = form.. "box["..(i-0.1)..","..(linhei+0.4)..";1,1;green]" end pre_own = ent.owner pre_wl = ent.whitelist @@ -1018,24 +1021,24 @@ function wagon:show_bordcom(pname) end if train.movedir==1 then - form = form .. "label["..(#train.trainparts+1)..","..(linhei)..";-->]" + form = form.. "label["..(#train.trainparts+1)..","..(linhei)..";-->]" else - form = form .. "label[0.5,"..(linhei)..";<--]" + form = form.. "label[0.5,"..(linhei)..";<--]" end --check cpl_eid_front and _back of train local couple_front = checkcouple(train.cpl_front) local couple_back = checkcouple(train.cpl_back) if couple_front then - form = form .. "image_button[0.5,"..(linhei+1)..";1,1;advtrains_couple.png;cpl_f;]" + form = form.. "image_button[0.5,"..(linhei+1)..";1,1;advtrains_couple.png;cpl_f;]" end if couple_back then - form = form .. "image_button["..(#train.trainparts+0.5)..","..(linhei+1)..";1,1;advtrains_couple.png;cpl_b;]" + form = form.. "image_button["..(#train.trainparts+0.5)..","..(linhei+1)..";1,1;advtrains_couple.png;cpl_b;]" end else - form=form.."label[0.5,4.5;Train overview / coupling control is only shown when the train stands.]" + form=form.."label[0.5,4.5;"..S("Train overview / coupling control is only shown when the train stands.").."]" end - form = form .. "button[0.5,8;3,1;save;Save]" + form = form.. "button[0.5,8;3,1;save;"..S("Save").."]" -- Interlocking functionality: If the interlocking module is loaded, you can set the signal aspect -- from inside the train @@ -1045,14 +1048,14 @@ function wagon:show_bordcom(pname) local oci = train.lzb.checkpoints[i] if oci.udata and oci.udata.signal_pos then if advtrains.interlocking.db.get_sigd_for_signal(oci.udata.signal_pos) then - form = form .. "button[4.5,8;5,1;ilrs;Remote Routesetting]" + form = form.. "button[4.5,8;5,1;ilrs;"..S("Remote Routesetting").."]" break end end i=i+1 end if train.ars_disable then - form = form .. "button[4.5,7;5,1;ilarsenable;Clear 'Disable ARS' flag]" + form = form.. "button[4.5,7;5,1;ilarsenable;"..S("Clear 'Disable ARS' flag").."]" end end @@ -1269,7 +1272,7 @@ function wagon:seating_from_key_helper(pname, fields, no) self:show_bordcom(pname) end if fields.dcwarn then - minetest.chat_send_player(pname, attrans("Doors are closed. Use Sneak+rightclick to ignore the closed doors and get off.")) + minetest.chat_send_player(pname, S("Doors are closed. Use Sneak+rightclick to ignore the closed doors and get off.")) end if fields.off then self:get_off(no) @@ -1278,7 +1281,7 @@ end function wagon:check_seat_group_access(pname, sgr) local data = advtrains.wagons[self.id] if self.seat_groups[sgr].driving_ctrl_access and not (advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist)) then - return false, attrans("You are not allowed to access the driver stand.") + return false, S("You are not allowed to access the driver stand.") end if self.seat_groups[sgr].driving_ctrl_access then advtrains.log("Drive", pname, self.object:get_pos(), self:train().text_outside) @@ -1298,7 +1301,7 @@ end function advtrains.safe_decouple_wagon(w_id, pname, try_run) if not minetest.check_player_privs(pname, "train_operator") then - minetest.chat_send_player(pname, "Missing train_operator privilege") + minetest.chat_send_player(pname, S("Missing train_operator privilege")) return false end local data = advtrains.wagons[w_id] @@ -1316,7 +1319,7 @@ function advtrains.safe_decouple_wagon(w_id, pname, try_run) end if not checklock(pname, data.owner, owdata.owner, data.whitelist, owdata.whitelist) then - minetest.chat_send_player(pname, "Not allowed to do this.") + minetest.chat_send_player(pname, S("Not allowed to do this.")) return false end @@ -1341,7 +1344,7 @@ function advtrains.get_wagon_prototype(data) end local rt, proto = advtrains.resolve_wagon_alias(wt) if not rt then - --atwarn("Unable to load wagon type",wt,", using placeholder") + --atwarn(S("Unable to load wagon type"),wt,S(", using placeholder")) rt = "advtrains:wagon_placeholder" proto = advtrains.wagon_prototypes[rt] end @@ -1378,7 +1381,7 @@ function advtrains.standard_inventory_formspec(self, pname, invname) local r = "size[8,11]".. "list["..invname..";box;0,0;8,3;]" if data.owner==pname then - r = r .. "button_exit[0,9;4,1;prop;"..attrans("Wagon properties").."]" + r = r .. "button_exit[0,9;4,1;prop;"..S("Wagon properties").."]" end r = r .. "list[current_player;main;0,5;8,4;]".. "listring[]" @@ -1435,7 +1438,7 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati return itemstack end if not minetest.check_player_privs(placer, {train_operator = true }) then - minetest.chat_send_player(pname, "You don't have the train_operator privilege.") + minetest.chat_send_player(pname, S("You don't have the train_operator privilege.")) return itemstack end if not minetest.check_player_privs(placer, {train_admin = true }) and minetest.is_protected(pos, placer:get_player_name()) then @@ -1447,7 +1450,7 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati local prevpos = advtrains.get_adjacent_rail(pos, tconns, plconnid) if not prevpos then - minetest.chat_send_player(pname, "The track you are trying to place the wagon on is not long enough!") + minetest.chat_send_player(pname, S("The track you are trying to place the wagon on is not long enough!")) return end diff --git a/advtrains_line_automation/scheduler.lua b/advtrains_line_automation/scheduler.lua index 6025b02..5cba0a0 100644 --- a/advtrains_line_automation/scheduler.lua +++ b/advtrains_line_automation/scheduler.lua @@ -59,7 +59,7 @@ function sched.run() -- run it callbacks[elem.e](elem.d) else - atwarn("[lines][scheduler] No callback to handle schedule",elem) + atwarn("[lines][scheduler] "..S("No callback to handle schedule"),elem) end cnt=cnt+1 ucn = units_cnt[elem.u] diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua index ba3977d..89f4a09 100644 --- a/advtrains_line_automation/stoprail.lua +++ b/advtrains_line_automation/stoprail.lua @@ -1,6 +1,8 @@ -- stoprail.lua -- adds "stop rail". Recognized by lzb. (part of behavior is implemented there) +-- Translation +S = attrans local function to_int(n) --- Disallow floating-point numbers @@ -28,7 +30,7 @@ local function show_stoprailform(pos, player) local pe = advtrains.encode_pos(pos) local pname = player:get_player_name() if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, attrans("You are not allowed to configure this track.")) + minetest.chat_send_player(pname, S("You are not allowed to configure this track.")) return end @@ -51,19 +53,19 @@ local function show_stoprailform(pos, player) local form = "size[8,7]" form = form.."style[stn,ars;font=mono]" - form = form.."field[0.8,0.8;2,1;stn;"..attrans("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]" - form = form.."field[2.8,0.8;5,1;stnname;"..attrans("Station Name")..";"..minetest.formspec_escape(stnname).."]" - form = form.."field[0.80,2.0;1.75,1;ddelay;"..attrans("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]" - form = form.."field[2.55,2.0;1.75,1;speed;"..attrans("Dep. Speed")..";"..minetest.formspec_escape(stdata.speed).."]" - form = form.."field[4.30,2.0;1.75,1;track;"..attrans("Track")..";"..minetest.formspec_escape(stdata.track).."]" - form = form.."field[6.05,2.0;1.75,1;wait;"..attrans("Stop Time")..";"..stdata.wait.."]" - form = form.."label[0.5,2.6;"..attrans("Door Side").."]" - form = form.."dropdown[0.51,3.0;2;doors;Left,Right,Closed;"..door_dropdown[stdata.doors].."]" - form = form.."checkbox[3.00,2.4;reverse;"..attrans("Reverse train")..";"..(stdata.reverse and "true" or "false").."]" - form = form.."checkbox[3.00,2.8;kick;"..attrans("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]" - form = form.."checkbox[3.00,3.2;waitsig;"..attrans("Wait for signal to clear")..";"..(stdata.waitsig and "true" or "false").."]" - form = form.."textarea[0.8,4.2;7,2;ars;Trains stopping here (ARS rules);"..advtrains.interlocking.ars_to_text(stdata.ars).."]" - form = form.."button[0.5,6;7,1;save;"..attrans("Save").."]" + form = form.."field[0.8,0.8;2,1;stn;"..S("Station Code")..";"..minetest.formspec_escape(stdata.stn).."]" + form = form.."field[2.8,0.8;5,1;stnname;"..S("Station Name")..";"..minetest.formspec_escape(stnname).."]" + form = form.."field[0.80,2.0;1.75,1;ddelay;"..S("Door Delay")..";"..minetest.formspec_escape(stdata.ddelay).."]" + form = form.."field[2.55,2.0;1.75,1;speed;"..S("Dep. Speed")..";"..minetest.formspec_escape(stdata.speed).."]" + form = form.."field[4.30,2.0;1.75,1;track;"..S("Track")..";"..minetest.formspec_escape(stdata.track).."]" + form = form.."field[6.05,2.0;1.75,1;wait;"..S("Stop Time")..";"..stdata.wait.."]" + form = form.."label[0.5,2.6;"..S("Door Side").."]" + form = form.."dropdown[0.51,3.0;2;doors;"..S("Left")..","..S("Right")..","..S("Closed")..";"..door_dropdown[stdata.doors].."]" + form = form.."checkbox[3.00,2.4;reverse;"..S("Reverse train")..";"..(stdata.reverse and "true" or "false").."]" + form = form.."checkbox[3.00,2.8;kick;"..S("Kick out passengers")..";"..(stdata.kick and "true" or "false").."]" + form = form.."checkbox[3.00,3.2;waitsig;"..S("Wait for signal to clear")..";"..(stdata.waitsig and "true" or "false").."]" + form = form.."textarea[0.8,4.2;7,2;ars;"..S("Trains stopping here (ARS rules)")..";"..advtrains.interlocking.ars_to_text(stdata.ars).."]" + form = form.."button[0.5,6;7,1;save;"..S("Save").."]" minetest.show_formspec(pname, "at_lines_stop_"..pe, form) end @@ -74,7 +76,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local pos = advtrains.decode_pos(pe) if pos then if minetest.is_protected(pos, pname) then - minetest.chat_send_player(pname, attrans("You are not allowed to configure this track.")) + minetest.chat_send_player(pname, S("You are not allowed to configure this track.")) return end @@ -98,7 +100,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then stdata.stn = fields.stn else - minetest.chat_send_player(pname, attrans("Station code \"@1\" already exists and is owned by @2.", fields.stn, stn.owner)) + minetest.chat_send_player(pname, S("Station code \"@1\" already exists and is owned by @2.", fields.stn, stn.owner)) show_stoprailform(pos,player) return end @@ -112,7 +114,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if (stn.owner == pname or minetest.check_player_privs(pname, "train_admin")) then stn.name = fields.stnname else - minetest.chat_send_player(pname, attrans("This station is owned by @1. You are not allowed to edit its name.", stn.owner)) + minetest.chat_send_player(pname, S("This station is owned by @1. You are not allowed to edit its name.", stn.owner)) end end @@ -183,8 +185,8 @@ local adefunc = function(def, preset, suffix, rotation) if stdata.ars and (stdata.ars.default or advtrains.interlocking.ars_check_rule_match(stdata.ars, train) ) then advtrains.lzb_add_checkpoint(train, index, 2, nil) local stn = advtrains.lines.stations[stdata.stn] - local stnname = stn and stn.name or "Unknown Station" - train.text_inside = "Next Stop:\n"..stnname + local stnname = stn and stn.name or S("Unknown Station") + train.text_inside = S("Next Stop:\n")..stnname advtrains.interlocking.ars_set_disable(train, true) end end @@ -200,7 +202,7 @@ local adefunc = function(def, preset, suffix, rotation) if stdata.ars and (stdata.ars.default or advtrains.interlocking.ars_check_rule_match(stdata.ars, train) ) then local stn = advtrains.lines.stations[stdata.stn] - local stnname = stn and stn.name or "Unknown Station" + local stnname = stn and stn.name or S("Unknown Station") -- Send ATC command and set text advtrains.atc.train_set_command(train, "B0 W O"..stdata.doors..(stdata.kick and "K" or "") @@ -225,7 +227,7 @@ if minetest.get_modpath("advtrains_train_track") ~= nil then models_prefix="advtrains_dtrack", models_suffix=".b3d", shared_texture="advtrains_dtrack_shared_stop.png", - description=attrans("Station/Stop Track"), + description=S("Station/Stop Track"), formats={}, get_additional_definiton = adefunc, }, advtrains.trackpresets.t_30deg_straightonly) -- cgit v1.2.3