mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
[lua] Add possibility to draw tiles w/app.useTool{ tilemapMode=TilemapMode.TILES... }
This commit is contained in:
parent
c86b4a28a6
commit
27e2a287bf
@ -387,6 +387,13 @@ int App_useTool(lua_State* L)
|
||||
params.freehandAlgorithm = get_value_from_lua<tools::FreehandAlgorithm>(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
// Are we going to modify pixels or tiles?
|
||||
type = lua_getfield(L, 1, "tilemapMode");
|
||||
if (type != LUA_TNIL) {
|
||||
site.tilemapMode(TilemapMode(lua_tointeger(L, -1)));
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
// How the tileset must be modified depending on this tool usage
|
||||
type = lua_getfield(L, 1, "tilesetMode");
|
||||
if (type != LUA_TNIL) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "app/script/luacpp.h"
|
||||
#include "app/script/security.h"
|
||||
#include "app/sprite_sheet_type.h"
|
||||
#include "app/tilemap_mode.h"
|
||||
#include "app/tileset_mode.h"
|
||||
#include "app/tools/ink_type.h"
|
||||
#include "base/chrono.h"
|
||||
@ -370,6 +371,13 @@ Engine::Engine()
|
||||
setfield_integer(L, "X2", (int)ui::kButtonX2);
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_newtable(L);
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, "TilemapMode");
|
||||
setfield_integer(L, "PIXELS", TilemapMode::Pixels);
|
||||
setfield_integer(L, "TILES", TilemapMode::Tiles);
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_newtable(L);
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, "TilesetMode");
|
||||
|
Loading…
x
Reference in New Issue
Block a user