Created
February 22, 2017 11:46
-
-
Save Jordach/85ccd50a9a472a1accc8cd69f3f3bd97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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