@@ -57,7 +57,7 @@ def get_shine_def(name, path):
57
57
animationtexturescale = { x = 1.0 y = 1.0 }
58
58
}
59
59
legacy_lazy_load = no
60
- }\n """ % (
60
+ }""" % (
61
61
name ,
62
62
path ,
63
63
path ,
@@ -77,17 +77,23 @@ def main():
77
77
args = parser .parse_args ()
78
78
79
79
goal_regex = re .compile (
80
- r"name\s*=\s*\"([^\"]+)?\"\s*texturefile\s*=\s*\"([^\"]+)?\""
80
+ r"name\s*=\s*\"([^\"]+)?\"(?:[^\}]*?)texturefile\s*=\s*\"([^\"]+)?\"" , re .MULTILINE | re .DOTALL | re .IGNORECASE
81
+ )
82
+ goal_name_regex = re .compile (
83
+ r"name\s*=\s*\"([^\"]+)?\"" , re .MULTILINE | re .DOTALL | re .IGNORECASE
84
+ )
85
+ comments_regex = re .compile (
86
+ r"#*$"
81
87
)
82
88
83
89
print (f"Reading { args .goals_shine } ..." )
84
90
with open (args .goals_shine , "r" ) as f :
85
91
goals_shine = f .read ()
86
92
87
- goals_shine_matches = goal_regex .findall (
88
- goals_shine , re . MULTILINE | re . DOTALL | re . IGNORECASE
93
+ goals_shine_matches = goal_name_regex .findall (
94
+ comments_regex . sub ( goals_shine , '' )
89
95
)
90
- goals_shine_matches = { k : v for k , v in goals_shine_matches }
96
+ goals_shine_matches = set ( goals_shine_matches )
91
97
92
98
last_bracket_idx = 0
93
99
@@ -103,7 +109,7 @@ def main():
103
109
goals = f .read ()
104
110
105
111
goals_matches = goal_regex .findall (
106
- goals , re . MULTILINE | re . DOTALL | re . IGNORECASE
112
+ comments_regex . sub ( goals , '' )
107
113
)
108
114
goals_matches = {
109
115
k : v for k , v in goals_matches if not f"{ k } _shine" in goals_shine_matches
0 commit comments