diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-11-30 09:54:02 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-11-30 09:54:02 -0600 |
commit | a21b183757d8ff46ef1c9da5c92791c28f9f692e (patch) | |
tree | 9cd933d71f4fdf62fb239ba74f51f03ab5b7bfcd /crystal.py | |
parent | ff24a0d6216ce6ce20655b399f812f932699b9e0 (diff) |
move allowed_lengths for music macros out
This moves the allowed_lengths setting out of the preprocessor. Special
cases should not be hardcoded in the preprocessor.
original-commit-id: a1a9fa5560e01d97c7c33bbf8bb19fe4e76d3c28
Diffstat (limited to 'crystal.py')
-rw-r--r-- | crystal.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2990,8 +2990,6 @@ music_commands_new = { music_command_enders = [0xEA, 0xEB, 0xEE, 0xFC, 0xFF,] # special case for 0xFD (if loopchannel.count = 0, break) - - def create_music_command_classes(debug=False): klasses = [GivePoke] for (byte, cmd) in music_commands_new.items(): @@ -3010,6 +3008,10 @@ def create_music_command_classes(debug=False): klass_name = cmd_name+"Command" klass = classobj(klass_name, (Command,), params) globals()[klass_name] = klass + if klass.macro_name == "notetype": + klass.allowed_lengths = [1, 2] + elif klass.macro_name in ["togglenoise", "sfxtogglenoise"]: + klass.allowed_lengths = [0, 1] klasses.append(klass) # later an individual klass will be instantiated to handle something return klasses |