Commit Graph

1695 Commits

Author SHA1 Message Date
Benjamin Popp
d54ccd49e4 Include current date/time in crash log info 2021-02-06 17:35:58 -06:00
Benjamin Popp
b313692c1d close the autocomplete in more situations
* If the user moves the seleciton via click or left/right arrow keys
* If the user presses escape
2021-02-06 15:22:54 -06:00
Benjamin Popp
30de1f6740 Make autocomplete work right with quoted tuples 2021-02-06 15:12:19 -06:00
Benjamin Popp
108d2743eb Update trainer backsprite graphics tables
add another table (thanks Fred) that contains frame-switch data
make all three backsprite tables aware of eachother.
2021-02-06 14:38:14 -06:00
Benjamin Popp
54c0c8f58b Get autocomplete to work right with spaces and quotes
Autocomplete on close-quote.
Don't autocomplete on space while quotes are open.
2021-02-05 21:41:27 -06:00
Benjamin Popp
0ad34e6b25 Inline tuple autocomplete
Tuple autocomplete is weird, because it happens in stages. This is different compared to other things, where choosing autocomplete always finishes the cell.
2021-02-05 21:30:04 -06:00
Benjamin Popp
2bb4bb78a1 Bugfixes
* Handle quotes better
* Handle emptystring better
2021-02-05 16:16:39 -06:00
Benjamin Popp
5ab28cee8f Draft of Autocomplete UI
up/down/enter now works, buttons work. Occasionally crashes.
2021-02-05 15:59:30 -06:00
Benjamin Popp
cbcbcb0477 Start working on autocomplete visuals
This only works in the text tool, not the table tool yet. And it only shows the buttons, the buttons don't do anything yet.
2021-02-04 21:58:03 -06:00
Benjamin Popp
75bc07081a Implement autocomplete for egg move streams 2021-02-04 20:01:30 -06:00
Benjamin Popp
561c308619 Implement single-element table stream autocomplete for tuples 2021-02-04 20:01:14 -06:00
Benjamin Popp
d63a25b70c Refactor
Pull out and name the helpers that actually populate the autocomplete content
2021-02-03 23:10:07 -06:00
Benjamin Popp
5c60e4ff1a Expose a string instead of a Command
Using this in the tests, it becomes clear that the autocomplete really just wants to expose a new line to replace the input line. Update the IStreamRun interface to match.
2021-02-03 23:00:04 -06:00
Benjamin Popp
6ce987555b Start on tests/implementation for tuple autocomplete 2021-02-03 22:52:23 -06:00
Benjamin Popp
e93313457d Refactor test
Add a StubView to make testing easier. Refactor one of the ToolTests to be more readable.
2021-02-02 21:45:55 -06:00
Benjamin Popp
7e6c042be2 Fix palette copy bug
Uncompressed palettes copied incorrectly
2021-02-02 21:45:14 -06:00
Benjamin Popp
e4f4ea11df Fix broken tests
* fix a context menu test that broke when I refactor the "Add New" option in the context menu
* implement autocomplete options for single element streams
2021-01-29 21:48:54 -06:00
Benjamin Popp
a2bd132f05 fix copy crash
Don't crash when user copies tablestream anchor for a table stream with no end token
2021-01-29 21:16:26 -06:00
Benjamin Popp
30e32f7f56 Fix Memory Leak
The HexContent doesn't need to create a whole UI-that-watches-ViewModel-for-changes when all it wants is the bitmap source. Introduce a new lighter-weight method that doesn't do all the property changed registering so that we don't have the viewmodel hold on to countless view objects here.
2021-01-29 21:12:25 -06:00
Benjamin Popp
3860f2cfb7 Start implementing autocomplete for streams 2021-01-29 20:51:11 -06:00
Benjamin Popp
04d1e92bfc Add Right click option for displaying existing event scripts 2021-01-27 15:51:23 -06:00
Benjamin Popp
7a6b386b2e Image Paste now pastes based on cursor position
Instead of just blindly pasting into the middle of the canvas, paste now cares about where the cursor is.
2021-01-27 15:01:32 -06:00
Benjamin Popp
3446e88e44 Update tooltip 2021-01-27 14:27:04 -06:00
Benjamin Popp
2e0e3be064 Version Bump 2021-01-27 11:48:39 -06:00
Benjamin Popp
f06c33d63c Skip type chart for Clover
Clover does some dirty things with the type names to add Fairy type, which makes the type map too long and it overlaps the type chart. I'm ok with this failing: it's clover's fault.
2021-01-27 11:31:15 -06:00
Benjamin Popp
5ef6da0755 Tuple support for overworld sprites and pokemon ev stats 2021-01-27 11:16:49 -06:00
Benjamin Popp
7bd6a95e18 Type icons use tuples for x/y 2021-01-27 10:42:36 -06:00
Benjamin Popp
32113ed0e4 Initial UI for tuples
Adding both the XAML for checkboxes / comboboxes, and the dataformat for displaying tuples inline.
2021-01-27 10:27:56 -06:00
Benjamin Popp
84676870f8 Skip unnamed segments
This lets us have the ability to have 'padding' bits in the middle of a tuple.
2021-01-26 22:03:21 -06:00
Benjamin Popp
ec54a555fc Don't put unnamed elements in the table viewmodels 2021-01-26 21:52:51 -06:00
Benjamin Popp
17165dac1b Dependency check works correctly for tuples 2021-01-26 21:45:58 -06:00
Benjamin Popp
764692168d Implement tuple serialize/deserialize 2021-01-26 21:38:39 -06:00
Benjamin Popp
278aa8e0e2 Fix cut/paste for type chart
copy for a type chart needs to not only copy the data, but the format of the data needed for pasting.
This is already the case, almost: we copy the table format for the stream table. However, adding the stream table won't work correctly unless we also paste the end token. Otherwise the initial length of the stream table will be wrong.

