mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
fixing bug with hover overlay
This commit is contained in:
parent
35ca75093a
commit
efeb598495
1 changed files with 26 additions and 12 deletions
|
@ -356,6 +356,26 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onEnterOverlay(overlayID, event) {
|
||||||
|
if (currentDomain === "no domain") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (overlayID === loadingToTheSpotID) {
|
||||||
|
Overlays.editOverlay(loadingToTheSpotID, {visible: false});
|
||||||
|
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLeaveOverlay(overlayID, event) {
|
||||||
|
if (currentDomain === "no domain") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (overlayID === loadingToTheSpotHoverID) {
|
||||||
|
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
|
||||||
|
Overlays.editOverlay(loadingToTheSpotID, {visible: true});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var currentProgress = 0.1;
|
var currentProgress = 0.1;
|
||||||
|
|
||||||
function updateOverlays(physicsEnabled) {
|
function updateOverlays(physicsEnabled) {
|
||||||
|
@ -482,6 +502,8 @@
|
||||||
|
|
||||||
if (errorConnectingToDomain) {
|
if (errorConnectingToDomain) {
|
||||||
updateOverlays(errorConnectingToDomain);
|
updateOverlays(errorConnectingToDomain);
|
||||||
|
// setting hover id to invisible
|
||||||
|
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
|
||||||
endAudio();
|
endAudio();
|
||||||
currentDomain = "no domain";
|
currentDomain = "no domain";
|
||||||
timer = null;
|
timer = null;
|
||||||
|
@ -496,6 +518,8 @@
|
||||||
return;
|
return;
|
||||||
} else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) {
|
} else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) {
|
||||||
updateOverlays((physicsEnabled || connectionToDomainFailed));
|
updateOverlays((physicsEnabled || connectionToDomainFailed));
|
||||||
|
// setting hover id to invisible
|
||||||
|
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
|
||||||
endAudio();
|
endAudio();
|
||||||
currentDomain = "no domain";
|
currentDomain = "no domain";
|
||||||
timer = null;
|
timer = null;
|
||||||
|
@ -506,19 +530,9 @@
|
||||||
var whiteColor = {red: 255, green: 255, blue: 255};
|
var whiteColor = {red: 255, green: 255, blue: 255};
|
||||||
var greyColor = {red: 125, green: 125, blue: 125};
|
var greyColor = {red: 125, green: 125, blue: 125};
|
||||||
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
|
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
|
||||||
Overlays.hoverEnterOverlay.connect(function(overlayID, event) {
|
Overlays.hoverEnterOverlay.connect(onEnterOverlay);
|
||||||
if (overlayID === loadingToTheSpotID) {
|
|
||||||
Overlays.editOverlay(loadingToTheSpotID, {visible: false});
|
|
||||||
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Overlays.hoverLeaveOverlay.connect(function(overlayID, event) {
|
Overlays.hoverLeaveOverlay.connect(onLeaveOverlay);
|
||||||
if (overlayID === loadingToTheSpotHoverID) {
|
|
||||||
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
|
|
||||||
Overlays.editOverlay(loadingToTheSpotID, {visible: true});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
location.hostChanged.connect(domainChanged);
|
location.hostChanged.connect(domainChanged);
|
||||||
location.lookupResultsFinished.connect(function() {
|
location.lookupResultsFinished.connect(function() {
|
||||||
|
|
Loading…
Reference in a new issue