@@ -110,6 +110,24 @@ local function scrollbar_to_gui_scale(value)
110
110
end
111
111
112
112
local function formspec (tabview , name , tabdata )
113
+ local video_drivers = core .get_video_drivers ()
114
+
115
+ local video_driver_string = " "
116
+ local current_video_driver_idx = 0
117
+ local current_video_driver = core .setting_get (" video_driver" )
118
+ for i = 1 , # video_drivers , 1 do
119
+
120
+ if i ~= 1 then
121
+ video_driver_string = video_driver_string .. " ,"
122
+ end
123
+ video_driver_string = video_driver_string .. video_drivers [i ]
124
+
125
+ if current_video_driver :lower () == video_drivers [i ]:lower () then
126
+ current_video_driver_idx = i
127
+ end
128
+ end
129
+
130
+
113
131
local tab_string =
114
132
" vertlabel[0,-0.25;" .. fgettext (" SETTINGS" ) .. " ]" ..
115
133
" box[0.75,0;3.25,4;#999999]" ..
@@ -125,6 +143,10 @@ local function formspec(tabview, name, tabdata)
125
143
.. dump (core .setting_getbool (" preload_item_visuals" )) .. " ]" ..
126
144
" checkbox[1,2.5;cb_particles;" .. fgettext (" Enable Particles" ) .. " ;"
127
145
.. dump (core .setting_getbool (" enable_particles" )) .. " ]" ..
146
+ " dropdown[1,3.25;3;dd_video_driver;"
147
+ .. video_driver_string .. " ;" .. current_video_driver_idx .. " ]" ..
148
+ " tooltip[dd_video_driver;" ..
149
+ fgettext (" Restart minetest for driver change to take effect" ) .. " ]" ..
128
150
" box[4.25,0;3.25,2.5;#999999]" ..
129
151
" checkbox[4.5,0;cb_mipmapping;" .. fgettext (" Mip-Mapping" ) .. " ;"
130
152
.. dump (core .setting_getbool (" mip_map" )) .. " ]" ..
@@ -284,16 +306,20 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
284
306
return true
285
307
end
286
308
if fields [" btn_reset_singleplayer" ] then
287
- print (" sp reset" )
288
309
showconfirm_reset (this )
289
310
return true
290
311
end
312
+
291
313
-- Note dropdowns have to be handled LAST!
292
314
local ddhandled = false
293
315
if fields [" dd_touchthreshold" ] then
294
316
core .setting_set (" touchscreen_threshold" ,fields [" dd_touchthreshold" ])
295
317
ddhandled = true
296
318
end
319
+ if fields [" dd_video_driver" ] then
320
+ core .setting_set (" video_driver" ,fields [" dd_video_driver" ])
321
+ ddhandled = true
322
+ end
297
323
298
324
return ddhandled
299
325
end
0 commit comments