Skip to content

Commit

Permalink
Add Lua API for deco tool colour space, see 51e5f2b
Browse files Browse the repository at this point in the history
  • Loading branch information
LBPHacker committed Sep 21, 2019
1 parent 51e5f2b commit a6127bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/game/GameModel.cpp
Expand Up @@ -456,8 +456,8 @@ int GameModel::GetEdgeMode()

void GameModel::SetDecoSpace(int decoSpace)
{
this->decoSpace = decoSpace;
sim->SetDecoSpace(decoSpace);
this->decoSpace = sim->deco_space;
}

int GameModel::GetDecoSpace()
Expand Down
4 changes: 4 additions & 0 deletions src/lua/LuaScriptInterface.cpp
Expand Up @@ -395,6 +395,8 @@ int LuaScriptInterface::tpt_index(lua_State *l)
return lua_pushnumber(l, m->GetBrush()->GetRadius().Y), 1;
else if (!key.compare("brushID"))
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
return lua_rawget(l, 1), 1;
Expand Down Expand Up @@ -441,6 +443,8 @@ int LuaScriptInterface::tpt_newIndex(lua_State *l)
c->SetBrushSize(ui::Point(m->GetBrush()->GetRadius().X, luaL_checkinteger(l, 3)));
else if (!key.compare("brushID"))
m->SetBrushID(luaL_checkinteger(l, 3));
else if (!key.compare("decoSpace"))
m->SetDecoSpace(luaL_checkinteger(l, 3));
else
{
//if not a special key, set a value in the table
Expand Down

0 comments on commit a6127bc

Please sign in to comment.