pushing with new fix

This commit is contained in:
Wayne Chen 2018-10-17 15:03:09 -07:00
parent 0e0542ec6e
commit fd3c0d2f76
7 changed files with 33 additions and 3 deletions

View file

@ -3534,6 +3534,7 @@ void Application::setIsInterstitialMode(bool interstitialMode) {
if (enableInterstitial) {
if (_interstitialMode != interstitialMode) {
_interstitialMode = interstitialMode;
emit interstitialModeChanged(_interstitialMode);
DependencyManager::get<AudioClient>()->setAudioPaused(_interstitialMode);
DependencyManager::get<AvatarManager>()->setMyAvatarDataPacketsPaused(_interstitialMode);

View file

@ -334,6 +334,8 @@ signals:
void uploadRequest(QString path);
void interstitialModeChanged(bool isInInterstitialMode);
void loginDialogPoppedUp();
public slots:

View file

@ -54,6 +54,9 @@ WindowScriptingInterface::WindowScriptingInterface() {
});
connect(qApp->getWindow(), &MainWindow::windowGeometryChanged, this, &WindowScriptingInterface::onWindowGeometryChanged);
connect(qApp, &Application::interstitialModeChanged, [this] (bool interstitialMode) {
emit interstitialModeChanged(interstitialMode);
});
}
WindowScriptingInterface::~WindowScriptingInterface() {

View file

@ -619,6 +619,14 @@ signals:
*/
void redirectErrorStateChanged(bool isInErrorState);
/**jsdoc
* Triggered when interstitial mode changes.
* @function Window.interstitialModeChanged
* @param {bool} interstitialMode - The mode of the interstitial is changed to.
* @returns {Signal}
*/
void interstitialModeChanged(bool interstitialMode);
/**jsdoc
* Triggered when a still snapshot has been taken by calling {@link Window.takeSnapshot|takeSnapshot} with
* <code>includeAnimated = false</code> or {@link Window.takeSecondaryCameraSnapshot|takeSecondaryCameraSnapshot}.

View file

@ -14,6 +14,7 @@
(function() {
Script.include("/~/system/libraries/Xform.js");
Script.include("/~/system/libraries/globals.js");
var DEBUG = false;
var MIN_LOADING_PROGRESS = 3.6;
var TOTAL_LOADING_PROGRESS = 3.8;
@ -379,6 +380,12 @@
var currentProgress = 0.1;
function updateOverlays(physicsEnabled) {
if (isInterstitialOverlaysVisible !== !physicsEnabled) {
// visible changed
isInterstitialOverlaysVisible = !physicsEnabled;
}
var properties = {
visible: !physicsEnabled
};

View file

@ -9,3 +9,5 @@
//
HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
isInterstitialOverlaysVisible = false;

View file

@ -14,11 +14,11 @@
//
(function () { // BEGIN LOCAL_SCOPE
function debug() {
//print.apply(null, arguments);
}
Script.include("/~/system/libraries/globals.js");
var rawProgress = 100, // % raw value.
displayProgress = 100, // % smoothed value to display.
alpha = 0.0,
@ -83,7 +83,9 @@
// The initial delay cooldown keeps us from tracking progress before the allotted time
// has passed.
INITIAL_DELAY_COOLDOWN_TIME = 1000,
initialDelayCooldown = 0;
initialDelayCooldown = 0,
isInInterstitialMode = false;
function fade() {
@ -265,7 +267,7 @@
// Update state
if (!visible) { // Not visible because no recent downloads
if (displayProgress < 100 || gpuTextures > 0) { // Have started downloading so fade in
if ((displayProgress < 100 || gpuTextures > 0) && !(isInInterstitialMode || isInterstitialOverlaysVisible)) { // Have started downloading so fade in
visible = true;
alphaDelta = ALPHA_DELTA_IN;
fadeTimer = Script.setInterval(fade, FADE_INTERVAL);
@ -344,6 +346,10 @@
}
}
function interstitialModeChanged(inMode) {
isInInterstitialMode = inMode;
}
function setUp() {
var is4k = Window.innerWidth > 3000;
@ -369,6 +375,7 @@
}
setUp();
Window.interstitialModeChanged.connect(interstitialModeChanged);
GlobalServices.downloadInfoChanged.connect(onDownloadInfoChanged);
GlobalServices.updateDownloadInfo();
Script.setInterval(update, 1000 / 60);