aboutsummaryrefslogtreecommitdiff
path: root/cmake
Commit message (Collapse)AuthorAge
* cmake: Silence warnings. (#9750)orbea2020-04-28
| | | Fixes https://github.com/minetest/minetest/issues/9734
* Fix find_path for newer jsoncpp installationsWilliam Breathitt Gray2019-11-17
| | | | | | | | | The upstream JsonCpp project has renamed the `json/features.h` file to `json/json_features.h`. This patch fixes the JsonCpp installation search by looking for `json/allocator.h` which has not been renamed on newer versions of JsonCpp. Fixes: https://github.com/minetest/minetest/issues/9119
* Find LuaJIT headers on vcpkgUnknown2019-08-18
| | | luajit headers were moved into a subdirectory to avoid conflicts with plain lua
* Clean up FindOpenGLES2.cmakesfan52019-08-04
|
* Add compatibility to vcpkg buildsystem (#8317)adrido2019-06-10
|
* DragonFly BSD is somewhat identical to FreeBSD (#8159)Leonid Bobrov2019-02-03
|
* Fix libgmp detection (#7488)Leonid Bobrov2018-06-26
|
* Fix luajit include not being foundrubenwardy2018-05-08
|
* Initial Haiku support (#6568)miqlas2017-10-30
| | | | * Iitial Haiku support
* Fix cmake library default build problem since moving to lib/Loic Blot2017-04-07
| | | | Also make Lua library check a cmake module
* Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ ↵Loïc Blot2017-04-02
| | | | | | | | | | | | | | | | instead of src/ (#5473) * Update embedded jsoncpp from unk version to 0.10.6 0.10.6 is last release without c++11 * Make jsoncpp more compliant with its amalgamate Jsoncpp cpp file should be upper, make the library like it does in amalgamate * Reorganization: move minetest embedded libs outside of source tree to /lib * Fix a dead grep in LINT
* Fixes for compiling with a newer (system) jsoncpp (#4429)Rogier-52016-08-10
| | | | | | | | | | | | | | | | | | | | | | | * Move included json code to jsoncpp subdirectory This is needed to avoid having to specify the minetest src directory as a system include when fixing the json includes. * Fix json includes They used "", so that the compiler searches the project's directory first. The result was that when compiling with a system jsoncpp, the project's own version of json.h was still included, instead of the system version. The includes now use <>, so a system location, or one specified with '-Ilocation' is searched only. * Fix for jsoncpp deprecated function warning When compiling with a newer version of jsoncpp (and ENABLE_SYSTEM_JSONCPP=true), jsoncpp emits a warning about a deprecated function that minetest uses.
* Really fix ncurses lookup on Arch Linuxsfan52016-05-16
| | | | | Commit 27ee8d8943080a5dd735c9faa47c726604bafdff forgot to add the paths without ncursesw/ to the find_path() call
* Fix ncurses lookup on Arch LinuxDavid Knapp2016-04-08
| | | | | | | | Arch Linux doesn't put it's ncursesw includes inside an ncursesw directory. This script ends up setting USE_CURSES as true, but doesn't pick up any of the headers. https://bugs.archlinux.org/task/13994
* Improve LuaJIT detectionFerdinand Thiessen2015-12-05
| | | | | | | On openSUSE luajit is not detected correctly. This is because openSUSE is using a lua version suffix, like other Linux distributions do it also. So the include directory is: include/luajit-5_1-2.0
* Add server side ncurses terminalest312015-11-06
| | | | | | | | | | | | | | | | | | | | | | | | This adds a chat console the server owner can use for administration or to talk with players. It runs in its own thread, which makes the user interface immune to the server's lag, behaving just like a client, except timeout. As it uses the same console code as the f10 console, things like nick completion or a scroll buffer basically come for free. The terminal itself is written in a general way so that adding a client version later on is just about implementing an interface. Fatal errors are printed after the console exists and the ncurses terminal buffer gets cleaned up with endwin(), so that the error still remains visible. The server owner can chose their username their entered text will have in chat and where players can send PMs to. Once the username is secured with a password to prevent anybody to take over the server, the owner can execute admin tasks over the console. This change includes a contribution by @kahrl who has improved ncurses library detection.
* FindJson: use PATH_SUFFIXES jsoncpp to find incdirIgor Gnatenko2015-09-26
| | | | For example, on Fedora systems jsoncpp headers is installed in `/usr/include/jsoncpp`.
* Add LibGMPest312015-05-11
| | | | Uses system provided libgmp if found, if not it falls back to mini-gmp.
* Make Git version detection use VERSION_STRING instead of tagsShadowNinja2015-05-05
| | | | | | | | | | This fixes the problem where 0.4.12-dev versions were erroneously shown as 0.4.11-dev because the tag was added on a separate branch. It also fixes a similar issue when builders didn't fetch new tags when updating. This also removes the number-of-commits-since-tag field, since it's incompatible with this. Said field doesn't seem to be useful anyway if you have the commit hash.
* Better version detection for shallow clonesest312015-05-03
|
* Fix typo in OpenGL ES 2 CMake fileShadowNinja2015-03-27
|
* Clean up and tweak build systemShadowNinja2015-03-27
| | | | | | | | | | | | | | | | * Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
* Fix cmake po detection bugest312015-03-23
| | | | Previously, cmake po detection would treat the "timestamp" file created by building for android as own language directory.
* Improve FindIrrlicht.cmake moduleMarkus Koschany2015-02-21
| | | | | | | | | Linux distributions prefer to link against a shared version of the Irrlicht engine instead of using embedded code copies of the same. Search for this shared version first and use that but fall back to the static version if it does not exist. This also fixes https://github.com/minetest/minetest/issues/2163
* Remove included SQLite3ShadowNinja2015-01-08
|
* OS X compatibility fixesMartin Doege2014-06-29
|
* Add CURL_DLL search to show up CURL_DLL in cmake gui and don't silently ↵sapier2013-11-17
| | | | ignore missing CURL_DLL
* Show git hash in version string at top left corner of windowKahrl2013-09-28
|
* Always use builtin JThread librarykwolekr2013-09-15
|
* build with ogles2 driverproller2013-03-16
|
* fix link if system json lib existsproller2013-03-05
|
* new auto masterserverproller2013-02-22
|
* Prefer shared cURL library instead of the static one.Ilya Zhuravlev2012-12-21
|
* Tweak CMake files for cURLsfan52012-12-18
|
* Added ability to fetch media from remote server (using cURL library)Ilya Zhuravlev2012-12-16
|
* Add OGG_INCLUDE_DIR to SOUND_INCLUDE_DIRSPerttu Ahola2012-03-25
|
* celeron55's sound system initial frameworkPerttu Ahola2012-03-24
|
* Flatten share/ and user/ in the source and for the RUN_IN_PLACE buildPerttu Ahola2012-03-20
|
* Gettext fix for *BSD - require special linkage as glibc is not usedq662011-08-11
|
* Locale dir should be parallel to global data dirGiuseppe Bilotta2011-07-24
|
* Bring po update out of cmake againGiuseppe Bilotta2011-07-24
| | | | | | | | | | | | | | This solves two issues at once: * CMake would delete po files during ‘make clean’ because it thought they were autogenerated and not just managed * the only gettext tools readily available in Windows are so old they don't support options like --package-name The change also moves minetest.pot down one level, so we don't need to special case ‘en’ anymore. The downside is of course that you need some sane POSIX shell to update the po files.
* updated cmakerules to autodetect if gettext can be usedConstantin Wenger2011-07-23
| | | fixed error if gettext is disabled
* updatepo cmake ruleGiuseppe Bilotta2011-07-22
| | | | | | | | | | Get rid of the system-specific updatelocales.sh and introduce an updatepo cmake rule. po files are also updated before creating the mo files, and we now keep the .pot file (in the po/en directory). To stabilize the po file creation, file contents are sorted by source filename. Update po files in the process.
* Refactor mo creation/installationGiuseppe Bilotta2011-07-22
|
* fixed not finding dll for gettext in MSVCConstantin Wenger2011-07-21
|
* Find correct library for MSVC vs MingW in WinowsGiuseppe Bilotta2011-07-21
|
* updated some path because the dlls are mostly under bin not libConstantin Wenger2011-07-21
| | | added explanation why libintl must not belinked under some oses
* Refactor and clean up gettext managementGiuseppe Bilotta2011-07-21
|
* Use system sqlite3/jthread libs if availableGiuseppe Bilotta2011-07-20
|
* Added libIrrlicht.dll.a to searched library names for non-MSVC windowsPerttu Ahola2011-05-17
|
>"(" .. CHAR_CLASSES.VARIABLE .. "+)" -- type .. CHAR_CLASSES.SPACE .. "*" .. ")") if not first_part then return "Invalid line" end if name:match("secure%.[.]*") and not allow_secure then return "Tried to add \"secure.\" setting" end if readable_name == "" then readable_name = nil end local remaining_line = line:sub(first_part:len() + 1) if setting_type == "int" then local default, min, max = remaining_line:match("^" -- first int is required, the last 2 are optional .. "(" .. CHAR_CLASSES.INTEGER .. "+)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.INTEGER .. "*)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.INTEGER .. "*)" .. "$") if not default or not tonumber(default) then return "Invalid integer setting" end min = tonumber(min) max = tonumber(max) table.insert(settings, { name = name, readable_name = readable_name, type = "int", default = default, min = min, max = max, comment = current_comment, }) return end if setting_type == "string" or setting_type == "noise_params" or setting_type == "key" or setting_type == "v3f" then local default = remaining_line:match("^(.*)$") if not default then return "Invalid string setting" end if setting_type == "key" and not read_all then -- ignore key type if read_all is false return end table.insert(settings, { name = name, readable_name = readable_name, type = setting_type, default = default, comment = current_comment, }) return end if setting_type == "bool" then if remaining_line ~= "false" and remaining_line ~= "true" then return "Invalid boolean setting" end table.insert(settings, { name = name, readable_name = readable_name, type = "bool", default = remaining_line, comment = current_comment, }) return end if setting_type == "float" then local default, min, max = remaining_line:match("^" -- first float is required, the last 2 are optional .. "(" .. CHAR_CLASSES.FLOAT .. "+)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.FLOAT .. "*)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.FLOAT .. "*)" .."$") if not default or not tonumber(default) then return "Invalid float setting" end min = tonumber(min) max = tonumber(max) table.insert(settings, { name = name, readable_name = readable_name, type = "float", default = default, min = min, max = max, comment = current_comment, }) return end if setting_type == "enum" then local default, values = remaining_line:match("^" -- first value (default) may be empty (i.e. is optional) .. "(" .. CHAR_CLASSES.VARIABLE .. "*)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.FLAGS .. "+)" .. "$") if not default or values == "" then return "Invalid enum setting" end table.insert(settings, { name = name, readable_name = readable_name, type = "enum", default = default, values = values:split(",", true), comment = current_comment, }) return end if setting_type == "path" then local default = remaining_line:match("^(.*)$") if not default then return "Invalid path setting" end table.insert(settings, { name = name, readable_name = readable_name, type = "path", default = default, comment = current_comment, }) return end if setting_type == "flags" then local default, possible = remaining_line:match("^" -- first value (default) may be empty (i.e. is optional) -- this is implemented by making the last value optional, and -- swapping them around if it turns out empty. .. "(" .. CHAR_CLASSES.FLAGS .. "+)" .. CHAR_CLASSES.SPACE .. "*" .. "(" .. CHAR_CLASSES.FLAGS .. "*)" .. "$") if not default or not possible then return "Invalid flags setting" end if possible == "" then possible = default default = "" end table.insert(settings, { name = name, readable_name = readable_name, type = "flags", default = default, possible = possible, comment = current_comment, }) return end return "Invalid setting type \"" .. setting_type .. "\"" end local function parse_single_file(file, filepath, read_all, result, base_level, allow_secure) -- store this helper variable in the table so it's easier to pass to parse_setting_line() result.current_comment = "" local line = file:read("*line") while line do local error_msg = parse_setting_line(result, line, read_all, base_level, allow_secure) if error_msg then core.log("error", error_msg .. " in " .. filepath .. " \"" .. line .. "\"") end line = file:read("*line") end result.current_comment = nil end -- read_all: whether to ignore certain setting types for GUI or not -- parse_mods: whether to parse settingtypes.txt in mods and games local function parse_config_file(read_all, parse_mods) local builtin_path = core.get_builtin_path() .. DIR_DELIM .. FILENAME local file = io.open(builtin_path, "r") local settings = {} if not file then core.log("error", "Can't load " .. FILENAME) return settings end parse_single_file(file, builtin_path, read_all, settings, 0, true) file:close() if parse_mods then -- Parse games local games_category_initialized = false local index = 1 local game = gamemgr.get_game(index) while game do local path = game.path .. DIR_DELIM .. FILENAME local file = io.open(path, "r") if file then if not games_category_initialized then local translation = fgettext_ne("Games"), -- not used, but needed for xgettext table.insert(settings, { name = "Games", level = 0, type = "category", }) games_category_initialized = true end table.insert(settings, { name = game.name, level = 1, type = "category", }) parse_single_file(file, path, read_all, settings, 2, false) file:close() end index = index + 1 game = gamemgr.get_game(index) end -- Parse mods local mods_category_initialized = false local mods = {} get_mods(core.get_modpath(), mods) for _, mod in ipairs(mods) do local path = mod.path .. DIR_DELIM .. FILENAME local file = io.open(path, "r") if file then if not mods_category_initialized then local translation = fgettext_ne("Mods"), -- not used, but needed for xgettext table.insert(settings, { name = "Mods", level = 0, type = "category", }) mods_category_initialized = true end table.insert(settings, { name = mod.name, level = 1, type = "category", }) parse_single_file(file, path, read_all, settings, 2, false) file:close() end end end return settings end local function filter_settings(settings, searchstring) if not searchstring or searchstring == "" then return settings, -1 end -- Setup the keyword list local keywords = {} for word in searchstring:lower():gmatch("%S+") do table.insert(keywords, word) end local result = {} local category_stack = {} local current_level = 0 local best_setting = nil for _, entry in pairs(settings) do if entry.type == "category" then -- Remove all settingless categories while #category_stack > 0 and entry.level <= current_level do table.remove(category_stack, #category_stack) if #category_stack > 0 then current_level = category_stack[#category_stack].level else current_level = 0 end end -- Push category onto stack category_stack[#category_stack + 1] = entry current_level = entry.level else -- See if setting matches keywords local setting_score = 0 for k = 1, #keywords do local keyword = keywords[k] if string.find(entry.name:lower(), keyword, 1, true) then setting_score = setting_score + 1 end if entry.readable_name and string.find(fgettext(entry.readable_name):lower(), keyword, 1, true) then setting_score = setting_score + 1 end if entry.comment and string.find(fgettext_ne(entry.comment):lower(), keyword, 1, true) then setting_score = setting_score + 1 end end -- Add setting to results if match if setting_score > 0 then -- Add parent categories for _, category in pairs(category_stack) do result[#result + 1] = category end category_stack = {} -- Add setting result[#result + 1] = entry entry.score = setting_score if not best_setting or setting_score > result[best_setting].score then best_setting = #result end end end end return result, best_setting or -1 end local full_settings = parse_config_file(false, true) local search_string = "" local settings = full_settings local selected_setting = 1 local function get_current_value(setting) local value = core.settings:get(setting.name) if value == nil then value = setting.default end return value end local function create_change_setting_formspec(dialogdata) local setting = settings[selected_setting] local formspec = "size[10,5.2,true]" .. "button[5,4.5;2,1;btn_done;" .. fgettext("Save") .. "]" .. "button[3,4.5;2,1;btn_cancel;" .. fgettext("Cancel") .. "]" .. "tablecolumns[color;text]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "table[0,0;10,3;info;" if setting.readable_name then formspec = formspec .. "#FFFF00," .. fgettext(setting.readable_name) .. " (" .. core.formspec_escape(setting.name) .. ")," else formspec = formspec .. "#FFFF00," .. core.formspec_escape(setting.name) .. "," end formspec = formspec .. ",," local comment_text = "" if setting.comment == "" then comment_text = fgettext_ne("(No description of setting given)") else comment_text = fgettext_ne(setting.comment) end for _, comment_line in ipairs(comment_text:split("\n", true)) do formspec = formspec .. "," .. core.formspec_escape(comment_line) .. "," end if setting.type == "flags" then formspec = formspec .. ",," .. "," .. fgettext("Please enter a comma seperated list of flags.") .. "," .. "," .. fgettext("Possible values are: ") .. core.formspec_escape(setting.possible:gsub(",", ", ")) .. "," elseif setting.type == "noise_params" then formspec = formspec .. ",," .. "," .. fgettext("Format: <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistence>") .. "," .. "," .. fgettext("Optionally the lacunarity can be appended with a leading comma.") .. "," elseif setting.type == "v3f" then formspec = formspec .. ",," .. "," .. fgettext_ne("Format is 3 numbers separated by commas and inside brackets.") .. "," end formspec = formspec:sub(1, -2) -- remove trailing comma formspec = formspec .. ";1]" if setting.type == "bool" then local selected_index if core.is_yes(get_current_value(setting)) then selected_index = 2 else selected_index = 1 end formspec = formspec .. "dropdown[0.5,3.5;3,1;dd_setting_value;" .. fgettext("Disabled") .. "," .. fgettext("Enabled") .. ";" .. selected_index .. "]" elseif setting.type == "enum" then local selected_index = 0 formspec = formspec .. "dropdown[0.5,3.5;3,1;dd_setting_value;" for index, value in ipairs(setting.values) do -- translating value is not possible, since it's the value -- that we set the setting to formspec = formspec .. core.formspec_escape(value) .. "," if get_current_value(setting) == value then selected_index = index end end if #setting.values > 0 then formspec = formspec:sub(1, -2) -- remove trailing comma end formspec = formspec .. ";" .. selected_index .. "]" elseif setting.type == "path" then local current_value = dialogdata.selected_path if not current_value then current_value = get_current_value(setting) end formspec = formspec .. "field[0.5,4;7.5,1;te_setting_value;;" .. core.formspec_escape(current_value) .. "]" .. "button[8,3.75;2,1;btn_browser_path;" .. fgettext("Browse") .. "]" else -- TODO: fancy input for float, int, flags, noise_params, v3f local width = 10 local text = get_current_value(setting) if dialogdata.error_message then formspec = formspec .. "tablecolumns[color;text]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "table[5,3.9;5,0.6;error_message;#FF0000," .. core.formspec_escape(dialogdata.error_message) .. ";0]" width = 5 if dialogdata.entered_text then text = dialogdata.entered_text end end formspec = formspec .. "field[0.5,4;" .. width .. ",1;te_setting_value;;" .. core.formspec_escape(text) .. "]" end return formspec end local function handle_change_setting_buttons(this, fields) if fields["btn_done"] or fields["key_enter"] then local setting = settings[selected_setting] if setting.type == "bool" then local new_value = fields["dd_setting_value"] -- Note: new_value is the actual (translated) value shown in the dropdown core.settings:set_bool(setting.name, new_value == fgettext("Enabled")) elseif setting.type == "enum" then local new_value = fields["dd_setting_value"] core.settings:set(setting.name, new_value) elseif setting.type == "int" then local new_value = tonumber(fields["te_setting_value"]) if not new_value or math.floor(new_value) ~= new_value then this.data.error_message = fgettext_ne("Please enter a valid integer.") this.data.entered_text = fields["te_setting_value"] core.update_formspec(this:get_formspec()) return true end if setting.min and new_value < setting.min then this.data.error_message = fgettext_ne("The value must be at least $1.", setting.min) this.data.entered_text = fields["te_setting_value"] core.update_formspec(this:get_formspec()) return true end if setting.max and new_value > setting.max then this.data.error_message = fgettext_ne("The value must not be larger than $1.", setting.max) this.data.entered_text = fields["te_setting_value"] core.update_formspec(this:get_formspec()) return true end core.settings:set(setting.name, new_value) elseif setting.type == "float" then local new_value = tonumber(fields["te_setting_value"]) if not new_value then this.data.error_message = fgettext_ne("Please enter a valid number.") this.data.entered_text = fields["te_setting_value"] core.update_formspec(this:get_formspec()) return true end core.settings:set(setting.name, new_value) elseif setting.type == "flags" then local new_value = fields["te_setting_value"] for _,value in ipairs(new_value:split(",", true)) do value = value:trim() local possible = "," .. setting.possible .. "," if not possible:find("," .. value .. ",", 0, true) then this.data.error_message = fgettext_ne("\"$1\" is not a valid flag.", value) this.data.entered_text = fields["te_setting_value"] core.update_formspec(this:get_formspec()) return true end end core.settings:set(setting.name, new_value) else local new_value = fields["te_setting_value"] core.settings:set(setting.name, new_value) end core.settings:write() this:delete() return true end if fields["btn_cancel"] then this:delete() return true end if fields["btn_browser_path"] then core.show_file_open_dialog("dlg_browse_path", fgettext_ne("Select path")) end if fields["dlg_browse_path_accepted"] then this.data.selected_path = fields["dlg_browse_path_accepted"] core.update_formspec(this:get_formspec()) end return false end local function create_settings_formspec(tabview, name, tabdata) local formspec = "size[12,6.5;true]" .. "tablecolumns[color;tree;text,width=32;text]" .. "tableoptions[background=#00000000;border=false]" .. "field[0.3,0.1;10.2,1;search_string;;" .. core.formspec_escape(search_string) .. "]" .. "field_close_on_enter[search_string;false]" .. "button[10.2,-0.2;2,1;search;" .. fgettext("Search") .. "]" .. "table[0,0.8;12,4.5;list_settings;" local current_level = 0 for _, entry in ipairs(settings) do local name if not core.settings:get_bool("main_menu_technical_settings") and entry.readable_name then name = fgettext_ne(entry.readable_name) else name = entry.name end if entry.type == "category" then current_level = entry.level formspec = formspec .. "#FFFF00," .. current_level .. "," .. fgettext(name) .. ",," elseif entry.type == "bool" then local value = get_current_value(entry) if core.is_yes(value) then value = fgettext("Enabled") else value = fgettext("Disabled") end formspec = formspec .. "," .. (current_level + 1) .. "," .. core.formspec_escape(name) .. "," .. value .. "," elseif entry.type == "key" then -- ignore key settings, since we have a special dialog for them else formspec = formspec .. "," .. (current_level + 1) .. "," .. core.formspec_escape(name) .. "," .. core.formspec_escape(get_current_value(entry)) .. "," end end if #settings > 0 then formspec = formspec:sub(1, -2) -- remove trailing comma end formspec = formspec .. ";" .. selected_setting .. "]" .. "button[0,6;4,1;btn_back;".. fgettext("< Back to Settings page") .. "]" .. "button[10,6;2,1;btn_edit;" .. fgettext("Edit") .. "]" .. "button[7,6;3,1;btn_restore;" .. fgettext("Restore Default") .. "]" .. "checkbox[0,5.3;cb_tech_settings;" .. fgettext("Show technical names") .. ";" .. dump(core.settings:get_bool("main_menu_technical_settings")) .. "]" return formspec end local function handle_settings_buttons(this, fields, tabname, tabdata) local list_enter = false if fields["list_settings"] then selected_setting = core.get_table_index("list_settings") if core.explode_table_event(fields["list_settings"]).type == "DCL" then -- Directly toggle booleans local setting = settings[selected_setting] if setting and setting.type == "bool" then local current_value = get_current_value(setting) core.settings:set_bool(setting.name, not core.is_yes(current_value)) core.settings:write() return true else list_enter = true end else return true end end if fields.search or fields.key_enter_field == "search_string" then if search_string == fields.search_string then if selected_setting > 0 then -- Go to next result on enter press local i = selected_setting + 1 local looped = false while i > #settings or settings[i].type == "category" do i = i + 1 if i > #settings then -- Stop infinte looping if looped then return false end i = 1 looped = true end end selected_setting = i core.update_formspec(this:get_formspec()) return true end else -- Search for setting search_string = fields.search_string settings, selected_setting = filter_settings(full_settings, search_string) core.update_formspec(this:get_formspec()) end return true end if fields["btn_edit"] or list_enter then local setting = settings[selected_setting] if setting and setting.type ~= "category" then local edit_dialog = dialog_create("change_setting", create_change_setting_formspec, handle_change_setting_buttons) edit_dialog:set_parent(this) this:hide() edit_dialog:show() end return true end if fields["btn_restore"] then local setting = settings[selected_setting] if setting and setting.type ~= "category" then core.settings:set(setting.name, setting.default) core.settings:write() core.update_formspec(this:get_formspec()) end return true end if fields["btn_back"] then this:delete() return true end if fields["cb_tech_settings"] then core.settings:set("main_menu_technical_settings", fields["cb_tech_settings"]) core.settings:write() core.update_formspec(this:get_formspec()) return true end return false end function create_adv_settings_dlg() local dlg = dialog_create("settings_advanced", create_settings_formspec, handle_settings_buttons, nil) return dlg end -- Generate minetest.conf.example and settings_translation_file.cpp --assert(loadfile(core.get_builtin_path()..DIR_DELIM.."mainmenu"..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))