Refactor AL_value_to_string -> AL_property_to_string
parent
1cf51640cb
commit
c4cc6d2c1b
|
@ -167,7 +167,7 @@ function get_properties_formspec(p_name, mod, arena, sel_idx)
|
|||
|
||||
-- ottengo una stringa con tutte le proprietà
|
||||
for property, v in pairs(mod_ref.properties) do
|
||||
properties = properties .. property .. " = " .. FS(AL_value_to_string(arena[property])) .. ","
|
||||
properties = properties .. property .. " = " .. FS(AL_property_to_string(arena[property])) .. ","
|
||||
properties_by_idx[i] = property
|
||||
i = i + 1
|
||||
end
|
||||
|
@ -181,7 +181,7 @@ function get_properties_formspec(p_name, mod, arena, sel_idx)
|
|||
|
||||
-- e assegno il valore
|
||||
sel_property_attr[p_name] = {id = sel_idx, name = sel_property}
|
||||
sel_property_value = FS(AL_value_to_string(arena[sel_property]))
|
||||
sel_property_value = FS(AL_property_to_string(arena[sel_property]))
|
||||
|
||||
properties = properties:sub(1,-2)
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ function get_settings_formspec(p_name, sel_idx)
|
|||
|
||||
-- ottengo una stringa con tutte le impostazioni
|
||||
for setting, v in pairs(mod_ref.settings) do
|
||||
settings = settings .. setting .. " = " .. FS(AL_value_to_string(mod_ref.settings[setting])) .. ","
|
||||
settings = settings .. setting .. " = " .. FS(AL_property_to_string(mod_ref.settings[setting])) .. ","
|
||||
settings_by_idx[i] = setting
|
||||
i = i + 1
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ function get_settings_formspec(p_name, sel_idx)
|
|||
|
||||
-- e assegno il valore
|
||||
sel_setting_attr[p_name] = {id = sel_idx, name = sel_setting}
|
||||
sel_setting_value = FS(AL_value_to_string(mod_ref.settings[sel_setting]))
|
||||
sel_setting_value = FS(AL_property_to_string(mod_ref.settings[sel_setting]))
|
||||
|
||||
settings = settings:sub(1,-2)
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ end
|
|||
|
||||
|
||||
|
||||
function AL_value_to_string(value)
|
||||
function AL_property_to_string(property)
|
||||
|
||||
if type(value) == "string" then
|
||||
return "\"" .. value .. "\""
|
||||
elseif type(value) == "table" then
|
||||
return tostring(dump(value)):gsub("\n", "")
|
||||
if type(property) == "string" then
|
||||
return "\"" .. property .. "\""
|
||||
elseif type(property) == "table" then
|
||||
return tostring(dump(property)):gsub("\n", "")
|
||||
else
|
||||
return tostring(value)
|
||||
return tostring(property)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue