add item.caption(...) function & move item library docs to libitem.md
This commit is contained in:
@@ -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>},
|
||||
|
||||
Reference in New Issue
Block a user