UndertaleModTool
UndertaleModTool copied to clipboard
UA: Add rough check for CodeLocals' removal from FUNC in 2024.8
Description
As @colinator27 noted around the time of GM 2024.8(00) Beta's release, this GM version removes the CodeLocals list from the FUNC chunk. This PR adds logic to detect this, and makes builtin scripts aware of this.
Might fix #1928.
For contributors: feel free to continue this yourself if it's stuck in limbo or something.
Caveats
- HEAVILY UNTESTED, the disassembler didn't get touched a lot. I only checked whether (de)serialization works as expected.
- Variable names are no longer highlighted in the code editor.
Notes
Data.CodeLocals is now null if the bytecode version doesn't support it, it must be created manually if needed.
Download the artifacts for this pull request here:
GUI:
- GUI-windows-latest-isBundled-false-isSingleFile-true
- GUI-windows-latest-isBundled-false-isSingleFile-false
CLI:
Doesn't look too wrong so bug catching can take place. No clue what to do with the disassembler's message
~~Amazing UX GitHub, I'm trying again. Might fix #1928.~~ Incomprehensible
I am unable to use the search function when using this artifact fyi, but it does load 2024.8 data for reading and some editing. It seems to have a chance to somehow corrupt gml scripts, from time to time when I make a modification and leave a script, I'll try to come back to it and get that giant wall of greentext.
Can confirm that it does fix https://github.com/UnderminersTeam/UndertaleModTool/issues/1928
I modified the NewTextureRepacker script to be a form instead of a messagebox. This is useful since it contains user configurable items that the user may wish to change on a per-game basis. The reuse extracted items checkbox does not work atm. Feel free to implement it and adjust.
FYI I am using this build and as of 2024.11 there is a SHDR error on data.win load as seen in #1996. Does not occur with every game. If a data.win does load, it has about a minute of misaligned readings to wade through.
Okay, while there's all sorts of weirdness brought by this, like the mildly inconvenient code editor UI situation (probably got to rely on Colin's work here anyway as I have no idea how all that stuff works). Signs lead me to believe this is fair enough for initial implementation, and basically I'm done with it at this point (focus has moved on to #2013), so it's probably the right time (finally) to open this up for review so things can get moving faster.