1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-21 00:45:23 +01:00

Improve shadow settings usability

This commit is contained in:
sfan5
2025-11-17 13:38:46 +01:00
parent 1f0aa28cf0
commit 08ba866992
2 changed files with 11 additions and 5 deletions

View File

@@ -34,9 +34,9 @@ local function detect_mapping_idx()
local shadow_map_max_distance = tonumber(core.settings:get("shadow_map_max_distance"))
local shadow_map_texture_size = tonumber(core.settings:get("shadow_map_texture_size"))
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit", false)
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit")
local shadow_filters = tonumber(core.settings:get("shadow_filters"))
local shadow_map_color = core.settings:get_bool("shadow_map_color", false)
local shadow_map_color = core.settings:get_bool("shadow_map_color")
for i = 2, 6 do
local preset = shadow_presets[i]
@@ -81,8 +81,14 @@ return {
table.remove(labels, PRESET_CUSTOM)
end
-- Don't show anything if shadows are disabled
-- Reason: there's a separate checkbox and users can't see the suggested default in the dropdown
if idx == PRESET_DISABLED then
return "", 0
end
local fs =
"label[0,0.2;" .. fgettext("Dynamic shadows") .. "]" ..
"label[0,0.2;" .. fgettext("Quality preset") .. "]" ..
"dropdown[0,0.4;3,0.8;dd_shadows;" .. table.concat(labels, ",") .. ";" .. idx .. ";true]" ..
"label[0,1.5;" .. core.colorize("#bbb", fgettext("(The game will need to enable shadows as well)")) .. "]"
return fs, 1.8