Skip to content

Commit 9faeca3

Browse files
authoredSep 4, 2020
Devtest: Extend tooltips of many items and tools (#10312)
Also show error message when using tools wrong
1 parent b3ace8f commit 9faeca3

File tree

12 files changed

+147
-60
lines changed

12 files changed

+147
-60
lines changed
 

‎games/devtest/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Basically, just create a world and start. A few important things to note:
2525
* Check out the game settings and server commands for additional tests and features
2626
* Creative Mode does nothing (apart from default engine behavior)
2727

28-
Confused by a certain node or item? Check out for inline code comments.
28+
Confused by a certain node or item? Check out for inline code comments. The usages of most tools are explained in their tooltips.
2929

3030
### Example tests
3131

‎games/devtest/mods/basenodes/init.lua

+16-7
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ minetest.register_node("basenodes:pine_needles", {
124124
})
125125

126126
minetest.register_node("basenodes:water_source", {
127-
description = "Water Source",
127+
description = "Water Source".."\n"..
128+
"Drowning damage: 1",
128129
drawtype = "liquid",
129130
tiles = {"default_water.png"},
130131
special_tiles = {
@@ -148,7 +149,8 @@ minetest.register_node("basenodes:water_source", {
148149
})
149150

150151
minetest.register_node("basenodes:water_flowing", {
151-
description = "Flowing Water",
152+
description = "Flowing Water".."\n"..
153+
"Drowning damage: 1",
152154
drawtype = "flowingliquid",
153155
tiles = {"default_water_flowing.png"},
154156
special_tiles = {
@@ -173,7 +175,8 @@ minetest.register_node("basenodes:water_flowing", {
173175
})
174176

175177
minetest.register_node("basenodes:river_water_source", {
176-
description = "River Water Source",
178+
description = "River Water Source".."\n"..
179+
"Drowning damage: 1",
177180
drawtype = "liquid",
178181
tiles = { "default_river_water.png" },
179182
special_tiles = {
@@ -199,7 +202,8 @@ minetest.register_node("basenodes:river_water_source", {
199202
})
200203

201204
minetest.register_node("basenodes:river_water_flowing", {
202-
description = "Flowing River Water",
205+
description = "Flowing River Water".."\n"..
206+
"Drowning damage: 1",
203207
drawtype = "flowingliquid",
204208
tiles = {"default_river_water_flowing.png"},
205209
special_tiles = {
@@ -226,7 +230,9 @@ minetest.register_node("basenodes:river_water_flowing", {
226230
})
227231

228232
minetest.register_node("basenodes:lava_flowing", {
229-
description = "Flowing Lava",
233+
description = "Flowing Lava".."\n"..
234+
"4 damage per second".."\n"..
235+
"Drowning damage: 1",
230236
drawtype = "flowingliquid",
231237
tiles = {"default_lava_flowing.png"},
232238
special_tiles = {
@@ -251,7 +257,9 @@ minetest.register_node("basenodes:lava_flowing", {
251257
})
252258

253259
minetest.register_node("basenodes:lava_source", {
254-
description = "Lava Source",
260+
description = "Lava Source".."\n"..
261+
"4 damage per second".."\n"..
262+
"Drowning damage: 1",
255263
drawtype = "liquid",
256264
tiles = { "default_lava.png" },
257265
special_tiles = {
@@ -290,7 +298,8 @@ minetest.register_node("basenodes:mossycobble", {
290298
})
291299

292300
minetest.register_node("basenodes:apple", {
293-
description = "Apple",
301+
description = "Apple".."\n"..
302+
"Food (+2)",
294303
drawtype = "plantlike",
295304
tiles ={"default_apple.png"},
296305
inventory_image = "default_apple.png",

‎games/devtest/mods/basetools/init.lua

+49-23
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ minetest.register_item(":", {
4242

4343
-- Mese Pickaxe: special tool that digs "everything" instantly
4444
minetest.register_tool("basetools:pick_mese", {
45-
description = "Mese Pickaxe",
45+
description = "Mese Pickaxe".."\n"..
46+
"Digs diggable nodes instantly",
4647
inventory_image = "basetools_mesepick.png",
4748
tool_capabilities = {
4849
full_punch_interval = 1.0,
@@ -65,7 +66,9 @@ minetest.register_tool("basetools:pick_mese", {
6566

6667
-- This should break after only 1 use
6768
minetest.register_tool("basetools:pick_dirt", {
68-
description = "Dirt Pickaxe",
69+
description = "Dirt Pickaxe".."\n"..
70+
"Digs cracky=3".."\n"..
71+
"1 use only",
6972
inventory_image = "basetools_dirtpick.png",
7073
tool_capabilities = {
7174
max_drop_level=0,
@@ -76,7 +79,8 @@ minetest.register_tool("basetools:pick_dirt", {
7679
})
7780

7881
minetest.register_tool("basetools:pick_wood", {
79-
description = "Wooden Pickaxe",
82+
description = "Wooden Pickaxe".."\n"..
83+
"Digs cracky=3",
8084
inventory_image = "basetools_woodpick.png",
8185
tool_capabilities = {
8286
max_drop_level=0,
@@ -86,7 +90,8 @@ minetest.register_tool("basetools:pick_wood", {
8690
},
8791
})
8892
minetest.register_tool("basetools:pick_stone", {
89-
description = "Stone Pickaxe",
93+
description = "Stone Pickaxe".."\n"..
94+
"Digs cracky=2..3",
9095
inventory_image = "basetools_stonepick.png",
9196
tool_capabilities = {
9297
max_drop_level=0,
@@ -96,7 +101,8 @@ minetest.register_tool("basetools:pick_stone", {
96101
},
97102
})
98103
minetest.register_tool("basetools:pick_steel", {
99-
description = "Steel Pickaxe",
104+
description = "Steel Pickaxe".."\n"..
105+
"Digs cracky=1..3",
100106
inventory_image = "basetools_steelpick.png",
101107
tool_capabilities = {
102108
max_drop_level=1,
@@ -106,7 +112,9 @@ minetest.register_tool("basetools:pick_steel", {
106112
},
107113
})
108114
minetest.register_tool("basetools:pick_steel_l1", {
109-
description = "Steel Pickaxe Level 1",
115+
description = "Steel Pickaxe Level 1".."\n"..
116+
"Digs cracky=1..3".."\n"..
117+
"maxlevel=1",
110118
inventory_image = "basetools_steelpick_l1.png",
111119
tool_capabilities = {
112120
max_drop_level=1,
@@ -116,7 +124,9 @@ minetest.register_tool("basetools:pick_steel_l1", {
116124
},
117125
})
118126
minetest.register_tool("basetools:pick_steel_l2", {
119-
description = "Steel Pickaxe Level 2",
127+
description = "Steel Pickaxe Level 2".."\n"..
128+
"Digs cracky=1..3".."\n"..
129+
"maxlevel=2",
120130
inventory_image = "basetools_steelpick_l2.png",
121131
tool_capabilities = {
122132
max_drop_level=1,
@@ -131,7 +141,8 @@ minetest.register_tool("basetools:pick_steel_l2", {
131141
--
132142

133143
minetest.register_tool("basetools:shovel_wood", {
134-
description = "Wooden Shovel",
144+
description = "Wooden Shovel".."\n"..
145+
"Digs crumbly=3",
135146
inventory_image = "basetools_woodshovel.png",
136147
tool_capabilities = {
137148
max_drop_level=0,
@@ -141,7 +152,8 @@ minetest.register_tool("basetools:shovel_wood", {
141152
},
142153
})
143154
minetest.register_tool("basetools:shovel_stone", {
144-
description = "Stone Shovel",
155+
description = "Stone Shovel".."\n"..
156+
"Digs crumbly=2..3",
145157
inventory_image = "basetools_stoneshovel.png",
146158
tool_capabilities = {
147159
max_drop_level=0,
@@ -151,7 +163,8 @@ minetest.register_tool("basetools:shovel_stone", {
151163
},
152164
})
153165
minetest.register_tool("basetools:shovel_steel", {
154-
description = "Steel Shovel",
166+
description = "Steel Shovel".."\n"..
167+
"Digs crumbly=1..3",
155168
inventory_image = "basetools_steelshovel.png",
156169
tool_capabilities = {
157170
max_drop_level=1,
@@ -166,7 +179,8 @@ minetest.register_tool("basetools:shovel_steel", {
166179
--
167180

168181
minetest.register_tool("basetools:axe_wood", {
169-
description = "Wooden Axe",
182+
description = "Wooden Axe".."\n"..
183+
"Digs choppy=3",
170184
inventory_image = "basetools_woodaxe.png",
171185
tool_capabilities = {
172186
max_drop_level=0,
@@ -176,7 +190,8 @@ minetest.register_tool("basetools:axe_wood", {
176190
},
177191
})
178192
minetest.register_tool("basetools:axe_stone", {
179-
description = "Stone Axe",
193+
description = "Stone Axe".."\n"..
194+
"Digs choppy=2..3",
180195
inventory_image = "basetools_stoneaxe.png",
181196
tool_capabilities = {
182197
max_drop_level=0,
@@ -186,7 +201,8 @@ minetest.register_tool("basetools:axe_stone", {
186201
},
187202
})
188203
minetest.register_tool("basetools:axe_steel", {
189-
description = "Steel Axe",
204+
description = "Steel Axe".."\n"..
205+
"Digs choppy=1..3",
190206
inventory_image = "basetools_steelaxe.png",
191207
tool_capabilities = {
192208
max_drop_level=1,
@@ -201,7 +217,8 @@ minetest.register_tool("basetools:axe_steel", {
201217
--
202218

203219
minetest.register_tool("basetools:shears_wood", {
204-
description = "Wooden Shears",
220+
description = "Wooden Shears".."\n"..
221+
"Digs snappy=3",
205222
inventory_image = "basetools_woodshears.png",
206223
tool_capabilities = {
207224
max_drop_level=0,
@@ -211,7 +228,8 @@ minetest.register_tool("basetools:shears_wood", {
211228
},
212229
})
213230
minetest.register_tool("basetools:shears_stone", {
214-
description = "Stone Shears",
231+
description = "Stone Shears".."\n"..
232+
"Digs snappy=2..3",
215233
inventory_image = "basetools_stoneshears.png",
216234
tool_capabilities = {
217235
max_drop_level=0,
@@ -221,7 +239,8 @@ minetest.register_tool("basetools:shears_stone", {
221239
},
222240
})
223241
minetest.register_tool("basetools:shears_steel", {
224-
description = "Steel Shears",
242+
description = "Steel Shears".."\n"..
243+
"Digs snappy=1..3",
225244
inventory_image = "basetools_steelshears.png",
226245
tool_capabilities = {
227246
max_drop_level=1,
@@ -236,15 +255,17 @@ minetest.register_tool("basetools:shears_steel", {
236255
--
237256

238257
minetest.register_tool("basetools:sword_wood", {
239-
description = "Wooden Sword",
258+
description = "Wooden Sword".."\n"..
259+
"Damage: fleshy=2",
240260
inventory_image = "basetools_woodsword.png",
241261
tool_capabilities = {
242262
full_punch_interval = 1.0,
243263
damage_groups = {fleshy=2},
244264
}
245265
})
246266
minetest.register_tool("basetools:sword_stone", {
247-
description = "Stone Sword",
267+
description = "Stone Sword".."\n"..
268+
"Damage: fleshy=4",
248269
inventory_image = "basetools_stonesword.png",
249270
tool_capabilities = {
250271
full_punch_interval = 1.0,
@@ -253,7 +274,8 @@ minetest.register_tool("basetools:sword_stone", {
253274
}
254275
})
255276
minetest.register_tool("basetools:sword_steel", {
256-
description = "Steel Sword",
277+
description = "Steel Sword".."\n"..
278+
"Damage: fleshy=6",
257279
inventory_image = "basetools_steelsword.png",
258280
tool_capabilities = {
259281
full_punch_interval = 1.0,
@@ -264,7 +286,8 @@ minetest.register_tool("basetools:sword_steel", {
264286

265287
-- Fire/Ice sword: Deal damage to non-fleshy damage groups
266288
minetest.register_tool("basetools:sword_fire", {
267-
description = "Fire Sword",
289+
description = "Fire Sword".."\n"..
290+
"Damage: icy=6",
268291
inventory_image = "basetools_firesword.png",
269292
tool_capabilities = {
270293
full_punch_interval = 1.0,
@@ -273,20 +296,23 @@ minetest.register_tool("basetools:sword_fire", {
273296
}
274297
})
275298
minetest.register_tool("basetools:sword_ice", {
276-
description = "Ice Sword",
299+
description = "Ice Sword".."\n"..
300+
"Damage: fiery=6",
277301
inventory_image = "basetools_icesword.png",
278302
tool_capabilities = {
279303
full_punch_interval = 1.0,
280304
max_drop_level=0,
281-
damage_groups = {firy=6},
305+
damage_groups = {fiery=6},
282306
}
283307
})
284308

285309
--
286310
-- Dagger: Low damage, fast punch interval
287311
--
288312
minetest.register_tool("basetools:dagger_steel", {
289-
description = "Steel Dagger",
313+
description = "Steel Dagger".."\n"..
314+
"Damage: fleshy=2".."\n"..
315+
"Full Punch Interval: 0.5s",
290316
inventory_image = "basetools_steeldagger.png",
291317
tool_capabilities = {
292318
full_punch_interval = 0.5,

‎games/devtest/mods/bucket/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
-- Bucket: Punch liquid source or flowing liquid to collect it
22

33
minetest.register_tool("bucket:bucket", {
4-
description = "Bucket",
4+
description = "Bucket".."\n"..
5+
"Picks up liquid nodes",
56
inventory_image = "bucket.png",
67
stack_max = 1,
78
liquids_pointable = true,

‎games/devtest/mods/chest/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
minetest.register_node("chest:chest", {
2-
description = "Chest",
2+
description = "Chest" .. "\n" ..
3+
"32 inventory slots",
34
tiles ={"chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:0,0",
45
"chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:1,0",
56
"chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:0,1"},

‎games/devtest/mods/chest_of_everything/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ local function get_chest_formspec(page)
4343
end
4444

4545
minetest.register_node("chest_of_everything:chest", {
46-
description = "Chest of Everything",
46+
description = "Chest of Everything" .. "\n" ..
47+
"Grants access to all items",
4748
tiles ={"chest_of_everything_chest.png^[sheet:2x2:0,0", "chest_of_everything_chest.png^[sheet:2x2:0,0",
4849
"chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:1,0",
4950
"chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:0,1"},

‎games/devtest/mods/experimental/items.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ minetest.register_node("experimental:callback_node", {
4444
})
4545

4646
minetest.register_tool("experimental:privatizer", {
47-
description = "Node Meta Privatizer",
47+
description = "Node Meta Privatizer".."\n"..
48+
"Punch: Marks 'infotext' and 'formspec' meta fields of chest as private",
4849
inventory_image = "experimental_tester_tool_1.png",
4950
groups = { testtool = 1, disable_repair = 1 },
5051
on_use = function(itemstack, user, pointed_thing)
@@ -67,7 +68,8 @@ minetest.register_tool("experimental:privatizer", {
6768
})
6869

6970
minetest.register_tool("experimental:particle_spawner", {
70-
description = "Particle Spawner",
71+
description = "Particle Spawner".."\n"..
72+
"Punch: Spawn random test particle",
7173
inventory_image = "experimental_tester_tool_1.png^[invert:g",
7274
groups = { testtool = 1, disable_repair = 1 },
7375
on_use = function(itemstack, user, pointed_thing)

‎games/devtest/mods/soundstuff/init.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ minetest.register_node("soundstuff:footstep_climbable", {
107107

108108

109109
minetest.register_craftitem("soundstuff:eat", {
110-
description = "Eat Sound Item",
110+
description = "Eat Sound Item".."\n"..
111+
"Makes a sound when 'eaten' (with punch key)",
111112
inventory_image = "soundstuff_eat.png",
112113
on_use = minetest.item_eat(0),
113114
sound = {
@@ -116,7 +117,9 @@ minetest.register_craftitem("soundstuff:eat", {
116117
})
117118

118119
minetest.register_tool("soundstuff:breaks", {
119-
description = "Break Sound Tool",
120+
description = "Break Sound Tool".."\n"..
121+
"Digs cracky=3 and more".."\n"..
122+
"Makes a sound when it breaks",
120123
inventory_image = "soundstuff_node_dug.png",
121124
sound = {
122125
breaks = { name = "soundstuff_mono", gain = 1.0 },

‎games/devtest/mods/testentities/armor.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
local phasearmor = {
55
[0]={icy=100},
6-
[1]={firy=100},
6+
[1]={fiery=100},
77
[2]={fleshy=100},
88
[3]={immortal=1},
99
[4]={punch_operable=1},

‎games/devtest/mods/testnodes/light.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ end
2222
-- Lets light through, but not sunlight, leading to a
2323
-- reduction in light level when light passes through
2424
minetest.register_node("testnodes:sunlight_filter", {
25-
description = S("Sunlight Filter"),
25+
description = S("Sunlight Filter") .."\n"..
26+
S("Lets light through, but weakens sunlight"),
2627
paramtype = "light",
2728

2829

@@ -35,7 +36,8 @@ minetest.register_node("testnodes:sunlight_filter", {
3536

3637
-- Lets light and sunlight through without obstruction
3738
minetest.register_node("testnodes:sunlight_propagator", {
38-
description = S("Sunlight Propagator"),
39+
description = S("Sunlight Propagator") .."\n"..
40+
S("Lets all light through"),
3941
paramtype = "light",
4042
sunlight_propagates = true,
4143

‎games/devtest/mods/testpathfinder/init.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ end
121121
-- Sneak+punch: Select pathfinding algorithm
122122
-- Place: Select destination node
123123
minetest.register_tool("testpathfinder:testpathfinder", {
124-
description = S("Pathfinder Tester"),
124+
description = S("Pathfinder Tester") .."\n"..
125+
S("Finds path between 2 points") .."\n"..
126+
S("Place on node: Select destination") .."\n"..
127+
S("Punch: Find path from here") .."\n"..
128+
S("Sneak+Punch: Change algorithm"),
125129
inventory_image = "testpathfinder_testpathfinder.png",
126130
groups = { testtool = 1, disable_repair = 1 },
127131
on_use = find_path_or_set_algorithm,

‎games/devtest/mods/testtools/init.lua

+56-18
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ local F = minetest.formspec_escape
33

44
-- TODO: Add a Node Metadata tool
55

6-
-- Param 2 Tool: Set param2 value of tools
7-
-- Punch: +1
8-
-- Punch+Shift: +8
9-
-- Place: -1
10-
-- Place+Shift: -8
116
minetest.register_tool("testtools:param2tool", {
12-
description = S("Param2 Tool"),
7+
description = S("Param2 Tool") .."\n"..
8+
S("Modify param2 value of nodes") .."\n"..
9+
S("Punch: +1") .."\n"..
10+
S("Sneak+Punch: +8") .."\n"..
11+
S("Place: -1") .."\n"..
12+
S("Sneak+Place: -8"),
1313
inventory_image = "testtools_param2tool.png",
1414
groups = { testtool = 1, disable_repair = 1 },
1515
on_use = function(itemstack, user, pointed_thing)
@@ -47,7 +47,11 @@ minetest.register_tool("testtools:param2tool", {
4747
})
4848

4949
minetest.register_tool("testtools:node_setter", {
50-
description = S("Node Setter"),
50+
description = S("Node Setter") .."\n"..
51+
S("Replace pointed node with something else") .."\n"..
52+
S("Punch: Select pointed node") .."\n"..
53+
S("Place on node: Replace node with selected node") .."\n"..
54+
S("Place in air: Manually select a node"),
5155
inventory_image = "testtools_node_setter.png",
5256
groups = { testtool = 1, disable_repair = 1 },
5357
on_use = function(itemstack, user, pointed_thing)
@@ -125,7 +129,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
125129
end)
126130

127131
minetest.register_tool("testtools:remover", {
128-
description = S("Remover"),
132+
description = S("Remover") .."\n"..
133+
S("Punch: Remove pointed node or object"),
129134
inventory_image = "testtools_remover.png",
130135
groups = { testtool = 1, disable_repair = 1 },
131136
on_use = function(itemstack, user, pointed_thing)
@@ -136,13 +141,17 @@ minetest.register_tool("testtools:remover", {
136141
local obj = pointed_thing.ref
137142
if not obj:is_player() then
138143
obj:remove()
144+
else
145+
minetest.chat_send_player(user:get_player_name(), S("Can't remove players!"))
139146
end
140147
end
141148
end,
142149
})
143150

144151
minetest.register_tool("testtools:falling_node_tool", {
145-
description = S("Falling Node Tool"),
152+
description = S("Falling Node Tool") .."\n"..
153+
S("Punch: Make pointed node fall") .."\n"..
154+
S("Place: Move pointed node 2 units upwards, then make it fall"),
146155
inventory_image = "testtools_falling_node_tool.png",
147156
groups = { testtool = 1, disable_repair = 1 },
148157
on_place = function(itemstack, user, pointed_thing)
@@ -191,7 +200,11 @@ minetest.register_tool("testtools:falling_node_tool", {
191200
})
192201

193202
minetest.register_tool("testtools:rotator", {
194-
description = S("Entity Rotator"),
203+
description = S("Entity Rotator") .. "\n" ..
204+
S("Rotate pointed entity") .."\n"..
205+
S("Punch: Yaw") .."\n"..
206+
S("Sneak+Punch: Pitch") .."\n"..
207+
S("Aux1+Punch: Roll"),
195208
inventory_image = "testtools_entity_rotator.png",
196209
groups = { testtool = 1, disable_repair = 1 },
197210
on_use = function(itemstack, user, pointed_thing)
@@ -244,7 +257,12 @@ local mover_config = function(itemstack, user, pointed_thing)
244257
end
245258

246259
minetest.register_tool("testtools:object_mover", {
247-
description = S("Object Mover"),
260+
description = S("Object Mover") .."\n"..
261+
S("Move pointed object towards or away from you") .."\n"..
262+
S("Punch: Move by distance").."\n"..
263+
S("Sneak+Punch: Move by negative distance").."\n"..
264+
S("Place: Increase distance").."\n"..
265+
S("Sneak+Place: Decrease distance"),
248266
inventory_image = "testtools_object_mover.png",
249267
groups = { testtool = 1, disable_repair = 1 },
250268
on_place = mover_config,
@@ -287,7 +305,10 @@ minetest.register_tool("testtools:object_mover", {
287305

288306

289307
minetest.register_tool("testtools:entity_scaler", {
290-
description = S("Entity Visual Scaler"),
308+
description = S("Entity Visual Scaler") .."\n"..
309+
S("Scale visual size of entities") .."\n"..
310+
S("Punch: Increase size") .."\n"..
311+
S("Sneak+Punch: Decrease scale"),
291312
inventory_image = "testtools_entity_scaler.png",
292313
groups = { testtool = 1, disable_repair = 1 },
293314
on_use = function(itemstack, user, pointed_thing)
@@ -342,14 +363,21 @@ local function get_entity_list()
342363
return entity_list
343364
end
344365
minetest.register_tool("testtools:entity_spawner", {
345-
description = S("Entity Spawner"),
366+
description = S("Entity Spawner") .."\n"..
367+
S("Spawns entities") .."\n"..
368+
S("Punch: Select entity to spawn") .."\n"..
369+
S("Place: Spawn selected entity"),
346370
inventory_image = "testtools_entity_spawner.png",
347371
groups = { testtool = 1, disable_repair = 1 },
348372
on_place = function(itemstack, user, pointed_thing)
349373
local name = user:get_player_name()
350-
if selections[name] and pointed_thing.type == "node" then
351-
local pos = pointed_thing.above
352-
minetest.add_entity(pos, get_entity_list()[selections[name]])
374+
if pointed_thing.type == "node" then
375+
if selections[name] then
376+
local pos = pointed_thing.above
377+
minetest.add_entity(pos, get_entity_list()[selections[name]])
378+
else
379+
minetest.chat_send_player(name, S("Select an entity first (with punch key)!"))
380+
end
353381
end
354382
end,
355383
on_use = function(itemstack, user, pointed_thing)
@@ -435,7 +463,10 @@ local editor_formspec = function(playername, obj, value, sel)
435463
end
436464

437465
minetest.register_tool("testtools:object_editor", {
438-
description = S("Object Property Editor"),
466+
description = S("Object Property Editor") .."\n"..
467+
S("Edit properties of objects") .."\n"..
468+
S("Punch object: Edit object") .."\n"..
469+
S("Punch air: Edit yourself"),
439470
inventory_image = "testtools_object_editor.png",
440471
groups = { testtool = 1, disable_repair = 1 },
441472
on_use = function(itemstack, user, pointed_thing)
@@ -515,7 +546,14 @@ local attacher_config = function(itemstack, user, pointed_thing)
515546
end
516547

517548
minetest.register_tool("testtools:object_attacher", {
518-
description = S("Object Attacher"),
549+
description = S("Object Attacher") .."\n"..
550+
S("Attach object to another") .."\n"..
551+
S("Punch objects to first select parent object, then the child object to attach") .."\n"..
552+
S("Punch air to select yourself") .."\n"..
553+
S("Place: Incease attachment Y offset") .."\n"..
554+
S("Sneak+Place: Decease attachment Y offset") .."\n"..
555+
S("Aux1+Place: Incease attachment rotation") .."\n"..
556+
S("Aux1+Sneak+Place: Decrease attachment rotation"),
519557
inventory_image = "testtools_object_attacher.png",
520558
groups = { testtool = 1, disable_repair = 1 },
521559
on_place = attacher_config,

0 commit comments

Comments
 (0)
Please sign in to comment.