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:
parent
ecf8488406
commit
7435ea0d4e
2 changed files with 35 additions and 2 deletions
26
builtin/mainmenu/settings/shader_warning_component.lua
Normal file
26
builtin/mainmenu/settings/shader_warning_component.lua
Normal 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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue