1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Show warning in the settings menu when shaders are disabled (#15272)

This commit is contained in:
grorp 2024-10-14 09:43:29 +02:00 committed by GitHub
parent ecf8488406
commit 7435ea0d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 2 deletions

View file

@ -0,0 +1,26 @@
-- Minetest
-- SPDX-License-Identifier: LGPL-2.1-or-later
return {
query_text = "Shaders",
requires = {
shaders_support = true,
shaders = false,
},
full_width = true,
get_formspec = function(self, avail_w)
local fs = {
"box[0,0;", avail_w, ",1.2;", mt_color_orange, "]",
"label[0.2,0.4;", fgettext("Shaders are disabled."), "]",
"label[0.2,0.8;", fgettext("This is not a recommended configuration."), "]",
"button[", avail_w - 2.2, ",0.2;2,0.8;fix_shader_warning;", fgettext("Enable"), "]",
}
return table.concat(fs, ""), 1.2
end,
on_submit = function(self, fields)
if fields.fix_shader_warning then
core.settings:remove("enable_shaders") -- default value is true
return true
end
end,
}