MineKhan icon indicating copy to clipboard operation
MineKhan copied to clipboard

[Question] KA Version Refactoring

Open MicrolemurDev opened this issue 3 years ago • 2 comments

I know the KA Version isn't up to date but I have been playing with the source code and found that trying to split up the JavaScript causes huge console spam relating to the render context. I am curious how the source for this version was able to be split up without causing huge console error spam.

TLDR: I am getting huge amounts of errors when trying to move the KA Version to multiple files. Why is this?

MicrolemurDev avatar Dec 31 '21 20:12 MicrolemurDev

I assume you're running some initialization code more than you're supposed to or something. I can't answer questions about code I've never seen. Splitting code into multiple files on this project is a little complex because there's so many functions editing shared variables that aren't global. They're all in a big closure. Phi started splitting it up, and he mostly made it work by adding the shared variables to function parameters.

Willard21 avatar Dec 31 '21 20:12 Willard21

Now I got past some first issues but still am now dealing with drawScreens[screen] not being a function? Do you know where this is defined by any chance?

Refactoring code is annoying but has to be done.

MicrolemurDev avatar Dec 31 '21 21:12 MicrolemurDev

This isn't an issue with this version so I'm closing it.

Willard21 avatar Apr 14 '23 17:04 Willard21