diff options
author | Wuzzy <almikes@aol.com> | 2016-11-03 03:21:24 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-11-03 03:21:24 +0100 |
commit | 9c4229420748c7916cd2be7056f2ac2a7e83f8db (patch) | |
tree | 9de37da31844a113996beb5ef5612616e8d249e9 | |
parent | 24bde5c9130a4741df77db5b94a9e53d1d082049 (diff) |
Use doc_item's group names
-rw-r--r-- | helptexts.lua | 26 | ||||
-rw-r--r-- | init.lua | 10 |
2 files changed, 22 insertions, 14 deletions
diff --git a/helptexts.lua b/helptexts.lua index dbe0b7b..c4cf9b6 100644 --- a/helptexts.lua +++ b/helptexts.lua @@ -84,6 +84,12 @@ local tntdesc = string.format(S("An explosive device. When it explodes, it will local nyandesc = S("A weird creature with a cat face, cat extremities and a strawberry-flavored pop-tart body. It has been trapped in a block and cannot move and can thus be dug easily by simple tools. Nyan cats are usually followed by nyan cat rainbows. Legends say that in ancient times, long before the creation of our world, there were many of the Nyan Cats which were free and flew through space and sang the \"Nya-nya\" song. Nowadays, nyan cats serve as a fancy collector's item and are traded as souveniers. Apart from that, nyan cats have no intrinsic value.") local rainbowdesc = S("A rainbow made by a real nyan cat, ancient creatures which once flew through space. It has gone inert and can be dug by simple tools. Like nyan cats, nyan cat rainbows have no intrinsic value.") +local groupname_sand = doc.sub.items.get_group_name("sand") +local groupname_water = doc.sub.items.get_group_name("water") +local groupname_flora = doc.sub.items.get_group_name("flora") +local groupname_book = doc.sub.items.get_group_name("book") +local groupname_vessel = doc.sub.items.get_group_name("vessel") + local export_longdesc = { [""] = S("You use your bare hand whenever you are not wielding any item. With your hand you can mine the weakest blocks and deal minor damage by punching. Using the hand is often a last resort, as proper mining tools and weapons are usually better than the hand. When you are wielding an item which is not a mining tool or a weapon it will behave as if it were the hand when you start mining or punching. In Creative Mode, the mining capabilities, range and damage of the hand are greatly enhanced."), ["default:apple"] = S("Eat it to restore 2 hit points."), @@ -109,7 +115,7 @@ local export_longdesc = { ["default:ice"] = S("Ice is found in arctic regions. It can appear either in huge glacier formations below snow blocks, or above water."), ["default:dirt"] = S("Dirt is found often directly under the surface and very common in many regions of the world. When exposed to sunlight, the surface of dirt may change, depending on its neighbors. It can be turned into soil for farming with a hoe."), ["default:sand"] = S("Sand is found in large quantities at beaches, but it occacionally appears in small chunks around the world."), - ["default:desert_sand"] = S("Usually found in huge quantities at the surface of deserts. Members of the Flora group will slowly turn into dry shrubs when placed on desert sand. Desert sand can be turned into desert sand soil with a hoe."), + ["default:desert_sand"] = string.format(S("Usually found in huge quantities at the surface of deserts. Members of the %s group will slowly turn into dry shrubs when placed on desert sand. Desert sand can be turned into desert sand soil with a hoe."), groupname_flora), ["default:gravel"] = S("This block consists of a couple of loose stones and can't support itself. It is common only at the beaches of very cold regions, but it can be found in small quantities on the surface and underground."), ["default:clay"] = S("Clay is a rather soft material and it sometimes found in sand beaches."), ["default:sandstone"] = S("A pretty soft kind of stone. It is common below the surface of some grassland biomes."), @@ -140,8 +146,8 @@ local export_longdesc = { ["default:acacia_leaves"] = S("Acacia leaves are grown from acacia trees found in savannahs."), ["default:aspen_leaves"] = S("Aspen leaves are grown from aspen trees found in deciduous forests."), ["default:pine_needles"] = S("Pine needles are grown from pine trees found in coniferous forests."), - ["default:cactus"] = S("A piece of cactus usually found in deserts. Cacti grow on sand, desert sand and other blocks belonging to the “Sand” group and can reach a height of up to 4 cactus blocks."), - ["default:papyrus"] = S("A papyrus piece usually found near shallow water. Papyrus grows vertically on dirt and dirt with grass near a water source (or another block belonging to the Water group) and can reach a height of up to 4 blocks. When dug, all papyrus blocks directly connected above it will also be dug."), + ["default:cactus"] = string.format(S("A piece of cactus usually found in deserts. Cacti grow on sand, desert sand and other blocks belonging to the “%s” group and can reach a height of up to 4 cactus blocks."), groupname_sand), + ["default:papyrus"] = string.format(S("A papyrus piece usually found near shallow water. Papyrus grows vertically on dirt and dirt with grass near a water source (or another block belonging to the %s group) and can reach a height of up to 4 blocks. When dug, all papyrus blocks directly connected above it will also be dug."), groupname_water), ["default:bookshelf"] = S("A bookshelf provides 16 inventory slots for books."), ["default:glass"] = S("A decorational and mostly transparent block which is rather easy to break."), ["default:fence_wood"] = fencedesc, @@ -155,13 +161,13 @@ local export_longdesc = { ["doors:gate_pine_wood_closed"] = fencegatedesc, ["doors:gate_aspen_wood_closed"] = fencegatedesc, - ["default:dry_shrub"] = S("An unremarkable dead plant which is common in deserts and snowy biomes. Small plants which are members of the Flora group placed on desert sand will sooner or later turn into dry shrubs."), + ["default:dry_shrub"] = string.format(S("An unremarkable dead plant which is common in deserts and snowy biomes. Small plants which are members of the %s group placed on desert sand will sooner or later turn into dry shrubs."), groupname_flora), ["default:rail"] = S("Railroad tracks. Place these on the ground to build your railway, the blocks will automatically connect to each other and will turn into curves, junctions, crossings and slopes as needed."), ["default:ladder_wood"] = ladderdesc, ["default:ladder_steel"] = ladderdesc, ["default:water_source"] = S("Water is abundant in oceans and may also appear in small quantities in underground water pockets. You can swim easily in water, but you need to catch your breath from time to time. Water will turn nearby lava into obsidian or stone."), ["default:river_water_source"] = S("You can swim easily in river water, but you need to catch your breath from time to time. Unlike (normal) water, it appears in rivers only. River water will turn nearby lava into obsidian or stone."), - ["default:lava_source"] = string.format(S("Lava is found deep underground (%d and below) and rather dangerous. Don't touch it, it will hurt you a lot and once you're in, it is hard to get out. When a lava source meets water or river water (or another block in the Water group), it turns into obsidian. Flowing lava turns into stone instead."), lavaheight), + ["default:lava_source"] = string.format(S("Lava is found deep underground (%d and below) and rather dangerous. Don't touch it, it will hurt you a lot and once you're in, it is hard to get out. When a lava source meets water or river water (or another block in the %s group), it turns into obsidian. Flowing lava turns into stone instead."), lavaheight, groupname_water), ["default:torch"] = S("Provides plenty of light. It can be placed on almost any block facing any direction."), ["default:sign_wall_wood"] = signdesc, ["default:sign_wall_steel"] = signdesc, @@ -176,7 +182,7 @@ local export_longdesc = { ["default:goldblock"] = deconode, ["default:diamondblock"] = S("A very hard decorational block."), ["default:obsidian_glass"] = S("Obsidian glass is transparent, has a very clean surface and is rather hard to break."), - ["default:obsidian"] = S("A hard mineral which is created from a lava source when it meets water (any block in the Water group)."), + ["default:obsidian"] = string.format(S("A hard mineral which is created from a lava source when it meets water (any block in the %s group)."), groupname_water), ["default:obsidianbrick"] = buildnode, -- 0.4.14 Nyan Cats (for compability) @@ -430,8 +436,8 @@ local export_usagehelp = { ["default:book_written"] = S("Hold the book with text in hand and leftclick to read or change the notes. The text in a book with text can be transferred to a book (without text) by a special crafting recipe: Just place the book with text and a book into the crafting grid."), ["default:sign_wall_wood"] = signuse, ["default:sign_wall_steel"] = signuse, - ["default:bookshelf"] = S("Rightclick to open the bookshelf. You can only store books and other items belonging to the Books group into the bookshelf. To collect the bookshelf, you must make sure it does not contain anything."), - ["vessels:shelf"] = S("Rightclick to open the vessels shelf. You can only store items which belong to the Vessels group (glass bottle, drinking glass, heavy steel bottle). To collect the vessels shelf, it must be empty."), + ["default:bookshelf"] = string.format(S("Rightclick to open the bookshelf. You can only store books and other items belonging to the %s group into the bookshelf. To collect the bookshelf, you must make sure it does not contain anything."), groupname_book), + ["vessels:shelf"] = string.format(S("Rightclick to open the vessels shelf. You can only store items which belong to the %s group (glass bottle, drinking glass, heavy steel bottle). To collect the vessels shelf, it must be empty."), groupname_vessel), ["bucket:bucket_empty"] = S("Punch a liquid source to collect the liquid. With the filled bucket, you can rightclick somewhere to empty the bucket which will create a liquid source at the position you've clicked at."), ["bucket:bucket_water"] = S("Rightclick on any block to empty the bucket and put a water source on this spot."), ["bucket:bucket_river_water"] = S("Rightclick on any block to empty the bucket and put a river water source on this spot."), @@ -452,14 +458,14 @@ local export_usagehelp = { ["screwdriver:screwdriver"] = S("Leftclick on a block to rotate it around its current axis. Rightclick on a block to rotate its axis. Note that not all blocks can be rotated."), - ["boats:boat"] = S("Place the boat on water (any block belonging to the Water group) to set it up. Rightclick the boat to enter it. When you are on the boat, use the forward key to speed up, the backward key to slow down and the left and right keys to turn the boat. Rightclick on the boat again to leave it. Leftclick the placed boat to collect it."), + ["boats:boat"] = string.format(S("Place the boat on water (any block belonging to the %s group) to set it up. Rightclick the boat to enter it. When you are on the boat, use the forward key to speed up, the backward key to slow down and the left and right keys to turn the boat. Rightclick on the boat again to leave it. Leftclick the placed boat to collect it."), groupname_water), ["beds:bed_bottom"] = beduse, ["beds:fancy_bed_bottom"] = beduse, ["farming:seed_wheat"] = S("Place the wheat seed on soil or wet soil. Use a hoe to create soil. The plant will only grow in sunlight and as long as the soil is wet. Watch the wheat plant grow and mine it at its full size."), ["farming:seed_cotton"] = S("Place the cotton seed on soil, wet soil, desert sand soil or wet desert sand soil. Use a hoe to create soil. The plant will only grow in sunlight and as long as the soil is wet. Watch the cotton plant grow and mine it at its full size."), ["fire:flint_and_steel"] = S("Punch with it on the surface of a flammable block to create a basic flame in front of it. A basic flame can only be created inside air."), - ["flowers:waterlily"] = S("Waterlilies can only be placed on water sources (and other members of the Water group)."), + ["flowers:waterlily"] = string.format(S("Waterlilies can only be placed on water sources (and other members of the %s group)."), groupname_water), ["farming:hoe_wood"] = hoeuse, ["farming:hoe_stone"] = hoeuse, ["farming:hoe_steel"] = hoeuse, @@ -178,7 +178,8 @@ end -- flora group local function f_flora(itemstring, def) if def.groups.flora == 1 then - return S("This block belongs to the Flora group. It a living organism which likes to grow and spread on dirt with grass or dirt with dry grass when it is in light. Spreading will stop when the surrounding area is too crammed with Flora blocks. On desert sand, it will wither and die and turn into a dry shrub.") + local groupname = doc.sub.items.get_group_name("flora") + return string.format(S("This block belongs to the %s group. It a living organism which likes to grow and spread on dirt with grass or dirt with dry grass when it is in light. Spreading will stop when the surrounding area is too crammed with %s blocks. On desert sand, it will wither and die and turn into a dry shrub."), groupname, groupname) else return "" end @@ -198,13 +199,14 @@ end local function f_leafdecay(itemstring, def) local formstring = "" if def.groups.leafdecay ~= nil then + local groupname = doc.sub.items.get_group_name("tree") if def.groups.leafdecay_drop ~= nil then - formstring = string.format(S("This block may drop as an item when no trunk is nearby. This is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been manually placed by a player."), def.groups.leafdecay) + formstring = string.format(S("This block may drop as an item when no trunk is nearby. This is prevented if any block of the group “%s” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been manually placed by a player."), groupname, def.groups.leafdecay) else if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then - formstring = string.format(S("This block may decay when no trunk is nearby. When decaying, it disappears and may drop one of its mining drops (but never itself). Decay is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player."), def.groups.leafdecay) + formstring = string.format(S("This block may decay when no trunk is nearby. When decaying, it disappears and may drop one of its mining drops (but never itself). Decay is prevented if any block of the group “%s” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player."), groupname, def.groups.leafdecay) else - formstring = string.format(S("This block may decay and disappear when no trunk is nearby. Decay is prevented if any block of the group “Tree Trunks” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player."), def.groups.leafdecay) + formstring = string.format(S("This block may decay and disappear when no trunk is nearby. Decay is prevented if any block of the group “%s” is nearby (up to a distance of %d), the block is completely surrounded by blocks which are neither air or a liquid or it has been placed by a player."), groupname, def.groups.leafdecay) end end end |