33
src/Config.c
33
src/Config.c
@@ -160,8 +160,11 @@ int config_load_ref(lua_State *L, int idx, Config *out)
|
||||
// ======== DEFAULTS ========
|
||||
out->space.offset = (Vector3) { 0, 0, 0 };
|
||||
out->space.initial_center = (Vector3) { 0, 1, 0 };
|
||||
out->space.radius = 0.7f;
|
||||
out->space.radius = 1.0f;
|
||||
out->space.window_scale = 0.001f;
|
||||
out->displays.hud.size = 720;
|
||||
out->displays.hud.font_size = 24;
|
||||
out->displays.virtual.resolution = (Vector2) { 2560, 1440 };
|
||||
// ====== END DEFAULTS ======
|
||||
|
||||
out->xwayland.enabled = true;
|
||||
@@ -290,6 +293,34 @@ int config_load_ref(lua_State *L, int idx, Config *out)
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_getfield(L, -1, "displays");
|
||||
if (lua_istable(L, -1)) {
|
||||
lua_getfield(L, -1, "hud");
|
||||
if (lua_istable(L, -1)) {
|
||||
lua_getfield(L, -1, "size");
|
||||
if (lua_isnumber(L, -1))
|
||||
out->displays.hud.size = (float)lua_tonumber(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_getfield(L, -1, "font_size");
|
||||
if (lua_isnumber(L, -1))
|
||||
out->displays.hud.font_size = (float)lua_tonumber(L, -1);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_getfield(L, -1, "virtual");
|
||||
if (lua_istable(L, -1)) {
|
||||
lua_getfield(L, -1, "resolution");
|
||||
if (lua_istable(L, -1) || lua_isuserdata(L, -1))
|
||||
out->displays.virtual.resolution
|
||||
= lua_readVector2(L, lua_absindex(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_pop(L, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user