@@ -116,21 +116,50 @@ local function formspec(tabview, name, tabdata)
116116 local current_video_driver_idx = 0
117117 local current_video_driver = core .setting_get (" video_driver" )
118118 for i = 1 , # video_drivers , 1 do
119-
119+
120120 if i ~= 1 then
121121 video_driver_string = video_driver_string .. " ,"
122122 end
123123 video_driver_string = video_driver_string .. video_drivers [i ]
124-
124+
125125 local video_driver = string.gsub (video_drivers [i ], " " , " " )
126126 if current_video_driver :lower () == video_driver :lower () then
127127 current_video_driver_idx = i
128128 end
129129 end
130-
131-
130+
131+ local filters = {
132+ {" No Filter,Bilinear Filter,Trilinear Filter" },
133+ {" " , " bilinear_filter" , " trilinear_filter" },
134+ }
135+
136+ local mipmap = {
137+ {" No Mipmap,Mipmap,Mipmap + Aniso. Filter" },
138+ {" " , " mip_map" , " anisotropic_filter" },
139+ }
140+
141+ local function getFilterSettingIndex ()
142+ if (core .setting_get (filters [2 ][3 ]) == " true" ) then
143+ return 3
144+ end
145+ if (core .setting_get (filters [2 ][3 ]) == " false" and core .setting_get (filters [2 ][2 ]) == " true" ) then
146+ return 2
147+ end
148+ return 1
149+ end
150+
151+ local function getMipmapSettingIndex ()
152+ if (core .setting_get (mipmap [2 ][3 ]) == " true" ) then
153+ return 3
154+ end
155+ if (core .setting_get (mipmap [2 ][3 ]) == " false" and core .setting_get (mipmap [2 ][2 ]) == " true" ) then
156+ return 2
157+ end
158+ return 1
159+ end
160+
132161 local tab_string =
133- " box[0,0;3.5,4 ;#999999]" ..
162+ " box[0,0;3.5,3.9 ;#999999]" ..
134163 " checkbox[0.25,0;cb_smooth_lighting;" .. fgettext (" Smooth Lighting" )
135164 .. " ;" .. dump (core .setting_getbool (" smooth_lighting" )) .. " ]" ..
136165 " checkbox[0.25,0.5;cb_particles;" .. fgettext (" Enable Particles" ) .. " ;"
@@ -143,22 +172,23 @@ local function formspec(tabview, name, tabdata)
143172 .. dump (core .setting_getbool (" opaque_water" )) .. " ]" ..
144173 " checkbox[0.25,2.5;cb_connected_glass;" .. fgettext (" Connected Glass" ) .. " ;"
145174 .. dump (core .setting_getbool (" connected_glass" )) .. " ]" ..
146- " dropdown[0.25,3.25;3.25;dd_video_driver;"
147- .. video_driver_string .. " ;" .. current_video_driver_idx .. " ]" ..
175+ " checkbox[0.25,3.0;cb_node_highlighting;" .. fgettext (" Node Highlighting" ) .. " ;"
176+ .. dump (core .setting_getbool (" enable_node_highlighting" )) .. " ]" ..
177+ " box[3.75,0;3.75,3.45;#999999]" ..
178+ " label[3.85,0.1;" .. fgettext (" Texturing:" ) .. " ]" ..
179+ " dropdown[3.85,0.55;3.85;dd_filters;" .. filters [1 ][1 ] .. " ;"
180+ .. getFilterSettingIndex () .. " ]" ..
181+ " dropdown[3.85,1.35;3.85;dd_mipmap;" .. mipmap [1 ][1 ] .. " ;"
182+ .. getMipmapSettingIndex () .. " ]" ..
183+ " label[3.85,2.15;" .. fgettext (" Rendering:" ) .. " ]" ..
184+ " dropdown[3.85,2.6;3.85;dd_video_driver;"
185+ .. video_driver_string .. " ;" .. current_video_driver_idx .. " ]" ..
148186 " tooltip[dd_video_driver;" ..
149- fgettext (" Restart minetest for driver change to take effect" ) .. " ]" ..
150- " box[3.75,0;3.75,2.5;#999999]" ..
151- " checkbox[4,0;cb_mipmapping;" .. fgettext (" Mip-Mapping" ) .. " ;"
152- .. dump (core .setting_getbool (" mip_map" )) .. " ]" ..
153- " checkbox[4,0.5;cb_anisotrophic;" .. fgettext (" Anisotropic Filtering" ) .. " ;"
154- .. dump (core .setting_getbool (" anisotropic_filter" )) .. " ]" ..
155- " checkbox[4,1.0;cb_bilinear;" .. fgettext (" Bi-Linear Filtering" ) .. " ;"
156- .. dump (core .setting_getbool (" bilinear_filter" )) .. " ]" ..
157- " checkbox[4,1.5;cb_trilinear;" .. fgettext (" Tri-Linear Filtering" ) .. " ;"
158- .. dump (core .setting_getbool (" trilinear_filter" )) .. " ]" ..
187+ fgettext (" Restart minetest for driver change to take effect" ) .. " ]" ..
159188 " box[7.75,0;4,4;#999999]" ..
160189 " checkbox[8,0;cb_shaders;" .. fgettext (" Shaders" ) .. " ;"
161190 .. dump (core .setting_getbool (" enable_shaders" )) .. " ]"
191+
162192 if PLATFORM ~= " Android" then
163193 tab_string = tab_string ..
164194 " button[8,4.75;3.75,0.5;btn_change_keys;" .. fgettext (" Change keys" ) .. " ]"
@@ -167,7 +197,7 @@ local function formspec(tabview, name, tabdata)
167197 " button[8,4.75;3.75,0.5;btn_reset_singleplayer;" .. fgettext (" Reset singleplayer world" ) .. " ]"
168198 end
169199 tab_string = tab_string ..
170- " box[0,4.25;3.5,1.25 ;#999999]" ..
200+ " box[0,4.25;3.5,1.1 ;#999999]" ..
171201 " label[0.25,4.25;" .. fgettext (" GUI scale factor" ) .. " ]" ..
172202 " scrollbar[0.25,4.75;3,0.4;sb_gui_scaling;horizontal;" ..
173203 gui_scale_to_scrollbar () .. " ]" ..
@@ -177,15 +207,15 @@ local function formspec(tabview, name, tabdata)
177207
178208 if PLATFORM == " Android" then
179209 tab_string = tab_string ..
180- " box[4.25,2.75 ;3.25,2.15 ;#999999]" ..
181- " checkbox[4.5,2.75 ;cb_touchscreen_target;" .. fgettext (" Touch free target" ) .. " ;"
210+ " box[3.75,3.55 ;3.75,1.8 ;#999999]" ..
211+ " checkbox[3.9,3.45 ;cb_touchscreen_target;" .. fgettext (" Touch free target" ) .. " ;"
182212 .. dump (core .setting_getbool (" touchtarget" )) .. " ]"
183213 end
184214
185215 if core .setting_get (" touchscreen_threshold" ) ~= nil then
186216 tab_string = tab_string ..
187- " label[4.5,3.5 ;" .. fgettext (" Touchthreshold (px)" ) .. " ]" ..
188- " dropdown[4.5,4;3 ;dd_touchthreshold;0,10,20,30,40,50;" ..
217+ " label[4.3,4.1 ;" .. fgettext (" Touchthreshold (px)" ) .. " ]" ..
218+ " dropdown[3.85,4.55;3.85 ;dd_touchthreshold;0,10,20,30,40,50;" ..
189219 ((tonumber (core .setting_get (" touchscreen_threshold" ))/ 10 )+ 1 ) .. " ]"
190220 end
191221
@@ -233,22 +263,6 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
233263 core .setting_set (" opaque_water" , fields [" cb_opaque_water" ])
234264 return true
235265 end
236- if fields [" cb_mipmapping" ] then
237- core .setting_set (" mip_map" , fields [" cb_mipmapping" ])
238- return true
239- end
240- if fields [" cb_anisotrophic" ] then
241- core .setting_set (" anisotropic_filter" , fields [" cb_anisotrophic" ])
242- return true
243- end
244- if fields [" cb_bilinear" ] then
245- core .setting_set (" bilinear_filter" , fields [" cb_bilinear" ])
246- return true
247- end
248- if fields [" cb_trilinear" ] then
249- core .setting_set (" trilinear_filter" , fields [" cb_trilinear" ])
250- return true
251- end
252266 if fields [" cb_shaders" ] then
253267 if (core .setting_get (" video_driver" ) == " direct3d8" or core .setting_get (" video_driver" ) == " direct3d9" ) then
254268 core .setting_set (" enable_shaders" , " false" )
@@ -262,6 +276,10 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
262276 core .setting_set (" connected_glass" , fields [" cb_connected_glass" ])
263277 return true
264278 end
279+ if fields [" cb_node_highlighting" ] then
280+ core .setting_set (" enable_node_highlighting" , fields [" cb_node_highlighting" ])
281+ return true
282+ end
265283 if fields [" cb_particles" ] then
266284 core .setting_set (" enable_particles" , fields [" cb_particles" ])
267285 return true
@@ -312,6 +330,7 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
312330
313331 -- Note dropdowns have to be handled LAST!
314332 local ddhandled = false
333+
315334 if fields [" dd_touchthreshold" ] then
316335 core .setting_set (" touchscreen_threshold" ,fields [" dd_touchthreshold" ])
317336 ddhandled = true
@@ -321,7 +340,31 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
321340 core .setting_set (" video_driver" ,string.lower (video_driver ))
322341 ddhandled = true
323342 end
324-
343+ if fields [" dd_filters" ] == " No Filter" then
344+ core .setting_set (" bilinear_filter" , " false" )
345+ core .setting_set (" trilinear_filter" , " false" )
346+ end
347+ if fields [" dd_filters" ] == " Bilinear Filter" then
348+ core .setting_set (" bilinear_filter" , " true" )
349+ core .setting_set (" trilinear_filter" , " false" )
350+ end
351+ if fields [" dd_filters" ] == " Trilinear Filter" then
352+ core .setting_set (" bilinear_filter" , " false" )
353+ core .setting_set (" trilinear_filter" , " true" )
354+ end
355+ if fields [" dd_mipmap" ] == " No Mipmap" then
356+ core .setting_set (" mip_map" , " false" )
357+ core .setting_set (" anisotropic_filter" , " false" )
358+ end
359+ if fields [" dd_mipmap" ] == " Mipmap" then
360+ core .setting_set (" mip_map" , " true" )
361+ core .setting_set (" anisotropic_filter" , " false" )
362+ end
363+ if fields [" dd_mipmap" ] == " Mipmap + Aniso. Filter" then
364+ core .setting_set (" mip_map" , " true" )
365+ core .setting_set (" anisotropic_filter" , " true" )
366+ end
367+
325368 return ddhandled
326369end
327370
0 commit comments