1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Settings menu improvements regarding default values (#13489)

The reset button now removes the setting from minetest.conf instead of setting it to its default value.
The reset button is now shown whenever a value is present in minetest.conf
Float settings now get a .0 suffix if they have no decimal places.
This commit is contained in:
Gregor Parzefall 2023-05-18 20:32:26 +02:00 committed by GitHub
parent 5ba70cf5ef
commit f393214fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 50 additions and 18 deletions

View file

@ -7898,6 +7898,12 @@ It can be created via `Settings(filename)`.
* Also, see documentation for set() above.
* `remove(key)`: returns a boolean (`true` for success)
* `get_names()`: returns `{key1,...}`
* `has(key)`:
* Returns a boolean indicating whether `key` exists.
* Note that for the main settings object (`minetest.settings`), `get(key)`
might return a value even if `has(key)` returns `false`. That's because
`get` can fall back to the so-called parent of the `Settings` object, i.e.
the default values.
* `write()`: returns a boolean (`true` for success)
* Writes changes to file.
* `to_table()`: returns `{[key1]=value1,...}`