Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function wardrobe.is_save_hex(textfield)
if string.match(textfield, "^[0-9a-fA-F]+$") and #textfield == 6 then
return textfield
else
return "ffffff"
end
end
function wardrobe.load_user_data()
-- load non-RGB choices
local input = io.open(wardrobe.texture_save_data, "r")
if input then
repeat
local value = {}
for i = 1, 22 do
value[i] = input:read("*n")
if value = nil then
break
end
end
local user = input:read("*l")
wardrobe.formspec_selections[user:sub(2)] = value
until input:read(0) == nil
io.close(input)
-- load RGB
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment