From 9c728d2cac69ff6c9f26b77af0130fb4bd30d3a1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 12 Jan 2023 09:19:49 -0300 Subject: [PATCH] [lua] Add Tile.index getter --- src/app/script/tile_class.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/script/tile_class.cpp b/src/app/script/tile_class.cpp index 439b57d0c..2299296f7 100644 --- a/src/app/script/tile_class.cpp +++ b/src/app/script/tile_class.cpp @@ -33,6 +33,13 @@ struct Tile { } }; +int Tile_get_index(lua_State* L) +{ + auto tile = get_obj(L, 1); + lua_pushinteger(L, tile->ti); + return 1; +} + int Tile_get_image(lua_State* L) { auto tile = get_obj(L, 1); @@ -165,6 +172,7 @@ const luaL_Reg Tile_methods[] = { }; const Property Tile_properties[] = { + { "index", Tile_get_index, nullptr }, { "image", Tile_get_image, nullptr }, // TODO Tile_set_image { "data", Tile_get_data, Tile_set_data }, { "color", Tile_get_color, Tile_set_color },