aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-05-05 13:47:11 +0200
committerGitHub <noreply@github.com>2017-05-05 13:47:11 +0200
commit21e0a049f81eb0d34adaf45646b11569eeadec52 (patch)
tree735f6b234d0e3baa53b6d0fea1187dd3f06a2119 /builtin
parentd6cf5450a897b00e5ed0d053f14108c94dfb3701 (diff)
downloadminetest-21e0a049f81eb0d34adaf45646b11569eeadec52.tar.gz
minetest-21e0a049f81eb0d34adaf45646b11569eeadec52.tar.bz2
minetest-21e0a049f81eb0d34adaf45646b11569eeadec52.zip
Save minetest screen width/height options when modified (#5683)
* Save minetest screen width/height options when modified * Add autosave_screensize setting (default true) * Fix @SmallJoker comments
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/tab_settings.lua9
-rw-r--r--builtin/settingtypes.txt3
2 files changed, 11 insertions, 1 deletions
diff --git a/builtin/mainmenu/tab_settings.lua b/builtin/mainmenu/tab_settings.lua
index e59572a41..8a97d8334 100644
--- a/builtin/mainmenu/tab_settings.lua
+++ b/builtin/mainmenu/tab_settings.lua
@@ -190,7 +190,7 @@ local function formspec(tabview, name, tabdata)
.. getSettingIndex.NodeHighlighting() .. "]" ..
"dropdown[0.25,3.6;3.3;dd_leaves_style;" .. dd_options.leaves[1] .. ";"
.. getSettingIndex.Leaves() .. "]" ..
- "box[3.75,0;3.75,3.45;#999999]" ..
+ "box[3.75,0;3.75,4.45;#999999]" ..
"label[3.85,0.1;" .. fgettext("Texturing:") .. "]" ..
"dropdown[3.85,0.55;3.85;dd_filters;" .. dd_options.filters[1] .. ";"
.. getSettingIndex.Filter() .. "]" ..
@@ -199,6 +199,9 @@ local function formspec(tabview, name, tabdata)
"label[3.85,2.15;" .. fgettext("Antialiasing:") .. "]" ..
"dropdown[3.85,2.6;3.85;dd_antialiasing;" .. dd_options.antialiasing[1] .. ";"
.. getSettingIndex.Antialiasing() .. "]" ..
+ "label[3.85,3.45;" .. fgettext("Screen:") .. "]" ..
+ "checkbox[3.85,3.6;cb_autosave_screensize;" .. fgettext("Autosave screen size") .. ";"
+ .. dump(core.setting_getbool("autosave_screensize")) .. "]" ..
"box[7.75,0;4,4.4;#999999]" ..
"checkbox[8,0;cb_shaders;" .. fgettext("Shaders") .. ";"
.. dump(core.setting_getbool("enable_shaders")) .. "]"
@@ -290,6 +293,10 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
core.setting_set("connected_glass", fields["cb_connected_glass"])
return true
end
+ if fields["cb_autosave_screensize"] then
+ core.setting_set("autosave_screensize", fields["cb_autosave_screensize"])
+ return true
+ end
if fields["cb_shaders"] then
if (core.setting_get("video_driver") == "direct3d8" or
core.setting_get("video_driver") == "direct3d9") then
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt
index 29a96ab8e..4b82a1e0e 100644
--- a/builtin/settingtypes.txt
+++ b/builtin/settingtypes.txt
@@ -459,6 +459,9 @@ screenW (Screen width) int 800
# Height component of the initial window size.
screenH (Screen height) int 600
+# Save window size automatically when modified.
+autosave_screensize (Autosave Screen Size) bool true
+
# Fullscreen mode.
fullscreen (Full screen) bool false