MT-Translationsupport added.
parent
4828663058
commit
82106d701f
37
booking.lua
37
booking.lua
|
@ -12,40 +12,39 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local tBlockingTime = {}
|
||||
local tBookings = {} -- open bookings: tBookings[S(departure_pos)] = arrival_pos
|
||||
local tBookings = {} -- open bookings: tBookings[SP(departure_pos)] = arrival_pos
|
||||
|
||||
local Stations = hyperloop.Stations
|
||||
|
||||
-- Reserve departure and arrival stations for some time
|
||||
function hyperloop.reserve(departure_pos, arrival_pos, player)
|
||||
if Stations:get(departure_pos) == nil then
|
||||
hyperloop.chat(player, I("Station data is corrupted. Please rebuild the station!"))
|
||||
hyperloop.chat(player, S("Station data is corrupted. Please rebuild the station!"))
|
||||
return false
|
||||
elseif Stations:get(arrival_pos) == nil then
|
||||
hyperloop.chat(player, I("Station data is corrupted. Please rebuild the station!"))
|
||||
hyperloop.chat(player, S("Station data is corrupted. Please rebuild the station!"))
|
||||
return false
|
||||
end
|
||||
|
||||
if (tBlockingTime[S(departure_pos)] or 0) > minetest.get_gametime() then
|
||||
hyperloop.chat(player, I("Station is still blocked. Please try again in a few seconds!"))
|
||||
if (tBlockingTime[SP(departure_pos)] or 0) > minetest.get_gametime() then
|
||||
hyperloop.chat(player, S("Station is still blocked. Please try again in a few seconds!"))
|
||||
return false
|
||||
elseif (tBlockingTime[S(arrival_pos)] or 0) > minetest.get_gametime() then
|
||||
hyperloop.chat(player, I("Station is still blocked. Please try again in a few seconds!"))
|
||||
elseif (tBlockingTime[SP(arrival_pos)] or 0) > minetest.get_gametime() then
|
||||
hyperloop.chat(player, S("Station is still blocked. Please try again in a few seconds!"))
|
||||
return false
|
||||
end
|
||||
|
||||
-- place a reservation for 20 seconds to start the trip
|
||||
tBlockingTime[S(departure_pos)] = minetest.get_gametime() + 20
|
||||
tBlockingTime[S(arrival_pos)] = minetest.get_gametime() + 20
|
||||
tBlockingTime[SP(departure_pos)] = minetest.get_gametime() + 20
|
||||
tBlockingTime[SP(arrival_pos)] = minetest.get_gametime() + 20
|
||||
return true
|
||||
end
|
||||
|
||||
|
@ -57,8 +56,8 @@ function hyperloop.block(departure_pos, arrival_pos, seconds)
|
|||
return false
|
||||
end
|
||||
|
||||
tBlockingTime[S(departure_pos)] = minetest.get_gametime() + seconds
|
||||
tBlockingTime[S(arrival_pos)] = minetest.get_gametime() + seconds
|
||||
tBlockingTime[SP(departure_pos)] = minetest.get_gametime() + seconds
|
||||
tBlockingTime[SP(arrival_pos)] = minetest.get_gametime() + seconds
|
||||
return true
|
||||
end
|
||||
|
||||
|
@ -69,17 +68,17 @@ function hyperloop.is_blocked(pos)
|
|||
return false
|
||||
end
|
||||
|
||||
return (tBlockingTime[S(pos)] or 0) > minetest.get_gametime()
|
||||
return (tBlockingTime[SP(pos)] or 0) > minetest.get_gametime()
|
||||
end
|
||||
|
||||
|
||||
function hyperloop.set_arrival(departure_pos, arrival_pos)
|
||||
tBookings[S(departure_pos)] = arrival_pos
|
||||
tBookings[SP(departure_pos)] = arrival_pos
|
||||
end
|
||||
|
||||
function hyperloop.get_arrival(departure_pos)
|
||||
-- Return and delete the arrival pos
|
||||
local arrival_pos = tBookings[S(departure_pos)]
|
||||
tBookings[S(departure_pos)] = nil
|
||||
local arrival_pos = tBookings[SP(departure_pos)]
|
||||
tBookings[SP(departure_pos)] = nil
|
||||
return arrival_pos
|
||||
end
|
||||
|
|
|
@ -12,16 +12,16 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
-- Used to store the Station list for each booking machine:
|
||||
-- tStationList[S(pos)] = {pos1, pos2, ...}
|
||||
-- tStationList[SP(pos)] = {pos1, pos2, ...}
|
||||
local tStationList = {}
|
||||
|
||||
local Stations = hyperloop.Stations
|
||||
|
@ -34,12 +34,12 @@ local function generate_string(sortedList)
|
|||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"item_image[0,0;1,1;hyperloop:booking]"..
|
||||
"label[4,0; "..I("Select your destination").."]"}
|
||||
"label[4,0; "..S("Select your destination").."]"}
|
||||
tRes[2] = "tablecolumns[text,width=20;text,width=6,align=right;text]"
|
||||
|
||||
local stations = {}
|
||||
for idx,tDest in ipairs(sortedList) do
|
||||
local name = tDest.name or I("<unknown>")
|
||||
local name = tDest.name or S("<unknown>")
|
||||
local distance = tDest.distance or 0
|
||||
local info = tDest.booking_info or ""
|
||||
|
||||
|
@ -62,7 +62,7 @@ local function store_station_list(pos, sortedList)
|
|||
for idx,item in ipairs(sortedList) do
|
||||
tbl[#tbl+1] = item.pos
|
||||
end
|
||||
tStationList[S(pos)] = tbl
|
||||
tStationList[SP(pos)] = tbl
|
||||
end
|
||||
|
||||
local function remove_junctions(sortedList)
|
||||
|
@ -95,9 +95,9 @@ local function naming_formspec(pos)
|
|||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,0;"..I("Please enter the station name to\nwhich this booking machine belongs.").."]" ..
|
||||
"field[0.5,1.5;5,1;name;"..I("Station name")..";MyTown]" ..
|
||||
"field[0.5,2.7;5,1;info;"..I("Additional station information")..";]" ..
|
||||
"label[0,0;"..S("Please enter the station name to\nwhich this booking machine belongs.").."]" ..
|
||||
"field[0.5,1.5;5,1;name;"..S("Station name")..";MyTown]" ..
|
||||
"field[0.5,2.7;5,1;info;"..S("Additional station information")..";]" ..
|
||||
"button_exit[2,3.6;2,1;exit;Save]"
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_int("change_counter", 0)
|
||||
|
@ -139,7 +139,7 @@ local function on_receive_fields(pos, formname, fields, player)
|
|||
local stationPos = Stations:get_next_station(pos)
|
||||
if stationPos then
|
||||
if Stations:get(stationPos).booking_pos then
|
||||
hyperloop.chat(player, I("Station has already a booking machine!"))
|
||||
hyperloop.chat(player, S("Station has already a booking machine!"))
|
||||
return
|
||||
end
|
||||
-- store meta and generate station formspec
|
||||
|
@ -150,18 +150,18 @@ local function on_receive_fields(pos, formname, fields, player)
|
|||
})
|
||||
|
||||
local meta = M(pos)
|
||||
meta:set_string("sStationPos", S(stationPos))
|
||||
meta:set_string("sStationPos", SP(stationPos))
|
||||
meta:set_string("infotext", "Station: "..station_name)
|
||||
meta:set_string("formspec", station_list_as_string(stationPos))
|
||||
else
|
||||
hyperloop.chat(player, I("Invalid station name!"))
|
||||
hyperloop.chat(player, S("Invalid station name!"))
|
||||
end
|
||||
elseif fields.button ~= nil then -- destination selected?
|
||||
local te = minetest.explode_table_event(fields.button)
|
||||
local idx = tonumber(te.row)
|
||||
if idx and te.type=="CHG" then
|
||||
local tStation, src_pos = hyperloop.get_base_station(pos)
|
||||
local dest_pos = tStationList[S(src_pos)] and tStationList[S(src_pos)][idx]
|
||||
local dest_pos = tStationList[SP(src_pos)] and tStationList[SP(src_pos)][idx]
|
||||
if dest_pos and tStation then
|
||||
-- place booking if not already blocked
|
||||
if hyperloop.reserve(src_pos, dest_pos, player) then
|
||||
|
@ -206,7 +206,7 @@ end
|
|||
|
||||
-- wall mounted booking machine
|
||||
minetest.register_node("hyperloop:booking", {
|
||||
description = I("Hyperloop Booking Machine"),
|
||||
description = S("Hyperloop Booking Machine"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_booking.png",
|
||||
|
@ -243,7 +243,7 @@ minetest.register_node("hyperloop:booking", {
|
|||
|
||||
-- ground mounted booking machine
|
||||
minetest.register_node("hyperloop:booking_ground", {
|
||||
description = I("Hyperloop Booking Machine"),
|
||||
description = S("Hyperloop Booking Machine"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_booking.png",
|
||||
|
|
20
deco.lua
20
deco.lua
|
@ -14,8 +14,8 @@
|
|||
]]--
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local tilesL = {"hyperloop_alpsL.png", "hyperloop_seaL.png", "hyperloop_agyptL.png"}
|
||||
local tilesR = {"hyperloop_alpsR.png", "hyperloop_seaR.png", "hyperloop_agyptR.png"}
|
||||
|
@ -30,7 +30,7 @@ end
|
|||
for idx = 1,3 do
|
||||
|
||||
minetest.register_node("hyperloop:poster"..idx.."L", {
|
||||
description = I("Hyperloop Promo Poster ")..idx,
|
||||
description = S("Hyperloop Promo Poster ")..idx,
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin2.png",
|
||||
|
@ -78,7 +78,7 @@ for idx = 1,3 do
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:poster"..idx.."R", {
|
||||
description = I("Hyperloop Promo Poster ")..idx,
|
||||
description = S("Hyperloop Promo Poster ")..idx,
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin2.png",
|
||||
|
@ -104,7 +104,7 @@ end
|
|||
|
||||
|
||||
minetest.register_node("hyperloop:sign", {
|
||||
description = I("Hyperloop Station Sign"),
|
||||
description = S("Hyperloop Station Sign"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_sign_top.png",
|
||||
|
@ -116,7 +116,7 @@ minetest.register_node("hyperloop:sign", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:signR", {
|
||||
description = I("Hyperloop Station Sign Right"),
|
||||
description = S("Hyperloop Station Sign Right"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_sign3.png^[transformR90]",
|
||||
|
@ -153,7 +153,7 @@ minetest.register_node("hyperloop:signR", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:signL", {
|
||||
description = I("Hyperloop Station Sign Left"),
|
||||
description = S("Hyperloop Station Sign Left"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_sign3.png^[transformR90]",
|
||||
|
@ -190,7 +190,7 @@ minetest.register_node("hyperloop:signL", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:signR_ground", {
|
||||
description = I("Hyperloop Station Sign Right"),
|
||||
description = S("Hyperloop Station Sign Right"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_sign3.png^[transformR90]",
|
||||
|
@ -216,7 +216,7 @@ minetest.register_node("hyperloop:signR_ground", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:signL_ground", {
|
||||
description = I("Hyperloop Station Sign Left"),
|
||||
description = S("Hyperloop Station Sign Left"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_sign3.png^[transformR90]",
|
||||
|
@ -239,4 +239,4 @@ minetest.register_node("hyperloop:signL_ground", {
|
|||
light_source = 4,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2, stone = 2, not_in_creative_inventory=1},
|
||||
})
|
||||
})
|
||||
|
|
14
door.lua
14
door.lua
|
@ -11,20 +11,20 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
--- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
-- Open the door for an emergency
|
||||
local function door_on_punch(pos, node, puncher, pointed_thing)
|
||||
local station = hyperloop.get_base_station(pos)
|
||||
if station then
|
||||
if station.name == "Station" then
|
||||
hyperloop.chat(puncher, I("The Booking Machine for this station is missing!"))
|
||||
hyperloop.chat(puncher, S("The Booking Machine for this station is missing!"))
|
||||
elseif not hyperloop.is_blocked(station.pos) then
|
||||
hyperloop.open_pod_door(station)
|
||||
end
|
||||
|
@ -98,7 +98,7 @@ function hyperloop.animate_pod_door(tStation)
|
|||
end
|
||||
|
||||
minetest.register_node("hyperloop:doorTopPassive", {
|
||||
description = "Hyperloop Door Top",
|
||||
description = S("Hyperloop Door Top"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin_door.png",
|
||||
|
@ -132,7 +132,7 @@ minetest.register_node("hyperloop:doorTopPassive", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:doorTopActive", {
|
||||
description = "Hyperloop Door Top",
|
||||
description = S("Hyperloop Door Top"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin_door.png",
|
||||
|
@ -166,7 +166,7 @@ minetest.register_node("hyperloop:doorTopActive", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:doorBottom", {
|
||||
description = "Hyperloop Door Bottom",
|
||||
description = S("Hyperloop Door Bottom"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin_door.png",
|
||||
|
|
38
elevator.lua
38
elevator.lua
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
-- To store elevator floors and formspecs
|
||||
local Cache = {}
|
||||
|
@ -75,7 +75,7 @@ end)
|
|||
|
||||
|
||||
minetest.register_node("hyperloop:shaft", {
|
||||
description = I("Hyperloop Elevator Shaft"),
|
||||
description = S("Hyperloop Elevator Shaft"),
|
||||
inventory_image = 'hyperloop_shaft_inv.png',
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
|
@ -125,7 +125,7 @@ minetest.register_node("hyperloop:shaft", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:shaftA", {
|
||||
description = I("Hyperloop Elevator Shaft"),
|
||||
description = S("Hyperloop Elevator Shaft"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_tube_closed.png^[transformR90]",
|
||||
|
@ -176,7 +176,7 @@ minetest.register_node("hyperloop:shaftA", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:shaft2", {
|
||||
description = I("Hyperloop Elevator Shaft"),
|
||||
description = S("Hyperloop Elevator Shaft"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR270]",
|
||||
|
@ -218,7 +218,7 @@ minetest.register_node("hyperloop:shaft2", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:shaftA2", {
|
||||
description = I("Hyperloop Elevator Shaft"),
|
||||
description = S("Hyperloop Elevator Shaft"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_tube_locked.png^hyperloop_elogo.png^[transformR270]",
|
||||
|
@ -266,8 +266,8 @@ minetest.register_node("hyperloop:shaftA2", {
|
|||
|
||||
-- Form spec for the floor list
|
||||
local function formspec(pos, lFloors)
|
||||
local tRes = {"size[5,10]label[0.5,0; "..I("Select your destination").."]"}
|
||||
tRes[2] = "label[1,0.6;"..I("Destination").."]label[2.5,0.6;"..I("Floor").."]"
|
||||
local tRes = {"size[5,10]label[0.5,0; "..S("Select your destination").."]"}
|
||||
tRes[2] = "label[1,0.6;"..S("Destination").."]label[2.5,0.6;"..S("Floor").."]"
|
||||
for idx,floor in ipairs(lFloors) do
|
||||
if idx >= 12 then
|
||||
break
|
||||
|
@ -276,7 +276,7 @@ local function formspec(pos, lFloors)
|
|||
local ypos2 = ypos - 0.2
|
||||
tRes[#tRes+1] = "button_exit[1,"..ypos2..";1,1;button;"..(#lFloors-idx).."]"
|
||||
if vector.equals(floor.pos, pos) then
|
||||
tRes[#tRes+1] = "label[2.5,"..ypos..";"..I("(current position)").."]"
|
||||
tRes[#tRes+1] = "label[2.5,"..ypos..";"..S("(current position)").."]"
|
||||
else
|
||||
tRes[#tRes+1] = "label[2.5,"..ypos..";"..(floor.name or "<unknown>").."]"
|
||||
end
|
||||
|
@ -291,7 +291,7 @@ local function update_formspec(pos)
|
|||
local meta = M(pos)
|
||||
local counter = meta:get_int("change_counter") or 0
|
||||
local changed, newcounter = Elevators:changed(counter)
|
||||
local sKey = S(pos)
|
||||
local sKey = SP(pos)
|
||||
if changed or not Cache[sKey] then
|
||||
local lFloors = Elevators:station_list(pos, pos, "level")
|
||||
Cache[sKey] = {}
|
||||
|
@ -326,8 +326,8 @@ local function door_command(floor_pos, facedir, cmnd, sound)
|
|||
node2.name = "air"
|
||||
minetest.swap_node(door_pos2, node2)
|
||||
elseif cmnd == "close" then
|
||||
M(door_pos1):set_string("floor_pos", S(floor_pos))
|
||||
M(door_pos2):set_string("floor_pos", S(floor_pos))
|
||||
M(door_pos1):set_string("floor_pos", SP(floor_pos))
|
||||
M(door_pos2):set_string("floor_pos", SP(floor_pos))
|
||||
node1.name = "hyperloop:elevator_door"
|
||||
node1.param2 = facedir
|
||||
minetest.swap_node(door_pos1, node1)
|
||||
|
@ -387,7 +387,7 @@ local function on_travel(tDeparture, tArrival, player_name, seconds)
|
|||
end
|
||||
|
||||
minetest.register_node("hyperloop:elevator_bottom", {
|
||||
description = I("Hyperloop Elevator"),
|
||||
description = S("Hyperloop Elevator"),
|
||||
tiles = {
|
||||
"hyperloop_elevator_bottom.png",
|
||||
"hyperloop_elevator_bottom.png",
|
||||
|
@ -427,9 +427,9 @@ minetest.register_node("hyperloop:elevator_bottom", {
|
|||
-- formspec
|
||||
local meta = minetest.get_meta(pos)
|
||||
local formspec = "size[6,4]"..
|
||||
"label[0,0;"..I("Please insert floor name").."]" ..
|
||||
"field[0.5,1.5;5,1;floor;"..I("Floor name")..";"..I("Base").."]" ..
|
||||
"button_exit[2,3;2,1;exit;"..I("Save").."]"
|
||||
"label[0,0;"..S("Please insert floor name").."]" ..
|
||||
"field[0.5,1.5;5,1;floor;"..S("Floor name")..";"..S("Base").."]" ..
|
||||
"button_exit[2,3;2,1;exit;"..S("Save").."]"
|
||||
meta:set_string("formspec", formspec)
|
||||
|
||||
-- add upper part of the car
|
||||
|
@ -453,7 +453,7 @@ minetest.register_node("hyperloop:elevator_bottom", {
|
|||
if floor then
|
||||
floor = table.copy(floor)
|
||||
floor.pos = pos
|
||||
local sKey = S(pos)
|
||||
local sKey = SP(pos)
|
||||
local idx = tonumber(fields.button)
|
||||
if idx then
|
||||
local lFloors = Cache[sKey].lFloors
|
||||
|
@ -498,7 +498,7 @@ minetest.register_node("hyperloop:elevator_bottom", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:elevator_top", {
|
||||
description = I("Hyperloop Elevator"),
|
||||
description = S("Hyperloop Elevator"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_elevator_bottom.png",
|
||||
|
|
10
init.lua
10
init.lua
|
@ -37,6 +37,16 @@
|
|||
|
||||
hyperloop = {}
|
||||
|
||||
if minetest.get_translator ~= nil then
|
||||
hyperloop.S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
else
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
hyperloop.S, hyperloop.NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
end
|
||||
|
||||
if tubelib2.version < 1.7 then
|
||||
minetest.log("error", "Hyperloop requires tubelib2 version 1.7 or newer!!!")
|
||||
else
|
||||
|
|
16
junction.lua
16
junction.lua
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Tube = hyperloop.Tube
|
||||
local Stations = hyperloop.Stations
|
||||
|
@ -28,17 +28,17 @@ Tube:register_on_tube_update(function(node, pos, out_dir, peer_pos, peer_in_dir)
|
|||
if out_dir <= 5 then
|
||||
Stations:update_connections(pos, out_dir, peer_pos)
|
||||
local s = hyperloop.get_connection_string(pos)
|
||||
M(pos):set_string("infotext", I("Station connected with ")..s)
|
||||
M(pos):set_string("infotext", S("Station connected with ")..s)
|
||||
end
|
||||
elseif node.name == "hyperloop:junction" then
|
||||
Stations:update_connections(pos, out_dir, peer_pos)
|
||||
local s = hyperloop.get_connection_string(pos)
|
||||
M(pos):set_string("infotext", I("Junction connected with ")..s)
|
||||
M(pos):set_string("infotext", S("Junction connected with ")..s)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_node("hyperloop:junction", {
|
||||
description = I("Hyperloop Junction Block"),
|
||||
description = S("Hyperloop Junction Block"),
|
||||
tiles = {
|
||||
"hyperloop_junction_top.png",
|
||||
"hyperloop_junction_top.png",
|
||||
|
@ -47,7 +47,7 @@ minetest.register_node("hyperloop:junction", {
|
|||
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
hyperloop.check_network_level(pos, placer)
|
||||
M(pos):set_string("infotext", I("Junction"))
|
||||
M(pos):set_string("infotext", S("Junction"))
|
||||
Stations:set(pos, "Junction", {
|
||||
owner = placer:get_player_name(), junction = true})
|
||||
Tube:after_place_node(pos)
|
||||
|
@ -69,7 +69,7 @@ minetest.register_node("hyperloop:junction", {
|
|||
|
||||
-- for tube viaducts
|
||||
minetest.register_node("hyperloop:pillar", {
|
||||
description = I("Hyperloop Pillar"),
|
||||
description = S("Hyperloop Pillar"),
|
||||
tiles = {"hyperloop_tube_locked.png^[transformR90]"},
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
|
|
9
lcd.lua
9
lcd.lua
|
@ -11,8 +11,9 @@
|
|||
]]--
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
|
||||
-- load characters map
|
||||
local chars_file = io.open(minetest.get_modpath("hyperloop").."/characters.data", "r")
|
||||
|
@ -157,7 +158,7 @@ local lcd_box = {
|
|||
|
||||
minetest.register_node("hyperloop:lcd", {
|
||||
drawtype = "nodebox",
|
||||
description = I("Hyperloop Display"),
|
||||
description = S("Hyperloop Display"),
|
||||
tiles = {"hyperloop_lcd.png"},
|
||||
|
||||
on_rotate = screwdriver.disallow,
|
||||
|
@ -174,7 +175,7 @@ minetest.register_node("hyperloop:lcd", {
|
|||
if param2 == 0 or param2 == 1 then
|
||||
minetest.add_node(pos, {name = "hyperloop:lcd", param2 = 3})
|
||||
end
|
||||
lcd_update(pos, I(" | | << Hyperloop >> | be anywhere"))
|
||||
lcd_update(pos, S(" | | << Hyperloop >> | be anywhere"))
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
# textdomain: hyperloop
|
||||
|
||||
|
||||
### booking.lua ###
|
||||
Station data is corrupted. Please rebuild the station!=Stationsdaten sind beschädigt. Bitte die Station neu bauen!
|
||||
Station is still blocked. Please try again in a few seconds!=Die Station ist noch blockiert. Bitte versuche es in ein paar Sekunden wieder!
|
||||
|
||||
### booking_node.lua ###
|
||||
Additional station information=Zusätzliche Stationsinformationen
|
||||
Hyperloop Booking Machine=Hyperloop Fahrkartenautomat
|
||||
Invalid station name!=Ungültiger Stationsname!
|
||||
Please enter the station name to@nwhich this booking machine belongs.=Bitte gib den Stationsnamen ein@nzu dem dieser Fahrkartenautomat gehört.
|
||||
Station has already a booking machine!=Station hat bereits einen Fahrkartenautomat!
|
||||
Station name=Stationsname
|
||||
|
||||
### elevator.lua ###
|
||||
Select your destination=Wähle dein Ziel
|
||||
|
||||
### migrate.lua ###
|
||||
<unknown>=<unbekannt>
|
||||
|
||||
### deco.lua ###
|
||||
Hyperloop Promo Poster =Hyperloop Werbeposter
|
||||
Hyperloop Station Sign=Hyperloop Stationszeichen
|
||||
Hyperloop Station Sign Left=Hyperloop Stationszeichen links
|
||||
Hyperloop Station Sign Right=Hyperloop Stationszeichen rechts
|
||||
|
||||
### door.lua ###
|
||||
Hyperloop Door Bottom=Hyperloop Tür Unterteil
|
||||
Hyperloop Door Top=Hyperloop Tür Oberteil
|
||||
The Booking Machine for this station is missing!=Der Fahrkartenautomat für die Station fehlt!
|
||||
|
||||
### elevator.lua ###
|
||||
(current position)=(aktuelle Position)
|
||||
Base=Basis
|
||||
Destination=Ziel
|
||||
Floor=Stockwerk
|
||||
Floor name=Stockwerkname
|
||||
Hyperloop Elevator=Hyperloop Aufzug
|
||||
Hyperloop Elevator Shaft=Hyperloop Aufzugsschacht
|
||||
Please insert floor name=Gib den Stockwerknamen ein
|
||||
|
||||
### wifi.lua ###
|
||||
Save=Speichern
|
||||
|
||||
### junction.lua ###
|
||||
Hyperloop Junction Block=Hyperloop Anschlussstelle
|
||||
Hyperloop Pillar=Hyperloop Stütze
|
||||
Junction connected with =Anschlussstelle verbunden mit
|
||||
Station connected with =Station verbunden mit
|
||||
|
||||
### migrate.lua ###
|
||||
Junction=Anschlussstelle
|
||||
Hyperloop Legacy Tube=Hyperloop veraltetes Rohr
|
||||
unknown=unbekant
|
||||
|
||||
### lcd.lua ###
|
||||
Hyperloop Display=Hyperloop Bildschirm
|
||||
|
||||
### seat.lua ###
|
||||
| | << Hyperloop >> | be anywhere= | | << Hyperloop >> | ist irgendwo
|
||||
|
||||
### map.lua ###
|
||||
Close=Schließen
|
||||
Conn. with=Verb. mit
|
||||
Dist.=Entf.
|
||||
Hyperloop Station Book=Hyperloop Stationsbuch
|
||||
Owner=Besitzer
|
||||
Position=Position
|
||||
Station/Junction=Station/Anschlussstelle
|
||||
|
||||
### seat.lua ###
|
||||
| Welcome at | | = | Willkommen | in | |
|
||||
Arrival in:=Ankunft in:
|
||||
Destination:=Ziel:
|
||||
Distance:=Entfernung:
|
||||
Hyperloop Pod Seat=Hyperloop Sitz
|
||||
Thank you | for | travelling | with | Hyperloop.=Thank you | for | travelling | with | Hyperloop.
|
||||
[Hyperloop] No booking entered!=[Hyperloop] Keine Buchung eingegeben!
|
||||
|
||||
### station.lua ###
|
||||
Hypersteel Ingot=Hyperstahl Barren
|
||||
Area is protected!=Die Area ist geschützt!
|
||||
Blue Wool=Blaue Wolle
|
||||
Build Station=Baue Station
|
||||
Destroy Station=Zerstöre Station
|
||||
Glass=Glas
|
||||
Hyperloop Pod Shell=Hyperloop Kabinenwand
|
||||
Hyperloop Station Block=Hyperloop Stations Block
|
||||
Hyperloop Station Pod Builder=Hyperloop Stations Ersteller
|
||||
Not enough inventory items to build the station!=Nicht ausreichend Inventory Items um die Station zu bauen!
|
||||
Not enough space to build the station!=Nicht ausreichend Platz um die Station zu errichten!
|
||||
Station=Station
|
||||
Station completed. Now place the Booking Machine!=Station fertig. Setze nun den Fahrkartenautomat!
|
||||
|
||||
### tube.lua ###
|
||||
Do you really want to start a new network?!=Willst du wirklich ein neues Liniennetz beginnen?!
|
||||
Hyperloop Tube=Hyperloop Röhre
|
||||
Junction at =Anschlussstelle bei
|
||||
Open end at =Offenes Ende bei
|
||||
Station '=Station '
|
||||
Station at =Station bei
|
||||
There is no station/junction on this level. =Es gibt keine Station/Anschlussstelle auf dieser Höhe.
|
||||
|
||||
### tubecrowbar.lua ###
|
||||
left: remove node@n= links: entferne Block@n
|
||||
right: repair tube/shaft line@n= rechts: repariere Röhre/Schacht@n
|
||||
Hyperloop Tube Crowbar=Hyperloop Brecheisen
|
||||
Repair via WorldEdit placed Hyperloop tubes by reusing WorldEdit pos1/pos2=Reparatur über WorldEdit platzierte Hyperloop-Röhren durch Wiederverwendung von WorldEdit pos1/pos2
|
||||
Rights to remove tube nodes by means of the crowbar=Rechte zur Entfernung von Rohrknoten mit Hilfe der Brechstange
|
||||
You don't have the necessary privs!=Du hast nicht die notwendigen Rechte!
|
||||
[Crowbar Help]@n=[Brecheisen Hilfe]@n
|
||||
|
||||
### waypoint.lua ###
|
||||
Hyperloop Waypoint=Hyperloop Wegpunkt
|
||||
|
||||
### wifi.lua ###
|
||||
Enter channel string=Kanalname eingeben
|
||||
Hyperloop WiFi Tube=Hyperloop Wifi Röhre
|
|
@ -0,0 +1,154 @@
|
|||
# textdomain: hyperloop
|
||||
|
||||
|
||||
### booking.lua ###
|
||||
|
||||
Station data is corrupted. Please rebuild the station!=
|
||||
Station is still blocked. Please try again in a few seconds!=
|
||||
|
||||
### booking_node.lua ###
|
||||
|
||||
Additional station information=
|
||||
Hyperloop Booking Machine=
|
||||
Invalid station name!=
|
||||
|
||||
Please enter the station name to@nwhich this booking machine belongs.=
|
||||
|
||||
Station has already a booking machine!=
|
||||
Station name=
|
||||
|
||||
### booking_node.lua ###
|
||||
### elevator.lua ###
|
||||
|
||||
Select your destination=
|
||||
|
||||
### booking_node.lua ###
|
||||
### migrate.lua ###
|
||||
|
||||
<unknown>=
|
||||
|
||||
### deco.lua ###
|
||||
|
||||
Hyperloop Promo Poster =
|
||||
Hyperloop Station Sign=
|
||||
Hyperloop Station Sign Left=
|
||||
Hyperloop Station Sign Right=
|
||||
|
||||
### door.lua ###
|
||||
|
||||
Hyperloop Door Bottom=
|
||||
Hyperloop Door Top=
|
||||
The Booking Machine for this station is missing!=
|
||||
|
||||
### elevator.lua ###
|
||||
|
||||
(current position)=
|
||||
Base=
|
||||
Destination=
|
||||
Floor=
|
||||
Floor name=
|
||||
Hyperloop Elevator=
|
||||
Hyperloop Elevator Shaft=
|
||||
Please insert floor name=
|
||||
|
||||
### elevator.lua ###
|
||||
### wifi.lua ###
|
||||
|
||||
Save=
|
||||
|
||||
### junction.lua ###
|
||||
|
||||
Hyperloop Junction Block=
|
||||
Hyperloop Pillar=
|
||||
Junction connected with =
|
||||
Station connected with =
|
||||
|
||||
### junction.lua ###
|
||||
### migrate.lua ###
|
||||
|
||||
Junction=
|
||||
|
||||
### lcd.lua ###
|
||||
|
||||
Hyperloop Display=
|
||||
|
||||
### lcd.lua ###
|
||||
### seat.lua ###
|
||||
|
||||
| | << Hyperloop >> | be anywhere=
|
||||
|
||||
### map.lua ###
|
||||
|
||||
Close=
|
||||
Conn. with=
|
||||
Dist.=
|
||||
Hyperloop Station Book=
|
||||
Owner=
|
||||
Position=
|
||||
Station/Junction=
|
||||
|
||||
### migrate.lua ###
|
||||
|
||||
Hyperloop Legacy Tube=
|
||||
unknown=
|
||||
|
||||
### recipes.lua ###
|
||||
### station.lua ###
|
||||
|
||||
Hypersteel Ingot=
|
||||
|
||||
### seat.lua ###
|
||||
|
||||
| Welcome at | | =
|
||||
Arrival in:=
|
||||
Destination:=
|
||||
Distance:=
|
||||
Hyperloop Pod Seat=
|
||||
Thank you | for | travelling | with | Hyperloop.=
|
||||
[Hyperloop] No booking entered!=
|
||||
|
||||
### station.lua ###
|
||||
|
||||
Area is protected!=
|
||||
Blue Wool=
|
||||
Build Station=
|
||||
Destroy Station=
|
||||
Glass=
|
||||
Hyperloop Pod Shell=
|
||||
Hyperloop Station Block=
|
||||
Hyperloop Station Pod Builder=
|
||||
Not enough inventory items to build the station!=
|
||||
Not enough space to build the station!=
|
||||
Station=
|
||||
Station completed. Now place the Booking Machine!=
|
||||
|
||||
### tube.lua ###
|
||||
|
||||
Do you really want to start a new network?!=
|
||||
Hyperloop Tube=
|
||||
Junction at =
|
||||
Open end at =
|
||||
Station '=
|
||||
Station at =
|
||||
There is no station/junction on this level. =
|
||||
|
||||
### tubecrowbar.lua ###
|
||||
|
||||
left: remove node@n=
|
||||
right: repair tube/shaft line@n=
|
||||
Hyperloop Tube Crowbar=
|
||||
|
||||
Repair via WorldEdit placed Hyperloop tubes by reusing WorldEdit pos1/pos2=
|
||||
|
||||
Rights to remove tube nodes by means of the crowbar=
|
||||
You don't have the necessary privs!=
|
||||
[Crowbar Help]@n=
|
||||
|
||||
### waypoint.lua ###
|
||||
|
||||
Hyperloop Waypoint=
|
||||
|
||||
### wifi.lua ###
|
||||
|
||||
Enter channel string=
|
||||
Hyperloop WiFi Tube=
|
26
map.lua
26
map.lua
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Stations = hyperloop.Stations
|
||||
|
||||
|
@ -27,17 +27,17 @@ local function generate_string(sortedList)
|
|||
-- used to generate the "connected with" list.
|
||||
local lStationPositions = {}
|
||||
for idx,item in ipairs(sortedList) do
|
||||
local sKey = S(item.pos)
|
||||
local sKey = SP(item.pos)
|
||||
lStationPositions[sKey] = idx
|
||||
end
|
||||
|
||||
local tRes = {
|
||||
"label[0,0;ID]"..
|
||||
"label[0.7,0;"..I("Dist.").."]"..
|
||||
"label[1.8,0;"..I("Station/Junction").."]"..
|
||||
"label[5.4,0;"..I("Position").."]"..
|
||||
"label[7.9,0;"..I("Owner").."]"..
|
||||
"label[10,0;"..I("Conn. with").."]"}
|
||||
"label[0.7,0;"..S("Dist.").."]"..
|
||||
"label[1.8,0;"..S("Station/Junction").."]"..
|
||||
"label[5.4,0;"..S("Position").."]"..
|
||||
"label[7.9,0;"..S("Owner").."]"..
|
||||
"label[10,0;"..S("Conn. with").."]"}
|
||||
for idx,dataSet in ipairs(sortedList) do
|
||||
if idx == 23 then
|
||||
break
|
||||
|
@ -50,7 +50,7 @@ local function generate_string(sortedList)
|
|||
tRes[#tRes+1] = "label[0,"..ypos..";"..idx.."]"
|
||||
tRes[#tRes+1] = "label[0.7,"..ypos..";"..distance.." m]"
|
||||
tRes[#tRes+1] = "label[1.8,"..ypos..";"..string.sub(name,1,24).."]"
|
||||
tRes[#tRes+1] = "label[5.4,"..ypos..";"..S(dataSet.pos).."]"
|
||||
tRes[#tRes+1] = "label[5.4,"..ypos..";"..SP(dataSet.pos).."]"
|
||||
tRes[#tRes+1] = "label[7.9,"..ypos..";"..string.sub(owner,1,14).."]"
|
||||
tRes[#tRes+1] = "label[10,"..ypos..";"
|
||||
for dir,conn in pairs(dataSet.conn) do
|
||||
|
@ -92,7 +92,7 @@ local function map_on_use(itemstack, user)
|
|||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
sStationList ..
|
||||
"button_exit[5,9.5;2,1;close;"..I("Close").."]"
|
||||
"button_exit[5,9.5;2,1;close;"..S("Close").."]"
|
||||
|
||||
minetest.show_formspec(player_name, "hyperloop:station_map", formspec)
|
||||
return itemstack
|
||||
|
@ -107,7 +107,7 @@ local function map_on_secondary_use(itemstack, user)
|
|||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
sStationList ..
|
||||
"button_exit[5,9.5;2,1;close;"..I("Close").."]"
|
||||
"button_exit[5,9.5;2,1;close;"..S("Close").."]"
|
||||
|
||||
minetest.show_formspec(player_name, "hyperloop:station_map", formspec)
|
||||
return itemstack
|
||||
|
@ -115,7 +115,7 @@ end
|
|||
|
||||
-- Tool for tube workers to find the next station
|
||||
minetest.register_node("hyperloop:station_map", {
|
||||
description = I("Hyperloop Station Book"),
|
||||
description = S("Hyperloop Station Book"),
|
||||
inventory_image = "hyperloop_stations_book.png",
|
||||
wield_image = "hyperloop_stations_book.png",
|
||||
groups = {cracky=1, book=1},
|
||||
|
|
18
migrate.lua
18
migrate.lua
|
@ -16,13 +16,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = minetest.pos_to_string
|
||||
local SP = minetest.pos_to_string
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Tube = hyperloop.Tube
|
||||
local Shaft = hyperloop.Shaft
|
||||
|
@ -64,7 +64,7 @@ end
|
|||
-- convert legacy tubes to current tubes
|
||||
for idx = 0,2 do
|
||||
minetest.register_node("hyperloop:tube"..idx, {
|
||||
description = "Hyperloop Legacy Tube",
|
||||
description = S("Hyperloop Legacy Tube"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_tube_locked.png^[transformR90]",
|
||||
|
@ -172,7 +172,7 @@ local function determine_wifi_pairs(pos)
|
|||
end
|
||||
end
|
||||
-- add single Wifi node to pairing table
|
||||
tWifiNodes[S(pos)] = {pos1, pos2}
|
||||
tWifiNodes[SP(pos)] = {pos1, pos2}
|
||||
end
|
||||
|
||||
local function next_node_on_the_way_to_a_wifi_node(pos)
|
||||
|
@ -276,7 +276,7 @@ local function convert_station_data(tAllStations)
|
|||
for key,item in pairs(tAllStations) do
|
||||
if item.pos and Tube:is_secondary_node(item.pos) then
|
||||
Stations:set(item.pos, station_name(item), {
|
||||
owner = item.owner or "<unknown>",
|
||||
owner = item.owner or S("<unknown>"),
|
||||
junction = item.junction,
|
||||
facedir = item.facedir,
|
||||
booking_info = item.booking_info,
|
||||
|
@ -334,10 +334,10 @@ end
|
|||
local function place_junctions()
|
||||
for _,pos in ipairs(JunctionsToBePlacedAfter) do
|
||||
minetest.set_node(pos, {name = "hyperloop:junction"})
|
||||
M(pos):set_string("infotext", I("Junction"))
|
||||
Stations:set(pos, "Junction", {owner = "unknown", junction = true})
|
||||
M(pos):set_string("infotext", S("Junction"))
|
||||
Stations:set(pos, "Junction", {owner = S("unknown"), junction = true})
|
||||
Tube:after_place_node(pos)
|
||||
minetest.log("action", "[Hyperloop] Junction placed at "..S(pos))
|
||||
minetest.log("action", "[Hyperloop] Junction placed at "..SP(pos))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
4
mod.conf
4
mod.conf
|
@ -1 +1,3 @@
|
|||
name = hyperloop
|
||||
name = hyperloop
|
||||
depends = default, tubelib2
|
||||
optional_depends = techage, worldedit
|
||||
|
|
|
@ -14,12 +14,11 @@
|
|||
]]--
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
minetest.register_craftitem("hyperloop:hypersteel_ingot", {
|
||||
description = I("Hypersteel Ingot"),
|
||||
description = S("Hypersteel Ingot"),
|
||||
inventory_image = "hyperloop_hypersteel_ingot.png",
|
||||
})
|
||||
|
||||
|
|
20
seat.lua
20
seat.lua
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Stations = hyperloop.Stations
|
||||
|
||||
|
@ -37,7 +37,7 @@ local function on_final_close_door(tStation)
|
|||
minetest.after(3.0, on_final_close_door, tStation)
|
||||
else
|
||||
hyperloop.close_pod_door(tStation)
|
||||
enter_display(tStation, I(" | | << Hyperloop >> | be anywhere"))
|
||||
enter_display(tStation, S(" | | << Hyperloop >> | be anywhere"))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -48,14 +48,14 @@ local function on_open_door(tArrival)
|
|||
-- open door
|
||||
hyperloop.open_pod_door(tArrival)
|
||||
-- prepare display for the next trip
|
||||
enter_display(tArrival, I("Thank you | for | travelling | with | Hyperloop."))
|
||||
enter_display(tArrival, S("Thank you | for | travelling | with | Hyperloop."))
|
||||
minetest.after(5.0, on_final_close_door, tArrival, tArrival.facedir)
|
||||
end
|
||||
|
||||
local function on_arrival(tDeparture, tArrival, player_name, sound)
|
||||
local player = minetest.get_player_by_name(player_name)
|
||||
-- activate display
|
||||
local text = I(" | Welcome at | | ")..string.sub(tArrival.name, 1, 13)
|
||||
local text = S(" | Welcome at | | ")..string.sub(tArrival.name, 1, 13)
|
||||
enter_display(tArrival, text)
|
||||
-- stop timer
|
||||
minetest.get_node_timer(tDeparture.pos):stop()
|
||||
|
@ -134,7 +134,7 @@ local function on_start_travel(pos, node, clicker)
|
|||
local tDeparture, departure_pos = hyperloop.get_base_station(pos)
|
||||
local arrival_pos = hyperloop.get_arrival(departure_pos)
|
||||
if arrival_pos == nil then
|
||||
minetest.chat_send_player(clicker:get_player_name(), I("[Hyperloop] No booking entered!"))
|
||||
minetest.chat_send_player(clicker:get_player_name(), S("[Hyperloop] No booking entered!"))
|
||||
return
|
||||
end
|
||||
local tArrival = hyperloop.get_station(arrival_pos)
|
||||
|
@ -158,8 +158,8 @@ local function on_start_travel(pos, node, clicker)
|
|||
|
||||
-- activate display
|
||||
local dist = hyperloop.distance(pos, tArrival.pos)
|
||||
local text = I("Destination:").." | "..string.sub(tArrival.name, 1, 13).." | "..I("Distance:").." | "..
|
||||
meter_to_km(dist).." | "..I("Arrival in:").." | "
|
||||
local text = S("Destination:").." | "..string.sub(tArrival.name, 1, 13).." | "..S("Distance:").." | "..
|
||||
meter_to_km(dist).." | "..S("Arrival in:").." | "
|
||||
local atime
|
||||
if dist < 1000 then
|
||||
atime = 10 + math.floor(dist/200) -- 10..15 sec
|
||||
|
@ -185,7 +185,7 @@ end
|
|||
|
||||
-- Hyperloop Seat
|
||||
minetest.register_node("hyperloop:seat", {
|
||||
description = I("Hyperloop Pod Seat"),
|
||||
description = S("Hyperloop Pod Seat"),
|
||||
tiles = {
|
||||
"hyperloop_seat-top.png",
|
||||
"hyperloop_seat-side.png",
|
||||
|
|
42
station.lua
42
station.lua
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Tube = hyperloop.Tube
|
||||
local Stations = hyperloop.Stations
|
||||
|
@ -105,7 +105,7 @@ local function construct(idx, pos, facedir, player_name, sKey)
|
|||
place_node(pos, (facedir + fd_offs) % 4, node_name, sKey)
|
||||
minetest.after(0.5, construct, idx+1, pos, facedir, player_name, sKey)
|
||||
else
|
||||
hyperloop.chat(player_name, I("Station completed. Now place the Booking Machine!"))
|
||||
hyperloop.chat(player_name, S("Station completed. Now place the Booking Machine!"))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -114,10 +114,10 @@ local function check_space(pos, facedir, placer)
|
|||
local y, path, node_name = item[1], item[2], item[4]
|
||||
pos = hyperloop.new_pos(pos, facedir, path, y)
|
||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||
hyperloop.chat(placer, I("Area is protected!"))
|
||||
hyperloop.chat(placer, S("Area is protected!"))
|
||||
return false
|
||||
elseif minetest.get_node_or_nil(pos).name ~= "air" then
|
||||
hyperloop.chat(placer, I("Not enough space to build the station!"))
|
||||
hyperloop.chat(placer, S("Not enough space to build the station!"))
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
@ -129,16 +129,16 @@ local station_formspec =
|
|||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[2,0;"..I("Hyperloop Station Pod Builder").."]" ..
|
||||
"label[2,0;"..S("Hyperloop Station Pod Builder").."]" ..
|
||||
"image[0.2,0.9;3,3;hyperloop_station_formspec.png]"..
|
||||
"list[context;src;3,0.9;1,4;]"..
|
||||
"label[4,1.2;30 x "..I("Hyperloop Pod Shell").."]" ..
|
||||
"label[4,1.2;30 x "..S("Hyperloop Pod Shell").."]" ..
|
||||
"item_image[3,0.9;1,1;hyperloop:pod_wall]"..
|
||||
"label[4,2.2;4 x "..I("Hypersteel Ingot").."]" ..
|
||||
"label[4,2.2;4 x "..S("Hypersteel Ingot").."]" ..
|
||||
"item_image[3,1.9;1,1;hyperloop:hypersteel_ingot]"..
|
||||
"label[4,3.2;2 x "..I("Blue Wool").."]" ..
|
||||
"label[4,3.2;2 x "..S("Blue Wool").."]" ..
|
||||
"item_image[3,2.9;1,1;wool:blue]"..
|
||||
"label[4,4.2;2 x "..I("Glass").."]" ..
|
||||
"label[4,4.2;2 x "..S("Glass").."]" ..
|
||||
"item_image[3,3.9;1,1;default:glass]"..
|
||||
"list[current_player;main;0,5.3;8,4;]"..
|
||||
"listring[context;src]"..
|
||||
|
@ -166,7 +166,7 @@ local function check_inventory(inv, player)
|
|||
end
|
||||
end
|
||||
end
|
||||
hyperloop.chat(player, I("Not enough inventory items to build the station!"))
|
||||
hyperloop.chat(player, S("Not enough inventory items to build the station!"))
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -199,9 +199,9 @@ local function build_station(pos, placer)
|
|||
Stations:update(pos, {facedir = facedir})
|
||||
|
||||
if check_space(table.copy(pos), facedir, placer) then
|
||||
construct(1, table.copy(pos), facedir, placer:get_player_name(), S(pos))
|
||||
construct(1, table.copy(pos), facedir, placer:get_player_name(), SP(pos))
|
||||
meta:set_string("formspec", station_formspec ..
|
||||
"button_exit[0,3.9;3,1;destroy;"..I("Destroy Station").."]")
|
||||
"button_exit[0,3.9;3,1;destroy;"..S("Destroy Station").."]")
|
||||
meta:set_int("built", 1)
|
||||
meta:set_int("busy", 1)
|
||||
-- remove items aften the station is build
|
||||
|
@ -237,7 +237,7 @@ local function destroy_station(pos, player_name)
|
|||
-- maintain meta
|
||||
local meta = M(pos)
|
||||
meta:set_string("formspec", station_formspec ..
|
||||
"button_exit[0,3.9;3,1;build;"..I("Build Station").."]")
|
||||
"button_exit[0,3.9;3,1;build;"..S("Build Station").."]")
|
||||
local inv = meta:get_inventory()
|
||||
add_inventory_items(inv)
|
||||
meta:set_int("built", 0)
|
||||
|
@ -247,7 +247,7 @@ local function destroy_station(pos, player_name)
|
|||
end
|
||||
|
||||
minetest.register_node("hyperloop:station", {
|
||||
description = I("Hyperloop Station Block"),
|
||||
description = S("Hyperloop Station Block"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"hyperloop_station.png",
|
||||
|
@ -258,14 +258,14 @@ minetest.register_node("hyperloop:station", {
|
|||
on_construct = function(pos)
|
||||
local meta = M(pos)
|
||||
meta:set_string("formspec", station_formspec ..
|
||||
"button_exit[0,3.9;3,1;build;"..I("Build Station").."]")
|
||||
"button_exit[0,3.9;3,1;build;"..S("Build Station").."]")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size('src', 4)
|
||||
end,
|
||||
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
hyperloop.check_network_level(pos, placer)
|
||||
M(pos):set_string("infotext", I("Station"))
|
||||
M(pos):set_string("infotext", S("Station"))
|
||||
store_station(pos, placer)
|
||||
Tube:after_place_node(pos)
|
||||
end,
|
||||
|
@ -302,7 +302,7 @@ minetest.register_node("hyperloop:station", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:pod_wall", {
|
||||
description = I("Hyperloop Pod Shell"),
|
||||
description = S("Hyperloop Pod Shell"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin2.png",
|
||||
|
@ -317,7 +317,7 @@ minetest.register_node("hyperloop:pod_wall", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:pod_wall_ni", {
|
||||
description = I("Hyperloop Pod Shell"),
|
||||
description = S("Hyperloop Pod Shell"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin2.png",
|
||||
|
@ -333,7 +333,7 @@ minetest.register_node("hyperloop:pod_wall_ni", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:pod_floor", {
|
||||
description = I("Hyperloop Pod Shell"),
|
||||
description = S("Hyperloop Pod Shell"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_skin2.png",
|
||||
|
|
18
tube.lua
18
tube.lua
|
@ -16,18 +16,18 @@ local P = minetest.string_to_pos
|
|||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local function station_name(pos)
|
||||
local dataSet = hyperloop.get_station(pos)
|
||||
if dataSet then
|
||||
if dataSet.junction == true then
|
||||
return I("Junction at ")..S(pos)
|
||||
return S("Junction at ")..SP(pos)
|
||||
elseif dataSet.name ~= nil then
|
||||
return S("Station '")..dataSet.name.."' at "..S(pos)
|
||||
return S("Station '")..dataSet.name.."' at "..SP(pos)
|
||||
else
|
||||
return S("Station at ")..S(pos)
|
||||
return S("Station at ")..SP(pos)
|
||||
end
|
||||
end
|
||||
return S("Open end at ")..minetest.pos_to_string(pos)
|
||||
|
@ -42,8 +42,8 @@ function hyperloop.check_network_level(pos, player)
|
|||
return
|
||||
end
|
||||
end
|
||||
hyperloop.chat(player, I("There is no station/junction on this level. ")..
|
||||
I("Do you really want to start a new network?!"))
|
||||
hyperloop.chat(player, S("There is no station/junction on this level. ")..
|
||||
S("Do you really want to start a new network?!"))
|
||||
end
|
||||
|
||||
-- North, East, South, West, Down, Up
|
||||
|
@ -70,7 +70,7 @@ local Tube = tubelib2.Tube:new({
|
|||
hyperloop.Tube = Tube
|
||||
|
||||
minetest.register_node("hyperloop:tubeS", {
|
||||
description = I("Hyperloop Tube"),
|
||||
description = S("Hyperloop Tube"),
|
||||
inventory_image = minetest.inventorycube("hyperloop_tube_locked.png",
|
||||
'hyperloop_tube_open.png', "hyperloop_tube_locked.png"),
|
||||
tiles = {
|
||||
|
@ -179,7 +179,7 @@ minetest.register_node("hyperloop:tubeS2", {
|
|||
})
|
||||
|
||||
minetest.register_node("hyperloop:tubeA", {
|
||||
description = I("Hyperloop Tube"),
|
||||
description = S("Hyperloop Tube"),
|
||||
inventory_image = minetest.inventorycube("hyperloop_tube_locked.png",
|
||||
'hyperloop_tube_open.png', "hyperloop_tube_locked.png"),
|
||||
tiles = {
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Shaft = hyperloop.Shaft
|
||||
local Tube = hyperloop.Tube
|
||||
|
@ -27,9 +27,9 @@ local function chat_message(dir, cnt, peer_pos, peer_dir)
|
|||
local sdir = tubelib2.dir_to_string(dir)
|
||||
if Shaft:is_secondary_node(peer_pos, peer_dir) then
|
||||
local npos, node = Shaft:get_node(peer_pos, peer_dir)
|
||||
return "[Hyperloop] To the "..sdir..": "..cnt.." tube nodes to "..node.name.." at "..S(npos)
|
||||
return "[Hyperloop] To the "..sdir..": "..cnt.." tube nodes to "..node.name.." at "..SP(npos)
|
||||
else
|
||||
return "[Hyperloop] To the "..sdir..": "..cnt.." tube nodes to "..S(peer_pos)
|
||||
return "[Hyperloop] To the "..sdir..": "..cnt.." tube nodes to "..SP(peer_pos)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -63,9 +63,9 @@ local function repair_tubes(itemstack, placer, pointed_thing)
|
|||
end
|
||||
else
|
||||
minetest.chat_send_player(placer:get_player_name(),
|
||||
I("[Crowbar Help]\n")..
|
||||
I(" left: remove node\n")..
|
||||
I(" right: repair tube/shaft line\n"))
|
||||
S("[Crowbar Help]\n")..
|
||||
S(" left: remove node\n")..
|
||||
S(" right: repair tube/shaft line\n"))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -88,7 +88,7 @@ local function remove_tube(itemstack, placer, pointed_thing)
|
|||
end
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(placer:get_player_name(), I("You don't have the necessary privs!"))
|
||||
minetest.chat_send_player(placer:get_player_name(), S("You don't have the necessary privs!"))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -98,7 +98,7 @@ end
|
|||
|
||||
-- Tool for tube workers to crack a protected tube line
|
||||
minetest.register_node("hyperloop:tube_crowbar", {
|
||||
description = I("Hyperloop Tube Crowbar"),
|
||||
description = S("Hyperloop Tube Crowbar"),
|
||||
inventory_image = "hyperloop_tubecrowbar.png",
|
||||
wield_image = "hyperloop_tubecrowbar.png",
|
||||
use_texture_alpha = true,
|
||||
|
@ -111,13 +111,13 @@ minetest.register_node("hyperloop:tube_crowbar", {
|
|||
})
|
||||
|
||||
minetest.register_privilege("hyperloop",
|
||||
{description = "Rights to remove tube nodes by means of the crowbar",
|
||||
{description = S("Rights to remove tube nodes by means of the crowbar"),
|
||||
give_to_singleplayer = false})
|
||||
|
||||
|
||||
if(minetest.get_modpath("worldedit")) ~= nil then
|
||||
minetest.register_chatcommand("hyperloop_repair_tubes", {
|
||||
description = "Repair via WorldEdit placed Hyperloop tubes by reusing WorldEdit pos1/pos2",
|
||||
description = S("Repair via WorldEdit placed Hyperloop tubes by reusing WorldEdit pos1/pos2"),
|
||||
privs = {worldedit=true},
|
||||
func = function(name, param)
|
||||
local pos1 = worldedit.pos1[name]
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
local PI = 3.1415926
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local SP = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local P = minetest.string_to_pos
|
||||
local M = minetest.get_meta
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
local Waypoints = {}
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
minetest.register_node("hyperloop:waypoint", {
|
||||
description = I("Hyperloop Waypoint"),
|
||||
description = S("Hyperloop Waypoint"),
|
||||
inventory_image = "hyperloop_waypoint_inv.png",
|
||||
tiles = {
|
||||
"hyperloop_waypoint.png",
|
||||
|
|
10
wifi.lua
10
wifi.lua
|
@ -11,17 +11,17 @@
|
|||
]]--
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath("hyperloop")
|
||||
local I, NS = dofile(MP.."/intllib.lua")
|
||||
local S = hyperloop.S
|
||||
local NS = hyperloop.NS
|
||||
|
||||
local Tube = hyperloop.Tube
|
||||
|
||||
local sFormspec = "size[7.5,3]"..
|
||||
"field[0.5,1;7,1;channel;"..I("Enter channel string")..";]" ..
|
||||
"button_exit[2,2;3,1;exit;"..I("Save").."]"
|
||||
"field[0.5,1;7,1;channel;"..S("Enter channel string")..";]" ..
|
||||
"button_exit[2,2;3,1;exit;"..S("Save").."]"
|
||||
|
||||
minetest.register_node("hyperloop:tube_wifi1", {
|
||||
description = I("Hyperloop WiFi Tube"),
|
||||
description = S("Hyperloop WiFi Tube"),
|
||||
tiles = {
|
||||
-- up, down, right, left, back, front
|
||||
"hyperloop_tube_locked.png^[transformR90]",
|
||||
|
|
Loading…
Reference in New Issue