languages menu moved to xml + minor refactor

This commit is contained in:
MihailRis
2024-04-13 16:28:06 +03:00
parent f525d82ca8
commit 657b09da9e
12 changed files with 71 additions and 48 deletions
+4 -4
View File
@@ -7,23 +7,23 @@
#include <cmath>
static int l_world_get_total_time(lua_State* L) {
lua_pushnumber(L, scripting::level->world->totalTime);
lua_pushnumber(L, scripting::level->getWorld()->totalTime);
return 1;
}
static int l_world_get_day_time(lua_State* L) {
lua_pushnumber(L, scripting::level->world->daytime);
lua_pushnumber(L, scripting::level->getWorld()->daytime);
return 1;
}
static int l_world_set_day_time(lua_State* L) {
double value = lua_tonumber(L, 1);
scripting::level->world->daytime = fmod(value, 1.0);
scripting::level->getWorld()->daytime = fmod(value, 1.0);
return 0;
}
static int l_world_get_seed(lua_State* L) {
lua_pushinteger(L, scripting::level->world->getSeed());
lua_pushinteger(L, scripting::level->getWorld()->getSeed());
return 1;
}