Skip to content

Commit

Permalink
Improve inner/outer stairs translation for external mods (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Sep 21, 2020
1 parent 63cffc4 commit 4c145bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 8 additions & 2 deletions game_api.txt
Expand Up @@ -765,12 +765,18 @@ delivered with Minetest Game, to keep them compatible with other mods.
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)

`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)`
```
stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab,
sounds, worldaligntex, desc_stair_inner, desc_stair_outer)
```

* A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer
* Uses almost the same arguments as stairs.register_stair
* `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed
* `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed unless
`desc_stair_inner` or `desc_stair_outer` are specified, which are used instead.
* `desc_slab`: Description for slab node
* `desc_stair_inner`: Description for inner stair node
* `desc_stair_outer`: Description for outer stair node


Xpanes API
Expand Down
11 changes: 6 additions & 5 deletions mods/stairs/init.lua
Expand Up @@ -468,13 +468,14 @@ end
-- Nodes will be called stairs:{stair,slab}_<subname>

function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
desc_stair, desc_slab, sounds, worldaligntex)
desc_stair, desc_slab, sounds, worldaligntex,
desc_stair_inner, desc_stair_outer)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair,
sounds, worldaligntex)
stairs.register_stair_inner(subname, recipeitem, groups, images, desc_stair,
sounds, worldaligntex)
stairs.register_stair_outer(subname, recipeitem, groups, images, desc_stair,
sounds, worldaligntex)
stairs.register_stair_inner(subname, recipeitem, groups, images,
desc_stair, sounds, worldaligntex, desc_stair_inner)
stairs.register_stair_outer(subname, recipeitem, groups, images,
desc_stair, sounds, worldaligntex, desc_stair_outer)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab,
sounds, worldaligntex)
end
Expand Down

0 comments on commit 4c145bf

Please sign in to comment.