Skip to content

Instantly share code, notes, and snippets.

@sapier
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapier/caeb84741dcc7314fb6f to your computer and use it in GitHub Desktop.
Save sapier/caeb84741dcc7314fb6f to your computer and use it in GitHub Desktop.
local filters = {
{"No Filter", ""},
{"Bilinear Filter", "bilinear_filter"},
{"Trilinear Filter", "trilinear_filter"},
}
<snip>
function getFilterSettingIndex()
for i in ipairs(filters) do
print("I==" .. i)
if i > 1 then -- no filter is default
print("checking for: " .. filters[i][2])
if core.setting_getbool(filters[i][2]) then
print(" returning index: " .. i)
return i
end
end
end
print("no setting found, defaulting to 1")
return 1
end
<snip>
tab_string = tab_string ..
"dropdown[3.86,0.2;3.75;dd_filters;" .. filters[1][1] .. "," .. filters[2][1] .. "," .. filters[3][1]
.. ";" .. getFilterSettingIndex() .. "]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment