Browse Source

Squash help entries for stained glass and panes

tags/0.53.0
Wuzzy 4 months ago
parent
commit
5c1717971b

+ 1
- 1
mods/ITEMS/mcl_core/locale/mcl_core.de.tr View File

@@ -199,7 +199,7 @@ Spruce Sapling=Fichtensetzling
199 199
 Spruce Wood=Fichtenholz
200 200
 Spruce Wood Planks=Fichtenholzplanken
201 201
 Spruce leaves are grown from spruce trees.=Fichtenblätter wachsen an Fichten.
202
-Stained glass is a decorative and mostly transparent block which comes in various different colors.=Farbglas ist ein dekorativer und größtenteils durchsichtiger Block, der in verschiedenen Farben daherkommt.
202
+Stained glass is a decorative and mostly transparent block which comes in various different colors.=Buntglas ist ein dekorativer und größtenteils durchsichtiger Block, der in verschiedenen Farben daherkommt.
203 203
 Stick=Stock
204 204
 Sticks are a very versatile crafting material; used in countless crafting recipes.=Stöcke sind ein vielseitiges Material, sie werden in zahllosen Fertigungsrezepten gebraucht.
205 205
 Stone=Stein

+ 36
- 19
mods/ITEMS/mcl_core/nodes_glass.lua View File

@@ -1,5 +1,6 @@
1 1
 -- Glass nodes
2 2
 local S = minetest.get_translator("mcl_core")
3
+local mod_doc = minetest.get_modpath("doc")
3 4
 
