fixed potential bug with Choices not being strings

This commit is contained in:
Mark Cannon
2010-12-27 21:05:32 -05:00
parent 114e28a1d3
commit efe31cfd63
@@ -3,6 +3,7 @@ ThemePrefsRows: you give it the choices, values, and params, and it'll
generate the rest; quirky behavior to be outlined below. Documentation
will be provided once this system is stabilized.
v0.6: Dec. 27, 2010. Fix Choices not necessarily being strings.
v0.5: Dec. 15, 2010. Initial version. Not very well tested.
--]]
@@ -65,6 +66,11 @@ local function CreateThemePrefRow( pref, tbl )
local Values = tbl.Values and tbl.Values or Choices
local Params = tbl.Params and tbl.Params or { }
-- if the choices aren't strings, make them strings now
for i, str in ipairs(Choices) do
Choices[i] = tostring( Chances[i] )
end
-- set the name and choices here; we'll do the rest below
local Handler = { Name = pref, Choices = Choices }