This can happen if the run fails to generate due to a data conflict, such as in fr omega where a text run overwrites the first byte of a trainer team run
* bitfields should support names with the `'` character.
* don't let tables/ascii runs go past the end of the file
* don't let arrays have zero length per element
* allow editing record enums in tables
* don't create change tokens when no change is needed
Now works right for capital letters that come after escape bytes
also fix random crash in ModelTable string recognition
also fi random assert from adding an anchor to a pointer
* if adding a new run would overwrite the pointer that made us want to add it, stick with a no-info run.
* if adding a palette would cause us to overwiret a pointer that made us want to add it, stick with a no-info run
* add debug message for non-positive run lengths
* add a sanity check for the number of pokemon in a trainer team. In vanilla it'll never be more than 6, so put a reasonable cap of 1000 on it to prevent possible integer overflows
* make sure that a missing map names table doesn't cause issues
* don't freeze when AMap saves
* allow edit->paste to target the ViewPort even if it doesn't have focus
* notify on repoint
* command to jump to data in the viewport
* show hover point in the corner
* finish script UI (add, remove, edit)
* find record fields when doing Show Uses
* tooltip for address for rom overview
* make sure the model length changes after importing a sprite causes the rom to auto-expand
* require less freespace by default as excess to a run being expanded, and require less freespace buffer placed after runs.
* fix double-click crashes reported by wet blanket
* if Ctrl+F is used before the rom finishes loading, wait for the rom to finish loading before trying to do the find.
*
* fairy script wasn't adding correctly
* right-click menus for inner-pointers weren't showing the right addresses
* appending a table and then updating the new pointer to point into a new table wasn't clearing the old pointer location from the old anchor
* search was causing thread-lock issues
* Display As Text was causing thread-lock issues
* python tool needs to update related fields when updating a table (structType, child table length from parent)
* fix character set issues
* fix crashes with mapper when tables don't have expected elements
* fix showing map options when there's no mapper
* improve handling of custom character escape sequences
* truncate text in tooltips
change all instances of lock (runs) to lock (threadlock) so that there's just one master threadlock that's used when accessing / editing the runs collection.
All public methods that access or edit the runs collection are now protected by the threadlock.
PLEASE tell me I didn't accidentally cause a deadlock here...
When the asks HMA to recognize something as text, be smarter about working around things HMA thinks it has found.
* Be able to find text despite false PCSRun/NoInfoRun runs.
* Be able to find text despite false pointers
* Make sure that this new logic doesn't accidentally clear tables.
Normally, HMA allows you to extend a table by typing a `+` directly after the table. But for tables that have an end-token, they should instead be expanded by typing `+` over the end token `[]`.
Expanding a table where the last element has a named anchor adds another pointer to that anchor. Some format types, such as palettes, do a ClearFormat when adding the new run. This is reasonable, but causes us to lose any custom name attached to those elements, which update their pointers to point to null and adds the name to the unmapped anchor names list.
In this case, we need to track the name before we clear the format, so that when we add the new run, we can add the name as well.
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
In rare cases, you can get a race condition where we try to turn the address-for-anchor keys into a list while also adding a new address-for-anchor key. This multi-threaded work can crash the app.
Use a thread-locking version of version of the dictionary to prevent Keys from being accessed at the same time as Add.
Double-clearing it is a problem if it's created in the same token, because then it counts as clearing something that isn't there... which means that undoing the interaction will bring back an anchor, even though it wasn't there to begin with.
map tileset animations consist of 3 parts:
(1) an `init` routine that sets a hook and some Max values
(2) a callback that runs every frame that decides whether or not to animate
(3) a set of uncompressed tiles to replace existing tiles in the tileset
For each replacement effect, you need to know how many frames are in the animation, how often to update to the next frame, how many tiles to replace, which tiles to replace, and the new tiles to insert. This is handled by a new table that's created specifically for this purpose, where the first field of the table is a pointer to a table of frames. This should make it a bit easier to understand, but a good user guide is still needed for this feature.
This doesn't work yet: there's an issue with the thumb code import step. But this is a first draft.
Shiny discovered a rom where the constant is added on top of a pointer. This is no good, because the constant replacing the pointer didn't clear the pointer from the anchor it points at.
Add logic to clear the format before adding the constant.
* 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
When generating a default anchor name, make sure that name isn't already in use.
When generating a default anchor name, put it in `misc.temp.`. Don't save anchors in from namespace to the toml file. This should make cut/paste operations less prone to adding noise to the toml.
This should improve copy/paste scenarios where the user wants to copy the content from the first element and paste it somewhere else within the same (or a similar) run, without negatively effecting the common cut/paste operation of moving an entire run to a new address.