mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
Merge pull request #8705 from ZappoMan/removeMicNotifications
remove mic and window resize notifications
This commit is contained in:
commit
0ee1156e5c
1 changed files with 5 additions and 36 deletions
|
@ -17,11 +17,9 @@
|
||||||
// keystroke:
|
// keystroke:
|
||||||
//
|
//
|
||||||
// CTRL/s for snapshot.
|
// CTRL/s for snapshot.
|
||||||
// CTRL/m for mic mute and unmute.
|
|
||||||
|
|
||||||
// System generated notifications:
|
// System generated notifications:
|
||||||
// If Screen is resized.
|
// Connection refused.
|
||||||
// If mic is muted for any reason.
|
|
||||||
//
|
//
|
||||||
// To add a new System notification type:
|
// To add a new System notification type:
|
||||||
//
|
//
|
||||||
|
@ -92,16 +90,12 @@ var lodTextID = false;
|
||||||
|
|
||||||
var NotificationType = {
|
var NotificationType = {
|
||||||
UNKNOWN: 0,
|
UNKNOWN: 0,
|
||||||
MUTE_TOGGLE: 1,
|
SNAPSHOT: 1,
|
||||||
SNAPSHOT: 2,
|
LOD_WARNING: 2,
|
||||||
WINDOW_RESIZE: 3,
|
CONNECTION_REFUSED: 3,
|
||||||
LOD_WARNING: 4,
|
EDIT_ERROR: 4,
|
||||||
CONNECTION_REFUSED: 5,
|
|
||||||
EDIT_ERROR: 6,
|
|
||||||
properties: [
|
properties: [
|
||||||
{ text: "Mute Toggle" },
|
|
||||||
{ text: "Snapshot" },
|
{ text: "Snapshot" },
|
||||||
{ text: "Window Resize" },
|
|
||||||
{ text: "Level of Detail" },
|
{ text: "Level of Detail" },
|
||||||
{ text: "Connection Refused" },
|
{ text: "Connection Refused" },
|
||||||
{ text: "Edit error" }
|
{ text: "Edit error" }
|
||||||
|
@ -446,19 +440,6 @@ function wordWrap(str) {
|
||||||
return stringDivider(str, 43.0, "\n");
|
return stringDivider(str, 43.0, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// This fires a notification on window resize
|
|
||||||
function checkSize() {
|
|
||||||
if ((Window.innerWidth !== ourWidth) || (Window.innerHeight !== ourHeight)) {
|
|
||||||
var windowResize = "Window has been resized";
|
|
||||||
ourWidth = Window.innerWidth;
|
|
||||||
ourHeight = Window.innerHeight;
|
|
||||||
windowDimensions = Controller.getViewportDimensions();
|
|
||||||
overlayLocationX = (windowDimensions.x - (width + 60.0));
|
|
||||||
buttonLocationX = overlayLocationX + (width - 35.0);
|
|
||||||
createNotification(windowResize, NotificationType.WINDOW_RESIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
var nextOverlay,
|
var nextOverlay,
|
||||||
noticeOut,
|
noticeOut,
|
||||||
|
@ -480,7 +461,6 @@ function update() {
|
||||||
|
|
||||||
frame += 1;
|
frame += 1;
|
||||||
if ((frame % 60.0) === 0) { // only update once a second
|
if ((frame % 60.0) === 0) { // only update once a second
|
||||||
checkSize(); // checks for size change to trigger windowResize notification
|
|
||||||
locationY = 20.0;
|
locationY = 20.0;
|
||||||
for (i = 0; i < arrays.length; i += 1) { //repositions overlays as others fade
|
for (i = 0; i < arrays.length; i += 1) { //repositions overlays as others fade
|
||||||
nextOverlay = Overlays.getOverlayAtPoint({ x: overlayLocationX, y: locationY });
|
nextOverlay = Overlays.getOverlayAtPoint({ x: overlayLocationX, y: locationY });
|
||||||
|
@ -533,16 +513,6 @@ function isStartingUp() {
|
||||||
return startingUp;
|
return startingUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Triggers mic mute notification
|
|
||||||
function onMuteStateChanged() {
|
|
||||||
var muteState,
|
|
||||||
muteString;
|
|
||||||
|
|
||||||
muteState = AudioDevice.getMuted() ? "muted" : "unmuted";
|
|
||||||
muteString = "Microphone is now " + muteState;
|
|
||||||
createNotification(muteString, NotificationType.MUTE_TOGGLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDomainConnectionRefused(reason) {
|
function onDomainConnectionRefused(reason) {
|
||||||
createNotification("Connection refused: " + reason, NotificationType.CONNECTION_REFUSED);
|
createNotification("Connection refused: " + reason, NotificationType.CONNECTION_REFUSED);
|
||||||
}
|
}
|
||||||
|
@ -653,7 +623,6 @@ LODManager.LODDecreased.connect(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
AudioDevice.muteToggled.connect(onMuteStateChanged);
|
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
Controller.mousePressEvent.connect(mousePressEvent);
|
Controller.mousePressEvent.connect(mousePressEvent);
|
||||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||||
|
|
Loading…
Reference in a new issue