Add sim.temperatureScale
This commit is contained in:
parent
55524bc27a
commit
3a7cdeefd9
@ -943,6 +943,7 @@ void LuaScriptInterface::initSimulationAPI()
|
|||||||
{"removeCustomGol", simulation_removeCustomGol},
|
{"removeCustomGol", simulation_removeCustomGol},
|
||||||
{"lastUpdatedID", simulation_lastUpdatedID},
|
{"lastUpdatedID", simulation_lastUpdatedID},
|
||||||
{"updateUpTo", simulation_updateUpTo},
|
{"updateUpTo", simulation_updateUpTo},
|
||||||
|
{"temperatureScale", simulation_temperatureScale},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
luaL_register(l, "simulation", simulationAPIMethods);
|
luaL_register(l, "simulation", simulationAPIMethods);
|
||||||
@ -2540,6 +2541,21 @@ int LuaScriptInterface::simulation_updateUpTo(lua_State *l)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int LuaScriptInterface::simulation_temperatureScale(lua_State *l)
|
||||||
|
{
|
||||||
|
if (lua_gettop(l) == 0)
|
||||||
|
{
|
||||||
|
lua_pushinteger(l, luacon_model->GetTemperatureScale());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int temperatureScale = luaL_checkinteger(l, 1);
|
||||||
|
if (temperatureScale < 0 || temperatureScale > 2)
|
||||||
|
return luaL_error(l, "Invalid temperature scale");
|
||||||
|
luacon_model->SetTemperatureScale(temperatureScale);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//// Begin Renderer API
|
//// Begin Renderer API
|
||||||
|
|
||||||
void LuaScriptInterface::initRendererAPI()
|
void LuaScriptInterface::initRendererAPI()
|
||||||
|
@ -123,6 +123,7 @@ class LuaScriptInterface: public CommandInterface
|
|||||||
static int simulation_removeCustomGol(lua_State *l);
|
static int simulation_removeCustomGol(lua_State *l);
|
||||||
static int simulation_lastUpdatedID(lua_State *l);
|
static int simulation_lastUpdatedID(lua_State *l);
|
||||||
static int simulation_updateUpTo(lua_State *l);
|
static int simulation_updateUpTo(lua_State *l);
|
||||||
|
static int simulation_temperatureScale(lua_State *l);
|
||||||
|
|
||||||
|
|
||||||
//Renderer
|
//Renderer
|
||||||
|
Reference in New Issue
Block a user