mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-10 18:51:05 +00:00
parent
0fde9ab7e8
commit
794aea8e92
35 changed files with 117 additions and 411 deletions
|
@ -19,8 +19,6 @@
|
|||
local component_funcs = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
|
||||
"settings" .. DIR_DELIM .. "components.lua")
|
||||
|
||||
local shader_warning_component = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
|
||||
"settings" .. DIR_DELIM .. "shader_warning_component.lua")
|
||||
local shadows_component = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
|
||||
"settings" .. DIR_DELIM .. "shadows_component.lua")
|
||||
|
||||
|
@ -154,12 +152,7 @@ local function load()
|
|||
|
||||
table.insert(page_by_id.controls_keyboard_and_mouse.content, 1, change_keys)
|
||||
do
|
||||
local content = page_by_id.graphics_and_audio_graphics.content
|
||||
table.insert(content, 1, shader_warning_component)
|
||||
|
||||
content = page_by_id.graphics_and_audio_effects.content
|
||||
table.insert(content, 1, shader_warning_component)
|
||||
|
||||
local content = page_by_id.graphics_and_audio_effects.content
|
||||
local idx = table.indexof(content, "enable_dynamic_shadows")
|
||||
table.insert(content, idx, shadows_component)
|
||||
|
||||
|
@ -348,7 +341,6 @@ local function check_requirements(name, requires)
|
|||
end
|
||||
|
||||
local video_driver = core.get_active_driver()
|
||||
local shaders_support = video_driver == "opengl" or video_driver == "opengl3" or video_driver == "ogles2"
|
||||
local touch_support = core.irrlicht_device_supports_touch()
|
||||
local touch_controls = core.settings:get("touch_controls")
|
||||
local special = {
|
||||
|
@ -359,8 +351,6 @@ local function check_requirements(name, requires)
|
|||
-- be used, so we show settings for both.
|
||||
touchscreen = touch_support and (touch_controls == "auto" or core.is_yes(touch_controls)),
|
||||
keyboard_mouse = not touch_support or (touch_controls == "auto" or not core.is_yes(touch_controls)),
|
||||
shaders_support = shaders_support,
|
||||
shaders = core.settings:get_bool("enable_shaders") and shaders_support,
|
||||
opengl = video_driver == "opengl",
|
||||
gles = video_driver:sub(1, 5) == "ogles",
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
-- Luanti
|
||||
-- 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