@@ -137,6 +137,7 @@ local function load()
137137
138138 -- insert after "touch_controls"
139139 table.insert (page_by_id .controls_touchscreen .content , 2 , touchscreen_layout )
140+
140141 do
141142 local content = page_by_id .graphics_and_audio_effects .content
142143 local idx = table .indexof (content , " enable_dynamic_shadows" )
@@ -407,18 +408,8 @@ function page_has_contents(page, actual_content)
407408 for _ , item in ipairs (actual_content ) do
408409 if item == false or item .heading then -- luacheck: ignore
409410 -- skip
410- elseif type (item ) == " string" then
411- local setting = get_setting_info (item )
412- assert (setting , " Unknown setting: " .. item )
413- if check_requirements (setting .name , setting .requires , setting .context ) then
414- return true
415- end
416- elseif item .get_formspec then
417- if check_requirements (item .id , item .requires , item .context ) then
418- return true
419- end
420411 else
421- error ( " Unknown content in page: " .. dump ( item ))
412+ return true
422413 end
423414 end
424415
429420local function build_page_components (page )
430421 -- Filter settings based on requirements
431422 local content = {}
423+ local settings_off = {}
432424 local last_heading
433425 for _ , item in ipairs (page .content ) do
434426 if item == false then -- luacheck: ignore
@@ -437,8 +429,9 @@ local function build_page_components(page)
437429 last_heading = item
438430 else
439431 local name , requires , context
432+ local setting
440433 if type (item ) == " string" then
441- local setting = get_setting_info (item )
434+ setting = get_setting_info (item )
442435 assert (setting , " Unknown setting: " .. item )
443436 name = setting .name
444437 requires = setting .requires
@@ -457,6 +450,8 @@ local function build_page_components(page)
457450 last_heading = nil
458451 end
459452 content [# content + 1 ] = item
453+ elseif setting then
454+ settings_off [# settings_off + 1 ] = setting
460455 end
461456 end
462457 end
@@ -475,6 +470,14 @@ local function build_page_components(page)
475470 retval [i ] = component_funcs .heading (item .heading )
476471 end
477472 end
473+
474+ if # settings_off > 0 then
475+ retval [# retval + 1 ] = component_funcs .heading (fgettext_ne (" Unavailable" ),
476+ -- luacheck: ignore
477+ fgettext_ne (" These settings are unavailable due to your platform, hardware or in combination with the current settings." )
478+ )
479+ retval [# retval + 1 ] = component_funcs .unavail_list (settings_off )
480+ end
478481 return retval
479482end
480483
0 commit comments