Fix wrong video_driver setting when changing in mainmenu
authorSmallJoker <st.rentsch@hotmail.com>
Thu, 4 Sep 2014 18:34:36 +0000 (20:34 +0200)
committerBlockMen <nmuelll@web.de>
Sun, 21 Sep 2014 14:27:58 +0000 (16:27 +0200)
Fixes issue with direct3d(8|9)

builtin/mainmenu/tab_settings.lua

index 4bb3eb36c253d0e7e3f916d70577cb83b33b06d9..d97dd0051221d99953eed120b644f44691a24f94 100644 (file)
@@ -122,7 +122,8 @@ local function formspec(tabview, name, tabdata)
                end
                video_driver_string = video_driver_string .. video_drivers[i]
                
-               if current_video_driver:lower() == video_drivers[i]:lower() then
+               local video_driver = string.gsub(video_drivers[i], " ", "")
+               if current_video_driver:lower() == video_driver:lower() then
                        current_video_driver_idx = i
                end
        end
@@ -317,7 +318,8 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
                ddhandled = true
        end
        if fields["dd_video_driver"] then
-               core.setting_set("video_driver",fields["dd_video_driver"])
+               local video_driver = string.gsub(fields["dd_video_driver"], " ", "")
+               core.setting_set("video_driver",string.lower(video_driver))
                ddhandled = true
        end