class_name INI static func Load(file: String): var sections = Dictionary() var fileHandle = FileAccess.open(file, FileAccess.READ) var fileContent = fileHandle.get_as_text().replace("\r\n", "\n").split("\n") fileHandle.close() var currentSection: Dictionary = sections.get_or_add("loose", Dictionary()) for line in fileContent: if line.strip_edges().strip_escapes() == "" or line.begins_with(";"): continue if line.begins_with("[") and line.ends_with("]"): currentSection = sections.get_or_add(line.substr(1, len(line) - 2), Dictionary()) else: var segments = line.split("=") currentSection.get_or_add(segments[0], segments[1]) return sections