diff --git a/data_base.lua b/data_base.lua index 0c7f1f4..ba8e202 100644 --- a/data_base.lua +++ b/data_base.lua @@ -54,7 +54,7 @@ minetest.register_on_shutdown(function() end) -- delete data base entries without corresponding nodes -minetest.after(5, check_data_base) +--minetest.after(5, check_data_base) -- store data after one hour minetest.after(60*60, update_mod_storage) diff --git a/init.lua b/init.lua index 0b39088..6caafdd 100644 --- a/init.lua +++ b/init.lua @@ -35,13 +35,14 @@ 2020-03-12 v2.05 minetest translator added (thanks to acmgit/Clyde) 2020-06-14 v2.06 The default value for `hyperloop_free_tube_placement_enabled` is now true 2021-02-07 v2.07 tube_crowbar: Add tube length check + 2021-11-01 v2.08 Enable the use of hyperloop networks for other mods ]]-- hyperloop = {} -- Version for compatibility checks, see history -hyperloop.version = 2.06 +hyperloop.version = 2.08 if minetest.global_exists("techage") and techage.version < 0.06 then error("[hyperloop] Hyperloop requires techage version 0.06 or newer!") @@ -71,7 +72,7 @@ else hyperloop.wifi_enabled = minetest.settings:get_bool("hyperloop_wifi_enabled") hyperloop.wifi_crafting_enabled = minetest.settings:get_bool("hyperloop_wifi_crafting_enabled") hyperloop.free_tube_placement_enabled = minetest.settings:get_bool("hyperloop_free_tube_placement_enabled", true) - hyperloop.subnet_enabled = minetest.settings:get_bool("hyperloop_subnet_enabled") + hyperloop.subnet_enabled = minetest.settings:get_bool("hyperloop_subnet_enabled", true) dofile(minetest.get_modpath("hyperloop") .. "/network.lua") dofile(minetest.get_modpath("hyperloop") .. "/data_base.lua") diff --git a/junction.lua b/junction.lua index 47be4b6..f504521 100644 --- a/junction.lua +++ b/junction.lua @@ -28,12 +28,18 @@ 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", S("Station connected with ")..s) + M(pos):set_string("infotext", S("Station connected to ")..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", S("Junction connected with ")..s) + M(pos):set_string("infotext", S("Junction connected to ")..s) + elseif Tube.secondary_node_names[node.name] then + if out_dir == 5 then + Stations:update_connections(pos, out_dir, peer_pos) + local s = hyperloop.get_connection_string(pos) + M(pos):set_string("conn_to", s) + end end end) diff --git a/locale/hyperloop.de.tr b/locale/hyperloop.de.tr index fc27f03..26d842d 100644 --- a/locale/hyperloop.de.tr +++ b/locale/hyperloop.de.tr @@ -57,8 +57,8 @@ Save=Speichern ### junction.lua ### -Station connected with =Station verbunden mit -Junction connected with =Anschlussstelle verbunden mit +Station connected to =Station verbunden mit +Junction connected to =Anschlussstelle verbunden mit Hyperloop Junction Block=Hyperloop Anschlussstelle Hyperloop Pillar=Hyperloop Stütze @@ -77,7 +77,7 @@ Dist.=Entf. Station/Junction=Station/Anschlussstelle Position=Position Owner=Besitzer -Conn. with=Verb. mit +Conn. to=Verb. mit Close=Schließen Hyperloop Station Book=Hyperloop Stationsbuch diff --git a/map.lua b/map.lua index c875268..9c292e6 100644 --- a/map.lua +++ b/map.lua @@ -37,7 +37,7 @@ local function generate_string(sortedList) "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").."]"} + "label[10,0;"..S("Conn. to").."]"} for idx,dataSet in ipairs(sortedList) do if idx == 23 then break diff --git a/network.lua b/network.lua index ae08c19..aaa9659 100644 --- a/network.lua +++ b/network.lua @@ -278,3 +278,11 @@ function Network:serialize() return minetest.serialize(self) end +-- Return a pos/item table with all network nodes, the node at pos is connected with +function Network:get_node_table(pos) + local tRes = {} + local key = S(pos) + get_stations(self.tStations, key, tRes) + tRes[key] = nil + return tRes +end diff --git a/settingtypes.txt b/settingtypes.txt index 2c2e90e..771bf66 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -12,4 +12,4 @@ hyperloop_free_tube_placement_enabled (free tube placement enabled) bool false # The ticket block has an additional field for specifying a subnet name. # Stations with the same subnet name (optional) represent an isolated # subnet within the Hyperloop network. -hyperloop_subnet_enabled (enable building of subnets) bool false \ No newline at end of file +hyperloop_subnet_enabled (enable building of subnets) bool true \ No newline at end of file