mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Merge pull request #183 from kanzure/preprocessor-macro-function
Function to make the preprocessor "macros" list.
This commit is contained in:
commit
ca0981eb36
@ -16,6 +16,12 @@ from extras.pokemontools.crystal import (
|
||||
effect_classes,
|
||||
)
|
||||
|
||||
def load_pokecrystal_macros():
|
||||
"""
|
||||
Construct a list of macros that are needed for pokecrystal preprocessing.
|
||||
"""
|
||||
ourmacros = []
|
||||
|
||||
even_more_macros = [
|
||||
Warp,
|
||||
XYTrigger,
|
||||
@ -24,12 +30,14 @@ even_more_macros = [
|
||||
DataByteWordMacro,
|
||||
]
|
||||
|
||||
macros = command_classes
|
||||
macros += even_more_macros
|
||||
macros += [each[1] for each in text_command_classes]
|
||||
macros += movement_command_classes
|
||||
macros += music_classes
|
||||
macros += effect_classes
|
||||
ourmacros += command_classes
|
||||
ourmacros += even_more_macros
|
||||
ourmacros += [each[1] for each in text_command_classes]
|
||||
ourmacros += movement_command_classes
|
||||
ourmacros += music_classes
|
||||
ourmacros += effect_classes
|
||||
|
||||
return ourmacros
|
||||
|
||||
chars = {
|
||||
"ガ": 0x05,
|
||||
@ -650,4 +658,4 @@ def preprocess(macros, lines=None):
|
||||
|
||||
# only run against stdin when not included as a module
|
||||
if __name__ == "__main__":
|
||||
preprocess(macros)
|
||||
preprocess(load_pokecrystal_macros())
|
||||
|
@ -14,4 +14,4 @@ if __name__ == '__main__':
|
||||
dest = os.path.splitext(source)[0] + '.tx'
|
||||
sys.stdin = open(source, 'r')
|
||||
sys.stdout = open(dest, 'w')
|
||||
preprocessor.preprocess(preprocessor.macros)
|
||||
preprocessor.preprocess(preprocessor.load_pokecrystal_macros())
|
||||
|
Loading…
Reference in New Issue
Block a user