mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-08-19 12:24:04 +02:00
stair digging is now possible, if a bit hacky.
This commit is contained in:
parent
d74363610d
commit
e717f09cb3
@ -12,6 +12,7 @@ local sequencer_commands =
|
|||||||
{
|
{
|
||||||
S("Sequence"),
|
S("Sequence"),
|
||||||
S("Dig Move Build"),
|
S("Dig Move Build"),
|
||||||
|
S("Dig Move Down"),
|
||||||
S("Move Up"),
|
S("Move Up"),
|
||||||
S("Move Down"),
|
S("Move Down"),
|
||||||
S("Move Left"),
|
S("Move Left"),
|
||||||
@ -217,6 +218,7 @@ local get_controller_assembled_formspec = function(digtron_id, player_name)
|
|||||||
.. "field_close_on_enter[digtron_name;false]"
|
.. "field_close_on_enter[digtron_name;false]"
|
||||||
.. "field[2.9,0.3;0.7,1;cycles;Cycles;1]" -- TODO persist, actually use
|
.. "field[2.9,0.3;0.7,1;cycles;Cycles;1]" -- TODO persist, actually use
|
||||||
.. "button[3.2,0;1,1;execute;Execute]"
|
.. "button[3.2,0;1,1;execute;Execute]"
|
||||||
|
.. "button[3.7,0;1,1;execute_down;Dig Down]"
|
||||||
.. "container_end[]"
|
.. "container_end[]"
|
||||||
|
|
||||||
.. "container[0,1]"
|
.. "container[0,1]"
|
||||||
@ -331,7 +333,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if fields.execute then
|
if fields.execute then
|
||||||
digtron.execute_cycle(digtron_id, player_name)
|
digtron.execute_dig_move_build_cycle(digtron_id, player_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
if fields.execute_down then
|
||||||
|
digtron.execute_dig_move_build_cycle(digtron_id, player_name, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.key_enter_field == "digtron_name" or fields.digtron_name then
|
if fields.key_enter_field == "digtron_name" or fields.digtron_name then
|
||||||
@ -369,7 +375,6 @@ local combine_defs = function(base_def, override_content)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local base_def = {
|
local base_def = {
|
||||||
description = S("Digtron Control Module"),
|
|
||||||
_doc_items_longdesc = nil,
|
_doc_items_longdesc = nil,
|
||||||
_doc_items_usagehelp = nil,
|
_doc_items_usagehelp = nil,
|
||||||
-- Note: this is not in the "digtron" group because we do not want it to be incorporated
|
-- Note: this is not in the "digtron" group because we do not want it to be incorporated
|
||||||
@ -378,15 +383,6 @@ local base_def = {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2= "facedir",
|
paramtype2= "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
-- Aims in the +Z direction by default
|
|
||||||
tiles = {
|
|
||||||
"digtron_plate.png^[transformR90",
|
|
||||||
"digtron_plate.png^[transformR270",
|
|
||||||
"digtron_plate.png",
|
|
||||||
"digtron_plate.png^[transformR180",
|
|
||||||
"digtron_plate.png",
|
|
||||||
"digtron_plate.png^digtron_control.png",
|
|
||||||
},
|
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -408,7 +404,16 @@ local base_def = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
minetest.register_node("digtron:controller_unassembled", combine_defs(base_def, {
|
minetest.register_node("digtron:controller_unassembled", combine_defs(base_def, {
|
||||||
|
description = S("Digtron Control Module"),
|
||||||
_digtron_assembled_node = "digtron:controller",
|
_digtron_assembled_node = "digtron:controller",
|
||||||
|
tiles = {
|
||||||
|
"digtron_plate.png^[transformR90",
|
||||||
|
"digtron_plate.png^[transformR270",
|
||||||
|
"digtron_plate.png",
|
||||||
|
"digtron_plate.png^[transformR180",
|
||||||
|
"digtron_plate.png",
|
||||||
|
"digtron_plate.png^digtron_control.png",
|
||||||
|
},
|
||||||
|
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
local returnstack, success = digtron.on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
local returnstack, success = digtron.on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
||||||
@ -433,6 +438,7 @@ minetest.register_node("digtron:controller_unassembled", combine_defs(base_def,
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
minetest.register_node("digtron:controller", combine_defs(base_def, {
|
minetest.register_node("digtron:controller", combine_defs(base_def, {
|
||||||
|
description = S("Digtron Assembly"),
|
||||||
tiles = {
|
tiles = {
|
||||||
"digtron_plate.png^[transformR90",
|
"digtron_plate.png^[transformR90",
|
||||||
"digtron_plate.png^[transformR270",
|
"digtron_plate.png^[transformR270",
|
||||||
|
@ -2,6 +2,11 @@ local mod_meta = digtron.mod_meta
|
|||||||
|
|
||||||
local cache = {}
|
local cache = {}
|
||||||
|
|
||||||
|
-- internationalization boilerplate
|
||||||
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||||
|
local S, NS = dofile(MP.."/intllib.lua")
|
||||||
|
|
||||||
|
|
||||||
--minetest.debug(dump(mod_meta:to_table()))
|
--minetest.debug(dump(mod_meta:to_table()))
|
||||||
|
|
||||||
-- Wipes mod_meta
|
-- Wipes mod_meta
|
||||||
@ -60,7 +65,12 @@ end
|
|||||||
|
|
||||||
-- Not bothering with a dynamic table store for names, they're just strings with no need for serialization or deserialization
|
-- Not bothering with a dynamic table store for names, they're just strings with no need for serialization or deserialization
|
||||||
local get_name = function(digtron_id)
|
local get_name = function(digtron_id)
|
||||||
return mod_meta:get_string(digtron_id..":name")
|
local digtron_name = mod_meta:get_string(digtron_id..":name")
|
||||||
|
if digtron_name == "" then
|
||||||
|
return S("Unnamed Digtron")
|
||||||
|
else
|
||||||
|
return digtron_name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local set_name = function(digtron_id, digtron_name)
|
local set_name = function(digtron_id, digtron_name)
|
||||||
@ -974,6 +984,8 @@ local get_controlling_coordinate = function(facedir)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Attempts to insert the item list into the digtron inventory, and whatever doesn't fit
|
||||||
|
-- gets placed as an item at pos
|
||||||
local insert_or_eject = function(digtron_id, item_list, pos)
|
local insert_or_eject = function(digtron_id, item_list, pos)
|
||||||
local predictive_inv = get_predictive_inventory(digtron_id)
|
local predictive_inv = get_predictive_inventory(digtron_id)
|
||||||
if not predictive_inv then
|
if not predictive_inv then
|
||||||
@ -987,20 +999,55 @@ local insert_or_eject = function(digtron_id, item_list, pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local execute_cycle = function(digtron_id, player_name)
|
-- TODO: the dig_down parameter is a bit hacky, see if I can come up with a better way to arrange this code
|
||||||
|
local execute_dig_move_build_cycle = function(digtron_id, player_name, dig_down)
|
||||||
local old_root_pos = retrieve_pos(digtron_id)
|
local old_root_pos = retrieve_pos(digtron_id)
|
||||||
local root_node = minetest.get_node(old_root_pos)
|
local root_node = minetest.get_node(old_root_pos)
|
||||||
local root_facedir = root_node.param2
|
local root_facedir = root_node.param2
|
||||||
local controlling_coordinate = get_controlling_coordinate(root_facedir)
|
local controlling_coordinate = get_controlling_coordinate(root_facedir)
|
||||||
|
|
||||||
local dig_leftovers, nodes_to_dig, dig_cost = predict_dig(digtron_id, player_name, controlling_coordinate)
|
local dig_leftovers, nodes_to_dig, dig_cost = predict_dig(digtron_id, player_name, controlling_coordinate)
|
||||||
local new_root_pos = vector.add(old_root_pos, digtron.facedir_to_dir(root_facedir))
|
local new_root_pos
|
||||||
local layout = retrieve_layout(digtron_id)
|
|
||||||
-- TODO: convert nodes_to_dig into a hash map here and pass that in to reduce duplication?
|
|
||||||
local buildable_to, succeeded, failed = digtron.is_buildable_to(digtron_id, layout, new_root_pos, player_name, nodes_to_dig)
|
|
||||||
local missing_items, built_nodes, build_cost = predict_build(digtron_id, new_root_pos, player_name, nodes_to_dig, controlling_coordinate)
|
|
||||||
|
|
||||||
if buildable_to and next(missing_items) == nil then
|
if dig_down then
|
||||||
|
new_root_pos = vector.add(old_root_pos, digtron.facedir_to_down(root_facedir))
|
||||||
|
else
|
||||||
|
new_root_pos = vector.add(old_root_pos, digtron.facedir_to_dir(root_facedir))
|
||||||
|
end
|
||||||
|
|
||||||
|
local layout = retrieve_layout(digtron_id)
|
||||||
|
local buildable_to, succeeded, failed = digtron.is_buildable_to(digtron_id, layout, new_root_pos, player_name, nodes_to_dig)
|
||||||
|
local missing_items, built_nodes, build_cost
|
||||||
|
|
||||||
|
if dig_down then
|
||||||
|
missing_items = {}
|
||||||
|
built_nodes = {}
|
||||||
|
build_cost = 0
|
||||||
|
else
|
||||||
|
missing_items, built_nodes, build_cost = predict_build(digtron_id, new_root_pos, player_name, nodes_to_dig, controlling_coordinate)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not buildable_to then
|
||||||
|
clear_predictive_inventory(digtron_id)
|
||||||
|
digtron.show_buildable_nodes({}, failed)
|
||||||
|
minetest.sound_play("digtron_squeal", {gain = 0.5, pos=old_root_pos})
|
||||||
|
minetest.chat_send_player(player_name, S("@1 at @2 has encountered an obstacle.",
|
||||||
|
get_name(digtron_id), minetest.pos_to_string(old_root_pos)))
|
||||||
|
elseif next(missing_items) ~= nil then
|
||||||
|
clear_predictive_inventory(digtron_id)
|
||||||
|
local items = {}
|
||||||
|
for item, count in ipairs(missing_items) do
|
||||||
|
local item_def = minetest.registered_items[item]
|
||||||
|
if item_def == nil then -- Shouldn't be a problem, but don't crash if it does happen somehow
|
||||||
|
table.insert(items, count .. " " .. item)
|
||||||
|
else
|
||||||
|
table.insert(items, count .. " " .. item_def.description)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(player_name, S("@1 at @2 requires @3 to execute its next build cycle.",
|
||||||
|
get_name(digtron_id), minetest.pos_to_string(old_root_pos), table.concat(items, ", ")))
|
||||||
|
minetest.sound_play("digtron_dingding", {gain = 0.5, pos=old_root_pos})
|
||||||
|
else
|
||||||
digtron.fake_player:update(old_root_pos, player_name)
|
digtron.fake_player:update(old_root_pos, player_name)
|
||||||
|
|
||||||
-- Removing old nodes
|
-- Removing old nodes
|
||||||
@ -1033,10 +1080,6 @@ local execute_cycle = function(digtron_id, player_name)
|
|||||||
|
|
||||||
commit_predictive_inventory(digtron_id)
|
commit_predictive_inventory(digtron_id)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
clear_predictive_inventory(digtron_id)
|
|
||||||
digtron.show_buildable_nodes({}, failed)
|
|
||||||
minetest.sound_play("digtron_squeal", {gain = 0.5, pos=new_root_pos})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1216,6 +1259,6 @@ digtron.is_buildable_to = is_buildable_to
|
|||||||
digtron.build_to_world = build_to_world
|
digtron.build_to_world = build_to_world
|
||||||
digtron.move = move
|
digtron.move = move
|
||||||
digtron.rotate = rotate
|
digtron.rotate = rotate
|
||||||
digtron.execute_cycle = execute_cycle
|
digtron.execute_dig_move_build_cycle = execute_dig_move_build_cycle
|
||||||
|
|
||||||
digtron.recover_digtron_id = recover_digtron_id
|
digtron.recover_digtron_id = recover_digtron_id
|
@ -147,7 +147,7 @@ end
|
|||||||
|
|
||||||
digtron.cardinal_dirs = cardinal_dirs -- used by builder entities as well
|
digtron.cardinal_dirs = cardinal_dirs -- used by builder entities as well
|
||||||
digtron.cardinal_dirs_hash = cardinal_dirs_hash
|
digtron.cardinal_dirs_hash = cardinal_dirs_hash
|
||||||
digtron.facedir_to_dir_map = facedir_to_dir_map
|
digtron.facedir_to_dir_map = facedir_to_dir_map -- used by get_controlling_coordinate
|
||||||
|
|
||||||
digtron.facedir_to_dir = facedir_to_dir
|
digtron.facedir_to_dir = facedir_to_dir
|
||||||
digtron.facedir_to_dir_hash = facedir_to_dir_hash
|
digtron.facedir_to_dir_hash = facedir_to_dir_hash
|
||||||
|
276
locale/template.pot
Normal file
276
locale/template.pot
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-09-01 18:19-0600\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: digtron\controller.lua:7
|
||||||
|
msgid "Main Inventory"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:8
|
||||||
|
msgid "Fuel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:13
|
||||||
|
msgid "Sequence"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:14
|
||||||
|
msgid "Dig Move Build"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:15
|
||||||
|
msgid "Dig Move Down"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:16
|
||||||
|
msgid "Move Up"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:17
|
||||||
|
msgid "Move Down"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:18
|
||||||
|
msgid "Move Left"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:19
|
||||||
|
msgid "Move Right"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:20
|
||||||
|
msgid "Move Forward"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:21
|
||||||
|
msgid "Move Back"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:22
|
||||||
|
msgid "Yaw Left"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:23
|
||||||
|
msgid "Yaw Right"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:24
|
||||||
|
msgid "Pitch Up"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:25
|
||||||
|
msgid "Pitch Down"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:26
|
||||||
|
msgid "Roll Clockwise"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:27
|
||||||
|
msgid "Roll Widdershins"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:402
|
||||||
|
msgid "Digtron Control Module"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\controller.lua:436
|
||||||
|
msgid "Digtron Assembly"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\functions.lua:65
|
||||||
|
msgid "Unnamed Digtron"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\functions.lua:1012
|
||||||
|
msgid "@1 at @2 has encountered an obstacle."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\functions.lua:1023
|
||||||
|
msgid "@1 at @2 requires @3 to execute its next build cycle."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:25
|
||||||
|
msgid "Extrusion"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:27
|
||||||
|
msgid ""
|
||||||
|
"Builder will extrude this many blocks in the direction it is facing.\n"
|
||||||
|
"Can be set from 1 to @1.\n"
|
||||||
|
"Note that Digtron won't build into unloaded map regions."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:28
|
||||||
|
#: digtron\nodes\node_digger.lua:20
|
||||||
|
msgid "Periodicity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:30
|
||||||
|
msgid ""
|
||||||
|
"Builder will build once every n steps.\n"
|
||||||
|
"These steps are globally aligned, so all builders with the\n"
|
||||||
|
"same period and offset will build on the same location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:31
|
||||||
|
#: digtron\nodes\node_digger.lua:23
|
||||||
|
msgid "Offset"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:33
|
||||||
|
msgid ""
|
||||||
|
"Offsets the start of periodicity counting by this amount.\n"
|
||||||
|
"For example, a builder with period 2 and offset 0 builds\n"
|
||||||
|
"every even-numbered block and one with period 2 and\n"
|
||||||
|
"offset 1 builds every odd-numbered block."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:34
|
||||||
|
#: digtron\nodes\node_digger.lua:26
|
||||||
|
msgid ""
|
||||||
|
"Save &\n"
|
||||||
|
"Show"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:35
|
||||||
|
msgid ""
|
||||||
|
"Saves settings, closes interface, and shows the locations this builder will "
|
||||||
|
"build to in-world."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:36
|
||||||
|
msgid "Facing"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:38
|
||||||
|
msgid ""
|
||||||
|
"Value from 0-23. Not all block types make use of this.\n"
|
||||||
|
"Use the 'Read & Save' button to copy the facing of the block\n"
|
||||||
|
"currently in the builder output location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:39
|
||||||
|
msgid "Read"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:40
|
||||||
|
msgid "Reads the facing of the block currently in the build location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:130
|
||||||
|
#: digtron\nodes\node_storage.lua:73
|
||||||
|
#: digtron\nodes\node_storage.lua:178
|
||||||
|
#: digtron\nodes\node_storage.lua:305
|
||||||
|
msgid "This Digtron is active, interact with it via the controller node."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:223
|
||||||
|
msgid ""
|
||||||
|
"Builder for @1\n"
|
||||||
|
"period @2, offset @3, extrusion @4"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_builder.lua:232
|
||||||
|
msgid "Digtron Builder Module"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:22
|
||||||
|
msgid ""
|
||||||
|
"Digger will dig once every n steps.\n"
|
||||||
|
"These steps are globally aligned, all diggers with\n"
|
||||||
|
"the same period and offset will dig on the same location."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:25
|
||||||
|
msgid ""
|
||||||
|
"Offsets the start of periodicity counting by this amount.\n"
|
||||||
|
"For example, a digger with period 2 and offset 0 digs\n"
|
||||||
|
"every even-numbered block and one with period 2 and\n"
|
||||||
|
"offset 1 digs every odd-numbered block."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:27
|
||||||
|
msgid "Saves settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:35
|
||||||
|
msgid ""
|
||||||
|
"Digger\n"
|
||||||
|
"period @1, offset @2"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:71
|
||||||
|
#: digtron\nodes\node_digger.lua:103
|
||||||
|
msgid "Digtron Digger"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_digger.lua:128
|
||||||
|
#: digtron\nodes\node_digger.lua:160
|
||||||
|
msgid "Digtron Dual Digger"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_misc.lua:7
|
||||||
|
msgid "Digtron Structure"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_misc.lua:41
|
||||||
|
msgid "Digtron Light"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_misc.lua:64
|
||||||
|
msgid "Digtron Panel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_misc.lua:88
|
||||||
|
msgid "Digtron Edge Panel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_misc.lua:117
|
||||||
|
msgid "Digtron Corner Panel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_pipeworks_interface.lua:85
|
||||||
|
msgid "Digtron Inventory Interface"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_storage.lua:9
|
||||||
|
#: digtron\nodes\node_storage.lua:213
|
||||||
|
msgid "Inventory items"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_storage.lua:20
|
||||||
|
msgid "Digtron Inventory Storage"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_storage.lua:102
|
||||||
|
#: digtron\nodes\node_storage.lua:215
|
||||||
|
msgid "Fuel items"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_storage.lua:113
|
||||||
|
msgid "Digtron Fuel Storage"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\node_storage.lua:226
|
||||||
|
msgid "Digtron Combined Storage"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: digtron\nodes\recipes.lua:6
|
||||||
|
msgid "Digtron Core"
|
||||||
|
msgstr ""
|
6
locale/update.bat
Normal file
6
locale/update.bat
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||||
|
cd ..
|
||||||
|
set LIST=
|
||||||
|
for /r %%X in (*.lua) do set LIST=!LIST! %%X
|
||||||
|
..\intllib\tools\xgettext.bat %LIST%
|
@ -2,7 +2,7 @@
|
|||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
local S, NS = dofile(MP.."/intllib.lua")
|
||||||
|
|
||||||
-- TODO: make global
|
-- TODO: make global, is used by builders too
|
||||||
local player_interacting_with_digtron_pos = {}
|
local player_interacting_with_digtron_pos = {}
|
||||||
|
|
||||||
local get_formspec = function(pos, player_name)
|
local get_formspec = function(pos, player_name)
|
||||||
@ -56,6 +56,24 @@ local dual_drill_nodebox = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local digger_on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
local returnstack, success = digtron.on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
if returnstack then
|
||||||
|
return returnstack, success
|
||||||
|
end
|
||||||
|
if clicker == nil then return end
|
||||||
|
local player_name = clicker:get_player_name()
|
||||||
|
player_interacting_with_digtron_pos[player_name] = pos
|
||||||
|
minetest.show_formspec(player_name, "digtron:digger", get_formspec(pos, player_name))
|
||||||
|
end
|
||||||
|
|
||||||
|
local assembled_digger_on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
|
if clicker == nil then return end
|
||||||
|
local player_name = clicker:get_player_name()
|
||||||
|
minetest.sound_play({name = "digtron_error", gain = 0.1}, {to_player=player_name})
|
||||||
|
minetest.chat_send_player(clicker:get_player_name(), S("This Digtron is active, interact with it via the controller node."))
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node("digtron:digger", {
|
minetest.register_node("digtron:digger", {
|
||||||
description = S("Digtron Digger"),
|
description = S("Digtron Digger"),
|
||||||
_doc_items_longdesc = nil,
|
_doc_items_longdesc = nil,
|
||||||
@ -86,6 +104,7 @@ minetest.register_node("digtron:digger", {
|
|||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
can_dig = digtron.can_dig,
|
can_dig = digtron.can_dig,
|
||||||
on_blast = digtron.on_blast,
|
on_blast = digtron.on_blast,
|
||||||
|
on_rightclick = assembled_digger_on_rightclick,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("digtron:digger_static",{
|
minetest.register_node("digtron:digger_static",{
|
||||||
@ -110,17 +129,7 @@ minetest.register_node("digtron:digger_static",{
|
|||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
can_dig = digtron.can_dig,
|
can_dig = digtron.can_dig,
|
||||||
on_blast = digtron.on_blast,
|
on_blast = digtron.on_blast,
|
||||||
|
on_rightclick = digger_on_rightclick,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
local returnstack, success = digtron.on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
if returnstack then
|
|
||||||
return returnstack, success
|
|
||||||
end
|
|
||||||
if clicker == nil then return end
|
|
||||||
local player_name = clicker:get_player_name()
|
|
||||||
player_interacting_with_digtron_pos[player_name] = pos
|
|
||||||
minetest.show_formspec(player_name, "digtron:digger", get_formspec(pos, player_name))
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("digtron:dual_digger", {
|
minetest.register_node("digtron:dual_digger", {
|
||||||
@ -153,6 +162,7 @@ minetest.register_node("digtron:dual_digger", {
|
|||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
can_dig = digtron.can_dig,
|
can_dig = digtron.can_dig,
|
||||||
on_blast = digtron.on_blast,
|
on_blast = digtron.on_blast,
|
||||||
|
on_rightclick = assembled_digger_on_rightclick,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("digtron:dual_digger_static",{
|
minetest.register_node("digtron:dual_digger_static",{
|
||||||
@ -177,17 +187,7 @@ minetest.register_node("digtron:dual_digger_static",{
|
|||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
can_dig = digtron.can_dig,
|
can_dig = digtron.can_dig,
|
||||||
on_blast = digtron.on_blast,
|
on_blast = digtron.on_blast,
|
||||||
|
on_rightclick = digger_on_rightclick,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
local returnstack, success = digtron.on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
|
||||||
if returnstack then
|
|
||||||
return returnstack, success
|
|
||||||
end
|
|
||||||
if clicker == nil then return end
|
|
||||||
local player_name = clicker:get_player_name()
|
|
||||||
player_interacting_with_digtron_pos[player_name] = pos
|
|
||||||
minetest.show_formspec(player_name, "digtron:digger", get_formspec(pos, player_name))
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
Loading…
Reference in New Issue
Block a user