Closed normano closed 8 months ago
I just updated the repo with a level.gd script that has an enum. With inline enum turned off, the world.gd script obfuscated does not reference any of the renamed enums.
Also line break before a func will break replacement of inner variable names
I'm gonna take a look at it in a short while, just want to finish something first.
No worries, I will keep looking for bugs so this is more resilient.
Line breaks before functions seem to have gotten fixed by one of the lambda changes I made.
I see now why those enum values values do not get renamed; enum values only work when they are getting accessed directly. Since constants are being evaluated before obfuscation anyways, "loading" all the enum values into constants like that should be fairly trivial.
Thanks for all the help!
Changed the title to better match the issue. Hope you don't mind! Anyway, I'm going to stop here for today and continue working on it tomorrow.
I changed const to var today and the problem persists, so it is not limited to const.
Fixed by b852b4dfd3c50b3ed5b1ef5931e8fa29a2bc6337
I changed const to var today and the problem persists, so it is not limited to const.
Not being able to assign inlined enums to variables is unfortunately an expected limitation. And honestly, I don't see why you would ever assign an enum to a variable instead of a constant, so I don't really want to spend time on that right now.
Inlined enums was unchecked, but hey the problem is fixed. Found one more bug that I'll put in another issue. Its a simple reserved keyword one.
Thanks for the report! This ended up being way more convoluted than I thought it would be. I hope the fix didn't break anything else, though it still works fine on my game.
When window.gd is obfuscated, you will see something like this:
Wth inline enums turned on, there is no longer a enum so cannot reference by constant, so I turned it off. After that the INFO/WARN/ERROR are still not replaced with the renamed enums.