1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-28 22:25:20 +01:00

Add inventory image animation API (#16538)

This commit is contained in:
cx384
2025-10-26 18:48:53 +01:00
committed by GitHub
parent dde463635e
commit 93ccb4b355
23 changed files with 606 additions and 227 deletions

View File

@@ -2708,10 +2708,10 @@ Some of the values in the key-value store are handled specially:
See also: `get_description` in [`ItemStack`](#itemstack)
* `short_description`: Set the item stack's short description.
See also: `get_short_description` in [`ItemStack`](#itemstack)
* `inventory_image`: Override inventory_image
* `inventory_overlay`: Override inventory_overlay
* `wield_image`: Override wield_image
* `wield_overlay`: Override wield_overlay
* `inventory_image`: Override inventory_image.name
* `inventory_overlay`: Override inventory_overlay.name
* `wield_image`: Override wield_image.name
* `wield_overlay`: Override wield_overlay.name
* `wield_scale`: Override wield_scale, use vector.to_string
* `color`: A `ColorString`, which sets the stack's color.
* `palette_index`: If the item has a palette, this is used to get the
@@ -5854,6 +5854,9 @@ Utilities
generate_decorations_biomes = true,
-- 'chunksize' mapgen setting can be a vector, instead of a single number (5.15.0)
chunksize_vector = true,
-- Item definition fields `inventory_image`, `inventory_overlay`, `wield_image`
-- and `wield_overlay` accept a table containing animation definitions. (5.16.0)
item_image_animation = true,
}
```
@@ -9518,6 +9521,7 @@ Player properties need to be saved manually.
-- `core.itemstring_with_palette()`), the entity will inherit the color.
-- Wielditems are scaled a bit. If you want a wielditem to appear
-- to be as large as a node, use `0.667` in `visual_size`
-- Currently, item image animations are not played. This may change in the future.
-- "item" is similar to "wielditem" but ignores the 'wield_image' parameter.
-- "node" looks exactly like a node in-world (supported since 5.12.0)
-- Note that visual effects like waving or liquid reflections will not work.
@@ -9858,6 +9862,13 @@ Tile animation definition
}
```
Item image definition
---------------------
* `"image.png"`
* `{name="image.png", animation={Tile Animation definition}}`
* Basically a tile definition but for items
Item definition
---------------
@@ -9884,18 +9895,18 @@ Used by `core.register_node`, `core.register_craftitem`, and
-- {bendy = 2, snappy = 1},
-- {hard = 1, metal = 1, spikes = 1}
inventory_image = "",
-- Texture shown in the inventory GUI
inventory_image = <Item image definition>,
-- Image shown in the inventory GUI
-- Defaults to a 3D rendering of the node if left empty.
inventory_overlay = "",
-- An overlay texture which is not affected by colorization
inventory_overlay = <Item image definition>,
-- An overlay image which is not affected by colorization
wield_image = "",
-- Texture shown when item is held in hand
wield_image = <Item image definition>,
-- Image shown when item is held in hand
-- Defaults to a 3D rendering of the node if left empty.
wield_overlay = "",
wield_overlay = <Item image definition>,
-- Like inventory_overlay but only used in the same situation as wield_image
wield_scale = {x = 1, y = 1, z = 1},