Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loadSettings()
- defaultSettings()
- success, value = pcall(love.filesystem.read, "save.txt")
- netsucc, value = pcall(love.filesystem.read, "coop.txt")
- if netsucc then
- local netData = love.filesystem.read("coop.txt")
- if not netData then
- return
- end
- local keys = netData:split(";")
- for x = 1, #keys do
- local keyPairs = keys[x]:split(":")
- if keyPairs[1] and keyPairs[2] then
- table.insert(serverList, {keyPairs[1], keyPairs[2], tonumber(keyPairs[3])})
- end
- end
- end
- local saveData
- if success then
- saveData = love.filesystem.read("save.txt")
- if not saveData then
- return
- end
- local keys = saveData:split(";")
- for x = 1, #keys do
- local keyPairs = keys[x]:split(":")
- local index, value = keyPairs[1], keyPairs[2]
- if index == "shoot" then
- controls[index] = value
- elseif index == "ability" then
- controls[index] = value
- elseif index == "left" then
- controls[index] = value
- elseif index == "right" then
- controls[index] = value
- elseif index == "dpad" then
- useDirectionalPad(util.toBoolean(value))
- elseif index == "achievement" then
- achievements[tonumber(value)]:unlock()
- elseif index == "highscore" then
- local split = value:split("~")
- highscores[tonumber(split[1])] = {split[2], split[3], tonumber(split[4])}
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement