whitespace + "waiting for entity server"

No functionality changes, but now prints "waiting for entity server"
once if waiting for more than X seconds in startup().
This commit is contained in:
Seiji Emery 2015-09-18 11:18:33 -07:00
parent c25d8857d9
commit e723a5c0fd

View file

@ -985,7 +985,7 @@ var PLATFORM_SHAPE_DIMENSIONS_RANGE = [ 0.001, 2.0 ]; // axis-aligned entity dim
/// Setup the UI. Creates a bunch of sliders for setting the platform radius, density, and entity color / shape properties.
/// The entityCount slider is readonly.
function _setupUI (platform) {
var layoutContainer = makePanel("+y", { visible: true });
var layoutContainer = makePanel("+y", { visible: false });
// layoutContainer.setPosition(10, 280);
// makeDraggable(layoutContainer);
_export.onScreenResize = function () {
@ -1173,7 +1173,7 @@ var CATCH_ERRORS_FROM_EVENT_UPDATES = false;
}
// Delays startup until / if entities can be spawned.
this.startup = function () {
this.startup = function (dt) {
if (Entities.canAdjustLocks() && Entities.canRez()) {
Script.update.disconnect(this.startup);
@ -1202,8 +1202,19 @@ var CATCH_ERRORS_FROM_EVENT_UPDATES = false;
Controller.mousePressEvent.connect(UI.handleMousePress);
Controller.mouseMoveEvent.connect(UI.handleMouseMove);
Controller.mouseReleaseEvent.connect(UI.handleMouseRelease);
} else {
if (!startup.printedWarnMsg) {
startup.timer = startup.timer || startup.ENTITY_SERVER_WAIT_TIME;
if ((startup.timer -= dt) < 0.0) {
logMessage("Waiting for entity server");
startup.printedWarnMsg = true;
}
}
}
}
startup.ENTITY_SERVER_WAIT_TIME = 0.2; // print "waiting for entity server" if more than this time has elapsed in startup()
Script.update.connect(this.startup);
})();