Add Lua API for deco tool colour space, see 51e5f2b

This commit is contained in:
Tamás Bálint Misius 2019-09-21 21:58:50 +02:00
parent 51e5f2bffa
commit a6127bc1fb
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
2 changed files with 5 additions and 1 deletions

View File

@ -456,8 +456,8 @@ int GameModel::GetEdgeMode()
void GameModel::SetDecoSpace(int decoSpace) void GameModel::SetDecoSpace(int decoSpace)
{ {
this->decoSpace = decoSpace;
sim->SetDecoSpace(decoSpace); sim->SetDecoSpace(decoSpace);
this->decoSpace = sim->deco_space;
} }
int GameModel::GetDecoSpace() int GameModel::GetDecoSpace()

View File

@ -395,6 +395,8 @@ int LuaScriptInterface::tpt_index(lua_State *l)
return lua_pushnumber(l, m->GetBrush()->GetRadius().Y), 1; return lua_pushnumber(l, m->GetBrush()->GetRadius().Y), 1;
else if (!key.compare("brushID")) else if (!key.compare("brushID"))
return lua_pushnumber(l, m->GetBrushID()), 1; return lua_pushnumber(l, m->GetBrushID()), 1;
else if (!key.compare("decoSpace"))
return lua_pushnumber(l, m->GetDecoSpace()), 1;
//if not a special key, return the value in the table //if not a special key, return the value in the table
return lua_rawget(l, 1), 1; return lua_rawget(l, 1), 1;
@ -441,6 +443,8 @@ int LuaScriptInterface::tpt_newIndex(lua_State *l)
c->SetBrushSize(ui::Point(m->GetBrush()->GetRadius().X, luaL_checkinteger(l, 3))); c->SetBrushSize(ui::Point(m->GetBrush()->GetRadius().X, luaL_checkinteger(l, 3)));
else if (!key.compare("brushID")) else if (!key.compare("brushID"))
m->SetBrushID(luaL_checkinteger(l, 3)); m->SetBrushID(luaL_checkinteger(l, 3));
else if (!key.compare("decoSpace"))
m->SetDecoSpace(luaL_checkinteger(l, 3));
else else
{ {
//if not a special key, set a value in the table //if not a special key, set a value in the table