add item.caption(...) function & move item library docs to libitem.md

This commit is contained in:
MihailRis
2024-10-15 04:48:01 +03:00
parent 57e397e692
commit 4dfa235f12
6 changed files with 54 additions and 65 deletions
+7
View File
@@ -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>},