mirror of
https://github.com/pmret/papermario.git
synced 2024-09-08 02:29:49 +02:00
use tabs in msg files
This commit is contained in:
parent
b2d0b2c6c8
commit
addfc799f6
@ -11,3 +11,6 @@ indent_size = 2
|
|||||||
|
|
||||||
[{Makefile,*.mk}]
|
[{Makefile,*.mk}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.msg]
|
||||||
|
indent_style = tab
|
||||||
|
@ -388,7 +388,7 @@ if __name__ == "__main__":
|
|||||||
explicit_end = False
|
explicit_end = False
|
||||||
|
|
||||||
while len(source) > 0:
|
while len(source) > 0:
|
||||||
if source[0] == "\r":
|
if source[0] == "\r" or source[0] == "\t":
|
||||||
source = source[1:]
|
source = source[1:]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ if __name__ == "__main__":
|
|||||||
source = source[1:]
|
source = source[1:]
|
||||||
|
|
||||||
for i in range(indent_level):
|
for i in range(indent_level):
|
||||||
if source[0] == " " or source[0] == "\t":
|
if source[0] == "\t":
|
||||||
source = source[1:]
|
source = source[1:]
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
@ -452,14 +452,12 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# count indent level
|
# count indent level
|
||||||
indent_level = 0
|
indent_level = 0
|
||||||
|
"""
|
||||||
while source[0] == " " or source[0] == "\t" or source[0] == "\n" or source[0] == "\r":
|
while source[0] == " " or source[0] == "\t" or source[0] == "\n" or source[0] == "\r":
|
||||||
if source[0] == " " or source[0] == "\t":
|
if source[0] == " " or source[0] == "\t":
|
||||||
indent_level += 1
|
indent_level += 1
|
||||||
source = source[1:]
|
source = source[1:]
|
||||||
|
"""
|
||||||
# TODO: lookahead at all lines until "}" to determine lowest indent value
|
|
||||||
if indent_level == 4:
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
command, args, source = parse_command(source)
|
command, args, source = parse_command(source)
|
||||||
|
|
||||||
|
@ -410,9 +410,9 @@ class N64SegPaperMarioMessages(N64Segment):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if msg_name is None:
|
if msg_name is None:
|
||||||
self.f.write(f"#message:{i:02X}:{j:03X} {{\n ")
|
self.f.write(f"#message:{i:02X}:{j:03X} {{\n\t")
|
||||||
else:
|
else:
|
||||||
self.f.write(f"#message:{i:02X}:({msg_name}) {{\n ")
|
self.f.write(f"#message:{i:02X}:({msg_name}) {{\n\t")
|
||||||
self.write_message_markup(data[msg_offset:])
|
self.write_message_markup(data[msg_offset:])
|
||||||
self.f.write("\n}\n")
|
self.f.write("\n}\n")
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ class N64SegPaperMarioMessages(N64Segment):
|
|||||||
self.write_markup("[end]")
|
self.write_markup("[end]")
|
||||||
|
|
||||||
def write_markup(self, markup):
|
def write_markup(self, markup):
|
||||||
self.f.write(re.sub("\n", "\n ", markup))
|
self.f.write(re.sub("\n", "\n\t", markup))
|
||||||
|
|
||||||
if markup == "[font:title]\n" or markup == "[font:subtitle]\n":
|
if markup == "[font:title]\n" or markup == "[font:subtitle]\n":
|
||||||
self.root_charset = CHARSET_CREDITS
|
self.root_charset = CHARSET_CREDITS
|
||||||
|
Loading…
Reference in New Issue
Block a user