add gfx.weather library & add weather.set command

This commit is contained in:
MihailRis
2025-02-27 07:30:49 +03:00
parent 02d8d8d6bf
commit 4d5b450145
8 changed files with 44 additions and 18 deletions
@@ -0,0 +1,16 @@
#include "libhud.hpp"
using namespace scripting;
static int l_change(lua::State* L) {
WeatherPreset weather {};
weather.deserialize(lua::tovalue(L, 1));
float time = lua::tonumber(L, 2);
renderer->weather.change(std::move(weather), time);
return 0;
}
const luaL_Reg weatherlib[] = {
{"change", wrap_hud<l_change>},
{NULL, NULL}
};