mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 21:29:06 +00:00
Try to fix another minor bug in generated indentation.
This commit is contained in:
parent
4657f5ddf6
commit
5a927b87cb
@ -929,26 +929,27 @@ def hack_syntax(filename, lines):
|
||||
print '"%s", %d: %s' % (filename, dup, key)
|
||||
if future:
|
||||
# Lift obsolete image_short and image_long tags
|
||||
expanded = """[animation]
|
||||
apply_to=attack
|
||||
[frame]
|
||||
duration=300
|
||||
image=%s
|
||||
[/frame]
|
||||
[attack_filter]
|
||||
range=%s
|
||||
[/attack_filter]
|
||||
expanded = """\
|
||||
[animation]
|
||||
apply_to=attack
|
||||
[frame]
|
||||
duration=300
|
||||
image=%s
|
||||
[/frame]
|
||||
[attack_filter]
|
||||
range=%s
|
||||
[/attack_filter]
|
||||
[/animation]
|
||||
"""
|
||||
for i in range(len(lines)):
|
||||
if "no-syntax-rewrite" in lines[i]:
|
||||
break
|
||||
m = re.search(r"(\s)image_short=(.*)", lines[i])
|
||||
m = re.search(r"(\s+)image_short=(.*)", lines[i])
|
||||
if m:
|
||||
image_block = expanded.replace("\n", "\n" + m.group(1))
|
||||
lines[i] = m.group(1) + image_block % (m.group(2), "melee")
|
||||
modcount += 1
|
||||
m = re.search(r"(\s)image_long=(.*)", lines[i])
|
||||
m = re.search(r"(\s+)image_long=(.*)", lines[i])
|
||||
if m:
|
||||
image_block = expanded.replace("\n", "\n" + m.group(1))
|
||||
lines[i] = m.group(1) + image_block % (m.group(2), "ranged")
|
||||
|
Loading…
x
Reference in New Issue
Block a user