mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 03:40:20 +02:00
Remove Emote App bar when in HMD mode and re-enable conditionally; don't allow keyboard shortcuts to work in HMD
This commit is contained in:
parent
7f45a7b45c
commit
5869ed3f20
1 changed files with 19 additions and 0 deletions
|
@ -359,6 +359,10 @@ var APPLAUD_KEY = "v";
|
||||||
var POINT_KEY = "b";
|
var POINT_KEY = "b";
|
||||||
var EMOTE_WINDOW = "f";
|
var EMOTE_WINDOW = "f";
|
||||||
function keyPressHandler(event) {
|
function keyPressHandler(event) {
|
||||||
|
if (HMD.active) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!event.isAutoRepeat && ! event.isMeta && ! event.isControl && ! event.isAlt) {
|
if (!event.isAutoRepeat && ! event.isMeta && ! event.isControl && ! event.isAlt) {
|
||||||
if (event.text === POSITIVE_KEY) {
|
if (event.text === POSITIVE_KEY) {
|
||||||
triggerReactionWrapper("positive");
|
triggerReactionWrapper("positive");
|
||||||
|
@ -461,6 +465,19 @@ function onSettingsValueChanged(settingName, newValue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onDisplayModeChanged(isHMDMode) {
|
||||||
|
reactionsBegun.forEach(function(react) {
|
||||||
|
endReactionWrapper(react);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (isHMDMode) {
|
||||||
|
handleEmoteIndicatorVisibleChanged(false);
|
||||||
|
} else if (Settings.getValue("simplifiedUI/emoteIndicatorVisible", true)) {
|
||||||
|
handleEmoteIndicatorVisibleChanged(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var EmojiAPI = Script.require("./emojiApp/simplifiedEmoji.js");
|
var EmojiAPI = Script.require("./emojiApp/simplifiedEmoji.js");
|
||||||
var emojiAPI = new EmojiAPI();
|
var emojiAPI = new EmojiAPI();
|
||||||
var keyPressSignalsConnected = false;
|
var keyPressSignalsConnected = false;
|
||||||
|
@ -493,6 +510,7 @@ function init() {
|
||||||
|
|
||||||
Window.geometryChanged.connect(onGeometryChanged);
|
Window.geometryChanged.connect(onGeometryChanged);
|
||||||
Settings.valueChanged.connect(onSettingsValueChanged);
|
Settings.valueChanged.connect(onSettingsValueChanged);
|
||||||
|
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
||||||
emojiAPI.startup();
|
emojiAPI.startup();
|
||||||
|
|
||||||
getSounds();
|
getSounds();
|
||||||
|
@ -527,6 +545,7 @@ function shutdown() {
|
||||||
|
|
||||||
Window.geometryChanged.disconnect(onGeometryChanged);
|
Window.geometryChanged.disconnect(onGeometryChanged);
|
||||||
Settings.valueChanged.disconnect(onSettingsValueChanged);
|
Settings.valueChanged.disconnect(onSettingsValueChanged);
|
||||||
|
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
||||||
|
|
||||||
if (keyPressSignalsConnected) {
|
if (keyPressSignalsConnected) {
|
||||||
Controller.keyPressEvent.disconnect(keyPressHandler);
|
Controller.keyPressEvent.disconnect(keyPressHandler);
|
||||||
|
|
Loading…
Reference in a new issue