Commit Graph

795 Commits

Author SHA1 Message Date
haven1433
db232c9675 Improve hover help logic 2023-08-02 23:11:00 -05:00
haven1433
2db6f890e9 update fadescreen 2023-08-02 23:10:35 -05:00
haven1433
b6cfcb3577 hide filler arguments 2023-07-31 23:03:57 -05:00
haven1433
0914efdb62 improve matching algorithm
instead of just preferring to match the lowest possible ID that counts as a partial match, add some extra criteria to make it act closer to how people expect.
* prefer entries where no letters are skipped
* prefer entries where the start of the partial matches the start of the full
2023-07-31 22:35:22 -05:00
haven1433
23a891a5eb improve documentation for msgbox.npc 2023-07-31 20:52:32 -05:00
haven1433
788d343357 text warnings get orange underline, not red underline (warning, not error) 2023-07-31 20:48:08 -05:00
haven1433
a958748824 script improvements: double-click highlight and tips
double-click on a command should highlight the entire command, even if it's a macro with `.`s.
When selecting a command, show the help tip for it.
2023-07-31 20:40:52 -05:00
haven1433
6bdc9e801c fixes from merge 2023-07-20 07:04:47 -05:00
haven1433
9930f21f9e Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2023-07-20 07:00:07 -05:00
ShinyTillDawn
47e54ec278
Professor Birch's Introduction Speech Dialogues (Attempt 2) (#173)
* Brought in the changes from PR #170.

I'll need to get the anchor refs for RS & FRLG.

I also bundled the \`tse` feature request for this file.

* Fixed Emerald's addresses.

Previously, they were addresses of the strings themselves instead of anchor references.

* Nested "speeches" under "professor."

* Making progress on finding FRLG anchor refs.

There are a few more I still need to add.

* Finished the Anchor refs for FRLG.

The Ruby/Sapphire Anchor refs are being started.

* Finished the Anchor refs for Ruby & Sapphire.

