Created
August 20, 2015 09:55
-
-
Save mekwall/78c2e4768ba782b0adf0 to your computer and use it in GitHub Desktop.
Ehrmagherd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start polling it for online check and game installed properly (ie the API is setup correctly) | |
// Origin needs some time starting + settings up the actual API correctly... | |
var pollCheckIfSignedIn = function() { | |
originlaunch.isOriginRunning(function(isRunning) { | |
if(isRunning) { | |
originlaunch.isOriginLoggedIn(function(isLoggedIn) { | |
if(isLoggedIn) { | |
function pollCheckIfGameIsInstalled() { | |
originlaunch.isGameInstalled(S.globalContext.realm.game, | |
function (isInstalled) { | |
if(isInstalled) { // We got a proper answer, everything is set up! | |
setTimeout(function() { | |
$(dialog).find("#joinflow-pluginpopup-continuebutton").removeClass("disabled").click(); | |
}, 1500); | |
} else { | |
setTimeout(pollCheckIfGameIsInstalled, 1000); | |
} | |
}); | |
} | |
pollCheckIfGameIsInstalled(); | |
} else { | |
setTimeout(pollCheckIfSignedIn, 1000); | |
} | |
}); | |
} else { | |
setTimeout(pollCheckIfSignedIn, 1000); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment