global.levels = [];

var _path = PATH_DATA + "/levels/";

var _file = file_text_open_read(_path + "level_list.txt");

while(!file_text_eof(_file)) {
	var _line = file_text_readln(_file);
	_line = string_replace_all(_line, chr(10), "");
	_line = string_replace_all(_line, chr(13), "");
	_line = string_replace_all(_line, "_", " ");
	
	var _c = "";
	var _str = "";
	for (var i = 1; _c != "."; i++) {
		_c = string_char_at(_line, i);
		if (_c != ".")
			_str += _c;
	}
	if (file_exists(_path + _str + ".lvl"))
		global.levels[array_length_1d(global.levels)] = _str;
}

file_text_close(_file);