Skip to content

Commit ffd0ef1

Browse files
kilbithest31
authored andcommittedJul 25, 2015
Fix FSAA dropdown option reset after changing another dropdown option
1 parent fa1096e commit ffd0ef1

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed
 

Diff for: ‎builtin/mainmenu/tab_settings.lua

+15-13
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ local dd_antialiasing_labels = {
6868
}
6969

7070
local antialiasing = {
71-
{dd_antialiasing_labels[1]..","..dd_antialiasing_labels[2]..","..
72-
dd_antialiasing_labels[3]..","..dd_antialiasing_labels[4]},
73-
{"0", "2", "4", "8"}
71+
{dd_antialiasing_labels[1]..","..dd_antialiasing_labels[2]..","..
72+
dd_antialiasing_labels[3]..","..dd_antialiasing_labels[4]},
73+
{"0", "2", "4", "8"}
7474
}
7575

7676
local function getFilterSettingIndex()
@@ -95,7 +95,7 @@ end
9595

9696
local function getAntialiasingSettingIndex()
9797
local antialiasing_setting = core.setting_get("fsaa")
98-
for i=1, #(antialiasing[2]) do
98+
for i = 1, #(antialiasing[2]) do
9999
if antialiasing_setting == antialiasing[2][i] then
100100
return i
101101
end
@@ -104,13 +104,12 @@ local function getAntialiasingSettingIndex()
104104
end
105105

106106
local function antialiasing_fname_to_name(fname)
107-
for i=1, #(dd_antialiasing_labels) do
108-
if fname == dd_antialiasing_labels[i] then
109-
return antialiasing[2][i]
110-
end
111-
end
112-
113-
return "0"
107+
for i = 1, #(dd_antialiasing_labels) do
108+
if fname == dd_antialiasing_labels[i] then
109+
return antialiasing[2][i]
110+
end
111+
end
112+
return 0
114113
end
115114

116115
local function dlg_confirm_reset_formspec(data)
@@ -418,8 +417,11 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
418417
core.setting_set("anisotropic_filter", "true")
419418
ddhandled = true
420419
end
421-
core.setting_set("fsaa",
422-
antialiasing_fname_to_name(fields["dd_antialiasing"]))
420+
if fields["dd_antialiasing"] then
421+
core.setting_set("fsaa",
422+
antialiasing_fname_to_name(fields["dd_antialiasing"]))
423+
ddhandled = true
424+
end
423425

424426
return ddhandled
425427
end

0 commit comments

Comments
 (0)