From ba74546d484e38c1439bb53ce3611ba4e74b35a4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Feb 2020 04:54:17 +0100 Subject: [PATCH 1/4] Add extended tooltips --- mods/ENTITIES/mcl_boats/init.lua | 4 +- mods/ENTITIES/mcl_minecarts/init.lua | 16 +- mods/ENTITIES/mcl_minecarts/rails.lua | 4 + mods/ENTITIES/mcl_mobs/crafts.lua | 1 + mods/ENTITIES/mobs_mc/1_items_default.lua | 1 + mods/HELP/doc/doc_identifier/init.lua | 1 + mods/HELP/mcl_tt/depends.txt | 1 + mods/HELP/mcl_tt/init.lua | 103 +++++++++ mods/HELP/tt/API.md | 33 +++ mods/HELP/tt/README.md | 12 + mods/HELP/tt/init.lua | 55 +++++ mods/HELP/tt/locale/template.txt | 27 +++ mods/HELP/tt/locale/tt.de.tr | 27 +++ mods/HELP/tt/mod.conf | 2 + mods/HELP/tt/snippets_builtin.lua | 210 ++++++++++++++++++ mods/HELP/tt/snippets_core.lua | 11 + mods/ITEMS/REDSTONE/mcl_dispensers/init.lua | 1 + mods/ITEMS/REDSTONE/mcl_droppers/init.lua | 1 + mods/ITEMS/REDSTONE/mcl_observers/init.lua | 1 + mods/ITEMS/REDSTONE/mesecons_button/init.lua | 7 +- .../REDSTONE/mesecons_commandblock/init.lua | 1 + mods/ITEMS/REDSTONE/mesecons_delayer/init.lua | 4 +- .../REDSTONE/mesecons_lightstone/init.lua | 1 + .../REDSTONE/mesecons_noteblock/init.lua | 1 + mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 2 + .../REDSTONE/mesecons_pressureplates/init.lua | 11 + .../REDSTONE/mesecons_solarpanel/init.lua | 1 + mods/ITEMS/REDSTONE/mesecons_torch/init.lua | 1 + .../REDSTONE/mesecons_walllever/init.lua | 1 + mods/ITEMS/REDSTONE/mesecons_wires/init.lua | 4 +- mods/ITEMS/mcl_anvils/init.lua | 1 + mods/ITEMS/mcl_armor_stand/init.lua | 1 + mods/ITEMS/mcl_banners/init.lua | 1 + mods/ITEMS/mcl_beds/api.lua | 1 + mods/ITEMS/mcl_books/init.lua | 1 + mods/ITEMS/mcl_bows/arrow.lua | 1 + mods/ITEMS/mcl_bows/bow.lua | 1 + mods/ITEMS/mcl_cake/init.lua | 7 +- mods/ITEMS/mcl_cauldrons/init.lua | 1 + mods/ITEMS/mcl_clock/init.lua | 4 +- mods/ITEMS/mcl_colorblocks/init.lua | 3 + mods/ITEMS/mcl_compass/init.lua | 4 +- mods/ITEMS/mcl_core/nodes_cactuscane.lua | 2 + mods/ITEMS/mcl_core/nodes_misc.lua | 1 + mods/ITEMS/mcl_crafting_table/init.lua | 1 + mods/ITEMS/mcl_dye/init.lua | 2 + mods/ITEMS/mcl_end/chorus_plant.lua | 3 + mods/ITEMS/mcl_end/eye_of_ender.lua | 1 + mods/ITEMS/mcl_farming/beetroot.lua | 1 + mods/ITEMS/mcl_farming/carrots.lua | 1 + mods/ITEMS/mcl_farming/hoes.lua | 24 +- mods/ITEMS/mcl_farming/melon.lua | 1 + mods/ITEMS/mcl_farming/potatoes.lua | 1 + mods/ITEMS/mcl_farming/pumpkin.lua | 1 + mods/ITEMS/mcl_farming/soil.lua | 1 + mods/ITEMS/mcl_farming/wheat.lua | 1 + mods/ITEMS/mcl_fire/fire_charge.lua | 1 + mods/ITEMS/mcl_fire/flint_and_steel.lua | 1 + mods/ITEMS/mcl_fishing/init.lua | 1 + mods/ITEMS/mcl_flowerpots/init.lua | 1 + mods/ITEMS/mcl_furnaces/init.lua | 1 + mods/ITEMS/mcl_hoppers/init.lua | 1 + mods/ITEMS/mcl_itemframes/init.lua | 1 + mods/ITEMS/mcl_jukebox/init.lua | 1 + mods/ITEMS/mcl_maps/init.lua | 1 + mods/ITEMS/mcl_mobitems/init.lua | 3 + mods/ITEMS/mcl_mobspawners/init.lua | 1 + mods/ITEMS/mcl_monster_eggs/init.lua | 1 + mods/ITEMS/mcl_mushrooms/small.lua | 4 + mods/ITEMS/mcl_nether/init.lua | 2 + mods/ITEMS/mcl_nether/nether_wart.lua | 1 + mods/ITEMS/mcl_ocean/corals.lua | 8 + mods/ITEMS/mcl_ocean/kelp.lua | 4 +- mods/ITEMS/mcl_ocean/sea_pickle.lua | 4 +- mods/ITEMS/mcl_ocean/seagrass.lua | 4 +- mods/ITEMS/mcl_portals/portal_end.lua | 2 + mods/ITEMS/mcl_potions/init.lua | 6 + mods/ITEMS/mcl_signs/init.lua | 1 + mods/ITEMS/mcl_sponges/init.lua | 3 + mods/ITEMS/mcl_throwing/init.lua | 3 + mods/ITEMS/mcl_tnt/init.lua | 1 + 81 files changed, 647 insertions(+), 22 deletions(-) create mode 100644 mods/HELP/mcl_tt/depends.txt create mode 100644 mods/HELP/mcl_tt/init.lua create mode 100644 mods/HELP/tt/API.md create mode 100644 mods/HELP/tt/README.md create mode 100644 mods/HELP/tt/init.lua create mode 100644 mods/HELP/tt/locale/template.txt create mode 100644 mods/HELP/tt/locale/tt.de.tr create mode 100644 mods/HELP/tt/mod.conf create mode 100644 mods/HELP/tt/snippets_builtin.lua create mode 100644 mods/HELP/tt/snippets_core.lua diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index 9999b2b756..6c0ad9a1bf 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -279,7 +279,7 @@ local images = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak" } for b=1, #boat_ids do local itemstring = "mcl_boats:"..boat_ids[b] - local longdesc, usagehelp, help, helpname + local longdesc, usagehelp, tt_help, help, helpname help = false -- Only create one help entry for all boats if b == 1 then @@ -288,9 +288,11 @@ for b=1, #boat_ids do usagehelp = S("Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.") helpname = S("Boat") end + tt_help = S("Water vehicle") minetest.register_craftitem(itemstring, { description = names[b], + _tt_help = tt_help, _doc_items_create_entry = help, _doc_items_entry_name = helpname, _doc_items_longdesc = longdesc, diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index d845041c70..7c57334be3 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -526,7 +526,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing) end -local register_craftitem = function(itemstring, entity_id, description, longdesc, usagehelp, icon, creative) +local register_craftitem = function(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative) entity_mapping[itemstring] = entity_id local groups = { minecart = 1, transport = 1 } @@ -566,6 +566,7 @@ local register_craftitem = function(itemstring, entity_id, description, longdesc groups = groups, } def.description = description + def._tt_help = tt_help def._doc_items_longdesc = longdesc def._doc_items_usagehelp = usagehelp def.inventory_image = icon @@ -588,9 +589,9 @@ Register a minecart * on_activate_by_rail: Called when above activator rail * creative: If false, don't show in Creative Inventory ]] -local function register_minecart(itemstring, entity_id, description, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative) +local function register_minecart(itemstring, entity_id, description, tt_help, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative) register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail) - register_craftitem(itemstring, entity_id, description, longdesc, usagehelp, icon, creative) + register_craftitem(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative) if minetest.get_modpath("doc_identifier") ~= nil then doc.sub.identifier.register_object(entity_id, "craftitems", itemstring) end @@ -601,6 +602,7 @@ register_minecart( "mcl_minecarts:minecart", "mcl_minecarts:minecart", S("Minecart"), + S("Vehicle for fast travel on rails"), S("Minecarts can be used for a quick transportion on rails.") .. "\n" .. S("Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type."), S("You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.") .. "\n" .. @@ -640,7 +642,7 @@ register_minecart( "mcl_minecarts:chest_minecart", "mcl_minecarts:chest_minecart", S("Minecart with Chest"), - nil, nil, + nil, nil, nil, "mcl_minecarts_minecart_chest.b3d", { "mcl_chests_normal.png", "mcl_minecarts_minecart.png" }, "mcl_minecarts_minecart_chest.png", @@ -652,6 +654,7 @@ register_minecart( "mcl_minecarts:furnace_minecart", "mcl_minecarts:furnace_minecart", S("Minecart with Furnace"), + nil, S("A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel."), S("Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.") .. "\n" .. S("To obtain the minecart and furnace, punch them while holding down the sneak key."), @@ -705,7 +708,7 @@ register_minecart( "mcl_minecarts:command_block_minecart", "mcl_minecarts:command_block_minecart", S("Minecart with Command Block"), - nil, nil, + nil, nil, nil, "mcl_minecarts_minecart_block.b3d", { "jeija_commandblock_off.png^[verticalframe:2:0", @@ -726,7 +729,7 @@ register_minecart( "mcl_minecarts:hopper_minecart", "mcl_minecarts:hopper_minecart", S("Minecart with Hopper"), - nil, nil, + nil, nil, nil, "mcl_minecarts_minecart_hopper.b3d", { "mcl_hoppers_hopper_inside.png", @@ -744,6 +747,7 @@ register_minecart( "mcl_minecarts:tnt_minecart", "mcl_minecarts:tnt_minecart", S("Minecart with TNT"), + S("Vehicle for fast travel on rails").."\n"..S("Can be ignited by tools or powered activator rail"), S("A minecart with TNT is an explosive vehicle that travels on rail."), S("Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.") .. "\n" .. S("To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited."), diff --git a/mods/ENTITIES/mcl_minecarts/rails.lua b/mods/ENTITIES/mcl_minecarts/rails.lua index 4c0bcf8c54..4c26aea8c0 100644 --- a/mods/ENTITIES/mcl_minecarts/rails.lua +++ b/mods/ENTITIES/mcl_minecarts/rails.lua @@ -73,6 +73,7 @@ register_rail("mcl_minecarts:rail", {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"}, { description = S("Rail"), + _tt_help = S("Track for minecarts"), _doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction."), _doc_items_usagehelp = railuse, } @@ -83,6 +84,7 @@ register_rail("mcl_minecarts:golden_rail", {"mcl_minecarts_rail_golden.png", "mcl_minecarts_rail_golden_curved.png", "mcl_minecarts_rail_golden_t_junction.png", "mcl_minecarts_rail_golden_crossing.png"}, { description = S("Powered Rail"), + _tt_help = S("Track for minecarts").."\n"..S("Speed up when powered, slow down when not powered"), _doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts."), _doc_items_usagehelp = railuse .. "\n" .. S("Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power."), _rail_acceleration = -3, @@ -121,6 +123,7 @@ register_rail("mcl_minecarts:activator_rail", {"mcl_minecarts_rail_activator.png", "mcl_minecarts_rail_activator_curved.png", "mcl_minecarts_rail_activator_t_junction.png", "mcl_minecarts_rail_activator_crossing.png"}, { description = S("Activator Rail"), + _tt_help = S("Track for minecarts").."\n"..S("Activates minecarts when powered"), _doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts."), _doc_items_usagehelp = railuse .. "\n" .. S("To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail."), mesecons = { @@ -172,6 +175,7 @@ register_rail("mcl_minecarts:detector_rail", {"mcl_minecarts_rail_detector.png", "mcl_minecarts_rail_detector_curved.png", "mcl_minecarts_rail_detector_t_junction.png", "mcl_minecarts_rail_detector_crossing.png"}, { description = S("Detector Rail"), + _tt_help = S("Track for minecarts").."\n"..S("Emits redstone power when a minecart is detected"), _doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms."), _doc_items_usagehelp = railuse .. "\n" .. S("To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail."), mesecons = { diff --git a/mods/ENTITIES/mcl_mobs/crafts.lua b/mods/ENTITIES/mcl_mobs/crafts.lua index e9e6abf90f..e8a5b60fc2 100644 --- a/mods/ENTITIES/mcl_mobs/crafts.lua +++ b/mods/ENTITIES/mcl_mobs/crafts.lua @@ -4,6 +4,7 @@ local S = minetest.get_translator("mcl_mobs") -- name tag minetest.register_craftitem("mcl_mobs:nametag", { description = S("Name Tag"), + _tt_help = S("Give names to mobs").."\n"..S("Set name at anvil"), _doc_items_longdesc = S("A name tag is an item to name a mob."), _doc_items_usagehelp = S("Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag."), inventory_image = "mobs_nametag.png", diff --git a/mods/ENTITIES/mobs_mc/1_items_default.lua b/mods/ENTITIES/mobs_mc/1_items_default.lua index 687c0ac179..a86bc012ef 100644 --- a/mods/ENTITIES/mobs_mc/1_items_default.lua +++ b/mods/ENTITIES/mobs_mc/1_items_default.lua @@ -532,6 +532,7 @@ if c("totem") then -- Totem of Undying minetest.register_craftitem("mobs_mc:totem", { description = S("Totem of Undying"), + _tt_help = S("Protects you from death while wielding it"), _doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."), _doc_items_usagehelp = S("The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however."), inventory_image = "mcl_totems_totem.png", diff --git a/mods/HELP/doc/doc_identifier/init.lua b/mods/HELP/doc/doc_identifier/init.lua index 2713d38903..2e041ae2e2 100644 --- a/mods/HELP/doc/doc_identifier/init.lua +++ b/mods/HELP/doc/doc_identifier/init.lua @@ -161,6 +161,7 @@ end minetest.register_tool("doc_identifier:identifier_solid", { description = S("Lookup Tool"), + _tt_help = S("Show help for pointed thing"), _doc_items_longdesc = S("This useful little helper can be used to quickly learn more about about one's closer environment. It identifies and analyzes blocks, items and other things and it shows extensive information about the thing on which it is used."), _doc_items_usagehelp = S("Punch any block, item or other thing about you wish to learn more about. This will open up the appropriate help entry. The tool comes in two modes which are changed by using. In liquid mode, this tool points to liquids as well while in solid mode this is not the case."), _doc_items_hidden = false, diff --git a/mods/HELP/mcl_tt/depends.txt b/mods/HELP/mcl_tt/depends.txt new file mode 100644 index 0000000000..c49c556e0e --- /dev/null +++ b/mods/HELP/mcl_tt/depends.txt @@ -0,0 +1 @@ +tt diff --git a/mods/HELP/mcl_tt/init.lua b/mods/HELP/mcl_tt/init.lua new file mode 100644 index 0000000000..445ec09b08 --- /dev/null +++ b/mods/HELP/mcl_tt/init.lua @@ -0,0 +1,103 @@ +local S = minetest.get_translator("mcl_tt") + +-- Armor +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + local head = minetest.get_item_group(itemstring, "armor_head") + local torso = minetest.get_item_group(itemstring, "armor_torso") + local legs = minetest.get_item_group(itemstring, "armor_legs") + local feet = minetest.get_item_group(itemstring, "armor_feet") + if head > 0 then + s = s .. S("Head armor") + end + if torso > 0 then + s = s .. S("Torso armor") + end + if legs > 0 then + s = s .. S("Legs armor") + end + if feet > 0 then + s = s .. S("Feet armor") + end + if s == "" then + s = nil + end + return s +end) +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + local use = minetest.get_item_group(itemstring, "mcl_armor_uses") + local pts = minetest.get_item_group(itemstring, "mcl_armor_points") + if pts > 0 then + s = s .. S("Armor points: @1", pts) + s = s .. "\n" + end + if use > 0 then + s = s .. S("Armor durability: @1", use) + end + if s == "" then + s = nil + end + return s +end) +-- Horse armor +tt.register_snippet(function(itemstring) + local armor_g = minetest.get_item_group(itemstring, "horse_armor") + if armor_g and armor_g > 0 then + return S("Protection: @1%", 100 - armor_g) + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + if def.groups.eatable and def.groups.eatable > 0 then + s = s .. S("Hunger points: +@1", def.groups.eatable) + end + if def._mcl_saturation and def._mcl_saturation > 0 then + if s ~= "" then + s = s .. "\n" + end + s = s .. S("Saturation points: +@1", string.format("%.1f", def._mcl_saturation)) + end + if s == "" then + s = nil + end + return s +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then + return S("Deals damage when falling") + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if def.groups.place_flowerlike == 1 then + return S("Grows on grass blocks or dirt") + elseif def.groups.place_flowerlike == 2 then + return S("Grows on grass blocks, podzol, dirt or coarse dirt") + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if def.groups.flammable then + return S("Flammable") + end +end) + +tt.register_snippet(function(itemstring) + if itemstring == "mcl_heads:zombie" then + return S("Zombie view range: -50%") + elseif itemstring == "mcl_heads:skeleton" then + return S("Skeleton view range: -50%") + elseif itemstring == "mcl_heads:creeper" then + return S("Creeper view range: -50%") + end +end) + diff --git a/mods/HELP/tt/API.md b/mods/HELP/tt/API.md new file mode 100644 index 0000000000..0f24e472ce --- /dev/null +++ b/mods/HELP/tt/API.md @@ -0,0 +1,33 @@ +# Tooltip API +This API explains how to handle the extended item tooltips (`description` field). + +## Fields + +Add these to the item definition. + +* `_tt_ignore`: If `true`, the `description` of this item won't be altered at all +* `_tt_help`: Custom help text +* `_tt_food`: If `true`, item is a food item that can be consumed by the player +* `_tt_food_hp`: Health increase (in HP) for player when consuming food item + +Once this mod had overwritten the `description` field of an item was overwritten, it will save the original (unaltered) `description` in the `_tt_original_description` field. + +## `tt.register_snippet(func)` + +Register a custom snippet function. +`func` is a function of the form `func(itemstring)`. +It will be called for (nearly) every itemstring. + +Returns: Two values, the first one is required. +1st return value: A string you want to append to this item or `nil` if nothing shall be appended. +2nd return value: If nil, `tt` will take of the text color. If a ColorString in `"#RRGGBB"` format, entire text is colorized in this color. Return `false` to force `tt` to not apply text any colorization (useful if you want to call `minetest.colorize` yourself. + +Example: + +``` +tt.register_snippet(function(itemstring) + if minetest.get_item_group(itemstring, "magic") == 1 then + return "This item is magic" + end +end) +``` diff --git a/mods/HELP/tt/README.md b/mods/HELP/tt/README.md new file mode 100644 index 0000000000..ca76902e47 --- /dev/null +++ b/mods/HELP/tt/README.md @@ -0,0 +1,12 @@ +# Extended Tooltip (`tt`) +This mod extends the tooltip of items to add more informative texts. + +It displays the following useful information: +* Weapon damage and speed +* Tool properties +* Noteworthy block properties +* Food satiation +* Custom help text (added by mods) + +## License +MIT License. diff --git a/mods/HELP/tt/init.lua b/mods/HELP/tt/init.lua new file mode 100644 index 0000000000..1e639baee3 --- /dev/null +++ b/mods/HELP/tt/init.lua @@ -0,0 +1,55 @@ +local S = minetest.get_translator("tt") + +tt = {} +tt.COLOR_DEFAULT = "#d0ffd0" +tt.COLOR_DANGER = "#ffff00" +tt.COLOR_GOOD = "#00ff00" + +-- API +tt.registered_snippets = {} + +tt.register_snippet = function(func) + table.insert(tt.registered_snippets, func) +end + +-- Register core snippets + +dofile(minetest.get_modpath(minetest.get_current_modname()).."/snippets_core.lua") +dofile(minetest.get_modpath(minetest.get_current_modname()).."/snippets_builtin.lua") + +-- Apply item description updates + +local function append_snippets() + for itemstring, def in pairs(minetest.registered_items) do + if itemstring ~= "" and itemstring ~= "air" and itemstring ~= "ignore" and itemstring ~= "unknown" and def ~= nil and def.description ~= nil and def.description ~= "" and def._tt_ignore ~= true then + local desc = def.description + local orig_desc = desc + local first = true + -- Apply snippets + for s=1, #tt.registered_snippets do + local str, snippet_color = tt.registered_snippets[s](itemstring) + if snippet_color == nil then + snippet_color = tt.COLOR_DEFAULT + elseif snippet_color == false then + snippet_color = false + end + if str then + if first then + first = false + end + desc = desc .. "\n" + if snippet_color then + desc = desc .. minetest.colorize(snippet_color, str) + else + desc = desc .. str + end + end + end + if desc ~= def.description then + minetest.override_item(itemstring, { description = desc, _tt_original_description = orig_desc }) + end + end + end +end + +minetest.register_on_mods_loaded(append_snippets) diff --git a/mods/HELP/tt/locale/template.txt b/mods/HELP/tt/locale/template.txt new file mode 100644 index 0000000000..488a0e262d --- /dev/null +++ b/mods/HELP/tt/locale/template.txt @@ -0,0 +1,27 @@ +# textdomain:tt +Damage: @1= +Damage (@1): @2= +Healing: @1= +Healing (@1): @2= +Full punch interval: @1s= +Food item= ++@1 satiation= +@1 satiation= ++@1 food points= +Contact damage: @1 per second= +Contact healing: @1 per second= +Drowning damage: @1= +Bouncy (@1%)= +Luminance: @1= +Slippery= +Climbable= +Climbable (only downwards)= +No jumping= +No swimming upwards= +No rising= +Fall damage: @1%= +Fall damage: +@1%= +No fall damage= +Digs @1 blocks= +Digs @1 blocks instantly= +Minimum dig time: @1s= diff --git a/mods/HELP/tt/locale/tt.de.tr b/mods/HELP/tt/locale/tt.de.tr new file mode 100644 index 0000000000..b62daee18e --- /dev/null +++ b/mods/HELP/tt/locale/tt.de.tr @@ -0,0 +1,27 @@ +# textdomain:tt +Damage: @1=Schaden: @1 +Damage (@1): @2=Schaden (@1): @2 +Healing: @1=Heilung: @1 +Healing (@1): @2=Heilung (@1): @2 +Full punch interval: @1s=Zeit zum Ausholen: @1s +Food item=Lebensmittel ++@1 satiation=+@1 Sättigung +@1 satiation=@1 Sättigung ++@1 food points=+@1 Nahrungspunkte +Contact damage: @1 per second=Kontaktschaden: @1 pro Sekunde +Contact healing: @1 per second=Kontaktheilung: @1 pro Sekunde +Drowning damage: @1=Ertrinkensschaden: @1 +Bouncy (@1%)=Sprunghaft (@1%) +Luminance: @1=Lichtstärke: @1 +Slippery=Rutschig +Climbable=Erkletterbar +Climbable (only downwards)=Erkletterbar (nur nach unten) +No jumping=Kein Springen +No swimming upwards=Kein nach oben schwimmen +No rising=Kein Aufsteigen +Fall damage: @1%=Fallschaden: @1% +Fall damage: +@1%=Fallschaden: +@1% +No fall damage=Kein Fallschaden +Digs @1 blocks=Gräbt „@1“-Blöcke +Digs @1 blocks instantly=Gräbt „@1“-Blöcke sofort +Minimum dig time: @1s=Minimale Grabezeit: @1s diff --git a/mods/HELP/tt/mod.conf b/mods/HELP/tt/mod.conf new file mode 100644 index 0000000000..aee1572f6b --- /dev/null +++ b/mods/HELP/tt/mod.conf @@ -0,0 +1,2 @@ +name = tt +description = Appends a helpful tooltip to the item description diff --git a/mods/HELP/tt/snippets_builtin.lua b/mods/HELP/tt/snippets_builtin.lua new file mode 100644 index 0000000000..6d383f7dff --- /dev/null +++ b/mods/HELP/tt/snippets_builtin.lua @@ -0,0 +1,210 @@ +local S = minetest.get_translator("tt") + +local function get_min_digtime(caps) + local mintime + local unique = true + local maxlevel = caps.maxlevel + if not maxlevel then + maxlevel = 1 + end + if maxlevel > 1 then + unique = false + end + if caps.times then + for r=1,3 do + local time = caps.times[r] + if time and maxlevel > 1 then + time = time / maxlevel + end + if time and ((not mintime) or (time < mintime)) then + if mintime and (time < mintime) then + unique = false + end + mintime = time + end + end + end + return mintime, unique +end + +local function newline(str) + if str ~= "" then + str = str .. "\n" + end + return str +end + +-- Digging capabilities of tool +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if not def.tool_capabilities then + return + end + local groupcaps = def.tool_capabilities.groupcaps + if not groupcaps then + return + end + local formstring = "" + local capstr = "" + local caplines = 0 + for k,v in pairs(groupcaps) do + local speedstr = "" + local miningusesstr = "" + -- Mining capabilities + caplines = caplines + 1 + local maxlevel = v.maxlevel + if not maxlevel then + -- Default from tool.h + maxlevel = 1 + end + + -- Digging speed + local speed_class = def.groups and def.groups.dig_speed_class + if speed_class == 1 then + speedstr = S("Painfully slow") + elseif speed_class == 2 then + speedstr = S("Very slow") + elseif speed_class == 3 then + speedstr = S("Slow") + elseif speed_class == 4 then + speedstr = S("Fast") + elseif speed_class == 5 then + speedstr = S("Very fast") + elseif speed_class == 6 then + speedstr = S("Extremely fast") + elseif speed_class == 7 then + speedstr = S("Instantaneous") + end + + -- Number of mining uses + local base_uses = v.uses + if not base_uses then + -- Default from tool.h + base_uses = 20 + end + if def._doc_items_durability == nil and base_uses > 0 then + local real_uses = base_uses * math.pow(3, maxlevel) + if real_uses < 65535 then + miningusesstr = S("@1 uses", real_uses) + else + miningusesstr = S("Unlimited uses") + end + end + + if speedstr ~= "" then + capstr = capstr .. S("Mining speed: @1", speedstr) .. "\n" + end + if miningusesstr ~= "" then + capstr = capstr .. S("Mining durability: @1", miningusesstr) .. "\n" + end + + -- Only show one group at max + break + end + if caplines > 0 then + -- Capabilities + formstring = formstring .. capstr + -- Max. drop level + local mdl = def.tool_capabilities.max_drop_level + if not def.tool_capabilities.max_drop_level then + mdl = 0 + end + formstring = formstring .. S("Block breaking strength: @1", mdl) + end + if formstring == "" then + formstring = nil + end + return formstring +end) + +-- Food +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local desc + if def._tt_food then + desc = S("Food item") + if def._tt_food_hp then + local msg = S("+@1 food points", def._tt_food_hp) + desc = desc .. "\n" .. msg + end + end + return desc +end) + +-- Node info +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local desc = "" + + -- Health-related node facts + if def.damage_per_second then + if def.damage_per_second > 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Contact damage: @1 per second", def.damage_per_second)) + elseif def.damage_per_second < 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_GOOD, S("Contact healing: @1 per second", math.abs(def.damage_per_second))) + end + end + if def.drowning and def.drowning ~= 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Drowning damage: @1", def.drowning)) + end + local tmp = minetest.get_item_group(itemstring, "fall_damage_add_percent") + if tmp > 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DANGER, S("Fall damage: +@1%", tmp)) + elseif tmp == -100 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_GOOD, S("No fall damage")) + elseif tmp < 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Fall damage: @1%", tmp)) + end + + -- Movement-related node facts + if minetest.get_item_group(itemstring, "disable_jump") == 1 and not def.climbable then + if def.liquidtype == "none" then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No jumping")) + elseif minetest.get_item_group(itemstring, "fake_liquid") == 0 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No swimming upwards")) + else + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("No rising")) + end + end + if def.climbable then + if minetest.get_item_group(itemstring, "disable_jump") == 1 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Climbable (only downwards)")) + else + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Climbable")) + end + end + if minetest.get_item_group(itemstring, "slippery") >= 1 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Slippery")) + end + local tmp = minetest.get_item_group(itemstring, "bouncy") + if tmp >= 1 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Bouncy (@1%)", tmp)) + end + + -- Node appearance + tmp = def.light_source + if tmp and tmp >= 1 then + desc = newline(desc) + desc = desc .. minetest.colorize(tt.COLOR_DEFAULT, S("Luminance: @1", tmp)) + end + + + if desc == "" then + desc = nil + end + return desc, false +end) + diff --git a/mods/HELP/tt/snippets_core.lua b/mods/HELP/tt/snippets_core.lua new file mode 100644 index 0000000000..cc67a10c91 --- /dev/null +++ b/mods/HELP/tt/snippets_core.lua @@ -0,0 +1,11 @@ +-- CORE SNIPPETS -- + +-- Custom text (_tt_help) +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if def._tt_help then + return def._tt_help + end +end) + + diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index cc8d7b666f..261546e79c 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -283,6 +283,7 @@ local dispenserdef = { local horizontal_def = table.copy(dispenserdef) horizontal_def.description = S("Dispenser") +horizontal_def._tt_help = S("9 inventory slots").."\n"..S("Launches item when powered with redstone power") horizontal_def._doc_items_longdesc = S("A dispenser is a block which acts as a redstone component which, when powered with redstone power, dispenses an item. It has a container with 9 inventory slots.") horizontal_def._doc_items_usagehelp = S("Place the dispenser in one of 6 possible directions. The “hole” is where items will fly out of the dispenser. Use the dispenser to access its inventory. Insert the items you wish to dispense. Supply the dispenser with redstone energy once to dispense a random item.").."\n\n".. diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index 7167de19fe..fd728320d7 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -148,6 +148,7 @@ local dropperdef = { local horizontal_def = table.copy(dropperdef) horizontal_def.description = S("Dropper") +horizontal_def._tt_help = S("9 inventory slots").."\n"..S("Drops item when powered with redstone power") horizontal_def._doc_items_longdesc = S("A dropper is a redstone component and a container with 9 inventory slots which, when supplied with redstone power, drops an item or puts it into a container in front of it.") horizontal_def._doc_items_usagehelp = S("Droppers can be placed in 6 possible directions, items will be dropped out of the hole. Use the dropper to access its inventory. Supply it with redstone energy once to make the dropper drop or transfer a random item.") horizontal_def.after_place_node = function(pos, placer, itemstack, pointed_thing) diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index 802e24509b..7b4955af83 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -87,6 +87,7 @@ mesecon.register_node("mcl_observers:observer", }, { description = S("Observer"), + _tt_help = S("Observes block in front of it and sends a brief redstone pulse when it changes"), _doc_items_longdesc = S("An observer is a redstone component which observes the block in front of it and sends a very short redstone pulse whenever this block changes."), _doc_items_usagehelp = S("Place the observer directly in front of the block you want to observe with the “face” looking at the block. The arrow points to the side of the output, which is at the opposite side of the “face”. You can place your redstone dust or any other component here."), diff --git a/mods/ITEMS/REDSTONE/mesecons_button/init.lua b/mods/ITEMS/REDSTONE/mesecons_button/init.lua index b397be4be0..30339858bb 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_button/init.lua @@ -97,7 +97,11 @@ mesecon.register_button = function(basename, description, texture, recipeitem, s groups_off.button_push_by_arrow = 1 groups_on.button_push_by_arrow = 1 end - + local tt = S("Provides redstone power when pushed") + tt = tt .. "\n" .. S("Push duration: @1s", string.format("%.1f", button_timer)) + if push_by_arrow then + tt = tt .. "\n" .. S("Pushable by arrow") + end minetest.register_node("mesecons_button:button_"..basename.."_off", { drawtype = "nodebox", tiles = {texture}, @@ -113,6 +117,7 @@ mesecon.register_button = function(basename, description, texture, recipeitem, s node_box = boxes_off, groups = groups_off, description = description, + _tt_help = tt, _doc_items_longdesc = longdesc, _doc_items_usagehelp = buttonuse, on_place = on_button_place, diff --git a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua index 91c682cbc0..0813668f75 100644 --- a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua @@ -204,6 +204,7 @@ end minetest.register_node("mesecons_commandblock:commandblock_off", { description = S("Command Block"), + _tt_help = S("Executes server commands when powered by redstone power"), _doc_items_longdesc = S("Command blocks are mighty redstone components which are able to alter reality itself. In other words, they cause the server to execute server commands when they are supplied with redstone power."), _doc_items_usagehelp = diff --git a/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua b/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua index c91b36acbb..724fb77be8 100644 --- a/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua @@ -181,9 +181,10 @@ boxes = { } end -local help, longdesc, usagehelp, icon, on_construct +local help, tt, longdesc, usagehelp, icon, on_construct if i == 1 then help = true + tt = S("Redstone component").."\n"..S("Restricts power to one direction").."\n"..S("Delays signal").."\n"..S("Output can be locked") longdesc = S("Redstone repeaters are versatile redstone components with multiple purposes: 1. They only allow signals to travel in one direction. 2. They delay the signal. 3. Optionally, they can lock their output in one state.") usagehelp = S("To power a redstone repeater, send a signal in “arrow” direction (the input). The signal goes out on the opposite side (the output) with a delay. To change the delay, use the redstone repeater. The delay is between 0.1 and 0.4 seconds long and can be changed in steps of 0.1 seconds. It is indicated by the position of the moving redstone torch.").."\n".. S("To lock a repeater, send a signal from an adjacent repeater into one of its sides. While locked, the moving redstone torch disappears, the output doesn't change and the input signal is ignored.") @@ -231,6 +232,7 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), { description = desc_off, inventory_image = icon, wield_image = icon, + _tt_help = tt, _doc_items_create_entry = help, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, diff --git a/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua b/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua index 822aa3be94..0e01d52b9e 100644 --- a/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_lightstone/init.lua @@ -7,6 +7,7 @@ minetest.register_node("mesecons_lightstone:lightstone_off", { groups = {handy=1, mesecon_effector_off = 1, mesecon = 2}, is_ground_content = false, description= S("Redstone Lamp"), + _tt_help = S("Glows when powered by redstone power"), _doc_items_longdesc = S("Redstone lamps are simple redstone components which glow brightly (light level @1) when they receive redstone power.", light), sounds = mcl_sounds.node_sound_glass_defaults(), mesecons = {effector = { diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua index 342cbc7c07..8080e82f0e 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua @@ -2,6 +2,7 @@ local S = minetest.get_translator("mesecons_noteblock") minetest.register_node("mesecons_noteblock:noteblock", { description = S("Note Block"), + _tt_help = S("Plays a musical note when powered by redstone power"), _doc_items_longdesc = S("A note block is a musical block which plays one of many musical notes and different intruments when it is punched or supplied with redstone power."), _doc_items_usagehelp = S("Use the note block to choose the next musical note (there are 25 semitones, or 2 octaves). The intrument played depends on the material of the block below the note block:").."\n\n".. diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index ce0e17a201..3800814743 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -178,6 +178,7 @@ local usagehelp_piston = S("This block can have one of 6 possible orientations." -- offstate minetest.register_node("mesecons_pistons:piston_normal_off", { description = S("Piston"), + _tt_help = S("Pushes block when powered by redstone power"), _doc_items_longdesc = S("A piston is a redstone component with a pusher which pushes the block or blocks in front of it when it is supplied with redstone power. Not all blocks can be pushed, however."), _doc_items_usagehelp = usagehelp_piston, tiles = { @@ -280,6 +281,7 @@ local pistonspec_sticky = { -- offstate minetest.register_node("mesecons_pistons:piston_sticky_off", { description = S("Sticky Piston"), + _tt_help = S("Pushes or pulls block when powered by redstone power"), _doc_items_longdesc = S("A sticky piston is a redstone component with a sticky pusher which can be extended and retracted. It extends when it is supplied with redstone power. When the pusher extends, it pushes the block or blocks in front of it. When it retracts, it pulls back the single block in front of it. Note that not all blocks can be pushed or pulled."), _doc_items_usagehelp = usagehelp_piston, diff --git a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua index c56b3f788c..7bc6e2e36b 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pressureplates/init.lua @@ -99,6 +99,16 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te if not longdesc then longdesc = S("A pressure plate is a redstone component which supplies its surrounding blocks with redstone power while someone or something rests on top of it.") end + local tt = S("Provides redstone power when pushed") + if not activated_by then + tt = tt .. "\n" .. S("Pushed by players, mobs and objects") + elseif activated_by.mob and activated_by.player then + tt = tt .. "\n" .. S("Pushed by players and mobs") + elseif activated_by.mob then + tt = tt .. "\n" .. S("Pushed by mobs") + elseif activated_by.player then + tt = tt .. "\n" .. S("Pushed by players") + end mesecon.register_node(basename, { drawtype = "nodebox", @@ -125,6 +135,7 @@ function mesecon.register_pressure_plate(basename, description, textures_off, te mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate }}, _doc_items_longdesc = longdesc, + _tt_help = tt, },{ node_box = pp_box_on, selection_box = pp_box_on, diff --git a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua index 3571688fcc..eb5eafdbc7 100644 --- a/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_solarpanel/init.lua @@ -58,6 +58,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", { }, groups = {handy=1,axey=1, material_wood=1}, description=S("Daylight Sensor"), + _tt_help = S("Provides redstone power when in sunlight") .. "\n" ..S("Can be inverted"), _doc_items_longdesc = S("Daylight sensors are redstone components which provide redstone power when they are in sunlight and no power otherwise. They can also be inverted.").."\n".. S("In inverted state, they provide redstone power when they are not in sunlight and no power otherwise."), _doc_items_usagehelp = S("Use the daylight sensor to toggle its state."), diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index 81ca4cc4df..cba14163c2 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -192,6 +192,7 @@ mcl_torches.register_torch("mesecon_torch_on", S("Redstone Torch"), minetest.register_node("mesecons_torch:redstoneblock", { description = S("Block of Redstone"), + _tt_help = S("Provides redstone power"), _doc_items_longdesc = S("A block of redstone permanently supplies redstone power to its surrounding blocks."), tiles = {"redstone_redstone_block.png"}, stack_max = 64, diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index 49dbbe32cf..e71327969a 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -47,6 +47,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { groups = {handy=1, dig_by_water=1, destroy_by_lava_flow=1, dig_by_piston=1, attached_node_facedir=1}, is_ground_content = false, description=S("Lever"), + _tt_help = S("Provides redstone power when flipped on"), _doc_items_longdesc = S("A lever is a redstone component which can be flipped on and off. It supplies redstone power to adjacent blocks while it is in the “on” state."), _doc_items_usagehelp = S("Use the lever to flip it on or off."), on_rightclick = function (pos, node) diff --git a/mods/ITEMS/REDSTONE/mesecons_wires/init.lua b/mods/ITEMS/REDSTONE/mesecons_wires/init.lua index 106f3fb6dc..75acd3ce03 100644 --- a/mods/ITEMS/REDSTONE/mesecons_wires/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_wires/init.lua @@ -217,7 +217,7 @@ local function register_wires() local tiles_off = { crossing_off, crossing_off, straight0_off, straight1_off, straight0_off, straight1_off } local tiles_on = { crossing_on, crossing_on, straight0_on, straight1_on, straight0_on, straight1_on } - local wirehelp, longdesc, usagehelp, img, desc_off, desc_on + local wirehelp, tt, longdesc, usagehelp, img, desc_off, desc_on if nodeid == "00000000" then -- Non-connected redstone wire nodebox.fixed = {-8/16, -.5, -8/16, 8/16, -.5+1/64, 8/16} @@ -225,6 +225,7 @@ local function register_wires() tiles_off = { dot_off, dot_off, "blank.png", "blank.png", "blank.png", "blank.png" } tiles_on = { dot_on, dot_on, "blank.png", "blank.png", "blank.png", "blank.png" } + tt = S("Transmits redstone power, powers mechanisms") longdesc = S("Redstone is a versatile conductive mineral which transmits redstone power. It can be placed on the ground as a trail.").."\n".. S("A redstone trail can be in two states: Powered or not powered. A powered redstone trail will power (and thus activate) adjacent redstone components.").."\n".. S("Redstone power can be received from various redstone components, such as a block of redstone or a button. Redstone power is used to activate numerous mechanisms, such as redstone lamps or pistons.") @@ -259,6 +260,7 @@ S("Read the help entries on the other redstone components to learn how redstone description = desc_off, inventory_image = img, wield_image = img, + _tt_help = tt, _doc_items_create_entry = wirehelp, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index a12a13cd4d..26c4676c54 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -449,6 +449,7 @@ S("• Tool + Tool: Place two tools of the same type in the input slots. The “ S("• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.").."\n".. S("Armor counts as a tool. It is possible to repair and rename a tool in a single step.").."\n\n".. S("The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.") +anvildef0._tt_help = S("Repair and rename items") local anvildef1 = table.copy(anvildef) anvildef1.description = S("Slightly Damaged Anvil") diff --git a/mods/ITEMS/mcl_armor_stand/init.lua b/mods/ITEMS/mcl_armor_stand/init.lua index 64b257215f..416a420d91 100644 --- a/mods/ITEMS/mcl_armor_stand/init.lua +++ b/mods/ITEMS/mcl_armor_stand/init.lua @@ -89,6 +89,7 @@ end -- TODO: The armor stand should be an entity minetest.register_node("mcl_armor_stand:armor_stand", { description = S("Armor Stand"), + _tt_help = S("Display pieces of armor"), _doc_items_longdesc = S("An armor stand is a decorative object which can display different pieces of armor. Anything which players can wear as armor can also be put on an armor stand."), _doc_items_usagehelp = S("Just place an armor item on the armor stand. To take the top piece of armor from the armor stand, select your hand and use the place key on the armor stand."), drawtype = "mesh", diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 870f39ca25..6ec620d1b0 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -195,6 +195,7 @@ end -- Standing banner node -- This one is also used for the help entry to avoid spamming the help with 16 entries. minetest.register_node("mcl_banners:standing_banner", { + _tt_help = S("Paintable"), _doc_items_entry_name = "Banner", _doc_items_image = "mcl_banners_item_base.png^mcl_banners_item_overlay.png", _doc_items_longdesc = S("Banners are tall colorful decorative blocks. They can be placed on the floor and at walls. Banners can be emblazoned with a variety of patterns using a lot of dye in crafting."), diff --git a/mods/ITEMS/mcl_beds/api.lua b/mods/ITEMS/mcl_beds/api.lua index efc27b3ea1..d4d001a4d0 100644 --- a/mods/ITEMS/mcl_beds/api.lua +++ b/mods/ITEMS/mcl_beds/api.lua @@ -66,6 +66,7 @@ function mcl_beds.register_bed(name, def) end minetest.register_node(name .. "_bottom", { description = def.description, + _tt_help = S("Allows you to sleep"), _doc_items_longdesc = def._doc_items_longdesc or beddesc, _doc_items_usagehelp = def._doc_items_usagehelp or beduse, _doc_items_create_entry = def._doc_items_create_entry, diff --git a/mods/ITEMS/mcl_books/init.lua b/mods/ITEMS/mcl_books/init.lua index 1cc0ef3d5f..e83e02b156 100644 --- a/mods/ITEMS/mcl_books/init.lua +++ b/mods/ITEMS/mcl_books/init.lua @@ -110,6 +110,7 @@ end -- Book and Quill minetest.register_craftitem("mcl_books:writable_book", { description = S("Book and Quill"), + _tt_help = S("Write down some notes"), _doc_items_longdesc = S("This item can be used to write down some notes."), _doc_items_usagehelp = S("Hold it in the hand, then rightclick to read the current notes and edit then. You can edit the text as often as you like. You can also sign the book which turns it into a written book which you can stack, but it can't be edited anymore.").."\n".. S("A book can hold up to 4500 characters. The title length is limited to 64 characters."), diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 421f5c3dce..80c1160b84 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -20,6 +20,7 @@ local mod_button = minetest.get_modpath("mesecons_button") minetest.register_craftitem("mcl_bows:arrow", { description = S("Arrow"), + _tt_help = S("Ammunition").."\n"..S("Damage from bow: 1-10").."\n"..S("Damage from dispenser: 3"), _doc_items_longdesc = S("Arrows are ammunition for bows and dispensers.").."\n".. S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there's a 20% chance of a critical hit dealing 10 damage instead. An arrow fired from a dispenser always deals 3 damage.").."\n".. S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons."), diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 4f39331d2b..68de5987c0 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -98,6 +98,7 @@ end -- Bow item, uncharged state minetest.register_tool("mcl_bows:bow", { description = S("Bow"), + _tt_help = S("Launch arrows"), _doc_items_longdesc = S("Bows are ranged weapons to shoot arrows at your foes.").."\n".. S("The speed and damage of the arrow increases the longer you charge. The regular damage of the arrow is between 1 and 9. At full charge, there's also a 20% of a critical hit, dealing 10 damage instead."), _doc_items_usagehelp = S("To use the bow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button to charge, release to shoot."), diff --git a/mods/ITEMS/mcl_cake/init.lua b/mods/ITEMS/mcl_cake/init.lua index f3cc023293..33cad61954 100644 --- a/mods/ITEMS/mcl_cake/init.lua +++ b/mods/ITEMS/mcl_cake/init.lua @@ -3,6 +3,8 @@ #!#!#!#Released under CC Attribution-ShareAlike 3.0 Unported #!#!# ]]-- +local CAKE_HUNGER_POINTS = 2 + local S = minetest.get_translator("mcl_cake") local cake_texture = {"cake_top.png","cake_bottom.png","cake_inner.png","cake_side.png","cake_side.png","cake_side.png"} @@ -31,6 +33,7 @@ minetest.register_craft({ minetest.register_node("mcl_cake:cake", { description = S("Cake"), + _tt_help = S("With 7 tasty slices!").."\n"..S("Hunger points: +@1 per slice", CAKE_HUNGER_POINTS), _doc_items_longdesc = S("Cakes can be placed and eaten to restore hunger points. A cake has 7 slices. Each slice restores 2 hunger points and 0.4 saturation points. Cakes will be destroyed when dug or when the block below them is broken."), _doc_items_usagehelp = S("Place the cake anywhere, then rightclick it to eat a single slice. You can't eat from the cake when your hunger bar is full."), tiles = {"cake_top.png","cake_bottom.png","cake_side.png","cake_side.png","cake_side.png","cake_side.png"}, @@ -82,7 +85,7 @@ local register_slice = function(level, nodebox, desc) minetest.record_protection_violation(pos, name) return end - local newcake = minetest.do_item_eat(2, ItemStack(after_eat), ItemStack(this), clicker, {type="nothing"}) + local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack(after_eat), ItemStack(this), clicker, {type="nothing"}) -- Check if we were allowed to eat if newcake:get_name() ~= this or minetest.settings:get_bool("creative_mode") == true then minetest.add_node(pos,{type="node",name=after_eat,param2=0}) @@ -96,7 +99,7 @@ local register_slice = function(level, nodebox, desc) minetest.record_protection_violation(pos, name) return end - local newcake = minetest.do_item_eat(2, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"}) + local newcake = minetest.do_item_eat(CAKE_HUNGER_POINTS, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"}) -- Check if we were allowed to eat if newcake:get_name() ~= this or minetest.settings:get_bool("creative_mode") == true then minetest.remove_node(pos) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 68c507ce7f..bc65e96627 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -45,6 +45,7 @@ end -- Empty cauldron minetest.register_node("mcl_cauldrons:cauldron", { description = S("Cauldron"), + _tt_help = S("Stores water"), _doc_items_longdesc = S("Cauldrons are used to store water and slowly fill up under rain."), _doc_items_usagehelp = S("Place a water pucket into the cauldron to fill it with water. Place an empty bucket on a full cauldron to retrieve the water. Place a water bottle into the cauldron to fill the cauldron to one third with water. Place a glass bottle in a cauldron with water to retrieve one third of the water."), wield_image = "mcl_cauldrons_cauldron.png", diff --git a/mods/ITEMS/mcl_clock/init.lua b/mods/ITEMS/mcl_clock/init.lua index 2e2d1b00ad..5d10b4cf73 100644 --- a/mods/ITEMS/mcl_clock/init.lua +++ b/mods/ITEMS/mcl_clock/init.lua @@ -54,13 +54,15 @@ function watch.register_item(name, image, creative, frame) if doc_mod and not use_doc then doc.add_entry_alias("craftitems", mcl_clock.stereotype, "craftitems", name) end - local longdesc, usagehelp + local longdesc, usagehelp, tt if use_doc then longdesc = S("Clocks are tools which shows the current time of day in the Overworld.") usagehelp = S("The clock contains a rotating disc with a sun symbol (yellow disc) and moon symbol and a little “pointer” which shows the current time of day by estimating the real position of the sun and the moon in the sky. Noon is represented by the sun symbol and midnight is represented by the moon symbol.") + tt = S("Displays time of day in the Overworld") end minetest.register_craftitem(name, { description = S("Clock"), + _tt_help = tt, _doc_items_create_entry = use_doc, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, diff --git a/mods/ITEMS/mcl_colorblocks/init.lua b/mods/ITEMS/mcl_colorblocks/init.lua index 15c12ab374..f55003e024 100644 --- a/mods/ITEMS/mcl_colorblocks/init.lua +++ b/mods/ITEMS/mcl_colorblocks/init.lua @@ -28,6 +28,7 @@ local hc_desc = S("Terracotta is a basic building material. It comes in many dif local gt_desc = S("Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.") local cp_desc = S("Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.") local c_desc = S("Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.") +local cp_tt = S("Turns into concrete on water contact") minetest.register_node("mcl_colorblocks:hardened_clay", { description = S("Terracotta"), @@ -62,6 +63,7 @@ for _, row in ipairs(block.dyes) do local ldesc_hc, ldesc_gt, ldesc_cp, ldesc_c local create_entry local ename_hc, ename_gt, ename_cp, ename_c + local ltt_cp = cp_tt if is_canonical then ldesc_hc = hc_desc ldesc_gt = gt_desc @@ -91,6 +93,7 @@ for _, row in ipairs(block.dyes) do minetest.register_node("mcl_colorblocks:concrete_powder_"..name, { description = sdesc_cp, + _tt_help = ltt_cp, _doc_items_longdesc = ldesc_cp, _doc_items_create_entry = create_entry, _doc_items_entry_name = ename_cp, diff --git a/mods/ITEMS/mcl_compass/init.lua b/mods/ITEMS/mcl_compass/init.lua index ee7df7de78..7a23cc50d3 100644 --- a/mods/ITEMS/mcl_compass/init.lua +++ b/mods/ITEMS/mcl_compass/init.lua @@ -78,14 +78,16 @@ for i,img in ipairs(images) do if i == stereotype_frame then inv = 0 end - local use_doc, longdesc, usagehelp + local use_doc, longdesc, usagehelp, tt use_doc = i == stereotype_frame if use_doc then + tt = S("Points to the world origin") longdesc = S("Compasses are tools which point to the world origin (X=0, Z=0) or the spawn point in the Overworld.") end local itemstring = "mcl_compass:"..(i-1) minetest.register_craftitem(itemstring, { description = S("Compass"), + _tt_help = tt, _doc_items_create_entry = use_doc, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, diff --git a/mods/ITEMS/mcl_core/nodes_cactuscane.lua b/mods/ITEMS/mcl_core/nodes_cactuscane.lua index 59efa75925..326182db0e 100644 --- a/mods/ITEMS/mcl_core/nodes_cactuscane.lua +++ b/mods/ITEMS/mcl_core/nodes_cactuscane.lua @@ -4,6 +4,7 @@ local S = minetest.get_translator("mcl_core") minetest.register_node("mcl_core:cactus", { description = S("Cactus"), + _tt_help = S("Grows on sand").."\n"..S("Contact damage: @1 per half second", 1), _doc_items_longdesc = S("This is a piece of cactus commonly found in dry areas, especially deserts. Over time, cacti will grow up to 3 blocks high on sand or red sand. A cactus hurts living beings touching it with a damage of 1 HP every half second. When a cactus block is broken, all cactus blocks connected above it will break as well."), _doc_items_usagehelp = S("A cactus can only be placed on top of another cactus or any sand."), drawtype = "nodebox", @@ -47,6 +48,7 @@ minetest.register_node("mcl_core:cactus", { minetest.register_node("mcl_core:reeds", { description = S("Sugar Canes"), + _tt_help = S("Grows on sand or dirt next to water"), _doc_items_longdesc = S("Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well."), _doc_items_usagehelp = S("Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow."), drawtype = "plantlike", diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index 689a88e198..43161b4465 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -56,6 +56,7 @@ minetest.register_node("mcl_core:slimeblock", { minetest.register_node("mcl_core:cobweb", { description = S("Cobweb"), + _tt_help = S("Slows down movement"), _doc_items_longdesc = S("Cobwebs can be walked through, but significantly slow you down."), drawtype = "plantlike", paramtype2 = "degrotate", diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua index 2a02551e21..f6e224d9c5 100644 --- a/mods/ITEMS/mcl_crafting_table/init.lua +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -2,6 +2,7 @@ local S = minetest.get_translator("mcl_crafting_table") minetest.register_node("mcl_crafting_table:crafting_table", { description = S("Crafting Table"), + _tt_help = S("Gives access to 3×3 crafting grid"), _doc_items_longdesc = S("A crafting table is a block which grants you access to a 3×3 crafting grid which allows you to perform advanced crafts."), _doc_items_usagehelp = S("Rightclick the crafting table to access the 3×3 crafting grid."), _doc_items_hidden = false, diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 30c493fff8..eaacaecf3f 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -322,6 +322,7 @@ end minetest.register_craftitem("mcl_dye:white", { inventory_image = "mcl_dye_white.png", description = S("Bone Meal"), + _tt_help = S("Speeds up plant growth"), _doc_items_longdesc = S("Bone meal is a white dye and also useful as a fertilizer to speed up the growth of many plants."), _doc_items_usagehelp = S("Rightclick a sheep to turn its wool white. Rightclick a plant to speed up its growth. Note that not all plants can be fertilized like this. When you rightclick a grass block, tall grass and flowers will grow all over the place."), stack_max = 64, @@ -359,6 +360,7 @@ minetest.register_craftitem("mcl_dye:white", { minetest.register_craftitem("mcl_dye:brown", { inventory_image = "mcl_dye_brown.png", + _tt_help = S("Grows at the side of jungle trees"), _doc_items_longdesc = S("Cocoa beans are a brown dye and can be used to plant cocoas."), _doc_items_usagehelp = S("Rightclick a sheep to turn its wool brown. Rightclick on the side of a jungle tree trunk (Jungle Wood) to plant a young cocoa."), description = S("Cocoa Beans"), diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index c6c2233668..b80babf60e 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -116,6 +116,7 @@ end minetest.register_node("mcl_end:chorus_flower", { description = S("Chorus Flower"), + _tt_help = S("Grows on end stone"), _doc_items_longdesc = S("A chorus flower is the living part of a chorus plant. It can grow into a tall chorus plant, step by step. When it grows, it may die on old age eventually. It also dies when it is unable to grow."), _doc_items_usagehelp = S("Place it and wait for it to grow. It can only be placed on top of end stone, on top of a chorus plant stem, or at the side of exactly one chorus plant stem."), tiles = { @@ -205,6 +206,7 @@ minetest.register_node("mcl_end:chorus_flower", { minetest.register_node("mcl_end:chorus_flower_dead", { description = S("Dead Chorus Flower"), + _tt_help = S("Grows on end stone"), _doc_items_longdesc = S("This is a part of a chorus plant. It doesn't grow. Chorus flowers die of old age or when they are unable to grow. A dead chorus flower can be harvested to obtain a fresh chorus flower which is able to grow again."), tiles = { "mcl_end_chorus_flower_dead.png", @@ -543,6 +545,7 @@ end minetest.register_craftitem("mcl_end:chorus_fruit", { description = S("Chorus Fruit"), + _tt_help = S("Randomly teleports you when eaten"), _doc_items_longdesc = S("A chorus fruit is an edible fruit from the chorus plant which is home to the End. Eating it teleports you to the top of a random solid block nearby, provided you won't end up inside a liquid, solid or harmful blocks. Teleportation might fail if there are very few or no places to teleport to."), wield_image = "mcl_end_chorus_fruit.png", inventory_image = "mcl_end_chorus_fruit.png", diff --git a/mods/ITEMS/mcl_end/eye_of_ender.lua b/mods/ITEMS/mcl_end/eye_of_ender.lua index d074e39236..3d2a990efe 100644 --- a/mods/ITEMS/mcl_end/eye_of_ender.lua +++ b/mods/ITEMS/mcl_end/eye_of_ender.lua @@ -74,6 +74,7 @@ minetest.register_entity("mcl_end:ender_eye", { minetest.register_craftitem("mcl_end:ender_eye", { description = S("Eye of Ender"), + _tt_help = S("Guides you to an End portal shrine"), _doc_items_longdesc = S("This item is used to locate End portal shrines in the Overworld and to activate End portals.") .. "\n" .. S("NOTE: The End dimension is currently incomplete and might change in future versions."), _doc_items_usagehelp = S("Use the attack key to release the eye of ender. It will rise and fly in the horizontal direction of the closest end portal shrine. If you're very close, the eye of ender will take the direct path to the End portal shrine instead. After a few seconds, it stops. It may drop as an item, but there's a 20% chance it shatters.") .. "\n" .. S("To activate an End portal, eyes of ender need to be placed into each block of an intact End portal frame."), wield_image = "mcl_end_ender_eye.png", diff --git a/mods/ITEMS/mcl_farming/beetroot.lua b/mods/ITEMS/mcl_farming/beetroot.lua index a6f8fc9ac7..ff0211533c 100644 --- a/mods/ITEMS/mcl_farming/beetroot.lua +++ b/mods/ITEMS/mcl_farming/beetroot.lua @@ -2,6 +2,7 @@ local S = minetest.get_translator("mcl_farming") minetest.register_craftitem("mcl_farming:beetroot_seeds", { description = S("Beetroot Seeds"), + _tt_help = S("Can be sown on farmland"), _doc_items_longdesc = S("Grows into a beetroot plant. Chickens like beetroot seeds."), _doc_items_usagehelp = S("Place the beetroot seeds on farmland (which can be created with a hoe) to plant a beetroot plant. They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it beetroot seeds."), groups = { craftitem=1 }, diff --git a/mods/ITEMS/mcl_farming/carrots.lua b/mods/ITEMS/mcl_farming/carrots.lua index 341bbeb07b..6080b3152f 100644 --- a/mods/ITEMS/mcl_farming/carrots.lua +++ b/mods/ITEMS/mcl_farming/carrots.lua @@ -82,6 +82,7 @@ minetest.register_node("mcl_farming:carrot", { minetest.register_craftitem("mcl_farming:carrot_item", { description = S("Carrot"), + _tt_help = S("Can be planted on farmland"), _doc_items_longdesc = S("Carrots can be eaten and planted. Pigs and rabbits like carrots."), _doc_items_usagehelp = S("Hold it in your hand and rightclick to eat it. Place it on top of farmland to plant the carrot. It grows in sunlight and grows faster on hydrated farmland. Rightclick an animal to feed it."), inventory_image = "farming_carrot.png", diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index 04105b0adb..578e3aa55e 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -49,16 +49,26 @@ local hoe_on_place_function = function(wear_divisor) end end +local uses = { + wood = 60, + stone = 132, + iron = 251, + gold = 33, + diamond = 1562, +} + +local hoe_tt = S("Turns block into farmland") local hoe_longdesc = S("Hoes are essential tools for growing crops. They are used to create farmland in order to plant seeds on it. Hoes can also be used as very weak weapons in a pinch.") local hoe_usagehelp = S("Use the hoe on a cultivatable block (by rightclicking it) to turn it into farmland. Dirt, grass blocks and grass paths are cultivatable blocks. Using a hoe on coarse dirt turns it into dirt.") minetest.register_tool("mcl_farming:hoe_wood", { description = S("Wood Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.wood), _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, _doc_items_hidden = false, inventory_image = "farming_tool_woodhoe.png", - on_place = hoe_on_place_function(60), + on_place = hoe_on_place_function(uses.wood), groups = { tool=1, hoe=1 }, tool_capabilities = { full_punch_interval = 1, @@ -91,10 +101,11 @@ minetest.register_craft({ minetest.register_tool("mcl_farming:hoe_stone", { description = S("Stone Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.stone), _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_stonehoe.png", - on_place = hoe_on_place_function(132), + on_place = hoe_on_place_function(uses.stone), groups = { tool=1, hoe=1 }, tool_capabilities = { full_punch_interval = 0.5, @@ -122,10 +133,11 @@ minetest.register_craft({ minetest.register_tool("mcl_farming:hoe_iron", { description = S("Iron Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.iron), _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_steelhoe.png", - on_place = hoe_on_place_function(251), + on_place = hoe_on_place_function(uses.iron), groups = { tool=1, hoe=1 }, tool_capabilities = { -- 1/3 @@ -161,10 +173,11 @@ minetest.register_craft({ minetest.register_tool("mcl_farming:hoe_gold", { description = S("Golden Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.gold), _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_goldhoe.png", - on_place = hoe_on_place_function(33), + on_place = hoe_on_place_function(uses.gold), groups = { tool=1, hoe=1 }, tool_capabilities = { full_punch_interval = 1, @@ -201,10 +214,11 @@ minetest.register_craft({ minetest.register_tool("mcl_farming:hoe_diamond", { description = S("Diamond Hoe"), + _tt_help = hoe_tt.."\n"..S("Uses: @1", uses.diamond), _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_diamondhoe.png", - on_place = hoe_on_place_function(1562), + on_place = hoe_on_place_function(uses.diamond), groups = { tool=1, hoe=1 }, tool_capabilities = { full_punch_interval = 0.25, diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index 18eb7faab0..5a4b324329 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -3,6 +3,7 @@ local S = minetest.get_translator("mcl_farming") -- Seeds minetest.register_craftitem("mcl_farming:melon_seeds", { description = S("Melon Seeds"), + _tt_help = S("Can be sown on farmland"), _doc_items_longdesc = S("Grows into a melon stem which in turn grows melons. Chickens like melon seeds."), _doc_items_usagehelp = S("Place the melon seeds on farmland (which can be created with a hoe) to plant a melon stem. Melon stems grow in sunlight and grow faster on hydrated farmland. When mature, the stem will attempt to grow a melon at the side. Rightclick an animal to feed it melon seeds."), stack_max = 64, diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 0ffbd1fad0..3faed1e02e 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -87,6 +87,7 @@ minetest.register_node("mcl_farming:potato", { minetest.register_craftitem("mcl_farming:potato_item", { description = S("Potato"), + _tt_help = S("Can be planted on farmland"), _doc_items_longdesc = S("Potatoes are food items which can be eaten, cooked in the furnace and planted. Pigs like potatoes."), _doc_items_usagehelp = S("Hold it in your hand and rightclick to eat it. Place it on top of farmland to plant it. It grows in sunlight and grows faster on hydrated farmland. Rightclick an animal to feed it."), inventory_image = "farming_potato.png", diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index d90b6e1826..e46844c985 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -9,6 +9,7 @@ end -- Seeds minetest.register_craftitem("mcl_farming:pumpkin_seeds", { description = S("Pumpkin Seeds"), + _tt_help = S("Can be sown on farmland"), _doc_items_longdesc = S("Grows into a pumpkin stem which in turn grows pumpkins. Chickens like pumpkin seeds."), _doc_items_usagehelp = S("Place the pumpkin seeds on farmland (which can be created with a hoe) to plant a pumpkin stem. Pumpkin stems grow in sunlight and grow faster on hydrated farmland. When mature, the stem attempts to grow a pumpkin next to it. Rightclick an animal to feed it pumpkin seeds."), stack_max = 64, diff --git a/mods/ITEMS/mcl_farming/soil.lua b/mods/ITEMS/mcl_farming/soil.lua index 012a9659bd..8249971609 100644 --- a/mods/ITEMS/mcl_farming/soil.lua +++ b/mods/ITEMS/mcl_farming/soil.lua @@ -3,6 +3,7 @@ local S = minetest.get_translator("mcl_farming") minetest.register_node("mcl_farming:soil", { tiles = {"mcl_farming_farmland_dry.png", "default_dirt.png"}, description = S("Farmland"), + _tt_help = S("Surface for farming plants").."\n"..S("Can become wet"), _doc_items_longdesc = S("Farmland is used for farming, a necessary surface to plant crops. It is created when a hoe is used on dirt or a similar block. Plants are able to grow on farmland, but slowly. Farmland will become hydrated farmland (on which plants grow faster) when it rains or a water source is nearby. This block will turn back to dirt when a solid block appears above it or a piston arm extends above it."), drop = "mcl_core:dirt", drawtype = "nodebox", diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index 4c8800da31..aca5f65446 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -3,6 +3,7 @@ local S = minetest.get_translator("mcl_farming") minetest.register_craftitem("mcl_farming:wheat_seeds", { -- Original Minecraft name: “Seeds” description = S("Wheat Seeds"), + _tt_help = S("Can be sown on farmland"), _doc_items_longdesc = S("Grows into a wheat plant. Chickens like wheat seeds."), _doc_items_usagehelp = S("Place the wheat seeds on farmland (which can be created with a hoe) to plant a wheat plant. They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it wheat seeds."), groups = { craftitem=1 }, diff --git a/mods/ITEMS/mcl_fire/fire_charge.lua b/mods/ITEMS/mcl_fire/fire_charge.lua index 58e86778f3..fbf75f18ac 100644 --- a/mods/ITEMS/mcl_fire/fire_charge.lua +++ b/mods/ITEMS/mcl_fire/fire_charge.lua @@ -3,6 +3,7 @@ local S = minetest.get_translator("mcl_fire") -- Fire Charge minetest.register_craftitem("mcl_fire:fire_charge", { description = S("Fire Charge"), + _tt_help = S("Dispenser projectile").."\n"..S("Starts fires and ignites blocks"), _doc_items_longdesc = S("Fire charges are primarily projectiles which can be launched from dispensers, they will fly in a straight line and burst into a fire on impact. Alternatively, they can be used to ignite fires directly."), _doc_items_usagehelp = S("Put the fire charge into a dispenser and supply it with redstone power to launch it. To ignite a fire directly, simply place the fire charge on the ground, which uses it up."), inventory_image = "mcl_fire_fire_charge.png", diff --git a/mods/ITEMS/mcl_fire/flint_and_steel.lua b/mods/ITEMS/mcl_fire/flint_and_steel.lua index 6ca2132d00..c5b1290b22 100644 --- a/mods/ITEMS/mcl_fire/flint_and_steel.lua +++ b/mods/ITEMS/mcl_fire/flint_and_steel.lua @@ -3,6 +3,7 @@ local S = minetest.get_translator("mcl_fire") -- Flint and Steel minetest.register_tool("mcl_fire:flint_and_steel", { description = S("Flint and Steel"), + _tt_help = S("Starts fires and ignites blocks"), _doc_items_longdesc = S("Flint and steel is a tool to start fires and ignite blocks."), _doc_items_usagehelp = S("Rightclick the surface of a block to attempt to light a fire in front of it or ignite the block. A few blocks have an unique reaction when ignited."), inventory_image = "mcl_fire_flint_and_steel.png", diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 4ca7976f34..fe1484a159 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -308,6 +308,7 @@ end) -- Fishing Rod minetest.register_tool("mcl_fishing:fishing_rod", { description = S("Fishing Rod"), + _tt_help = S("Catch fish in water"), _doc_items_longdesc = S("Fishing rods can be used to catch fish."), _doc_items_usagehelp = S("Rightclick to launch the bobber. When it sinks right-click again to reel in an item. Who knows what you're going to catch?"), groups = { tool=1 }, diff --git a/mods/ITEMS/mcl_flowerpots/init.lua b/mods/ITEMS/mcl_flowerpots/init.lua index 3131abd161..c2a85d8128 100644 --- a/mods/ITEMS/mcl_flowerpots/init.lua +++ b/mods/ITEMS/mcl_flowerpots/init.lua @@ -29,6 +29,7 @@ local cubes = { minetest.register_node("mcl_flowerpots:flower_pot", { description = S("Flower Pot"), + _tt_help = S("Can holds a small flower or plant"), _doc_items_longdesc = S("Flower pots are decorative blocks in which flowers and other small plants can be placed."), _doc_items_usagehelp = S("Just place a plant on the flower pot. Flower pots can hold small flowers (not higher than 1 block), saplings, ferns, dead bushes, mushrooms and cacti. Rightclick a potted plant to retrieve the plant."), drawtype = "mesh", diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 8b817312a2..a85912aadb 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -295,6 +295,7 @@ end minetest.register_node("mcl_furnaces:furnace", { description = S("Furnace"), + _tt_help = S("Uses fuel to smelt or cook items"), _doc_items_longdesc = S("Furnaces cook or smelt several items, using a furnace fuel, into something else."), _doc_items_usagehelp = S("Use the furnace to open the furnace menu. Place a furnace fuel in the lower slot and the source material in the upper slot. The furnace will slowly use its fuel to smelt the item. The result will be placed into the output slot at the right side.").."\n".. diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 78a0d43137..e9587c419f 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -125,6 +125,7 @@ local def_hopper = { -- Enabled downwards hopper local def_hopper_enabled = table.copy(def_hopper) def_hopper_enabled.description = S("Hopper") +def_hopper_enabled._tt_help = S("5 inventory slots").."\n"..S("Collects items from above, moves items to container below").."\n"..S("Can be disabled with redstone power") def_hopper_enabled._doc_items_longdesc = S("Hoppers are containers with 5 inventory slots. They collect dropped items from above, take items from a container above and attempt to put its items it into an adjacent container. Hoppers can go either downwards or sideways. Hoppers interact with chests, droppers, dispensers, shulker boxes, furnaces and hoppers.").."\n\n".. S("Hoppers interact with containers the following way:").."\n".. diff --git a/mods/ITEMS/mcl_itemframes/init.lua b/mods/ITEMS/mcl_itemframes/init.lua index 2d5ec5c043..6c6d62024f 100644 --- a/mods/ITEMS/mcl_itemframes/init.lua +++ b/mods/ITEMS/mcl_itemframes/init.lua @@ -101,6 +101,7 @@ end minetest.register_node("mcl_itemframes:item_frame",{ description = S("Item Frame"), + _tt_help = S("Holds an item"), _doc_items_longdesc = S("Item frames are decorative blocks in which items can be placed."), _doc_items_usagehelp = S("Just place any item on the item frame. Use the item frame again to retrieve the item."), drawtype = "mesh", diff --git a/mods/ITEMS/mcl_jukebox/init.lua b/mods/ITEMS/mcl_jukebox/init.lua index fb495e78a8..1329864f16 100644 --- a/mods/ITEMS/mcl_jukebox/init.lua +++ b/mods/ITEMS/mcl_jukebox/init.lua @@ -126,6 +126,7 @@ end -- Jukebox minetest.register_node("mcl_jukebox:jukebox", { description = S("Jukebox"), + _tt_help = S("Uses music discs to play music"), _doc_items_longdesc = S("Jukeboxes play music when they're supplied with a music disc."), _doc_items_usagehelp = S("Place a music disc into an empty jukebox to insert the music disc and play music. If the jukebox already has a music disc, you will retrieve this music disc first. The music can only be heard by you, not by other players."), tiles = {"mcl_jukebox_top.png", "mcl_jukebox_side.png", "mcl_jukebox_side.png"}, diff --git a/mods/ITEMS/mcl_maps/init.lua b/mods/ITEMS/mcl_maps/init.lua index ceca739b04..4e6eefc4d7 100644 --- a/mods/ITEMS/mcl_maps/init.lua +++ b/mods/ITEMS/mcl_maps/init.lua @@ -34,6 +34,7 @@ minetest.register_craftitem("mcl_maps:empty_map", { -- has a very greatly zoomed-out version and even a radar mode minetest.register_craftitem("mcl_maps:filled_map", { description = S("Map"), + _tt_help = S("Enables minimap"), _doc_items_longdesc = S("Maps show your surroundings as you explore the world."), _doc_items_usagehelp = S("Hold the map in any of the hotbar slots. This allows you to access the minimap by pressing the minimap key (see controls settings).").."\n".. S("In Creative Mode, you don't need this item; the minimap is always available."), diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 8a670766aa..ea4eb09552 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -146,6 +146,7 @@ end -- TODO: Clear *all* status effects minetest.register_craftitem("mcl_mobitems:milk_bucket", { description = S("Milk"), + _tt_help = S("Cures poison"), _doc_items_longdesc = S("Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points."), _doc_items_usagehelp = "Rightclick to drink the milk.", inventory_image = "mcl_mobitems_bucket_milk.png", @@ -272,6 +273,7 @@ minetest.register_craftitem("mcl_mobitems:rabbit_foot", { minetest.register_craftitem("mcl_mobitems:saddle", { description = S("Saddle"), + _tt_help = S("Can be placed on animals to ride them"), _doc_items_longdesc = S("Saddles can be put on some animals in order to mount them."), _doc_items_usagehelp = "Rightclick an animal (with the saddle in your hand) to try put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by rightclicking them again.", wield_image = "mcl_mobitems_saddle.png", @@ -316,6 +318,7 @@ minetest.register_craftitem("mcl_mobitems:gunpowder", { minetest.register_tool("mcl_mobitems:carrot_on_a_stick", { description = S("Carrot on a Stick"), + _tt_help = S("Lets you ride a saddled pig"), _doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them."), _doc_items_usagehelp = S("Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick."), wield_image = "mcl_mobitems_carrot_on_a_stick.png", diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index 632e4fa75a..8b9732c112 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -266,6 +266,7 @@ minetest.register_node("mcl_mobspawners:spawner", { paramtype = "light", walkable = true, description = S("Mob Spawner"), + _tt_help = S("Makes mobs appear"), _doc_items_longdesc = S("A mob spawner regularily causes mobs to appear around it while a player is nearby. Some mob spawners are disabled while in light."), _doc_items_usagehelp = S("If you have a spawn egg, you can use it to change the mob to spawn. Just place the item on the mob spawner. Player-set mob spawners always spawn mobs regardless of the light level."), groups = {pickaxey=1, material_stone=1, deco_block=1}, diff --git a/mods/ITEMS/mcl_monster_eggs/init.lua b/mods/ITEMS/mcl_monster_eggs/init.lua index 1f7244cb00..7823b360c9 100644 --- a/mods/ITEMS/mcl_monster_eggs/init.lua +++ b/mods/ITEMS/mcl_monster_eggs/init.lua @@ -23,6 +23,7 @@ local register_block = function(subname, description, tiles, is_ground_content) is_ground_content = false, sounds = mcl_sounds.node_sound_stone_defaults(), after_dig_node = spawn_silverfish, + _tt_help = S("Hides a silverfish"), _doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."), _mcl_hardness = 0, _mcl_blast_resistance = 3.75, diff --git a/mods/ITEMS/mcl_mushrooms/small.lua b/mods/ITEMS/mcl_mushrooms/small.lua index 75bdeeecf3..8105386f4b 100644 --- a/mods/ITEMS/mcl_mushrooms/small.lua +++ b/mods/ITEMS/mcl_mushrooms/small.lua @@ -23,12 +23,15 @@ local longdesc_intro_red = S("Red mushrooms are fungi which grow and spread in d local longdesc_append = S("A single mushroom of this species will slowly spread over time towards a random solid opaque block with a light level of 12 or lower in a 3×3×3 cube around the mushroom. It stops spreading when there are 5 or more mushrooms of the same species within an area of 9×3×9 blocks around the mushroom.").."\n".. S("Mushrooms will eventually uproot at a light level of 12 or higher. On mycelium or podzol, they survive and spread at any light level.") +local tt_help = S("Grows on podzol, mycelium and other blocks").."\n"..S("Spreads in darkness") + local usagehelp = S("This mushroom can be placed on mycelium and podzol at any light level. It can also be placed on blocks which are both solid and opaque, as long as the light level at daytime is not higher than 12.") minetest.register_node("mcl_mushrooms:mushroom_brown", { description = S("Brown Mushroom"), _doc_items_longdesc = longdesc_intro_brown .. "\n\n" .. longdesc_append, _doc_items_usagehelp = usagehelp, + _tt_help = tt_help, drawtype = "plantlike", tiles = { "farming_mushroom_brown.png" }, inventory_image = "farming_mushroom_brown.png", @@ -52,6 +55,7 @@ minetest.register_node("mcl_mushrooms:mushroom_red", { description = S("Red Mushroom"), _doc_items_longdesc = longdesc_intro_red .. "\n\n" .. longdesc_append, _doc_items_usagehelp = usagehelp, + _tt_help = tt_help, drawtype = "plantlike", tiles = { "farming_mushroom_red.png" }, inventory_image = "farming_mushroom_red.png", diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 4025d360f5..b6a662faeb 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -85,6 +85,7 @@ minetest.register_node("mcl_nether:netherrack", { minetest.register_node("mcl_nether:magma", { description = S("Magma Block"), + _tt_help = S("Deals damage when standing on it"), _doc_items_longdesc = S("Magma blocks are hot solid blocks which hurt anyone standing on it, unless they have fire resistance. Starting a fire on this block will create an eternal fire."), stack_max = 64, tiles = {{name="mcl_nether_magma.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.5}}}, @@ -113,6 +114,7 @@ minetest.register_node("mcl_nether:magma", { minetest.register_node("mcl_nether:soul_sand", { description = S("Soul Sand"), + _tt_help = S("Reduces walking speed"), _doc_items_longdesc = S("Soul sand is a block from the Nether. One can only slowly walk on soul sand. The slowing effect is amplified when the soul sand is on top of ice, packed ice or a slime block."), stack_max = 64, tiles = {"mcl_nether_soul_sand.png"}, diff --git a/mods/ITEMS/mcl_nether/nether_wart.lua b/mods/ITEMS/mcl_nether/nether_wart.lua index 7b01e46211..caaf41e553 100644 --- a/mods/ITEMS/mcl_nether/nether_wart.lua +++ b/mods/ITEMS/mcl_nether/nether_wart.lua @@ -97,6 +97,7 @@ minetest.register_node("mcl_nether:nether_wart", { minetest.register_craftitem("mcl_nether:nether_wart_item", { description = S("Nether Wart"), + _tt_help = S("Grows on soul sand"), _doc_items_longdesc = S("Nether warts are plants home to the Nether. They can be planted on soul sand and grow in 4 stages."), _doc_items_usagehelp = S("Place this item on soul sand to plant it and watch it grow."), inventory_image = "mcl_nether_nether_wart.png", diff --git a/mods/ITEMS/mcl_ocean/corals.lua b/mods/ITEMS/mcl_ocean/corals.lua index a5d6cb8566..a2d20d7519 100644 --- a/mods/ITEMS/mcl_ocean/corals.lua +++ b/mods/ITEMS/mcl_ocean/corals.lua @@ -76,11 +76,15 @@ for c=1, #corals do local doc_desc_block = S("Coral blocks live in the oceans and need a water source next to them to survive. Without water, they die off.") local doc_desc_coral = S("Corals grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.") local doc_desc_fan = S("Corals fans grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.") + local tt_block = S("Needs water to live") + local tt_coral_dead = S("Grows on coral block of same species") + local tt_coral = tt_coral_dead .. S("Needs water to live") -- Coral Block minetest.register_node("mcl_ocean:"..id.."_coral_block", { description = corals[c][2], _doc_items_longdesc = doc_desc_block, + _tt_help = tt_block, tiles = { "mcl_ocean_"..id.."_coral_block.png" }, groups = { pickaxey = 1, building_block = 1, coral=1, coral_block=1, coral_species=c, }, sounds = mcl_sounds.node_sound_dirt_defaults(), @@ -102,6 +106,7 @@ for c=1, #corals do minetest.register_node("mcl_ocean:"..id.."_coral", { description = corals[c][4], _doc_items_longdesc = doc_desc_coral, + _tt_help = tt_coral, drawtype = "plantlike_rooted", paramtype = "light", paramtype2 = "meshoptions", @@ -134,6 +139,7 @@ for c=1, #corals do minetest.register_node("mcl_ocean:dead_"..id.."_coral", { description = corals[c][5], _doc_items_create_entry = false, + _tt_help = tt_coral_dead, drawtype = "plantlike_rooted", paramtype = "light", paramtype2 = "meshoptions", @@ -167,6 +173,7 @@ for c=1, #corals do minetest.register_node("mcl_ocean:"..id.."_coral_fan", { description = corals[c][6], _doc_items_longdesc = doc_desc_fan, + _tt_help = tt_coral, drawtype = "plantlike_rooted", paramtype = "light", paramtype2 = "meshoptions", @@ -199,6 +206,7 @@ for c=1, #corals do minetest.register_node("mcl_ocean:dead_"..id.."_coral_fan", { description = corals[c][7], _doc_items_create_entry = false, + _tt_help = tt_coral_dead, drawtype = "plantlike_rooted", paramtype = "light", paramtype2 = "meshoptions", diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index 1b41183ab4..a659f0ad9e 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -152,9 +152,10 @@ for s=1, #surfaces do sounds.dig = leaf_sounds.dig sounds.dug = leaf_sounds.dug sounds.place = leaf_sounds.place - local doc_longdesc, doc_img, desc + local tt_help, doc_longdesc, doc_img, desc if surfaces[s][1] == "dirt" then doc_longdesc = S("Kelp grows inside water on top of dirt, sand or gravel.") + tt_help = S("Grows in water on dirt, sand, gravel") desc = S("Kelp") doc_create = true doc_img = "mcl_ocean_kelp_item.png" @@ -162,6 +163,7 @@ for s=1, #surfaces do doc_create = false end minetest.register_node("mcl_ocean:kelp_"..surfaces[s][1], { + _tt_help = tt_help, _doc_items_entry_name = desc, _doc_items_longdesc = doc_longdesc, _doc_items_create_entry = doc_create, diff --git a/mods/ITEMS/mcl_ocean/sea_pickle.lua b/mods/ITEMS/mcl_ocean/sea_pickle.lua index 2b0edf994a..9163a1eb4a 100644 --- a/mods/ITEMS/mcl_ocean/sea_pickle.lua +++ b/mods/ITEMS/mcl_ocean/sea_pickle.lua @@ -67,11 +67,12 @@ local ontop = "dead_brain_coral_block" local canonical = "mcl_ocean:sea_pickle_1_"..ontop for s=1,4 do - local desc, doc_desc, doc_use, doc_create, nici, img, img_off, on_place + local desc, doc_desc, doc_use, doc_create, tt_help, nici, img, img_off, on_place if s == 1 then desc = S("Sea Pickle") doc_desc = S("Sea pickles grow on dead brain coral blocks and provide light when underwater. They come in 4 sizes that vary in brightness.") doc_use = S("It can only be placed on top of dead brain coral blocks. Placing a sea pickle on another sea pickle will make it grow and brighter.") + tt_help = S("Glows when underwater").."\n"..S("4 possible sizes").."\n"..S("Grows on dead brain coral block") img = "mcl_ocean_sea_pickle_item.png" on_place = sea_pickle_on_place else @@ -88,6 +89,7 @@ for s=1,4 do minetest.register_node("mcl_ocean:sea_pickle_"..s.."_"..ontop, { description = desc, + _tt_help = tt_help, _doc_items_create_entry = doc_create, _doc_items_longdesc = doc_desc, _doc_items_usagehelp = doc_use, diff --git a/mods/ITEMS/mcl_ocean/seagrass.lua b/mods/ITEMS/mcl_ocean/seagrass.lua index 55435ad8f9..1140697614 100644 --- a/mods/ITEMS/mcl_ocean/seagrass.lua +++ b/mods/ITEMS/mcl_ocean/seagrass.lua @@ -99,9 +99,10 @@ for s=1, #surfaces do sounds.dig = leaf_sounds.dig sounds.dug = leaf_sounds.dug sounds.place = leaf_sounds.place - local doc_longdesc, doc_img, desc + local tt_help, doc_longdesc, doc_img, desc if surfaces[s][1] == "dirt" then doc_longdesc = S("Seagrass grows inside water on top of dirt, sand or gravel.") + tt_help = S("Grows in water on dirt, sand, gravel") desc = S("Seagrass") doc_create = true doc_img = "mcl_ocean_seagrass.png" @@ -109,6 +110,7 @@ for s=1, #surfaces do doc_create = false end minetest.register_node("mcl_ocean:seagrass_"..surfaces[s][1], { + _tt_help = tt_help, _doc_items_entry_name = desc, _doc_items_longdesc = doc_longdesc, _doc_items_create_entry = doc_create, diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index a790a7b6f3..80b832ef16 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -24,6 +24,7 @@ end -- End portal minetest.register_node("mcl_portals:portal_end", { description = S("End Portal"), + _tt_help = S("Used to construct end portals"), _doc_items_longdesc = S("An End portal teleports creatures and objects to the mysterious End dimension (and back!)."), _doc_items_usagehelp = S("Hop into the portal to teleport. Entering an End portal in the Overworld teleports you to a fixed position in the End dimension and creates a 5×5 obsidian platform at your destination. End portals in the End will lead back to your spawn point in the Overworld."), tiles = { @@ -309,6 +310,7 @@ end minetest.register_node("mcl_portals:end_portal_frame", { description = S("End Portal Frame"), + _tt_help = S("Used to construct end portals"), _doc_items_longdesc = S("End portal frames are used in the construction of End portals. Each block has a socket for an eye of ender.") .. "\n" .. S("NOTE: The End dimension is currently incomplete and might change in future versions."), _doc_items_usagehelp = S("To create an End portal, you need 12 end portal frames and 12 eyes of ender. The end portal frames have to be arranged around a horizontal 3×3 area with each block facing inward. Any other arrangement will fail.") .. "\n" .. S("Place an eye of ender into each block. The end portal appears in the middle after placing the final eye.") .. "\n" .. S("Once placed, an eye of ender can not be taken back."), groups = { creative_breakable = 1, deco_block = 1, end_portal_frame = 1 }, diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 0fc24d6504..73663673d2 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -20,6 +20,7 @@ minetest.register_craft({ minetest.register_craftitem("mcl_potions:glass_bottle", { description = S("Glass Bottle"), + _tt_help = S("Liquid container"), _doc_items_longdesc = S("A glass bottle is used as a container for liquids and can be used to collect water directly."), _doc_items_usagehelp = S("To collect water, it on a cauldron with water (which removes a level of water) or any water source (which removes no water)."), inventory_image = "mcl_potions_potion_bottle_empty.png", @@ -159,6 +160,7 @@ end minetest.register_craftitem("mcl_potions:potion_water", { description = S("Water Bottle"), + _tt_help = S("No effect"), _doc_items_longdesc = S("Water bottles can be used to fill cauldrons. Drinking water has no effect."), _doc_items_usagehelp = S("Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron."), stack_max = 1, @@ -203,6 +205,7 @@ minetest.register_craftitem("mcl_potions:potion_water", { minetest.register_craftitem("mcl_potions:potion_river_water", { description = S("River Water Bottle"), + _tt_help = S("No effect"), _doc_items_longdesc = S("River water bottles can be used to fill cauldrons. Drinking it has no effect."), _doc_items_usagehelp = S("Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron."), @@ -252,6 +255,7 @@ local how_to_drink = S("Use the “Place” key to drink it.") minetest.register_craftitem("mcl_potions:potion_awkward", { description = S("Awkward Potion"), + _tt_help = S("No effect"), _doc_items_longdesc = S("This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect."), _doc_items_usagehelp = how_to_drink, stack_max = 1, @@ -264,6 +268,7 @@ minetest.register_craftitem("mcl_potions:potion_awkward", { }) minetest.register_craftitem("mcl_potions:potion_mundane", { description = S("Mundane Potion"), + _tt_help = S("No effect"), _doc_items_longdesc = S("This potion has a clean taste and is used for brewing more potions. Drinking it has no effect."), _doc_items_usagehelp = how_to_drink, stack_max = 1, @@ -276,6 +281,7 @@ minetest.register_craftitem("mcl_potions:potion_mundane", { }) minetest.register_craftitem("mcl_potions:potion_thick", { description = S("Thick Potion"), + _tt_help = S("No effect"), _doc_items_longdesc = S("This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect."), _doc_items_usagehelp = how_to_drink, stack_max = 1, diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index a4e6b3b166..3127b53250 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -278,6 +278,7 @@ end minetest.register_node("mcl_signs:wall_sign", { description = S("Sign"), + _tt_help = S("Can be written"), _doc_items_longdesc = S("Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them."), _doc_items_usagehelp = S("After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again."), inventory_image = "default_sign.png", diff --git a/mods/ITEMS/mcl_sponges/init.lua b/mods/ITEMS/mcl_sponges/init.lua index 23ab711664..28edb4f768 100644 --- a/mods/ITEMS/mcl_sponges/init.lua +++ b/mods/ITEMS/mcl_sponges/init.lua @@ -37,6 +37,7 @@ end minetest.register_node("mcl_sponges:sponge", { description = S("Sponge"), + _tt_help = S("Removes water on contact"), _doc_items_longdesc = S("Sponges are blocks which remove water around them when they are placed or come in contact with water, turning it into a wet sponge."), drawtype = "normal", is_ground_content = false, @@ -95,6 +96,7 @@ minetest.register_node("mcl_sponges:sponge", { minetest.register_node("mcl_sponges:sponge_wet", { description = S("Waterlogged Sponge"), + _tt_help = S("Can be dried in furnace"), _doc_items_longdesc = S("A waterlogged sponge can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of a furnace, the water will pour into the bucket."), drawtype = "normal", is_ground_content = false, @@ -113,6 +115,7 @@ minetest.register_node("mcl_sponges:sponge_wet", { if minetest.get_modpath("mclx_core") then minetest.register_node("mcl_sponges:sponge_wet_river_water", { description = S("Riverwaterlogged Sponge"), + _tt_help = S("Can be dried in furnace"), _doc_items_longdesc = S("This is a sponge soaking wet with river water. It can be dried in the furnace to turn it into (dry) sponge. When there's an empty bucket in the fuel slot of the furnace, the river water will pour into the bucket.") .. "\n" .. S("A sponge becomes riverwaterlogged (instead of waterlogged) if it sucks up more river water than (normal) water."), drawtype = "normal", is_ground_content = false, diff --git a/mods/ITEMS/mcl_throwing/init.lua b/mods/ITEMS/mcl_throwing/init.lua index b1d9db3750..7e9249a6c9 100644 --- a/mods/ITEMS/mcl_throwing/init.lua +++ b/mods/ITEMS/mcl_throwing/init.lua @@ -393,6 +393,7 @@ local how_to_throw = S("Use the punch key to throw.") -- Snowball minetest.register_craftitem("mcl_throwing:snowball", { description = S("Snowball"), + _tt_help = S("Throwable"), _doc_items_longdesc = S("Snowballs can be thrown or launched from a dispenser for fun. Hitting something with a snowball does nothing."), _doc_items_usagehelp = how_to_throw, inventory_image = "mcl_throwing_snowball.png", @@ -405,6 +406,7 @@ minetest.register_craftitem("mcl_throwing:snowball", { -- Egg minetest.register_craftitem("mcl_throwing:egg", { description = S("Egg"), + _tt_help = S("Throwable").."\n"..S("Chance to hatch chicks when broken"), _doc_items_longdesc = S("Eggs can be thrown or launched from a dispenser and breaks on impact. There is a small chance that 1 or even 4 chicks will pop out of the egg."), _doc_items_usagehelp = how_to_throw, inventory_image = "mcl_throwing_egg.png", @@ -417,6 +419,7 @@ minetest.register_craftitem("mcl_throwing:egg", { -- Ender Pearl minetest.register_craftitem("mcl_throwing:ender_pearl", { description = S("Ender Pearl"), + _tt_help = S("Throwable").."\n"..S("Teleports you on impact for cost of 5 HP"), _doc_items_longdesc = S("An ender pearl is an item which can be used for teleportation at the cost of health. It can be thrown and teleport the thrower to its impact location when it hits a solid block or a plant. Each teleportation hurts the user by 5 hit points."), _doc_items_usagehelp = how_to_throw, wield_image = "mcl_throwing_ender_pearl.png", diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 47864bfa95..4218af00f6 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -98,6 +98,7 @@ minetest.register_node("mcl_tnt:tnt", { description = S("TNT"), paramtype = "light", sunlight_propagates = true, + _tt_help = S("Ignited by tools, explosions, fire, lava, redstone").."\n"..S("Explosion radius: @1", tostring(TNT_RANGE)), _doc_items_longdesc = longdesc, _doc_items_usagehelp = S("Place the TNT and ignite it with one of the methods above. Quickly get in safe distance. The TNT will start to be affected by gravity and explodes in 4 seconds."), groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, From cbda2ef3263db88281d6de8efe173d22286283cc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 8 Mar 2020 03:18:47 +0100 Subject: [PATCH 2/4] Add _tt_help to many more items --- mods/ITEMS/REDSTONE/mcl_observers/init.lua | 2 +- mods/ITEMS/REDSTONE/mesecons_torch/init.lua | 3 +- mods/ITEMS/mcl_armor_stand/init.lua | 2 +- mods/ITEMS/mcl_banners/init.lua | 4 +-- mods/ITEMS/mcl_buckets/init.lua | 10 +++++-- mods/ITEMS/mcl_core/nodes_base.lua | 4 ++- mods/ITEMS/mcl_core/nodes_trees.lua | 33 ++++++++++++++++----- mods/ITEMS/mcl_doors/api_doors.lua | 21 +++++++++---- mods/ITEMS/mcl_doors/api_trapdoors.lua | 18 ++++++++--- mods/ITEMS/mcl_end/eye_of_ender.lua | 2 +- mods/ITEMS/mcl_farming/potatoes.lua | 1 + mods/ITEMS/mcl_fences/init.lua | 5 ++-- mods/ITEMS/mcl_fishing/init.lua | 1 + mods/ITEMS/mcl_mobitems/init.lua | 3 ++ mods/ITEMS/mcl_ocean/corals.lua | 2 +- mods/ITEMS/mcl_ocean/kelp.lua | 3 +- mods/ITEMS/mcl_ocean/sea_pickle.lua | 2 +- mods/ITEMS/mcl_ocean/seagrass.lua | 5 ++-- mods/ITEMS/mcl_portals/portal_end.lua | 1 + 19 files changed, 88 insertions(+), 34 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index 7b4955af83..7c0eb3a2f8 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -87,7 +87,7 @@ mesecon.register_node("mcl_observers:observer", }, { description = S("Observer"), - _tt_help = S("Observes block in front of it and sends a brief redstone pulse when it changes"), + _tt_help = S("Emits redstone pulse when block in front changes"), _doc_items_longdesc = S("An observer is a redstone component which observes the block in front of it and sends a very short redstone pulse whenever this block changes."), _doc_items_usagehelp = S("Place the observer directly in front of the block you want to observe with the “face” looking at the block. The arrow points to the side of the output, which is at the opposite side of the “face”. You can place your redstone dust or any other component here."), diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index cba14163c2..4433561344 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -186,7 +186,8 @@ mcl_torches.register_torch("mesecon_torch_on", S("Redstone Torch"), rules = torch_get_input_rules, action_on = torch_action_on, }, - } + }, + _tt_help = S("Provides redstone power when it's not powered itself"), } ) diff --git a/mods/ITEMS/mcl_armor_stand/init.lua b/mods/ITEMS/mcl_armor_stand/init.lua index 416a420d91..88b46a3460 100644 --- a/mods/ITEMS/mcl_armor_stand/init.lua +++ b/mods/ITEMS/mcl_armor_stand/init.lua @@ -89,7 +89,7 @@ end -- TODO: The armor stand should be an entity minetest.register_node("mcl_armor_stand:armor_stand", { description = S("Armor Stand"), - _tt_help = S("Display pieces of armor"), + _tt_help = S("Displays pieces of armor"), _doc_items_longdesc = S("An armor stand is a decorative object which can display different pieces of armor. Anything which players can wear as armor can also be put on an armor stand."), _doc_items_usagehelp = S("Just place an armor item on the armor stand. To take the top piece of armor from the armor stand, select your hand and use the place key on the armor stand."), drawtype = "mesh", diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 6ec620d1b0..4b5220212a 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -195,8 +195,7 @@ end -- Standing banner node -- This one is also used for the help entry to avoid spamming the help with 16 entries. minetest.register_node("mcl_banners:standing_banner", { - _tt_help = S("Paintable"), - _doc_items_entry_name = "Banner", + _doc_items_entry_name = S("Banner"), _doc_items_image = "mcl_banners_item_base.png^mcl_banners_item_overlay.png", _doc_items_longdesc = S("Banners are tall colorful decorative blocks. They can be placed on the floor and at walls. Banners can be emblazoned with a variety of patterns using a lot of dye in crafting."), _doc_items_usagehelp = S("Use crafting to draw a pattern on top of the banner. Emblazoned banners can be emblazoned again to combine various patterns. You can draw up to 12 layers on a banner that way. If the banner includes a gradient, only 3 layers are possible.").."\n".. @@ -321,6 +320,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do -- TODO: Combine the items into only 1 item. minetest.register_craftitem(itemstring, { description = desc, + _tt_help = S("Paintable decoration"), _doc_items_create_entry = false, inventory_image = inv, wield_image = inv, diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 9b25c21a5f..b6e7ed002f 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -55,12 +55,13 @@ end -- name = user-visible bucket description -- longdesc = long explanatory description (for help) -- usagehelp = short usage explanation (for help) +-- tt_help = very short tooltip help -- extra_check(pos, placer) = optional function(pos) which can returns false to avoid placing the liquid. -- placer is object/player who is placing the liquid, can be nil -- groups = optional list of item groups -- -- This function can be called from any mod (which depends on this one) -function mcl_buckets.register_liquid(source_place, source_take, itemname, inventory_image, name, longdesc, usagehelp, extra_check, groups) +function mcl_buckets.register_liquid(source_place, source_take, itemname, inventory_image, name, longdesc, usagehelp, tt_help, extra_check, groups) for i=1, #source_take do mcl_buckets.liquids[source_take[i]] = { source_place = source_place, @@ -77,6 +78,7 @@ function mcl_buckets.register_liquid(source_place, source_take, itemname, invent description = name, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, + _tt_help = tt_help, inventory_image = inventory_image, stack_max = 16, liquids_pointable = true, @@ -187,6 +189,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", { description = S("Empty Bucket"), _doc_items_longdesc = S("A bucket can be used to collect and release liquids."), _doc_items_usagehelp = S("Punch a liquid source to collect it. You can then use the filled bucket to place the liquid somewhere else."), + _tt_help = S("Collects liquids"), inventory_image = "bucket.png", stack_max = 16, @@ -306,7 +309,8 @@ if mod_mcl_core then "bucket_lava.png", S("Lava Bucket"), S("A bucket can be used to collect and release liquids. This one is filled with hot lava, safely contained inside. Use with caution."), - S("Get in a safe distance and place the bucket to empty it and create a lava source at this spot. Don't burn yourself!") + S("Get in a safe distance and place the bucket to empty it and create a lava source at this spot. Don't burn yourself!"), + S("Places a lava source") ) -- Water bucket @@ -318,6 +322,7 @@ if mod_mcl_core then S("Water Bucket"), S("A bucket can be used to collect and release liquids. This one is filled with water."), S("Place it to empty the bucket and create a water source."), + S("Places a water source"), function(pos, placer) -- Check protection local placer_name = "" @@ -360,6 +365,7 @@ if mod_mclx_core then S("River Water Bucket"), S("A bucket can be used to collect and release liquids. This one is filled with river water."), S("Place it to empty the bucket and create a river water source."), + S("Places a river water source"), function(pos, placer) -- Check protection local placer_name = "" diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 155c637248..df06c44b73 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -862,10 +862,11 @@ for i=0,3 do end for i=1,8 do - local id, desc, longdesc, usagehelp, help, walkable, drawtype, node_box + local id, desc, longdesc, usagehelp, tt_help, help, walkable, drawtype, node_box if i == 1 then id = "mcl_core:snow" desc = S("Top Snow") + tt_help = S("Stackable") longdesc = S("Top snow is a layer of snow. It melts near light sources other than the sun with a light level of 12 or higher.").."\n"..S("Top snow can be stacked and has one of 8 different height levels. At levels 2-8, top snow is collidable. Top snow drops 2-9 snowballs, depending on its height.") usagehelp = S("This block can only be placed on full solid blocks and on another top snow (which increases its height).") walkable = false @@ -940,6 +941,7 @@ for i=1,8 do minetest.register_node(id, { description = desc, + _tt_help = tt_help, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, _doc_items_create_entry = help, diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index 92d2a7cd38..ad162e5b68 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -113,9 +113,10 @@ local register_leaves = function(subname, description, longdesc, tiles, drop1, d }) end -local register_sapling = function(subname, description, longdesc, texture, selbox) +local register_sapling = function(subname, description, longdesc, tt_help, texture, selbox) minetest.register_node("mcl_core:"..subname, { description = description, + _tt_help = tt_help, _doc_items_longdesc = longdesc, _doc_items_hidden = false, drawtype = "plantlike", @@ -169,12 +170,30 @@ register_wooden_planks("acaciawood", S("Acacia Wood Planks"), {"default_acacia_w register_wooden_planks("birchwood", S("Birch Wood Planks"), {"mcl_core_planks_birch.png"}) -register_sapling("sapling", S("Oak Sapling"), S("When placed on soil (such as dirt) and exposed to light, an oak sapling will grow into an oak after some time."), "default_sapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16}) -register_sapling("darksapling", S("Dark Oak Sapling"), S("Dark oak saplings can grow into dark oaks, but only in groups. A lonely dark oak sapling won't grow. A group of four dark oak saplings grows into a dark oak after some time when they are placed on soil (such as dirt) in a 2×2 square and exposed to light."), "mcl_core_sapling_big_oak.png", {-5/16, -0.5, -5/16, 5/16, 7/16, 5/16}) -register_sapling("junglesapling", S("Jungle Sapling"), S("When placed on soil (such as dirt) and exposed to light, a jungle sapling will grow into a jungle tree after some time. When there are 4 jungle saplings in a 2×2 square, they will grow to a huge jungle tree."), "default_junglesapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16}) -register_sapling("acaciasapling", S("Acacia Sapling"), S("When placed on soil (such as dirt) and exposed to light, an acacia sapling will grow into an acacia after some time."), "default_acacia_sapling.png", {-5/16, -0.5, -5/16, 5/16, 4/16, 5/16}) -register_sapling("sprucesapling", S("Spruce Sapling"), S("When placed on soil (such as dirt) and exposed to light, a spruce sapling will grow into a spruce after some time. When there are 4 spruce saplings in a 2×2 square, they will grow to a huge spruce."), "mcl_core_sapling_spruce.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}) -register_sapling("birchsapling", S("Birch Sapling"), S("When placed on soil (such as dirt) and exposed to light, a birch sapling will grow into a birch after some time."), "mcl_core_sapling_birch.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}) +register_sapling("sapling", S("Oak Sapling"), + S("When placed on soil (such as dirt) and exposed to light, an oak sapling will grow into an oak after some time."), + S("Needs soil and light to grow"), + "default_sapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16}) +register_sapling("darksapling", S("Dark Oak Sapling"), + S("Dark oak saplings can grow into dark oaks, but only in groups. A lonely dark oak sapling won't grow. A group of four dark oak saplings grows into a dark oak after some time when they are placed on soil (such as dirt) in a 2×2 square and exposed to light."), + S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings required"), + "mcl_core_sapling_big_oak.png", {-5/16, -0.5, -5/16, 5/16, 7/16, 5/16}) +register_sapling("junglesapling", S("Jungle Sapling"), + S("When placed on soil (such as dirt) and exposed to light, a jungle sapling will grow into a jungle tree after some time. When there are 4 jungle saplings in a 2×2 square, they will grow to a huge jungle tree."), + S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings = large tree"), + "default_junglesapling.png", {-5/16, -0.5, -5/16, 5/16, 0.5, 5/16}) +register_sapling("acaciasapling", S("Acacia Sapling"), + S("When placed on soil (such as dirt) and exposed to light, an acacia sapling will grow into an acacia after some time."), + S("Needs soil and light to grow"), + "default_acacia_sapling.png", {-5/16, -0.5, -5/16, 5/16, 4/16, 5/16}) +register_sapling("sprucesapling", S("Spruce Sapling"), + S("When placed on soil (such as dirt) and exposed to light, a spruce sapling will grow into a spruce after some time. When there are 4 spruce saplings in a 2×2 square, they will grow to a huge spruce."), + S("Needs soil and light to grow") .. "\n" .. S("2×2 saplings = large tree"), + "mcl_core_sapling_spruce.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}) +register_sapling("birchsapling", S("Birch Sapling"), + S("When placed on soil (such as dirt) and exposed to light, a birch sapling will grow into a birch after some time."), + S("Needs soil and light to grow"), + "mcl_core_sapling_birch.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16}) register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "mcl_core:sapling", 20, "mcl_core:apple", 200) diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index 951e4d9f90..0556031450 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mcl_doors") + -- This helper function calls on_place_node callbacks. local function on_place_node(place_to, newnode, placer, oldnode, itemstack, pointed_thing) @@ -66,26 +68,35 @@ function mcl_doors:register_door(name, def) def.selection_box_top = box end - local longdesc, usagehelp + local longdesc, usagehelp, tt_help + tt_help = def._tt_help longdesc = def._doc_items_longdesc if not longdesc then if def.only_redstone_can_open then - longdesc = "This door is a 2-block high barrier which can be opened or closed by hand or by redstone power." + longdesc = S("This door is a 2-block high barrier which can be opened or closed by hand or by redstone power.") else - longdesc = "This door is a 2-block high barrier which can only be opened by redstone power, not by hand." + longdesc = S("This door is a 2-block high barrier which can only be opened by redstone power, not by hand.") end end usagehelp = def._doc_items_usagehelp if not usagehelp then if def.only_redstone_can_open then - usagehelp = "To open or close this door, send a redstone signal to its bottom half." + usagehelp = S("To open or close this door, send a redstone signal to its bottom half.") else - usagehelp = "To open or close this door, rightclick it or send a redstone signal to its bottom half." + usagehelp = S("To open or close this door, rightclick it or send a redstone signal to its bottom half.") + end + end + if not tt_help then + if def.only_redstone_can_open then + tt_help = S("Opened or closed by redstone power") + else + tt_help = S("Use to open or close") end end minetest.register_craftitem(name, { description = def.description, + _tt_help = tt_help, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, inventory_image = def.inventory_image, diff --git a/mods/ITEMS/mcl_doors/api_trapdoors.lua b/mods/ITEMS/mcl_doors/api_trapdoors.lua index dc50702375..428382046a 100644 --- a/mods/ITEMS/mcl_doors/api_trapdoors.lua +++ b/mods/ITEMS/mcl_doors/api_trapdoors.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mcl_doors") + -- Wrapper around mintest.pointed_thing_to_face_pos. local function get_fpos(placer, pointed_thing) local fpos @@ -83,18 +85,25 @@ function mcl_doors:register_trapdoor(name, def) end -- Default help texts - local longdesc, usagehelp + local longdesc, usagehelp, tt_help longdesc = def._doc_items_longdesc if not longdesc then if def.only_redstone_can_open then - longdesc = "Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can only be opened or closed by redstone power." + longdesc = S("Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can only be opened or closed by redstone power.") else - longdesc = "Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can be opened or closed by hand or redstone power." + longdesc = S("Trapdoors are horizontal barriers which can be opened or closed and climbed like a ladder when open. They occupy the upper or lower part of a block, depending on how they have been placed. This trapdoor can be opened or closed by hand or redstone power.") end end usagehelp = def._doc_items_usagehelp if not usagehelp and not def.only_redstone_can_open then - usagehelp = "To open or close this trapdoor, rightclick it or send a redstone signal to it." + usagehelp = S("To open or close this trapdoor, rightclick it or send a redstone signal to it.") + end + if not tt_help then + if def.only_redstone_can_open then + tt_help = S("Opened or closed by redstone power") + else + tt_help = S("Use to opened or close") + end end -- Closed trapdoor @@ -116,6 +125,7 @@ function mcl_doors:register_trapdoor(name, def) groups_closed.deco_block = 1 minetest.register_node(name, { description = def.description, + _tt_help = tt_help, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, drawtype = "nodebox", diff --git a/mods/ITEMS/mcl_end/eye_of_ender.lua b/mods/ITEMS/mcl_end/eye_of_ender.lua index 3d2a990efe..41853def37 100644 --- a/mods/ITEMS/mcl_end/eye_of_ender.lua +++ b/mods/ITEMS/mcl_end/eye_of_ender.lua @@ -74,7 +74,7 @@ minetest.register_entity("mcl_end:ender_eye", { minetest.register_craftitem("mcl_end:ender_eye", { description = S("Eye of Ender"), - _tt_help = S("Guides you to an End portal shrine"), + _tt_help = S("Guides you to the End dimension"), _doc_items_longdesc = S("This item is used to locate End portal shrines in the Overworld and to activate End portals.") .. "\n" .. S("NOTE: The End dimension is currently incomplete and might change in future versions."), _doc_items_usagehelp = S("Use the attack key to release the eye of ender. It will rise and fly in the horizontal direction of the closest end portal shrine. If you're very close, the eye of ender will take the direct path to the End portal shrine instead. After a few seconds, it stops. It may drop as an item, but there's a 20% chance it shatters.") .. "\n" .. S("To activate an End portal, eyes of ender need to be placed into each block of an intact End portal frame."), wield_image = "mcl_end_ender_eye.png", diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 3faed1e02e..d00405f548 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -118,6 +118,7 @@ minetest.register_craftitem("mcl_farming:potato_item_baked", { minetest.register_craftitem("mcl_farming:potato_item_poison", { description = S("Poisonous Potato"), + _tt_help = S("60% chance of poisoning"), _doc_items_longdesc = S("This potato doesn't look too healthy. You can eat it to restore hunger points, but there's a 60% chance it will poison you briefly."), stack_max = 64, inventory_image = "farming_potato_poison.png", diff --git a/mods/ITEMS/mcl_fences/init.lua b/mods/ITEMS/mcl_fences/init.lua index bb2ca0fc6f..50b4dda090 100644 --- a/mods/ITEMS/mcl_fences/init.lua +++ b/mods/ITEMS/mcl_fences/init.lua @@ -174,6 +174,7 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, cgroups_closed.mesecon_effector_off = nil minetest.register_node(gate_id, { description = fence_gate_name, + _tt_help = S("Use to open or close"), _doc_items_longdesc = S("Fence gates can be opened or closed and can't be jumped over. Fences will connect nicely to fence gates."), _doc_items_usagehelp = S("Right-click the fence gate to open or close it."), tiles = {texture}, @@ -306,7 +307,7 @@ minetest.register_craft({ burntime = 15, }) -local time_to_load= os.clock() - init -print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load)) +local time_to_load = os.clock() - init +minetest.log("action", string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load)) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index fe1484a159..0bf638973c 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -418,6 +418,7 @@ minetest.register_craftitem("mcl_fishing:clownfish_raw", { -- TODO: Add real status effect minetest.register_craftitem("mcl_fishing:pufferfish_raw", { description = S("Pufferfish"), + _tt_help = S("Very poisonous"), _doc_items_longdesc = S("Pufferfish are a common species of fish and can be obtained by fishing. They can technically be eaten, but they are very bad for humans. Eating a pufferfish only restores 1 hunger point and will poison you very badly (which drains your health non-fatally) and causes serious food poisoning (which increases your hunger)."), inventory_image = "mcl_fishing_pufferfish_raw.png", on_place = minetest.item_eat(1), diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index ea4eb09552..9cebf1f30c 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -4,6 +4,7 @@ local S = minetest.get_translator("mcl_mobitems") minetest.register_craftitem("mcl_mobitems:rotten_flesh", { description = S("Rotten Flesh"), + _tt_help = S("80% chance of food poisoning"), _doc_items_longdesc = S("Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while."), inventory_image = "mcl_mobitems_rotten_flesh.png", wield_image = "mcl_mobitems_rotten_flesh.png", @@ -64,6 +65,7 @@ minetest.register_craftitem("mcl_mobitems:cooked_beef", { minetest.register_craftitem("mcl_mobitems:chicken", { description = S("Raw Chicken"), + _tt_help = S("30% chance of food poisoning"), _doc_items_longdesc = S("Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value."), inventory_image = "mcl_mobitems_chicken_raw.png", wield_image = "mcl_mobitems_chicken_raw.png", @@ -160,6 +162,7 @@ minetest.register_craftitem("mcl_mobitems:milk_bucket", { minetest.register_craftitem("mcl_mobitems:spider_eye", { description = S("Spider Eye"), + _tt_help = S("Poisonous"), _doc_items_longdesc = S("Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly."), inventory_image = "mcl_mobitems_spider_eye.png", wield_image = "mcl_mobitems_spider_eye.png", diff --git a/mods/ITEMS/mcl_ocean/corals.lua b/mods/ITEMS/mcl_ocean/corals.lua index a2d20d7519..a84dd92081 100644 --- a/mods/ITEMS/mcl_ocean/corals.lua +++ b/mods/ITEMS/mcl_ocean/corals.lua @@ -78,7 +78,7 @@ for c=1, #corals do local doc_desc_fan = S("Corals fans grow on top of coral blocks and need to be inside a water source to survive. Without water, it will die off, as well as the coral block below.") local tt_block = S("Needs water to live") local tt_coral_dead = S("Grows on coral block of same species") - local tt_coral = tt_coral_dead .. S("Needs water to live") + local tt_coral = tt_coral_dead .. "\n" .. S("Needs water to live") -- Coral Block minetest.register_node("mcl_ocean:"..id.."_coral_block", { diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index a659f0ad9e..e329ddcce1 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -132,6 +132,7 @@ end minetest.register_craftitem("mcl_ocean:kelp", { description = S("Kelp"), + _tt_help = S("Grows in water on dirt, sand, gravel"), _doc_items_create_entry = false, inventory_image = "mcl_ocean_kelp_item.png", wield_image = "mcl_ocean_kelp_item.png", @@ -155,7 +156,6 @@ for s=1, #surfaces do local tt_help, doc_longdesc, doc_img, desc if surfaces[s][1] == "dirt" then doc_longdesc = S("Kelp grows inside water on top of dirt, sand or gravel.") - tt_help = S("Grows in water on dirt, sand, gravel") desc = S("Kelp") doc_create = true doc_img = "mcl_ocean_kelp_item.png" @@ -163,7 +163,6 @@ for s=1, #surfaces do doc_create = false end minetest.register_node("mcl_ocean:kelp_"..surfaces[s][1], { - _tt_help = tt_help, _doc_items_entry_name = desc, _doc_items_longdesc = doc_longdesc, _doc_items_create_entry = doc_create, diff --git a/mods/ITEMS/mcl_ocean/sea_pickle.lua b/mods/ITEMS/mcl_ocean/sea_pickle.lua index 9163a1eb4a..55ea1755e4 100644 --- a/mods/ITEMS/mcl_ocean/sea_pickle.lua +++ b/mods/ITEMS/mcl_ocean/sea_pickle.lua @@ -72,7 +72,7 @@ for s=1,4 do desc = S("Sea Pickle") doc_desc = S("Sea pickles grow on dead brain coral blocks and provide light when underwater. They come in 4 sizes that vary in brightness.") doc_use = S("It can only be placed on top of dead brain coral blocks. Placing a sea pickle on another sea pickle will make it grow and brighter.") - tt_help = S("Glows when underwater").."\n"..S("4 possible sizes").."\n"..S("Grows on dead brain coral block") + tt_help = S("Glows in the water").."\n"..S("4 possible sizes").."\n"..S("Grows on dead brain coral block") img = "mcl_ocean_sea_pickle_item.png" on_place = sea_pickle_on_place else diff --git a/mods/ITEMS/mcl_ocean/seagrass.lua b/mods/ITEMS/mcl_ocean/seagrass.lua index 1140697614..6c0b5f7437 100644 --- a/mods/ITEMS/mcl_ocean/seagrass.lua +++ b/mods/ITEMS/mcl_ocean/seagrass.lua @@ -79,6 +79,7 @@ end minetest.register_craftitem("mcl_ocean:seagrass", { description = S("Seagrass"), + _tt_help = S("Grows in water on dirt, sand, gravel"), _doc_items_create_entry = false, inventory_image = "mcl_ocean_seagrass.png^[verticalframe:12:0", wield_image = "mcl_ocean_seagrass.png^[verticalframe:12:0", @@ -99,10 +100,9 @@ for s=1, #surfaces do sounds.dig = leaf_sounds.dig sounds.dug = leaf_sounds.dug sounds.place = leaf_sounds.place - local tt_help, doc_longdesc, doc_img, desc + local doc_longdesc, doc_img, desc if surfaces[s][1] == "dirt" then doc_longdesc = S("Seagrass grows inside water on top of dirt, sand or gravel.") - tt_help = S("Grows in water on dirt, sand, gravel") desc = S("Seagrass") doc_create = true doc_img = "mcl_ocean_seagrass.png" @@ -110,7 +110,6 @@ for s=1, #surfaces do doc_create = false end minetest.register_node("mcl_ocean:seagrass_"..surfaces[s][1], { - _tt_help = tt_help, _doc_items_entry_name = desc, _doc_items_longdesc = doc_longdesc, _doc_items_create_entry = doc_create, diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index 80b832ef16..c16c95eb21 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -335,6 +335,7 @@ minetest.register_node("mcl_portals:end_portal_frame", { minetest.register_node("mcl_portals:end_portal_frame_eye", { description = S("End Portal Frame with Eye of Ender"), + _tt_help = S("Used to construct end portals"), _doc_items_create_entry = false, groups = { creative_breakable = 1, deco_block = 1, comparator_signal = 15, end_portal_frame = 2 }, tiles = { "mcl_portals_endframe_top.png^[lowpart:75:mcl_portals_endframe_eye.png", "mcl_portals_endframe_bottom.png", "mcl_portals_endframe_eye.png^mcl_portals_endframe_side.png" }, From 2554c6d597bc48a1197fc2d773fd6ca83c5556e1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 8 Mar 2020 03:46:24 +0100 Subject: [PATCH 3/4] Display weapon damage in tooltip --- mods/HELP/tt/snippets_builtin.lua | 52 +++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/mods/HELP/tt/snippets_builtin.lua b/mods/HELP/tt/snippets_builtin.lua index 6d383f7dff..b61cc7ccca 100644 --- a/mods/HELP/tt/snippets_builtin.lua +++ b/mods/HELP/tt/snippets_builtin.lua @@ -44,7 +44,7 @@ tt.register_snippet(function(itemstring) if not groupcaps then return end - local formstring = "" + local minestring = "" local capstr = "" local caplines = 0 for k,v in pairs(groupcaps) do @@ -103,18 +103,58 @@ tt.register_snippet(function(itemstring) end if caplines > 0 then -- Capabilities - formstring = formstring .. capstr + minestring = minestring .. capstr -- Max. drop level local mdl = def.tool_capabilities.max_drop_level if not def.tool_capabilities.max_drop_level then mdl = 0 end - formstring = formstring .. S("Block breaking strength: @1", mdl) + minestring = minestring .. S("Block breaking strength: @1", mdl) end - if formstring == "" then - formstring = nil + + local weaponstring = "" + -- Weapon stats + if def.tool_capabilities.damage_groups then + for group, damage in pairs(def.tool_capabilities.damage_groups) do + local msg + if group == "fleshy" then + if damage >= 0 then + msg = S("Damage: @1", damage) + else + msg = S("Healing: @1", math.abs(damage)) + end + end + weaponstring = newline(weaponstring) + weaponstring = weaponstring .. msg + end + local full_punch_interval = def.tool_capabilities.full_punch_interval + if not full_punch_interval then + full_punch_interval = 1 + end + weaponstring = newline(weaponstring) + weaponstring = weaponstring .. S("Full punch interval: @1s", string.format("%.2f", full_punch_interval)) end - return formstring + + local ret + if minetest.get_item_group(itemstring, "weapon") == 1 then + ret = weaponstring + ret = newline(ret) + ret = ret .. minestring + else + ret = minestring + ret = newline(ret) + ret = ret .. weaponstring + end + + if ret == "" then + ret = nil + end + return ret +end) + +-- Weapon stats +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] end) -- Food From 4deb6eec204ac3bff5b397b31c73d7b7a3fe5cc0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 8 Mar 2020 08:50:21 +0100 Subject: [PATCH 4/4] Extra tooltips for mcl_chests --- mods/ITEMS/mcl_chests/init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index b41763d4f6..dcd04e106c 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -77,7 +77,7 @@ local player_chest_close = function(player) end -- This is a helper function to register both chests and trapped chests. Trapped chests will make use of the additional parameters -local register_chest = function(basename, desc, longdesc, usagehelp, tiles_table, hidden, mesecons, on_rightclick_addendum, on_rightclick_addendum_left, on_rightclick_addendum_right, drop, canonical_basename) +local register_chest = function(basename, desc, longdesc, usagehelp, tt_help, tiles_table, hidden, mesecons, on_rightclick_addendum, on_rightclick_addendum_left, on_rightclick_addendum_right, drop, canonical_basename) -- START OF register_chest FUNCTION BODY if not drop then drop = "mcl_chests:"..basename @@ -92,6 +92,7 @@ end minetest.register_node("mcl_chests:"..basename, { description = desc, + _tt_help = tt_help, _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, _doc_items_hidden = hidden, @@ -492,6 +493,7 @@ register_chest("chest", S("Chest"), S("Chests are containers which provide 27 inventory slots. Chests can be turned into large chests with double the capacity by placing two chests next to each other."), chestusage, + S("27 inventory slots") .. "\n" .. S("Can be combined to a double chest"), { small = {"default_chest_top.png", "mcl_chests_chest_bottom.png", "mcl_chests_chest_right.png", "mcl_chests_chest_left.png", @@ -522,6 +524,7 @@ register_chest("trapped_chest", S("Trapped Chest"), S("A trapped chest is a container which provides 27 inventory slots. When it is opened, it sends a redstone signal to its adjacent blocks as long it stays open. Trapped chests can be turned into large trapped chests with double the capacity by placing two trapped chests next to each other."), chestusage, + S("27 inventory slots") .. "\n" .. S("Can be combined to a double chest") .. "\n" .. S("Emits a redstone signal when opened"), traptiles, nil, {receptor = { @@ -560,7 +563,7 @@ register_chest("trapped_chest", ) register_chest("trapped_chest_on", - nil, nil, nil, traptiles, true, + nil, nil, nil, nil, traptiles, true, {receptor = { state = mesecon.state.on, rules = trapped_chest_mesecons_rules, @@ -643,6 +646,7 @@ minetest.register_craft({ minetest.register_node("mcl_chests:ender_chest", { description = S("Ender Chest"), + _tt_help = S("27 interdimensional inventory slots") .. "\n" .. S("Put items inside, retrieve them from any other ender chest"), _doc_items_longdesc = S("Ender chests grant you access to a single personal interdimensional inventory with 27 slots. This inventory is the same no matter from which ender chest you access it from. If you put one item into one ender chest, you will find it in all other ender chests. Each player will only see their own items, but not the items of other players."), _doc_items_usagehelp = S("Rightclick the ender chest to access your personal interdimensional inventory."), tiles = {"mcl_chests_ender_chest_top.png", "mcl_chests_ender_chest_bottom.png", @@ -756,6 +760,7 @@ for color, desc in pairs(boxtypes) do minetest.register_node("mcl_chests:"..color.."_shulker_box", { description = desc, + _tt_help = S("27 inventory slots") .. "\n" .. S("Can be carried around with its contents"), _doc_items_create_entry = create_entry, _doc_items_entry_name = entry_name, _doc_items_longdesc = longdesc,