[celx] Add method celestia:version()

pull/765/head
Hleb Valoshka 2020-05-30 10:07:17 +03:00
parent d9243202fa
commit a33e24914b
2 changed files with 14 additions and 0 deletions

View File

@ -2132,6 +2132,12 @@ static int celestia_loadfragment(lua_State* l)
return 1;
}
static int celestia_version(lua_State* l)
{
lua_pushstring(l, "1.7.0");
return 1;
}
void CreateCelestiaMetaTable(lua_State* l)
{
Celx_CreateClassMetatable(l, Celx_Celestia);
@ -2236,6 +2242,8 @@ void CreateCelestiaMetaTable(lua_State* l)
Celx_RegisterMethod(l, "loadfragment", celestia_loadfragment);
Celx_RegisterMethod(l, "version", celestia_version);
lua_pop(l, 1);
}

View File

@ -1,3 +1,9 @@
print(_VERSION)
print(_RELEASE)
print(_LUAJIT_VERSION)
if type(celestia['version']) == 'function' then
print(celestia:version())
else
print("No celestia:version defined")
end