![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | bitwes |
I’m trying to make some dynamic objects for testing purposes. If I was able to overload the load
function it would save me a WORLD of trouble. I don’t really care how ugly it is to do.
The more abstract issue is that I’m trying to mock objects that are loaded by a given script. I need to replace calls to load
and preload
to another method that will return the mocked scripts instead of what they are really trying to load. I’m already writing a new file based on the original, so I can replace the load
and preload
strings I find but that only works in trivial cases. If I want to be absolutely sure that I get them all and I’m not replacing load
in the middle of some string, I’ll have to make a complicated parsing algorithm.