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
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_setfield(L, -2, "new");
lua_pushcfunction(L, Sign_delete); lua_pushcfunction(L, Sign_delete);
lua_setfield(L, -2, "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_setfield(L, -2, "signs");
} }
lua_pushvalue(L, -1); lua_pushvalue(L, -1);

View File

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