I tested them, and all of the anchors show up in the Generation III games.
2023-07-20 06:49:20 -05:00
ShinyTillDawn
34ea580f12
Made "buffer1" through "buffer3" valid arguments. (#176)
"buffer1" is associated with 0 for a parameter in a command like "buffernumber." That misalignment by 1 can cause some confusion, so this change will allow the word "buffer1" to be used instead of 0 for such commands to line up with the \\ 02 text macro ([buffer1]) that would be used afterwards.
2023-07-20 06:45:56 -05:00
agsmgmaster64
56fc56265f
tweaked some battle script commands (#175)
tweaked some battle script commands to allow reading pointers for those that support it
2023-07-20 06:43:52 -05:00
haven1433
65b51641c5 Add specials to documentation. 2023-07-19 22:33:26 -05:00
haven1433
c76acd2536 improve comments 2023-07-19 21:06:04 -05:00
haven1433
435a36a535 Add human-readable documentation for scripts 2023-07-14 06:44:03 -05:00
haven1433
c7485c5275 bugfixes from testing
* pressing escape should close the script tip
* fix automatic inclusion of <auto> behavior
* Fix possible crash when looking for closing } when there isn't one
* Only update TextEditor layers if they've changed (performance)
* creating a new event script should include lock/faceplayer/release
* adjust focus when switching tabs (close open tips)
* only try to access list coments if the list isn't null
2023-07-12 21:32:44 -05:00
haven1433
1fc1566d4c add comment 2023-07-09 20:23:47 -05:00
haven1433
cce2153c2b fix broken macro-arg-order conversion 2023-07-08 22:22:01 -05:00
haven1433
46f57a0a97 add error underlines for scripts 2023-07-08 00:05:34 -05:00
haven1433
daea25bd4e make it possible to add comments to list elements
right now the comments are only shown by the script editor. But they could be added to other things too, like maybe wild pokemon rates?
2023-07-07 08:58:16 -05:00
haven1433
f14b44eb5e decompiled scripts now have sections appearing in address order
instead of labeling sections based on what address calls them, label section based on what order they appear in memory.
2023-07-01 21:40:59 -05:00
haven1433
419f83a6fb allow 2-argument sub in thumb
both `sub rd, #` and `sub rd, rn` are now supported
2023-06-30 08:05:33 -05:00
haven1433
e095bace1e beef up insert missing closers
make the caret adjust correctly
insert a blank line between {}
move {} to newlines
2023-06-30 08:04:14 -05:00
haven1433
6fc0f568dc Basic implementation for flag/vars show&tell
Currently hidden
2023-06-29 19:31:08 -05:00
haven1433
348e1e5b96 don't combine scripts if an anchor has multiple pointers 2023-06-26 23:08:27 -05:00
haven1433
59fc5fc648 add multichoicegrid alias for multichoice3 2023-06-26 22:23:14 -05:00
haven1433
cc383f59a3 allow decompiled scripts to use anchor names 2023-06-26 22:22:21 -05:00
haven1433
fe740b525f add reflection palette tables 2023-06-26 22:11:39 -05:00
haven1433
2634ff50e8 Add python button capability for tables
Adding a field `name|python=function` to a table will add a button to the table. Clicking the button will run a python function from `hma.py`. The function is expected to have one element, which will be the current selected element of the table as a `ModelArrayElement`. This python code still has access to the entire rom and the print() function.
The button's text is based on the name of the field, and therefore cannot have a spaces or special characters, just letters / numbers.
The button will get tooltip that is based on the comment of the chosen function.
2023-06-26 21:24:13 -05:00
haven1433
c6555d2cd2 Update hex in table tool
* show hex values with leading 0x
* allow parsing hex values in non-hex fields and non-hex values in hex fields
* flags are shown in hex everywhere else, show them in hex in the table tool too
2023-06-25 17:00:09 -05:00
haven1433
33a26f4681 improve firstpersonview table
* allow expanding it
* better formatting for the first 2 columns
2023-06-25 14:41:25 -05:00
haven1433
04fd403ad1 add pokemon level for R/S/E starter 2023-06-23 21:12:33 -05:00
haven1433
5021083f3e add seagallop destination/count 2023-06-23 21:12:23 -05:00
haven1433
67506e5828 add if macros for gender/male/female goto/call 2023-06-23 20:35:39 -05:00
haven1433
f9f2f72698 add graphics.battle.hud.hpbox images for emerald 2023-06-23 20:11:49 -05:00
haven1433
d9020df3e2 fix possible crashes 2023-06-21 20:26:39 -05:00
haven1433
d072b42e57 Track multi-pointer commands correctly when using multiple <auto> 2023-06-21 20:26:21 -05:00
haven1433
2ac3f88541 add the concept of 'comment segments' for tables
This can allow the table to insert comments when writing the content as a string.

Also, update the formatting for wild pokemon summary
2023-06-20 23:39:46 -05:00
haven1433
97f5bb7589 self-referential scripts should add script formatting 2023-06-19 21:53:24 -05:00
haven1433
9e4b27f538 goto combo source -> use current source instead of initial source 2023-06-19 20:29:43 -05:00
haven1433
f724f70cdb Improve memory allocation
* Avoid using foreach/enumorables in `MacroScriptLine.Matches` since it's called so often.
* Use Span<char> to reduce string allocations in `ArrayRun.ctor` and `ArrayRunEnumSegment.GetOptions`
2023-06-14 22:31:55 -05:00
haven1433
bd35c3deb3 decrease memory footprint
* don't store the delta object used for initial setup
* avoid making lambdas in `ScriptLine.Matches`, which is called very often.
* use use List<int> instead of SortedSpan<int> for building the initial DestinationToSource cache, since we're already guaranteed that they'll be added in order and without duplicates. This greatly reduces the number of int[] arrays created during startup.
* allow `ArrayRunPointerSegment` to cache the table content results from parsing its InnerFormat, so it doesn't have to re-parse each time. This greatly reduces the number of string allocations.
* Use `ThreadSafeDictionary` for `TryGetValueCaseInsensitive` so we don't need to create a new collection of keys each time we call the method. Also add key caching to `ThreadSafeDictionary` so we don't need to make a new collection each time it's requested.
* Make `GetOptions` return a readonly list. We already know it's unique, this means we don't have to make a new collection every time we parse segments.
* limit the number of undo tokens we store (default 100) to save memory
* Use `byte[]` and `Array.Copy` instead of `List<byte>` and `AddRange` to reduce byte array allocations when loading a file.
* Freeze geometries in the `Icons` collection.
* add option for running garbage collection from the developer menu
* use a custom `AutomationPeer` to prevent WPF from holding memory after controls have been closed.
2023-06-14 20:54:36 -05:00
haven1433
8f131f1bfa fix label resolution for data pointers
Only allow adding unresolved labels for script pointers
2023-06-14 00:18:35 -05:00
haven1433
e10dfb00ab fix scriptRef bugs
* fix documentation for checktrainerflag
* fix typo in if yes/no goto/call
2023-06-12 23:33:06 -05:00
haven1433
32c5c558e5 code cleanup
* Remove the `compact` macro, since it's just a combination of 3 macros that each make sense by themselves. The goal for macros is to put them in situations where you wouldn't ever want the command by itself.
* Move the `if` macros down to live with the other `if` macros.
2023-06-05 22:36:14 -05:00
ShinyTillDawn
08cf3a1015
Revamping the Yes/No Message Box (#165)
* The `(` symbol has been moved.

This was supposed to go in the previous pull request, but I was too late...

* Added another `msgbox.yesno` macro.

No testing has been done yet.

* Added if.yes & if.no macroes.

Caution: These macroes will show up unintentionally if you're using commands other than msgbox.yesno that involve comparing the last result variable (800D) with the literal number 1.

* Fixed the `ptr` pointer format.

my bad
2023-06-05 22:28:05 -05:00
ShinyTillDawn
6eb79dac33
New trainerbattle macros (#162)
* Configured the macroes.

* Added comments to the macros.

They seem all jumbled up.

* Added corresponding cmds. for trainerbattle 0−8.

Testing needs to be done to make sure they work atm.

* Updated trainerbattle 09 & 0C.

though trainerbattle 09 will need another change.

* Added trainerbattle 09 types based on a bit field.

Right-most bit: Whether or not the player can lose

Second-right-most bit: Tutorial battle w/ Professor Oak

Based on the combinations of bits, I added more variants to FRLG's `trainerbattle 09` command.

* LocalIDs are correctly filled in as 1/2-words now.

My bad

---------

Co-authored-by: haven1433 <haven1433@gmail.com>
2023-06-05 22:22:34 -05:00
haven1433
e39ace9b7d script parser improvements
make it possible for a script edit to expand the rom, rather than running out of space.

make a leading `0x` work for commands that expect pointers
2023-06-04 21:39:11 -05:00
haven1433
ed4a6f755c allow script macros to be game-specific 2023-06-04 20:59:47 -05:00
ShinyTillDawn
f442c1ebb8
Added the data.items.berry.master.berries table. (#163)
I thought the Berry Master & his wife would pull items from this table to give to the player if the player inputted the correct phrases; however, this specific table is only referenced in the `SetOpponentsBerryData` function in Pokémon Emerald.
2023-06-03 15:59:02 -05:00