Update existing tests that use the !00 metacommand: the !00 metacommand should only change the data if the data is unused, and should only cause the model to stop the edit if the data is used.

Don't adjust the selection after a double-click-follow-link operation. Only adjust the selection after a double-click-select operation.
2021-01-26 13:37:42 -06:00
Benjamin Popp
9fae650423 Fix messed up refactor
Thanks tests for noticing this!
2021-01-25 21:59:24 -06:00
Benjamin Popp
09125bcc6f Cut/Paste arrays should work for arrays with inner pointers
Inner Pointers were not previously correctly tracked during cut/paste operations. There needed to be some way to say that an address was attached not only to a name that does not exist, but to a specific index of such an array. The answer is to store the array offset in the bytes that are left behind, since the value of those bytes does not matter.
2021-01-25 21:57:02 -06:00
Benjamin Popp
9fd4f90605 ASCII runs need to support copy 2021-01-24 09:00:33 -06:00
Benjamin Popp
7bbf669c10 Implement simple Tuple Stream Serialization 2021-01-23 23:07:01 -06:00
Benjamin Popp
6ff5e621a2 Fix Logic / Test
* Update autosearch test to care about the new tuple format instead of the PLM format.
* Update the tuple parser to understand that enums can have '.' in the middle of their name, which should not be counted towards the bitlength of the tuple segment, but are part of the enum name.
2021-01-23 22:34:25 -06:00
Benjamin Popp
888feb57f7 no-op if clearing a format out of bounds. 2021-01-23 20:03:48 -06:00
Benjamin Popp
373c13edb9 Auto-scroll left/right when selection changes. 2021-01-23 19:54:55 -06:00
Benjamin Popp
836c426499 Improve tuple support
2 failing tests now pass, plus 5 more passing tests. Tuples are segments-within-segments, so they act as a second layer of list information within the table. They can be checkboxes, numbers, or enums.
2021-01-22 23:00:10 -06:00
Benjamin Popp
76f7f1f9bc Verify that the annotations are labeled correctly 2021-01-22 08:02:00 -06:00
Benjamin Popp
a05b360e15 Prefer Clipboard.SetDataObject over Clipboard.SetText
https://stackoverflow.com/questions/12769264/openclipboard-failed-when-copy-pasting-data-from-wpf-datagrid
Clipboard.SetText sometimes fails with a COMException, depending on what else is going on and what else is on the system. Starting in .Net 4.5, this issue is fixed... in Clibboard.SetDataObject.
2021-01-22 07:35:50 -06:00
Benjamin Popp
a8ad5304eb Sprite tool bugfixes
Import from table should respect the selected sprite/palette pages
Whenever the user moves the mouse over the palette, refresh the copy/paste commands.
2021-01-21 22:10:00 -06:00
Benjamin Popp
feacfd1a19 Don't add the nop before .words if the code starts at a non-multiple of 4 2021-01-21 13:05:14 -06:00
Benjamin Popp
b80c8bc1dd Test that thumb labels are allowed to start with a dot 2021-01-20 22:16:48 -06:00
Benjamin Popp
bb7cfb818d Improve PCS tool parsing
Show the hex values for escaped bytes in the text tool.
2021-01-20 21:56:28 -06:00
Benjamin Popp
6a4a3f62a2 Allow thumb in paste scripts
* ViewPort needs to be able to understand thumb directives. This means that .whatever must be interpreted as a directive and not as a constant. So constant names are required to *contain* at least one dot. For example, `.some.number`.
* When reading data that's been pasted in, if you find a `.thumb` directive, read until you find a `.end` directive, then interpret that whole thing as a thumb script, all at once.
* allow the `.end` directive to appear in thumb code
* `.align` directives should work in the viewport. Other directives that appear towards the top of thumb scripts before the `thumb` directive should be ignored.
2021-01-20 15:46:54 -06:00
Benjamin Popp
86a1706647 Thumb parse improvements
* Allow parsing numbers even if they don't start with the # prefix.
* Allow parsing of various ldr/str commands without needing to include an offset.
2021-01-20 07:56:40 -06:00
Benjamin Popp
8217f92c1e Allow pc/lr to be inside {} for push/pop instruction
This more closely matches the spec: https://developer.arm.com/documentation/dui0204/j/arm-and-thumb-instructions/memory-access-instructions/push-and-pop
2021-01-19 22:27:18 -06:00