Open keratagpro opened 8 years ago
I don't really know the internals of the game that well, so I'm not sure how much this would break things, but I thought this would make sense:
tagpro.ready.after = function(callback) { if (tagpro.resourcesLoaded) { - callback(); + setTimeout(callback, 0); } else { tagpro._afterReadyCallbacks.push(callback); } }
A use case I noticed was to have stuff run after tagpro.ready(createRenderer), but before tagpro.ready.after(tr.start). With the above change, this would work correctly in a userscript:
tagpro.ready(createRenderer)
tagpro.ready.after(tr.start)
tagpro.ready(function() { tagpro.renderer.options.transparent = true; });
which looks a lot simpler than the existing workaround: https://www.reddit.com/r/TagPro/comments/2xwwz4/userscript_newcomptes_transparent_canvas/
I don't really know the internals of the game that well, so I'm not sure how much this would break things, but I thought this would make sense:
A use case I noticed was to have stuff run after
tagpro.ready(createRenderer)
, but beforetagpro.ready.after(tr.start)
. With the above change, this would work correctly in a userscript:which looks a lot simpler than the existing workaround: https://www.reddit.com/r/TagPro/comments/2xwwz4/userscript_newcomptes_transparent_canvas/