Add some sign api constants

This commit is contained in:
Tamás Bálint Misius 2024-01-26 18:51:15 +01:00
parent 09ae62ac9e
commit ae07c55f4d
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
2 changed files with 13 additions and 4 deletions

View File

@ -2083,6 +2083,14 @@ void LuaSimulation::Open(lua_State *L)
lua_setfield(L, -2, "new");
lua_pushcfunction(L, Sign_delete);
lua_setfield(L, -2, "delete");
#define LCONSTAS(k, v) lua_pushinteger(L, int(v)); lua_setfield(L, -2, k)
LCONSTAS("JUSTMODE_LEFT" , sign::Left),
LCONSTAS("JUSTMODE_MIDDLE", sign::Middle),
LCONSTAS("JUSTMODE_RIGHT" , sign::Right),
LCONSTAS("JUSTMODE_NONE" , sign::None),
LCONSTAS("NUM_JUSTMODES" , sign::Max),
LCONSTAS("MAX_SIGNS" , MAXSIGNS),
#undef LCONSTAS
lua_setfield(L, -2, "signs");
}
lua_pushvalue(L, -1);

View File

@ -8,10 +8,11 @@ struct sign
{
enum Justification
{
Left = 0,
Middle = 1,
Right = 2,
None = 3
Left,
Middle,
Right,
None,
Max,
};
enum Type