@@ -41,16 +41,20 @@ def load_textdata(self, scriptname: str) -> Any:
41
41
script_dir = get_script_path ()
42
42
lang_file = script_dir / 'out' / 'raw' / f'{ scriptname } .gml'
43
43
ret = {}
44
- textdata_regex = re .compile (r"ds_map_add\(global\.text_data_[a-z]+, \"([a-zA-Z0-9_]+)\", ([\"'])(.*)\2\)" )
44
+ textdata_regex = re .compile (
45
+ r"ds_map_add\(global\.text_data_[a-z]+, "
46
+ + r"\"([a-zA-Z0-9_]+)\", ([\"'])(.*)\2\)"
47
+ )
45
48
with open (lang_file , 'r' ) as file :
46
- print ("Successfully opened" , lang_file )
47
49
for line in file .readlines ():
48
- if not line .startswith (" ds_map_add" ):
50
+ if not line .startswith (' ds_map_add' ):
49
51
continue
50
- line = line .replace ("' + \" '\" + '" , "'" ).replace ('" + \' "\' + "' , '"' )
52
+ line = line .replace ("' + \" '\" + '" , "'" )
53
+ line = line .replace ('" + \' "\' + "' , '"' )
51
54
matches = textdata_regex .match (line )
52
55
if matches is not None :
53
56
ret [matches [1 ]] = matches [3 ]
57
+ print ('Got %d lines' % len (ret ))
54
58
return ret
55
59
56
60
def load_enemies (self ) -> List [str ]:
@@ -68,7 +72,6 @@ def load_sums(self) -> Dict[str, str]:
68
72
return self .load_json ('sums' )
69
73
70
74
def load_lang (self ) -> Dict [str , str ]:
71
- print ("Game:" , self .game )
72
75
if self .game == 'undertale' :
73
76
return self .load_textdata ('gml_Script_textdata_en' )
74
77
return self .load_json ('lang_en' )
0 commit comments