tl; dr : How to reload included .js with the -always-load-scripts option?
The long version :
I'm writing a Skelton script that does all the init stuff / prototype and all those things I still don't fully understand :p
Inside the Skelton.prototype.beginEvent = function(), I include("child scripts.js"); that contains nothing but the actual drawing. (ala simple.js that includes simple_create.js, ...)
An example (Don't mind those variables and functions, they are defined in another include("post_ui.js"); and another script) :
Inside child_script.js
Code: Select all
getNewDrawing();
//Circle on Layer 0
addCircle( 0 , 0 , ray );
//Green Circles
addLayer( "Little Circles" , new RColor(0 , 255 , 0) );
addCircles( [
[ ray , 0 , ray/9 ],
[ -ray , 0 , ray/9 ],
[ new RVector( 0 , -ray ) , ray/9 ],
[ new RVector.createPolar( ray , Math.PI/2 ) , ray/9 ],
] );
// More stuff there
EAction.getGraphicsView().autoZoom();
But when I modify the code in the included script, I always need to restart Qcad for the changes to take effect.
Do I need to add some magic code to reload the included script without reloading Qcad?
Do I need to change the very way I do my (I know :p) voodoo coding? If so, how? Ideas are welcome !
Thanks for reading !