Commit Graph

1900 Commits

Author SHA1 Message Date
Benjamin Popp
31472fea77 ViewPort.GetSelectionSpan needs to be decorator aware 2021-02-20 21:04:59 -06:00
Benjamin Popp
0e075a34b7 Allow dragging in a PNG to the image editor to paste it in. 2021-02-20 21:04:34 -06:00
Benjamin Popp
b8a9686d57 Fix bugs in 2-palette sprites
When sprite has multiple palettes that it can render with, the image editor didn't quite work right.
2021-02-19 22:48:38 -06:00
Benjamin Popp
087a0260cc Support multiple game codes in the !game metacommand 2021-02-19 19:50:43 -06:00
Benjamin Popp
7ae90ec14d Allow '+' on LZSpriteRun length to increase by 1 row
For certain images, increasing the height is allowed. It doesn't need to be easy, just possible.
* For an uncompressed image, changing the format will work to increase the size of the run.
* For compressed images, allow the user to type '+' on the length to make it grow by one row.
2021-02-18 22:54:20 -06:00
Benjamin Popp
7502075ca2 Display known anchor names in bl commands 2021-02-18 22:02:29 -06:00
Benjamin Popp
5a1caef595 Allow loading .hma files as paste scripts 2021-02-18 21:36:04 -06:00
Benjamin Popp
36bf79e91b Add ability for to import content to the current tab.
Planned uses:
* Import an ips/ups into a ViewPort
* Import a .hma paste script into a ViewPort
* Import an image into the image editor
2021-02-18 21:25:47 -06:00
Benjamin Popp
6cc121bede Update newgame name tables 2021-02-18 21:13:20 -06:00
Benjamin Popp
1fb13c1160 Add !game metacommand
Allow paste-scripts to have sections that are specific to what game the script is being run on. Allows for creation of a single script that works on multiple games.
2021-02-18 20:56:24 -06:00
Benjamin Popp
e726dd1676 Paste-script improvements
Allow @anchor(length) to create a new anchor in a location with at least (length) freespace. Length is in hex.
Allow thumb branch instructions to include an offset.
Allow goto instructions to include an offset.
2021-02-17 19:47:47 -06:00
Benjamin Popp
92f73ddb87 Allow thumb script words and ldr commands to use anchors with offsets 2021-02-17 13:38:58 -06:00
Benjamin Popp
6a3ad1cf92 Limit the time used finding matches
Optimization: find matches should fail early if the search text contains a letter that the full text does not.
Optimization: don't try to match tokens that contain letters that aren't in the search text.
2021-02-16 09:28:12 -06:00
Benjamin Popp
d45c7c0461 Introduce data.pokemon.type.length
Since the number of types is determined from code that most existing hacks don't change, that means that the length will be interpreted as the default 18 for almost all hacks.

Since hacks that expand types often customize the end of the type chart, make the match-requirement for recognizing table streams a bit less strict.

Update table-length-from-constant logic to be more fault tolerant and to take the constant multiplier into account. Also fix a bug: the ValueOffset should be subtracted off, not added on.

And most importantly: add constants and update tables involving types.
2021-02-16 08:43:38 -06:00
Benjamin Popp
87a14ca975 Add concept of multiplier for constants
Constants currently can have a + or - offset. Now they can also have a * offset.
2021-02-16 07:51:40 -06:00
Benjamin Popp
62d9ead3da Don't crash if the tilemap is invalid 2021-02-15 12:40:34 -06:00
Benjamin Popp
a9b2da25c2 Initial Refactor for tileset limits
Introduce the concept of a 'max tiles' to the tileset format. Allow a tileset to know about the maximum number of tiles it's allowed to have.

