settings page completely moved to xml

This commit is contained in:
MihailRis
2024-04-20 15:52:55 +03:00
parent 9cdf3ff016
commit b9ea88b988
15 changed files with 111 additions and 107 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ void CameraControl::switchCamera() {
void CameraControl::update(PlayerInput& input, float delta, Chunks* chunks) {
offset = glm::vec3(0.0f, 0.7f, 0.0f);
if (settings.shaking && !input.cheat) {
if (settings.shaking.get() && !input.cheat) {
offset += updateCameraShaking(delta);
}
if (settings.fovEvents){
+2 -2
View File
@@ -133,8 +133,8 @@ static int l_str_setting(lua_State* L) {
static int l_get_setting_info(lua_State* L) {
auto name = lua_tostring(L, 1);
auto setting = scripting::engine->getSettingsHandler().getSetting(name);
lua_createtable(L, 0, 1);
if (auto number = dynamic_cast<NumberSetting*>(setting)) {
lua_createtable(L, 0, 1);
lua_pushnumber(L, number->getMin());
lua_setfield(L, -2, "min");
lua_pushnumber(L, number->getMax());
@@ -142,13 +142,13 @@ static int l_get_setting_info(lua_State* L) {
return 1;
}
if (auto integer = dynamic_cast<IntegerSetting*>(setting)) {
lua_createtable(L, 0, 1);
lua_pushinteger(L, integer->getMin());
lua_setfield(L, -2, "min");
lua_pushinteger(L, integer->getMax());
lua_setfield(L, -2, "max");
return 1;
}
lua_pop(L, 1);
luaL_error(L, "unsupported setting type");
return 0;
}