From 1e28f1c565bbf3f361daac994e10758578c826ad Mon Sep 17 00:00:00 2001 From: Freeman Date: Wed, 27 Mar 2024 21:47:06 +0100 Subject: [PATCH] correct use of S() func --- api.lua | 4 ++-- cables.lua | 4 ++-- compatibility.lua | 32 ++++++++++++++++---------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api.lua b/api.lua index ca21cd3..0f43380 100644 --- a/api.lua +++ b/api.lua @@ -647,7 +647,7 @@ end -- \returns nil industrialtest.api.registerResourceDust=function(name,displayName,resources,color,registerMaceratorRecipe) minetest.register_craftitem("industrialtest:"..name.."_dust",{ - description=S(displayName.." Dust"), + description=S("@1 Dust", displayName), inventory_image="industrialtest_dust.png", color=color }) @@ -693,7 +693,7 @@ industrialtest.api.registerStorageCell=function(name,displayName,node,modname) modname="industrialtest" end minetest.register_craftitem("industrialtest:"..name.."_cell",{ - description=S(displayName.." Cell"), + description=S("@1 Cell", displayName), inventory_image=modname.."_"..name.."_cell.png", on_place=function(itemstack,user,pointed) if pointed.type~="node" or not user or not user:is_player() then diff --git a/cables.lua b/cables.lua index c5a8fea..0e38d9f 100644 --- a/cables.lua +++ b/cables.lua @@ -47,7 +47,7 @@ end local function registerCable(name,displayName,size,flow,registerInsulated) local definition={ - description=S(displayName.." Cable"), + description=S("@1 Cable", displayName), inventory_image="industrialtest_"..name.."_cable_inv.png", tiles={"industrialtest_"..name.."_cable.png"}, wield_image="industrialtest_"..name.."_cable_inv.png", @@ -142,7 +142,7 @@ local function registerCable(name,displayName,size,flow,registerInsulated) minetest.register_node("industrialtest:"..name.."_cable",definition) if registerInsulated then definition=table.copy(definition) - definition.description=S("Insulated "..displayName.." Cable") + definition.description=S("Insulated @1 Cable", displayName) definition.inventory_image="industrialtest_insulated_"..name.."_cable_inv.png" definition.tiles={"industrialtest_insulated_"..name.."_cable.png"} definition.wield_image="industrialtest_insulated_"..name.."_cable_inv.png" diff --git a/compatibility.lua b/compatibility.lua index 9b6efd4..8976eef 100644 --- a/compatibility.lua +++ b/compatibility.lua @@ -94,15 +94,15 @@ end if industrialtest.mclAvailable then industrialtest.internal.registerMetal=function(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness) minetest.register_craftitem("industrialtest:raw_"..name,{ - description=S("Raw "..displayName), + description=S("Raw @1", displayName), inventory_image="industrialtest_mcl_raw_"..name..".png" }) minetest.register_craftitem("industrialtest:"..name.."_ingot",{ - description=S(displayName.." Ingot"), + description=S("@1 Ingot", displayName), inventory_image="industrialtest_mcl_"..name.."_ingot.png" }) minetest.register_node("industrialtest:stone_with_"..name,{ - description=S(displayName.." Ore"), + description=S("@1 Ore", displayName), tiles={"default_stone.png^industrialtest_mcl_stone_with_"..name..".png"}, sounds=mcl_sounds.node_sound_stone_defaults(), drop="industrialtest:raw_"..name, @@ -114,7 +114,7 @@ if industrialtest.mclAvailable then _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) minetest.register_node("industrialtest:deepslate_with_"..name,{ - description=S("Deepslate with "..displayName), + description=S("Deepslate with @1", displayName), tiles={"mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate.png^industrialtest_mcl_stone_with_"..name..".png"}, sounds=mcl_sounds.node_sound_stone_defaults(), drop="industrialtest:raw_"..name, @@ -128,7 +128,7 @@ if industrialtest.mclAvailable then _mcl_fortune_drop = mcl_core.fortune_drop_ore, }) minetest.register_node("industrialtest:raw_"..name.."_block",{ - description=S("Raw "..displayName.." Block"), + description=S("Raw @1 Block", displayName), tiles={"industrialtest_mcl_raw_"..name.."_block.png"}, groups={pickaxey=2,building_block=1,blast_furnace_smeltable=1}, sounds=mcl_sounds.node_sound_metal_defaults(), @@ -136,7 +136,7 @@ if industrialtest.mclAvailable then _mcl_hardness=rawBlockHardness, }) minetest.register_node("industrialtest:"..name.."_block",{ - description=S("Block of "..displayName), + description=S("Block of @1", displayName), tiles={"industrialtest_"..name.."_block.png"}, groups={pickaxey=2,building_block=1}, sounds=mcl_sounds.node_sound_metal_defaults(), @@ -192,7 +192,7 @@ if industrialtest.mclAvailable then end industrialtest.registerToolset=function(material,materialItem,materialDisplayName,config) minetest.register_tool("industrialtest:"..material.."_pickaxe",{ - description=S(materialDisplayName.." Pickaxe"), + description=S("@1 Pickaxe", materialDisplayName), inventory_image="industrialtest_mcl_"..material.."_pickaxe.png", groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass}, tool_capabilities={ @@ -208,7 +208,7 @@ if industrialtest.mclAvailable then } }) minetest.register_tool("industrialtest:"..material.."_shovel",{ - description=S(materialDisplayName.." Shovel"), + description=S("@1 Shovel", materialDisplayName), inventory_image="industrialtest_mcl_"..material.."_shovel.png", groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass}, tool_capabilities={ @@ -260,7 +260,7 @@ if industrialtest.mclAvailable then } }) minetest.register_tool("industrialtest:"..material.."_axe",{ - description=S(materialDisplayName.." Axe"), + description=S("@1 Axe", materialDisplayName), inventory_image="industrialtest_mcl_"..material.."_axe.png", groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass}, tool_capabilities={ @@ -277,7 +277,7 @@ if industrialtest.mclAvailable then } }) minetest.register_tool("industrialtest:"..material.."_sword",{ - description=S(materialDisplayName.." Sword"), + description=S("@1 Sword", materialDisplayName), inventory_image="industrialtest_mcl_"..material.."_sword.png", groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass}, tool_capabilities={ @@ -294,7 +294,7 @@ if industrialtest.mclAvailable then } }) minetest.register_tool("industrialtest:"..material.."_hoe",{ - description=S(materialDisplayName.." Hoe"), + description=S("@1 Hoe", materialDisplayName), inventory_image="industrialtest_mcl_"..material.."_hoe.png", groups={tool=1,hoe=1}, tool_capabilities={ @@ -552,7 +552,7 @@ if industrialtest.mclAvailable then } }) industrialtest.elementKeys.bronzeIngot="industrialtest:bronze_ingot" - industrialtest.registerToolset("bronze","bronze_ingot","Bronze",{ + industrialtest.registerToolset("bronze","bronze_ingot",S("Bronze"),{ digSpeedClass=4, dropLevel=4, speed=6, @@ -617,22 +617,22 @@ elseif industrialtest.mtgAvailable then industrialtest.internal.registerMetal=function(name,displayName,hardness) minetest.register_craftitem("industrialtest:"..name.."_lump",{ - description=S(displayName.." Lump"), + description=S("@1 Lump", displayName), inventory_image="industrialtest_mtg_"..name.."_lump.png" }) minetest.register_craftitem("industrialtest:"..name.."_ingot",{ - description=S(displayName.." Ingot"), + description=S("@1 Ingot", displayName), inventory_image="industrialtest_mtg_"..name.."_ingot.png" }) minetest.register_node("industrialtest:stone_with_"..name,{ - description=S(displayName.." Ore"), + description=S("@1 Ore", displayName), tiles={"default_stone.png^industrialtest_mtg_stone_with_"..name..".png"}, sounds=default.node_sound_stone_defaults(), drop="industrialtest:"..name.."_lump", groups={cracky=hardness}, }) minetest.register_node("industrialtest:"..name.."_block",{ - description=S("Block of "..displayName), + description=S("Block of @1", displayName), tiles={"industrialtest_"..name.."_block.png"}, groups={cracky=hardness,level=2}, sounds=default.node_sound_metal_defaults(),