* Document a few script commands
* Undo change to initclock parameters
Variable numbers will display in hex even without a |h, so this change
was misguided.
---------
Co-authored-by: haven1433 <haven1433@gmail.com>
* Autocomplete Overlay supports TextEditor
* Add Overlay to CodyBody's ControlTemplate
* Don't show help tip when autocomplete is showing
* 3 categories of autocomplete:
-> streams
-> arguments
-> commands
pull examples from actual code, semi-randomly. This takes a lot longer, but produces much better documentation, including realistic values and streams.
documentation comes from multiple sources.
* It's assumed that there's a List called specials. Those specials are used to create documentation.scripting.overworld.reference.specials.*
* It's assumed that there's commands in scriptReference. Those commands are used to create documentation.scripting.overworld.reference.commands.*
* Content from docRefreence.txt is read to create additional documention links that open web pages
* Specified the formatting of some ptr<> fields.
I wasn't too sure about the "virtualbuffer" command, so I left it untouched.
* A few preliminary changes
Script command 0x10 should be "loadbyte" instead of "setbyte2," but based on the official description of the command, "setbyte" makes more sense over "loadbyte".
I kept the old names & comments for "jumpram" and such.
I also made the last 6 commands or so in battleAIScriptReference.txt exclusive to Emerald via the [BPEE] tag as those are only defined in Emerald, not the older games.
* Changed "resetvars" to "gettime."
* Replaced "playsong2" with "savesong".
* Switched commands 4D and 4E.
Both "checkdecoration" and "testdecoration" were in the wrong places. The pokéemerald decomp puts "checkdecor" at command 4D while "checkdecorspace" ("testdecoration") is positioned at command 4E.
* Corrected applymovement2's parameters.
Because the 2 bytes after the pointer in "applymovement2" actually correspond to map data, supplying invalid maps (thinking that they were bytes for the next few commands) could lead to bugs.
* Did the same treatment with "waitmovement2."
I also made sure that "bank" comes before "map" for both commands.
* Multiple changes
- Replaced more instances of x & y when they should be bank & map.
- Clarified what "spriteinvisible" and "spritevisible" do.
For commands like "hidesprite" and "showsprite", the decomps call them "removeobject" and "addobject," respectively. Those deal with flags while "spritevisible" and "spriteinvisible" deal with some other attribute.
* Added more info to the "repeattrainerbattle" cmd.
* Clarified the description for "waitkeypress".
* "showbox" and "clearbox" are a nop in Emerald.
* Added a description for "preparemsg2."
* Adjusted the descs of "cry" and "sethealingplace."
* Updated some descriptions.
Commands B1 & B2 are actually nops in Emerald, not RS. Either way, they were unused in RS. The "addelevmenuitem" command actually takes in 4 parameters.
* Added descriptions for "hidecoins" & "updatecoins"
* Added more descriptions.
* Added descriptions for commands D8 and D9.
* Finishing touches
`IndexOfPartial` now uses improved sort order.
Improved sort order now prefers shorter tokens over longer tokens (PIDGEOT before PIDGEOTTO)
GetBestOptions now uses SortOptions
TrainerPokemonTeamRun now uses SortOptions for autocomplete
Update tests based on new expected sort orders
* Include example usage for commands, created using random options (fixed seed)
* Include example usage of specials, using special2 with the most common var based on usage in whatever tabs are loaded.
* Use collapsible sections for details of both script commands and specials, so it's easier to browse.
when typing a script command, when you press space, it'll autocomplete to the 'best' match. So if you forget a period or capital letter, it'll still work the way you expect.