Skip to content

Instantly share code, notes, and snippets.

@Jordach
Created February 22, 2017 11:46
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 Jordach/85ccd50a9a472a1accc8cd69f3f3bd97 to your computer and use it in GitHub Desktop.
Save Jordach/85ccd50a9a472a1accc8cd69f3f3bd97 to your computer and use it in GitHub Desktop.
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