The availability unlockable number for a skin is now available, read only, to Lua.

This commit is contained in:
toasterbabe 2016-07-14 15:51:03 +01:00
parent 417e9187d9
commit 4c6ed6da76

View file

@ -51,7 +51,8 @@ enum skin {
skin_starttranscolor, skin_starttranscolor,
skin_prefcolor, skin_prefcolor,
skin_highresscale, skin_highresscale,
skin_soundsid skin_soundsid,
skin_availability
}; };
static const char *const skin_opt[] = { static const char *const skin_opt[] = {
"valid", "valid",
@ -86,6 +87,7 @@ static const char *const skin_opt[] = {
"prefcolor", "prefcolor",
"highresscale", "highresscale",
"soundsid", "soundsid",
"availability",
NULL}; NULL};
#define UNIMPLEMENTED luaL_error(L, LUA_QL("skin_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", skin_opt[field]) #define UNIMPLEMENTED luaL_error(L, LUA_QL("skin_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", skin_opt[field])
@ -205,6 +207,9 @@ static int skin_get(lua_State *L)
case skin_soundsid: case skin_soundsid:
LUA_PushUserdata(L, skin->soundsid, META_SOUNDSID); LUA_PushUserdata(L, skin->soundsid, META_SOUNDSID);
break; break;
case skin_availability:
lua_pushinteger(L, skin->availability);
break;
} }
return 1; return 1;
} }