By default, tilesets are limited to 1024 tiles. But some tilesets should have a reduced tile cap because of how they're used in the game. For example, Oak's background in the intro.
2021-02-14 21:59:15 -06:00
Benjamin Popp
64929159dc Limited Space: Autocomplete appears below text
In situations where space is limited below, autocomplete will appear above instead.
2021-02-14 13:56:40 -06:00
Benjamin Popp
a7c2fd143e Add credits text data 2021-02-14 13:31:37 -06:00
Benjamin Popp
ca8889e9fb Name the egg groups 2021-02-14 13:08:13 -06:00
Benjamin Popp
fe9d06ac35 Simplify table name 2021-02-14 12:52:22 -06:00
Benjamin Popp
ffc13bbe84 Don't crash if there's no app to run the current loaded file. 2021-02-14 12:52:12 -06:00
Benjamin Popp
931c006ce5 Add discord icon 2021-02-13 23:39:01 -06:00
Benjamin Popp
73ba6e79c6 Allow Combined Search Results
When multiple results are close together, allow them to be combined into a single result within the new tab. This makes the overall result shorter, and makes it easier to see when 2 pieces of data are near each other.
2021-02-13 23:22:01 -06:00
Benjamin Popp
ed6bc81796 Allow editing anchors from the middle. 2021-02-13 20:28:16 -06:00
Benjamin Popp
7c1f52ecee Make the Anchor visible from anywhere in the run 2021-02-13 20:15:01 -06:00
Benjamin Popp
5ba085c375 Search button upgrades
* Show the button in blue when Find is selected
* Button should toggle the Find tool on/off
2021-02-13 19:56:06 -06:00
Benjamin Popp
3decb84e2d Bugfix
If the stored metadata doesn't contain a constant (NextExportID, FreeSpaceBuffer, FreeSpaceSearch), then don't update when loading that metadata.
Change metadata's default FreeSpaceBuffer to -1 so that such metadata can be recognized.
2021-02-13 19:52:39 -06:00
Benjamin Popp
dc1e733990 Improve Home button
* Highlight Blue Goto menu is showing
* Toggle off if pressed while goto is open
2021-02-13 19:41:34 -06:00
Benjamin Popp
95fcde5ac2 Make HMA a single instance application
If you have 2 different instances of HMA, you can run them both. But if you try to launch the same instance twice, the info from the second instance gets passed to the first one. This improves the way HMA works with AdvanceMap.
2021-02-13 15:42:42 -06:00
Benjamin Popp
19882524f0 First pass at a toolbar
Navigate Forward/Back
Undo/Redo
Save/Run
Goto/Find
Row Width controls, so that they can be seen / edited while looking at an anchor.
2021-02-13 14:23:24 -06:00
Benjamin Popp
a179fac76c Enable/Disable the RunFile Command when the save status changes. 2021-02-13 14:10:58 -06:00
Benjamin Popp
5bd065d768 Make sure Undo notifies when it becomes enabled.
Previously, it was notifying change, but before an actual change was made: just when the ViewPort was requesting a token so that it can change. At that point, there's no actual change yet, so CanExecuteChange was still returning false.
2021-02-13 13:12:34 -06:00
Benjamin Popp
05487290c4 Add FreeSpaceBuffer to TOML file
Users have requested the ability to control how much space is skipped between runs. Right now, the default in 0x100 bytes. But this means that data ends up getting rather spaced out, in a way that may be undesirable.

Users can now adjust the spacing used when data auto-moves.
2021-02-12 23:09:45 -06:00
Benjamin Popp
4dff97f5c7 Allow search to find byte sequences that have XX wildcards in them 2021-02-12 22:18:54 -06:00
Benjamin Popp
0aa2eda178 Include buttons to link from data tables to enums in other tables that depend on those data tables.
Example: we can now see, for a given item, what trainers use that item. We can now see, for a given type, what moves use that type.
2021-02-12 21:55:52 -06:00
Benjamin Popp
ba9af90bf0 Fix sprite scale during very tall block selections 2021-02-12 21:33:53 -06:00
Benjamin Popp
9d308dd8f2 Eyedropper click-drag should select based on the current block size 2021-02-12 21:29:49 -06:00
Benjamin Popp
89808079d3 Update max height to be reasonable
Some textboxes are very small, others are very large. Make the size always reasonable.
2021-02-11 22:39:15 -06:00
Benjamin Popp
da22719d11 Change the ZIndex dynamically based on whether or not there's autocomplete available
This makes the autocomplete z-order correct for tables that have lots of streams in a row, such as the habitat editing.
2021-02-11 22:22:29 -06:00
Benjamin Popp
b592726255 Stop filtering the view when the Find option is closed.
If the user presses escape to close Find, return the view to its original visuals (00/FF greyed out, other bytes high contrast)
2021-02-11 21:46:31 -06:00
Benjamin Popp
b9f9eb0bf6 Improve OW updating logic
* update the palette link when the palette changes in the table tool
* update the selected palette when the sprite gets re-selected, even if the sprite was already selected.
2021-02-11 21:33:56 -06:00
Benjamin Popp
b6cc0d9220 Autocomplete for Item Effects 2021-02-11 12:06:01 -06:00
Benjamin Popp
fcf6b7b4c2 Add tests for trainer team moves 2021-02-10 21:39:45 -06:00
Benjamin Popp
8128b87aa0 Implement autocomplete for trainer pokemon and their items 2021-02-10 16:49:26 -06:00
Benjamin Popp
536acf39db Add combobox filtering for tuples
Also adjust the UI for narrower names and wider content.
2021-02-10 14:00:31 -06:00
Benjamin Popp
ce4f4d0206 Improve ChangeHistory
* Don't allow inserting a custom change during a transaction
* Don't end a transaction when a Goto happens because of a paste-script directive ( @{ or @} ).
2021-02-09 22:36:57 -06:00
Benjamin Popp
f419d5affa Update tests to not depend directly on ViewPort constructor
As part of this, make the ViewPort constructor's new parameter no longer optional.
2021-02-09 21:37:16 -06:00
Benjamin Popp
1a4be29a28 Update tests to not depend directly on ViewPort constructor 2021-02-09 21:24:07 -06:00
Benjamin Popp
10bb99092a Update tests to not depend directly on ViewPort constructor 2021-02-09 21:17:01 -06:00