mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add item.caption(...) function & move item library docs to libitem.md
This commit is contained in:
parent
57e397e692
commit
4dfa235f12
6 changed files with 54 additions and 65 deletions
|
|
@ -47,6 +47,13 @@ static int l_item_get_icon(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int l_item_caption(lua::State* L) {
|
||||
if (auto def = get_item_def(L, 1)) {
|
||||
return lua::pushstring(L, def->caption);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg itemlib[] = {
|
||||
{"index", lua::wrap<l_item_index>},
|
||||
{"name", lua::wrap<l_item_name>},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue