Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a8f9cec

Browse files
authored
Add files via upload
1 parent d3d642e commit a8f9cec

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

‎python3/focusgfxshine.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_shine_def(name, path):
5757
animationtexturescale = { x = 1.0 y = 1.0 }
5858
}
5959
legacy_lazy_load = no
60-
}\n""" % (
60+
}""" % (
6161
name,
6262
path,
6363
path,
@@ -77,17 +77,23 @@ def main():
7777
args = parser.parse_args()
7878

7979
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"#*$"
8187
)
8288

8389
print(f"Reading {args.goals_shine}...")
8490
with open(args.goals_shine, "r") as f:
8591
goals_shine = f.read()
8692

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, '')
8995
)
90-
goals_shine_matches = {k: vfork, vingoals_shine_matches}
96+
goals_shine_matches = set(goals_shine_matches)
9197

9298
last_bracket_idx = 0
9399

@@ -103,7 +109,7 @@ def main():
103109
goals = f.read()
104110

105111
goals_matches = goal_regex.findall(
106-
goals, re.MULTILINE|re.DOTALL|re.IGNORECASE
112+
comments_regex.sub(goals, '')
107113
)
108114
goals_matches = {
109115
k: v for k, v in goals_matches if not f"{k}_shine" in goals_shine_matches

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /