Commit Graph

3392 Commits

Author SHA1 Message Date
Benjamin Popp
aec0c5a57e Merge branch 'trainer-pokemon-teams' into usability-updates-3-2 2019-11-05 11:10:49 -06:00
Benjamin Popp
4992629af0 Include Stream links in table tool.
Some streams depend directly on tables. When working with the table tool in one of those tables, we can provide a reverse-lookup for any streams that use the element we're currently looking at. For example, if we've selected "charmander" in the pokestats table, we can do a reverse-lookup to see charmander's uses in the egg moves table.

This is a bit more manual than I'd like. Hopefully a better abstraction becomes apparent as I add more streams.

Also, in order for this to work, I need to be able to know the name of elements from text tables. As a bonus, this means that Ctrl+G->items/potion now works as expected.
2019-11-05 11:02:19 -06:00
Benjamin Popp
37264ee2b2 'Copy Address' now available in standard right-click as well. 2019-11-05 07:39:13 -06:00
Benjamin Popp
b9a95db2b4 Warn and assist the user before they modify data with multiple things pointing to it.
- make it possible to clear a single pointer from a run in the model
- add commands and properties so the `StreamArrayElementViewModel` can auto-split data.
2019-11-04 21:14:28 -06:00
Benjamin Popp
ad30821e44 Move 'add new' button
Users didn't see the button during tests. Move it to between "previous" and "next"
2019-11-02 22:18:09 -05:00
Benjamin Popp
d13613f431 Improve lvlMoves member name
This name appears in the table tool. Make it more helpful.
2019-11-02 22:15:24 -05:00
Benjamin Popp
2304e91241 Don't crash when adding new elements to arrays with inner pointers. 2019-11-02 15:02:26 -05:00
Benjamin Popp
db318e2b73 Merge branch 'master' into trainer-pokemon-teams 2019-11-02 07:41:41 -05:00
Benjamin Popp
b29855db0e Merge branch 'table-tool-text-pointer-fixes' 2019-11-02 07:41:17 -05:00
Benjamin Popp
baa2e1ad69 Merge branch 'table-tool-text-pointer-fixes' into trainer-pokemon-teams 2019-11-01 23:08:43 -05:00
Benjamin Popp
0316c996d9 Table tool pointer updates
- update the stream when a pointer changes
- if the pointer isn't to a valid stream, don't crash
- bugfix: write the destination to the pointer, not the pointer to the destination.
2019-11-01 23:06:05 -05:00
Benjamin Popp
7e2e60ef4a Update anchors pointed to from moved tables
This was accidentally removed during the previous refactor.
2019-11-01 22:25:34 -05:00
Benjamin Popp
2da9f6fc17 Stream Edits can extend/move tpt runs. 2019-11-01 21:54:08 -05:00
Benjamin Popp
03903c7aa1 Allow manual hex editing of the trainer team 2019-11-01 20:19:28 -05:00
Benjamin Popp
f52ce35b5f 'Find' works for TPT runs
TPT runs contain pokemon, moves, and items. Now you can search for them.
2019-11-01 18:39:07 -05:00
Benjamin Popp
82b8e06fa0 TPT streams get multi-selection like tables. 2019-11-01 15:11:34 -05:00
Benjamin Popp
204dee8476 Run-Length fix
I was hitting a Debug.Fail because I was clearing data incorrectly for runs.
2019-11-01 14:50:35 -05:00
Benjamin Popp
b8d2dc4645 Trainer Pokemon Team Support
Well it's not pretty and it's not well tested, but the first phase of trainer pokemon teams is complete!
The trainer pokemon team (TPT) is both a table and a stream: it's a table of pokemon, but it's also editable as a stream. This lets me show a trainer's pokemon as part of the same table as the trainer, but you can dive down for table support.
2019-11-01 13:44:59 -05:00
Benjamin Popp
062262c457 First pass at adding code for rotated bit arrays
a user had the comment that bit arrays would be useful if they could show all the pokemon for a given TM, not just all the TMs for a given pokemon. The idea here is to add a bit-array element after a enum element if that enum is used by a bit array.
2019-10-31 16:32:47 -05:00
Benjamin Popp
6ccbf30f0d Move helper assemblies to subfolder
At some point, I'll probably depend on IronRuby or IronPython with the DLR for scripting purposes. In order to avoid making my directory structure get crazy, I'm moving all files that I can into a "resources" director.
2019-10-28 22:10:06 -05:00
Benjamin Popp
e9e76ededd Version Bump 2019-10-28 16:36:17 -05:00
Benjamin Popp
2900e252f9 Allow tables to include integer-bounded fields
Integer bounded fields work a lot like table-matched fields. But instead of having an option of every entry in the table, it's just an option of every entry less than the given number.

* Also moved `GetOptions` to `ModelCacheScope` since no one else is using it.
* Also updated `ArrayRunEnumSegment` to use cache scopes.
* trainerdata makes use of this feature
2019-10-28 15:04:03 -05:00
Benjamin Popp
63186582c3 Adding test for FireRed tutor compatibility
Check FireRed's tutor compatibility for Bulbasaur. If it's what it's supposed to be, then we probably found the right tutor data.
2019-10-28 14:20:52 -05:00
Benjamin Popp
ecc0ceee33 Tutor fix
tutor compatibility was finding the wrong data.
2019-10-28 08:33:50 -05:00
Benjamin Popp
a81b0d9137 Fix failing tests
trainer class names were off by one. They were finding more than they should. This is fixed now, and this is the test update to match.
2019-10-27 21:38:53 -05:00
haven1433
1bbac8c876 Merge pull request #42 from haven1433/usability-updates-3-1
Usability updates 3 1
2019-10-27 21:29:07 -05:00
Benjamin Popp
0c55136f2a add basic trainer support
Trainer tables include a nested pointer, which works a bit weird because the pointer points to a different data structure depending on the `structType`. The structure is a table, but won't be named. Since that pointer will require some more changes, for now we're just adding the parent table - the trainers.
2019-10-27 21:24:53 -05:00
Benjamin Popp
32b68a89cf Blinky Cursor for Hex Area
I finally did it. Multiple users asked for a blinking cursor to indicate editability in the Hex area. Well, now there's a blinky cursor.

Since the entire HexContent is designed to act as a single layer, and all the extra added effects live in TabView, I added the blinky-cursor code to TabView. It operates by drawing and erasing a tiny rectangle at the text insertion point, calculated using logic from FormatDrawer. We can't use a TextBox because a TextBox won't show its cursor when not focused, and we need the focus to stay on the HexContent.
2019-10-26 21:27:43 -05:00
Benjamin Popp
11cbc1ba1e Add a search field to the text tool
The unit test and search logic implementation were actually pretty simple. However, WPF TextBox's don't natively support a way to show text highlight when the textbox doesn't have focus... so I had to implemnet my own focus. I did this by wrapping the TextBox in a Grid so I could overlay a Rectangle that uses the same highlight color.

See TabView.xaml.cs for all the mathy bits.
2019-10-26 15:05:32 -05:00
Benjamin Popp
6827faa013 Add links into table tool
To facilitate faster editing, the table tool enums and bitarrays now include links to their sources. This should allow the user to jump to a source faster for when they want to add a new option to a list, such as adding a new type or a new item.
2019-10-21 22:45:20 -05:00
Benjamin Popp
85887e62f4 Readability updates
SplitterArrayElementViewModel doesn't use its event or the Linq namespace.
2019-10-21 13:48:26 -05:00
Benjamin Popp
c61ebd7c89 Pointer menu item: Repoint to New Copy
Make it possible to duplicate data at an anchor. This new data can be edited independently of the original data, and will only be pointed to by the one location you chose. All other pointers will still point to the original version.

As part of this change, runs need the ability to duplicate themselves at a new starting point. Refactoring runs to add the new functionality.

As part of this change, the Model needs to expose its method of finding free space in the ROM.

Added a new test that shows the new feature.
2019-10-21 13:43:13 -05:00
Benjamin Popp
b42b1d53bd Double Click to follow pointer
In most cases, double-click expands selection. For example, with text. But with pointers, the entire pointer is already selected anyway. So double-click is free to do something else.

Many users have tried to double-click to follow a pointer. Go ahead and make it do that.
2019-10-21 07:30:13 -05:00
Benjamin Popp
173fe9f79b "add new" tooltip update
The user never hovered long enough to see the tooltip. Make the tooltip appear instantly.
2019-10-21 07:25:38 -05:00
Benjamin Popp
97e3256e83 Include a selectable list of all tables in the table tool
from the usability test, the user wanted an easy way to see what tables were available. In lew of typing Ctrl+G followed by spacebar, which is not super intuitive, having the table tool itself list all the tables and let you quickly goto them seems like a reasonable solution.
2019-10-20 20:35:35 -05:00
haven1433
8a01042da1 Merge pull request #41 from haven1433/no-autosearch
Replace Autosearch with a more hardcoded, but less finicky method
2019-10-19 21:47:32 -05:00
Benjamin Popp
f37e7e1951 Include Numeric Limit
Whenever a table gets found and has a dynamic length, go ahead and give it a static length. This makes things more explicit, and editing the toml file is easier.
2019-10-19 21:40:47 -05:00
Benjamin Popp
d2bb4adbe2 Updates for Gaia
All tests pass now. The results for gaia are a bit different, but still acceptable.
2019-10-19 21:26:02 -05:00
Benjamin Popp
71485d0743 Fixing more tests
everything is working at this point except Gaia
2019-10-19 19:44:08 -05:00
Benjamin Popp
42b3d4349e Hardcoded Tables improvements
It now works for all existing tables with all 5 base roms.
2019-10-19 13:29:32 -05:00
Benjamin Popp
18c714e4cc hard-code stage 1
The AutoSearchModel is nifty, but seems to have trouble in a lot of situations where data isn't in the format I expect.

However, I've noticed that while many romhacks move tables around, a lot less of them move code around. So I can depend on most of the pointers to those tables still being in the same spot.

Based on this idea, I've created a new "HardcodeTablesModel" that uses known pointer locations to find tables instead of just searching for tables based on their format. This lets me simplify a lot of the logic, reducing it to basically a pointer lookup in many cases.

Most of the tests for FireRed are passing now using the new HardcodeTablesModel. I'll continue looking into issues from FireRed and the other baseroms in the next update.
2019-10-18 23:03:48 -05:00
Benjamin Popp
6381f4138f Bugfix
Don't crash when reading / loading text that has errors in it. Thanks to black fragrant for helping me find this bug!
2019-10-16 21:45:51 -05:00
Benjamin Popp
b67a1de6fe Version Bump 2019-10-14 22:14:36 -05:00
haven1433
1ddf7addcf Merge pull request #38 from haven1433/dev
Bugfix: Moving Table Pointers
2019-10-14 22:08:19 -05:00
Benjamin Popp
27dad7827d Update from review feedback 2019-10-14 22:07:58 -05:00
haven1433
6600916d32 Merge pull request #39 from haven1433/dev-textcopy
Copy Text bugfix
2019-10-14 22:05:12 -05:00
Benjamin Popp
51144a1748 update from review feedback 2019-10-14 22:04:25 -05:00
haven1433
95d4eb1ea7 Merge pull request #40 from haven1433/dev-cleararray
Cut in table should not delete entire table
2019-10-14 22:02:43 -05:00
Benjamin Popp
1ff057cace Cut in table should not delete entire table
Tables can contain many entries. If the user decides to delete or cut an entry, it should only effect that single entry instead of the entire array.

If the cut or delete has the entire table selected or also selects something from outside the table, the correct behavior is less clear, so keep the implementation the same.
2019-10-12 14:35:23 -05:00
Benjamin Popp
9d0279babb Copy Text bugfix
When copying text, don't copy all the bytes (in the case of a fixed-length string): just copy until the end-of-stream byte. This makes paste work better.
2019-10-12 13:53:10 -05:00