4 5
 minetest.register_node("mcl_core:glass", {
5 6
 	description = S("Glass"),
@@ -20,11 +21,23 @@ minetest.register_node("mcl_core:glass", {
20 21
 ------------------------
21 22
 -- Create Color Glass -- 
22 23
 ------------------------
23
-function mcl_core.add_glass(desc, recipeitem, colorgroup, color)
24
+local canonical_color = "blue"
25
+function mcl_core.add_stained_glass(desc, recipeitem, colorgroup, color)
24 26
 
27
+	local longdesc, create_entry, entry_name
28
+	if mod_doc then
29
+		if color == canonical_color then
30
+			longdesc = S("Stained glass is a decorative and mostly transparent block which comes in various different colors.")
31
+			entry_name = S("Stained Glass")
32
+		else
33
+			create_entry = false
34
+		end
35
+	end
25 36
 	minetest.register_node("mcl_core:glass_"..color, {
26 37
 		description = desc,
27
-		_doc_items_longdesc = S("Stained glass is a decorative and mostly transparent block which comes in various different colors."),
38
+		_doc_items_create_entry = create_entry,
39
+		_doc_items_entry_name = entry_name,
40
+		_doc_items_longdesc = longdesc,
28 41
 		drawtype = "glasslike",
29 42
 		is_ground_content = false,
30 43
 		tiles = {"mcl_core_glass_"..color..".png"},
@@ -48,23 +61,27 @@ function mcl_core.add_glass(desc, recipeitem, colorgroup, color)
48 61
 			{'mcl_core:glass','mcl_core:glass','mcl_core:glass'},
49 62
 		}
50 63
 	})
64
+
65
+	if mod_doc and color ~= canonical_color then
66
+		doc.add_entry_alias("nodes", "mcl_core:glass_"..canonical_color, "nodes", "mcl_core:glass_"..color)
67
+	end
68
+
51 69
 end
52 70
 
53 71
 ---- colored glass
54
-mcl_core.add_glass( S("Red Stained Glass"), "mcl_dye:red", "basecolor_red", "red")
55
-mcl_core.add_glass( S("Green Stained Glass"), "mcl_dye:dark_green", "unicolor_dark_green", "green")
56
-mcl_core.add_glass( S("Blue Stained Glass"), "mcl_dye:blue", "basecolor_blue", "blue")
57
-mcl_core.add_glass( S("Light Blue Stained Glass"), "mcl_dye:lightblue", "unicolor_light_blue", "light_blue")
58
-mcl_core.add_glass( S("Black Stained Glass"), "mcl_dye:black", "basecolor_black", "black")
59
-mcl_core.add_glass( S("White Stained Glass"), "mcl_dye:white", "basecolor_white", "white")
60
-mcl_core.add_glass( S("Yellow Stained Glass"), "mcl_dye:yellow", "basecolor_yellow", "yellow")
61
-mcl_core.add_glass( S("Brown Stained Glass"), "mcl_dye:brown", "unicolor_dark_orange", "brown")
62
-mcl_core.add_glass( S("Orange Stained Glass"), "mcl_dye:orange", "excolor_orange", "orange")
63
-mcl_core.add_glass( S("Pink Stained Glass"), "mcl_dye:pink", "unicolor_light_red", "pink")
64
-mcl_core.add_glass( S("Grey Stained Glass"), "mcl_dye:dark_grey", "unicolor_darkgrey", "gray")
65
-mcl_core.add_glass( S("Lime Stained Glass"), "mcl_dye:green", "basecolor_green", "lime")
66
-mcl_core.add_glass( S("Light Grey Stained Glass"), "mcl_dye:grey", "basecolor_grey", "silver")
67
-mcl_core.add_glass( S("Magenta Stained Glass"), "mcl_dye:magenta", "basecolor_magenta", "magenta")
68
-mcl_core.add_glass( S("Purple Stained Glass"), "mcl_dye:violet", "excolor_violet", "purple")
69
-mcl_core.add_glass( S("Cyan Stained Glass"), "mcl_dye:cyan", "basecolor_cyan", "cyan")
70
-
72
+mcl_core.add_stained_glass( S("Red Stained Glass"), "mcl_dye:red", "basecolor_red", "red")
73
+mcl_core.add_stained_glass( S("Green Stained Glass"), "mcl_dye:dark_green", "unicolor_dark_green", "green")
74
+mcl_core.add_stained_glass( S("Blue Stained Glass"), "mcl_dye:blue", "basecolor_blue", "blue")
75
+mcl_core.add_stained_glass( S("Light Blue Stained Glass"), "mcl_dye:lightblue", "unicolor_light_blue", "light_blue")
76
+mcl_core.add_stained_glass( S("Black Stained Glass"), "mcl_dye:black", "basecolor_black", "black")
77
+mcl_core.add_stained_glass( S("White Stained Glass"), "mcl_dye:white", "basecolor_white", "white")
78
+mcl_core.add_stained_glass( S("Yellow Stained Glass"), "mcl_dye:yellow", "basecolor_yellow", "yellow")
79
+mcl_core.add_stained_glass( S("Brown Stained Glass"), "mcl_dye:brown", "unicolor_dark_orange", "brown")
80
+mcl_core.add_stained_glass( S("Orange Stained Glass"), "mcl_dye:orange", "excolor_orange", "orange")
81
+mcl_core.add_stained_glass( S("Pink Stained Glass"), "mcl_dye:pink", "unicolor_light_red", "pink")
82
+mcl_core.add_stained_glass( S("Grey Stained Glass"), "mcl_dye:dark_grey", "unicolor_darkgrey", "gray")
83
+mcl_core.add_stained_glass( S("Lime Stained Glass"), "mcl_dye:green", "basecolor_green", "lime")
84
+mcl_core.add_stained_glass( S("Light Grey Stained Glass"), "mcl_dye:grey", "basecolor_grey", "silver")
85
+mcl_core.add_stained_glass( S("Magenta Stained Glass"), "mcl_dye:magenta", "basecolor_magenta", "magenta")
86
+mcl_core.add_stained_glass( S("Purple Stained Glass"), "mcl_dye:violet", "excolor_violet", "purple")
87
+mcl_core.add_stained_glass( S("Cyan Stained Glass"), "mcl_dye:cyan", "basecolor_cyan", "cyan")

+ 21
- 4
mods/ITEMS/xpanes/init.lua View File

@@ -1,4 +1,5 @@
1 1
 local S = minetest.get_translator("xpanes")
2
+local mod_doc = minetest.get_modpath("doc")
2 3
 
3 4
 local function is_pane(pos)
4 5
 	return minetest.get_item_group(minetest.get_node(pos).name, "pane") > 0
@@ -162,24 +163,35 @@ function xpanes.register_pane(name, def)
162 163
 		recipe = def.recipe
163 164
 	})
164 165
 
165
-	if minetest.get_modpath("doc") then
166
+	if mod_doc and def._doc_items_create_entry ~= false then
166 167
 		doc.add_entry_alias("nodes", "xpanes:" .. name .. "_flat", "nodes", "xpanes:" .. name)
167 168
 	end
168 169
 end
169 170
 
171
+local canonical_color = "blue"
170 172
 -- Register glass pane (stained and unstained)
171 173
 local pane = function(description, node, append)
172
-	local texture1
173
-
174
+	local texture1, longdesc, entry_name, create_entry
175
+	longdesc = S("Glass panes are thin layers of glass which neatly connect to their neighbors as you build them.")
176
+	local is_canonical = true
174 177
 	-- Special case: Default (unstained) glass texture
175 178
 	if append == "_natural" then
176 179
 		texture1 = "default_glass.png"
177 180
 	else
181
+		if append ~= "_"..canonical_color then
182
+			is_canonical = false
183
+			longdesc = nil
184
+			create_entry = false
185
+		else
186
+			entry_name = S("Stained Glass Pane")
187
+		end
178 188
 		texture1 = "mcl_core_glass"..append..".png"
179 189
 	end
180 190
 	xpanes.register_pane("pane"..append, {
181 191
 		description = description,
182
-		_doc_items_longdesc = S("Glass panes are thin layers of glass which neatly connect to their neighbors as you build them."),
192
+		_doc_items_create_entry = create_entry,
193
+		_doc_items_entry_name = entry_name,
194
+		_doc_items_longdesc = longdesc,
183 195
 		textures = {texture1, texture1, "xpanes_top_glass"..append..".png"},
184 196
 		use_texture_alpha = true,
185 197
 		inventory_image = texture1,
@@ -194,6 +206,11 @@ local pane = function(description, node, append)
194 206
 		_mcl_blast_resistance = 1.5,
195 207
 		_mcl_hardness = 0.3,
196 208
 	})
209
+
210
+	if mod_doc and not is_canonical then
211
+		doc.add_entry_alias("nodes", "xpanes:pane_".. canonical_color .. "_flat", "nodes", "xpanes:pane"..append)
212
+		doc.add_entry_alias("nodes", "xpanes:pane_".. canonical_color .. "_flat", "nodes", "xpanes:pane"..append.."_flat")
213
+	end
197 214
 end
198 215
 
199 216
 -- Iron Bars

Loading…
Cancel
Save