mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
Restore "away" behavior when restart script
This commit is contained in:
parent
6749239e4e
commit
3857fa1a4d
1 changed files with 7 additions and 3 deletions
|
@ -147,6 +147,11 @@ function handlePanMode(dx, dy) {
|
|||
Camera.setOrientation(orientationOf(vector));
|
||||
}
|
||||
|
||||
function enableAway(enable) {
|
||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||
Messages.sendMessage(CHANNEL_AWAY_ENABLE, enable ? "enable" : "disable", true);
|
||||
}
|
||||
|
||||
function saveCameraState() {
|
||||
oldMode = Camera.mode;
|
||||
oldPosition = Camera.getPosition();
|
||||
|
@ -204,9 +209,7 @@ function handleModes() {
|
|||
|
||||
mode = newMode;
|
||||
|
||||
// Don't go "away" when press Esc key while inspecting.
|
||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||
Messages.sendMessage(CHANNEL_AWAY_ENABLE, mode === noMode ? "enable" : "disable" , true);
|
||||
enableAway(mode === noMode);
|
||||
}
|
||||
|
||||
function keyPressEvent(event) {
|
||||
|
@ -331,6 +334,7 @@ function rotateTowardsTarget() {
|
|||
function scriptEnding() {
|
||||
if (mode !== noMode) {
|
||||
restoreCameraState();
|
||||
enableAway(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue