cameroncondry / cbc-kitten-scientists

Add-on for the wonderful incremental browser game: http://kittensgame.com/web/
MIT License
113 stars 94 forks source link

Make plugin load after gamePage is available #174

Closed zelenay closed 8 years ago

zelenay commented 8 years ago

Fixes #171 - The game is now loaded asynchronously, which causes gamePage to not be available when the script is started.

Whole script is wrapped into run() function that is called after gamePage is available. Function loadTest does the check every 2s.

oliversalzburg commented 8 years ago

Did you change the line endings in the second commit? It looks like every single line was changed.

zelenay commented 8 years ago

For better reading I intended the whole script because it is wrapped in the function.

zelenay commented 8 years ago

Maybe I have to wrap only few last lines - from

// add the options above the game log right.prepend(optionsElement.append(optionsListElement));

I will test it and let you know.

zelenay commented 8 years ago

Well,

I would have to wrap it from line 910:

if (game.colorScheme !== 'sleek') {

or modify logic of preparing color scheme in Engine initialization - maybe new Manager first and then wrap only last few lines in run() function.

cameroncondry commented 8 years ago

Thank you for the update, I will go ahead and merge.