Commit Graph

2863 Commits

Author SHA1 Message Date
Haven1433
f4e173bc49 improve paste logic
when pasting text, always complete the current cell by putting an extra space on the end. This might not be quite what we want, as we may want to paste something and then be in the middle of a cell edit... but more often, we want to paste multiple cells, and the last cell doesn't commit correctly if we didn't copy a space.
2022-09-03 23:04:25 -05:00
Haven1433
5d24810343 "goto source" in text tool 2022-09-03 22:05:29 -05:00
Haven1433
21eb4fc006 add down arrow graphics for menus/text 2022-09-03 21:16:20 -05:00
Haven1433
b81bd0506a implement missing method 2022-09-03 21:01:47 -05:00
Haven1433
5630ea5eb9 Update tools after editing the last byte in a table/stream 2022-09-03 20:52:31 -05:00
Haven1433
d22478a002 don't auto-change palettes when 8x8 editing a 16 color sprite
If a single sprite only supports 16 colors but has multiple palettes, you can cycle through the available palettes while editing it. But editing a 8x8 tile has special logic that causes it to switch the palette associated with a tile... which doesn't work in this case. So the 8x8 special logic should be skipped if its a 16-color image.
2022-09-03 20:51:59 -05:00
Haven1433
ed5a9eb47c fix D5 in scripts for R/S/E
R/S don't seem to have this commmand. Emerald does. In FR it's a nop.
2022-09-03 20:12:48 -05:00
Haven1433
ddf14d3837 Code cleanup 2022-09-03 00:07:36 -05:00
Haven1433
cf0e9dcc2e hex/decimal converter should support +/- 2022-09-01 21:54:14 -05:00
Haven1433
dc3cd28319 allow rom expansion to take MBs 2022-09-01 21:32:11 -05:00
Haven1433
d903c7e342 allow overworld sprite lists to have up to 27 sprites 2022-09-01 21:16:27 -05:00
Haven1433
5a4f63a8dc add option to copy crash message to clipboard 2022-09-01 21:15:43 -05:00
Haven1433
e35286c970 be more careful about which viewport we search
if multiple viewports are open on the same model, prefer to search the model from the viewport that the user has selected as a primary tab.
2022-09-01 20:18:23 -05:00
Haven1433
fc821ddd9d Expand tables using safe data
only expand the table using data that was already within the table for the new elements. This means that if you're doubling-or-more, you'll get the first element potentially multiple times (before you would get a _negative_ element, which doesn't exist)
2022-09-01 20:08:00 -05:00
Haven1433
8545fa95cb add right-click menu for controlling base-16/base-10 for length box 2022-09-01 19:58:16 -05:00
Haven1433
b704fb2f50 paste raw bytes
Pasting raw bytes is useful in a few situations. But pasting over a pointer isn't safe. So any time you paste over a pointer (or pointer in a table), paste-raw-bytes will clear the formatting. Other than that, it's an easy way to paste arbitrary data, but can cause issues if you're not careful, such as pasting over compressed data.
2022-09-01 16:12:14 -05:00
Haven1433
59c5c02f81 add 'Export All Table' function for images 2022-09-01 16:10:26 -05:00
Haven1433
aad0f4e48c fixes 2022-09-01 12:48:12 -05:00
Haven1433
52880278ea update battleScriptReference
thanks to AGSMG for helping to fill out some of these missing details
2022-09-01 12:45:33 -05:00
Haven1433
19c0d05030 support hex numbers in table length 2022-09-01 12:26:36 -05:00
Haven1433
cd78b16f69 revert owtextcolor change
This doesn't apply in vanilla
2022-09-01 11:19:53 -05:00
Haven1433
470f33266b Reading a pointer a ModelArrayElement should be smarter
If the user tries to get a field from a ModelArrayElement, and that field is a pointer that points to an ITable, do the same as GetSubTable would do.
2022-09-01 11:19:36 -05:00
Haven1433
6a761d9d23 Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2022-09-01 10:55:06 -05:00
TheDiamondMiner
55958724a0
Added a new value to default toml which is the owtextcolor for the unused value in overworld sprite (#95) 2022-09-01 10:54:45 -05:00
Haven1433
9a9d020f6e fix goto textbox height
wasn't quite tall enough for the text
2022-09-01 08:08:16 -05:00
Haven1433
bdcd527858 allow long tablestreams to become multiline
useful for pokemon teams, which can get very wide
2022-09-01 08:01:56 -05:00
Haven1433
c1651807d6 fix issues from tests
thanks tests
2022-09-01 08:01:21 -05:00
Haven1433
587dada550 update script commands 2022-09-01 07:24:44 -05:00
Haven1433
ca2ec54581 bump to 0.4.4.4
clear non-required files from the build directory
2022-08-31 22:48:02 -05:00
Haven1433
a2b01ca309 enum for trainer double battles 2022-08-31 22:28:54 -05:00
Haven1433
b7cd14f2c6 add emerald pc text table 2022-08-31 22:26:35 -05:00
Haven1433
967cec0d85 add pokeball catchrates 2022-08-31 22:26:08 -05:00
Haven1433
24184d4d1f fix tile removal edge case
if a tile isn't changed, don't remove it. This fixes an edge case in certain tilemaps (ex. emerald summary screen tilemap1) where a specific tile is used no matter what the tilemap says. Edits on the tilemap that don't effect the specific tile won't change the tile, and everything should still look right.
2022-08-31 22:13:22 -05:00
Haven1433
a70cdd38af match á and é 2022-08-31 20:40:56 -05:00
Haven1433
280fae25a6 scripts should remember their length
instead of calculating their length each time, an edited script can be passed its previous length. This lets you have multiple ends within the same script without issue.
2022-08-31 20:30:17 -05:00
Haven1433
68b4bc520d add macro support for gray as well as grey 2022-08-31 20:29:05 -05:00
Haven1433
1e9d380e22 Add a TableControl prototype
The Measure step of the ColumnStackPanel is very slow, because the ContentControls that it holds, created from the DataTemplates, are very complex. Maybe a custom control could be created for the table with a much simpler visual tree.
2022-08-31 20:14:49 -05:00
Haven1433
e49df51a98 Improve string matching logic performance
Instead of taking the available name.token.parts and concatenating them in every possible order, add an algorithm that can check for the best match among the possible tokens and use that. Then remove that token from the list and try to match the rest.

This algorithm is more complicated, but doesn't require as many string and list operations, and searches k short strings instead of E(k) long strings, so it's faster.
2022-08-31 20:12:45 -05:00
Haven1433
262180bee0 use a threadsafe dictionary for address/anchor mapping
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.
2022-08-30 21:42:01 -05:00
Haven1433
b2e776105f Improve script parsing logic
Previously, trying to edit a script with gotos/calls inline would cause trouble, because the destination is likely contained within the same script. But HMA parses the anchor and puts the script in a separate textbox, which is confusing. Worse, it prevents you from making your script longer, because it thinks it would overwrite itself because of the anchor.

Add logic to handle this case.
- If a script is completely contained within the script that's currently under edit, don't give the script its own textbox.
- If the script would overwrite some bytes, but those bytes are a script that (1) is totally contained within the script you're editing, and (2) is only referenced by the script you're editing; then allow the overwrite to occur.
2022-08-30 21:40:13 -05:00
Haven1433
7994bbc78d add logic for offsetting the sprite based on the elevation 2022-08-29 22:00:46 -05:00
Haven1433
7833c7fbe5 put limits on memory usage
* don't store undo/redo for patches
* don't store more than 1000 byte changes in the model
2022-08-29 21:39:28 -05:00
Haven1433
c79652d2fd don't copy text for splitter segments
these have no data and are purely for modeling
2022-08-29 20:49:59 -05:00
Haven1433
ce27bdcd53 trainers must have at least 1 pokemon
other arrays are limited to have at least 1 element, add that limit for trainer teams as well
2022-08-29 20:49:29 -05:00
Haven1433
6bd154ea22 Add easier-to-use expansion for uncompressed sprites
This works for LzRuns, make it work for uncompressed sprites as well
2022-08-29 20:24:17 -05:00
Haven1433
ed21535626 Store ToolPanelWidth in the ViewModel
WPF destroys the view whenever we switch tabs.
Store the ToolPanelWidth in the ViewModel so we can remember the value when changing tabs.
2022-08-29 07:38:13 -05:00
Haven1433
bc6fb382b2 typing text macros works in the hex content
also fixes a copy/paste bug
2022-08-26 22:55:24 -05:00
Haven1433
49fae5db0b allow tilemaps to include image switcher in the image tool 2022-08-26 21:31:38 -05:00
Haven1433
64050a4345 Cleanup Auto-Implement
This has been a thorn in the project's side for too long. Remove Auto-Implement from the project. Include the needed types, and the created implementations. If more implementations are needed, or the current implementations need to be updated, I can add them by hand. The implementations that I've actually needed have been comparable simple compared to what AutomImplement provides: I haven't needed custom property or event implementations, for example. And I haven't needed custom constructor overrides, or overrides for multiple methods with the same name. Go ahead and remove it, along with the code generation steps that come with compiling the app/tests.
2022-08-26 21:30:50 -05:00
Haven1433
0becbfac3f Tilemap tileset loading needs to be table-index aware
When showing a sprite in the table tool, we check to see what table index it is so we can use that index to find the palette. We need to do the same thing with tilesets. This means that GetPixels() needs a new parameter, the tableIndex, which can be passed in from any context that cares about it. Most of the time, getting the pixels doesn't care what the table index is. But now tilemaps can use this to figure out which tileset to use.
2022-08-25 22:46:48 -05:00