* squiggle errors for pokemon names / moves in trainer editor
* filtering for block behaviors
* image editor hover position and selection size displayed
* name hints for blocksets in the map header
the 'delay' logic is still in, but a few things happen instantly now rather than getting delayed. Specifically, HMA will run the "insert missing closers" bit immediately, which should reduce cursor jumps.
matters for when you jump directly from a battle script to an event script. Not only do we need the syntax highlighting to update, but also the auto-complete options
the cursor-save system didn't always work correctly. Replace it with a "deferred cursor set" that happens only with auto. In other cases, the cursor is just set based on the changed text (such as adding {}).
when typing a script command, when you press space, it'll autocomplete to the 'best' match. So if you forget a period or capital letter, it'll still work the way you expect.
* Show error underline in both script editor and npc textbox in map editor.
* Let model calculate invalid length, so we can underscore the entire error length.
* Load error when first showing a code body, instead of waiting for an edit
* pressing escape should close the script tip
* fix automatic inclusion of <auto> behavior
* Fix possible crash when looking for closing } when there isn't one
* Only update TextEditor layers if they've changed (performance)
* creating a new event script should include lock/faceplayer/release
* adjust focus when switching tabs (close open tips)
* only try to access list coments if the list isn't null
For script performance:
* call data.GetGameCode() less often, using a cached value for the ScriptParser
* use a 4-byte game code instead of string parsing for the game code
For map previews in the table tool performance
* Don't use dispatcher foreground/background thread swapping, it's safe to add the previews to the collection from the background thread.
* Check the exit condition more often
For drawing performance:
* Use Array.Copy when we don't need to worry about Transparency, since it's much faster.
* Make `Darken` faster, we call it a lot
* Reuse DarkenRect utility in HighlightCollision
Other performance changes
* Protototype for ObserableList<T> for a more configurable version of ObservableCollection
Situation:
* Script A refers to B and C. B and C occur right after eachother.
* Scirpt B does not refer to script C, so C doesn't get included in the same body.
-> when editing B, B needs to know that its length does not include C. So the script-length-cache that B uses shouldn't know about C, since B doesn't refer to C.
-> Therefore, B can't use the same cache as A.
* track length caches based on the code body start, not based on the entire model. This lets each code body have its own cache.
doing <??????> auto-included a new {} block, which is cool. But that block needs to not be included when calculating the new cursor position, because the cursor position should remain _before_ the new {}, so it's still on the same line in case you're writing `trainerbattle` or something with multiple pointers in the line.
* when jumping to a script from a map, format the script. This gets us things like text/marts immediately, instead of needing to load, then edit, to see runs that the script points to.
* When editing a script, keep better track of the cursor, so it doesn't jump around when the script address changes or a pointer within the script changes.
* submit failing tests
* Grab failing trainer test from remote branch (#121)
* Updated flash constants
* Fixed flash constant locations
I originally supplied anchor references, not locations of the constants themselves. That's been fixed. Also, I changed the field name for flash.radius, so it's hopefully clearer.
* Fixed some other pointer issues with RAM addresses in script commands
RAM addresses can't be encased in <> nicely. Some commands still needed their RAM-address pointers to have the ::|h formatting instead.
* Fixing some parameter formats in the script reference file.
There were a few other commands that needed RAM-address parameters set to their correct format so that typing "2024284" doesn't auto format to 0xA024284, etc.
* update script reference (again)
* Added a failing test for duplicating trainer data
Bug report in query: https://discord.com/channels/538022037718040588/538022038376415234/1083215729177931877
---------
Co-authored-by: ShinyTillDawn <80070404+ShinyTillDawn@users.noreply.github.com>
* Fix test
ExportTilesetWithPalette2_EditTileset_ImportTilesetWithPalette2_DataMatches
-> fix formatting in LzSpriteRun
-> fix overflow error in SpriteRun
-> fix default palette detection in SpriteTool
-> improve test so it gives better failure info
* fix trainer duplication assert
fix test name / remove unneeded comments
handle Trainer team runs specially
update assertion error message
* Improve pointer error logic
Pointers are allowed to point into the middle of an existing run. Such a pointer is an error, but is not a metadata inconsistency. Update metadata checking for new logic. Update pointer logic to display pointer as an error.
* improve handling of `auto`
allow <auto> to be used if there's a one-byte gap
* improve interruptingSourceRun logic
an interrupting table is not always valid.
It's only valid if the source is at an index that would make it a pointer.
* don't clear bytes, clear anchors
If you have a custom anchor name in the middle of a script and then edit the script, that custom anchor name will be lost. But anything pointing to it will still point to it.
---------
Co-authored-by: ShinyTillDawn <80070404+ShinyTillDawn@users.noreply.github.com>
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
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)