When scripts get merged together, some inner-scripts no longer appear to be real scripts. These were showing up as orphans when the scripts get formatted, since that causes scripts to get merged. But the pointers are still there, so they're not actually orphans.
Fix the orphan-naming logic so that it won't name things as orphans if they're inner scripts that still have pointers
ai script children should appear as ai scripts
editing an AI script shouldn't make a bunch of orphans
introduce a light caching system for noticing when scripts don't need to be loaded again.
script edits that don't change any compiled bytes should be capable of skipping the metadata update in situations where the metadata is already correct
* Selecting brock's script should select the _whole_ script
* Get correct number of code sections when scripts point to freespace
* Make sure script concatenation works correctly for `goto` followed by `end` (vanilla games do this a lot)
* multiple if statements / gotos all get compiled into one script, so long as it's all contiginous script data
* make sure `trainerbattle 01` works correctly with labels
* include blank line separators between labels when decompiling scripts
if the last thing is a label, make sure to include an end command for it
if the last thing isn't an end command (or goto, etc) make sure to include an end command for it
* add a basic limiter so that parsing scripts will 'give up' if they get the same 0-arg command 20 times
* fix crash that could happen sometimes when trying to check a pointer for sources during script decoding
* don't try to decode streams as scripts (misuse of the destinations collection)
Since scripts don't always end at an `end` or `goto` anymore (if there's a label from within the script to directly after the script), we need to make sure that these appended scripts still get a chance to add more scripts into the UI.
* say width/height correctly in the tooltips of the map size handles
* less flickering during undo
* include default OW sprite instead of blank (for example, tutorial catch man in viridian city)
* speed up the initial script-check process that looks for default trainer sprites for each OW by not caring about the length of child scripts
* use proper thread locking during block cache invalidation and renewal so that undo doesn't mess up the number of blocks shown in the block panel
* when docompiling, don't include a box that contains a partial script that's already in the main box
* when compiling, require arg counting for getting macro length
add enum types for fanfare / bufferitem
allow script constants to contain underscores
allow autocomplete for constants that are the last argument
allow 'find usages -> scripts' to find usages from macros (and fix crash)
instead of the script line itself knowing that it points to something,
pull it down to the argument level, so that each argument knows
if it points to something.
This will allow a single script line to point to multiple things (like trainers pointing to multiple text or scripts)
These were being cleared because they existed within scripts. Make the script ClearFormat logic smarter so it skips tables that align to single arguments.
New rule: when clearing format and the run starts _before_ what we're clearing, leave the pointers and a NoInfoRun. Before this rule, we would clear out the anchor as well, which could cause some confusion if that anchor/format was re-added later, since it wouldn't know about tables that point to it.
Fix bug in script parser: next text runs should know about pointers to them
The 'showmoney' and 'updatemoney' commands are different from game to game. It has 2 parameters in R/S, but 3 parameters in FR/LG/E.
Update the scriptReference to specify that these commands have different versions for the different games.
Update ScriptParser to be able to read this new addition to the script reference format.
Add tests to show that the new commands are read correctly between games.
* Replace the static PCSString.Convert method with an instance method on a TextConverter that's owned by the Model. The TextConverter can know about different macros depending on which rom is being edited.
* Add macros to pcsReference.txt