Commit Graph

3392 Commits

Author SHA1 Message Date
haven1433
03b0198207 be more surgical with locking during Initialize 2022-10-02 00:33:49 -05:00
haven1433
6de8951d6a Improve toml reading logic
If there's an error reading the toml, give an error rather than showing the crash dialog.
2022-10-02 00:16:15 -05:00
haven1433
0f3748419b lock like you mean it
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...
2022-10-01 22:20:54 -05:00
haven1433
f243c66562 remember length base-16 base-10 choice between runs 2022-09-30 22:59:03 -05:00
haven1433
987a2b356f Call Dispatcher.Invoke more carefully
Only call it if we really need to access UI properties.
2022-09-30 22:22:10 -05:00
haven1433
26103602dd improve text finding logic
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.
2022-09-30 22:21:33 -05:00
haven1433
ad15f35193 undo should refresh the code tool 2022-09-30 16:10:33 -05:00
haven1433
23c4e3b9ac fix underscore bug in menu items
need to escape underscores so WPF doesn't turn them into underlines for keyboard shortcuts
2022-09-30 16:09:56 -05:00
haven1433
5813fd00f7 Fix table-stream expansion logic
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 `[]`.
2022-09-30 15:50:34 -05:00
haven1433
abdf4eaa1c add new table
also, `GetIndexOfNearestAddress` shouldn't ever find a table with distance 0, because that's not what we're wanting to find: we want the table with the nearest values so we can do a cross-reference, and anything with this exact address is likely missing the other games we're looking for.
2022-09-29 21:29:15 -05:00
haven1433
898d6b586b add new table 2022-09-29 21:16:08 -05:00
haven1433
414a9e5b0a improve move expansion repoint logic
All level-move runs after expansion should start at a 4-byte aligned address. This worked fine for any run that got repointed... but _didn't_ work for runs that were expanded _without_ being repointed. It works correctly now.
2022-09-29 21:13:18 -05:00
haven1433
637aa59050 fix overworld sprite reading logic
The length is only 2 bytes long, not 4 bytes long. So I should only be checking 2 bytes instead of 4 bytes when looking for the length.
2022-09-29 20:41:57 -05:00
haven1433
4ccb5d940e fix edge case
if we fail to find the "sprites" in the data, show default blank sprite rather than crashing
2022-09-29 16:35:38 -05:00
haven1433
8b69b5a7e5 fix rom contraction bug
clear format before deleting the data
2022-09-29 16:19:06 -05:00
haven1433
8fd4a742af commit missing changes 2022-09-29 00:14:12 -05:00
haven1433
a080dedbdb fix plural "best match" goto
plural worked for finding anchors, but didn't work for best-match
2022-09-29 00:13:36 -05:00
haven1433
996d17fe01 cleanup 2022-09-28 22:51:16 -05:00
haven1433
e6c8e561b2 first pass at an improved text editor
for script editing, etc
2022-09-28 22:49:42 -05:00
haven1433
7a6ba78d94 fix {} creation after <??????>
Only add the {} if there isn't one already
2022-09-28 22:19:06 -05:00
haven1433
1858d8d3a0 fix stream data clearing issues
* when a stream shrinks, clear the old end token as well as the old data
* when parsing a stream with an end token, don't allow elements to have values that would look like end tokens (usually element 0)
* only goto moved data if the moved data was selected, as opposed to if the moved data was on-screen.
2022-09-28 21:40:03 -05:00
haven1433
b5817e65cf fix table expansion anchor glitch
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.
2022-09-28 20:47:09 -05:00
haven1433
a17fd96496 fix fairy-type script bug
A recent change to the model to make it update related arrays when doing CompleteArrayExtension caused it to double-increment array length. Added a test to verify that the fairy script adds exactly one type and fixed the issue.
2022-09-27 20:04:19 -05:00
haven1433
9108b360af Updates from usability test with Shiny 2022-09-27 19:30:49 -05:00
haven1433
8a6f3ea559 Event improvements
* fix cut off text trainer range / berry id
* template for npcs
* template for signposts
* extended info in event panel for templates
* edit names
2022-09-23 16:06:24 -05:00
haven1433
7cac8a42f0 export the EditBattleOdds script 2022-09-23 06:57:26 -05:00
haven1433
10c1ab44b1 tab navigation improvements 2022-09-22 22:42:08 -05:00
haven1433
1315e048b7 version bump 2022-09-22 21:22:01 -05:00
haven1433
7d74e66ef7 update map name table (R/S/E)
thanks Shiny!
2022-09-22 21:19:06 -05:00
haven1433
3a1f92f422 bugfix
allow pasting raw data to expand the data
don't keep trying to update selection if the selection stops changing
2022-09-22 21:15:49 -05:00
haven1433
2eaa1f6b6e improve editing 2022-09-22 21:05:20 -05:00
haven1433
d537f88c46 bugfixes 2022-09-22 20:58:41 -05:00
haven1433
af58a804f8 update method for testing new features 2022-09-22 13:18:59 -05:00
haven1433
5e9e5b944f update name from feedback 2022-09-22 07:41:38 -05:00
haven1433
7a6ce76b23 serialize null list items as numbers
also fix width on script tooltip
2022-09-22 07:36:26 -05:00
haven1433
6b845cc9de "Best Match" button still clipping 2022-09-21 20:16:47 -05:00
haven1433
a57ce5cf42 fix padding 2022-09-21 20:09:30 -05:00
haven1433
69ad7c6bb8 Applying patch marks the tab as needing a save
also fix issue with IPS patches
2022-09-21 16:40:13 -05:00
haven1433
2d0d0e1f6c add 8x8 pixel grid for image editor 2022-09-21 07:40:39 -05:00
haven1433
b1b82d5004 remove task/async warnings 2022-09-20 22:49:19 -05:00
haven1433
b8108e7638 Improve upgrade logic
When updating to a new version, don't upgrade tables that have been edited by the user.
2022-09-20 22:49:04 -05:00
haven1433
f5925af5ad remove shortname logic
after the UI updates, this text appears in a popup menu that has more available horizontal space. We don't need to truncate "data.poke" anymore, so remove the truncation logic.
2022-09-20 17:31:52 -05:00
haven1433
e18f9c3930 don't crash if rendering out-of-bounds 2022-09-20 17:23:59 -05:00
haven1433
7dd36e8853 allow import for uncompressed tilemaps 2022-09-20 17:23:43 -05:00
haven1433
32911324f3 allow cross-game macros 2022-09-20 17:23:02 -05:00
haven1433
b6cf8b58ab ascii run improvements 2022-09-20 17:22:44 -05:00
haven1433
53d10d2f35 fix patching bug 2022-09-20 08:27:15 -05:00
haven1433
a8a13bea8b fix code that broke tests 2022-09-19 22:44:10 -05:00
haven1433
fa99eaf886 fix import check
allow for the payload and index tables to be different lengths
2022-09-19 22:11:45 -05:00
haven1433
3132cbd33b fix crash (reading from undefined palette) 2022-09-19 21:34:09 -05:00