mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 22:06:18 +02:00
send UserActivityLogger events when tablet is opened or closed
This commit is contained in:
parent
1c7c0f7a76
commit
e3af5032c0
3 changed files with 13 additions and 2 deletions
|
@ -16,6 +16,14 @@ void UserActivityLoggerScriptingInterface::enabledEdit() {
|
|||
logAction("enabled_edit");
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::openedTablet() {
|
||||
logAction("opened_tablet");
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::closedTablet() {
|
||||
logAction("closed_tablet");
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::openedMarketplace() {
|
||||
logAction("opened_marketplace");
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ class UserActivityLoggerScriptingInterface : public QObject, public Dependency {
|
|||
Q_OBJECT
|
||||
public:
|
||||
Q_INVOKABLE void enabledEdit();
|
||||
Q_INVOKABLE void openedTablet();
|
||||
Q_INVOKABLE void closedTablet();
|
||||
Q_INVOKABLE void openedMarketplace();
|
||||
Q_INVOKABLE void toggledAway(bool isAway);
|
||||
Q_INVOKABLE void tutorialProgress(QString stepName, int stepNumber, float secondsToComplete,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
/* global Script, HMD, WebTablet, UIWebTablet */
|
||||
/* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablet, Overlays, MyAvatar */
|
||||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
var tabletShown = false;
|
||||
|
@ -65,8 +65,10 @@
|
|||
hideTabletUI();
|
||||
HMD.closeTablet();
|
||||
} else if (HMD.showTablet && !tabletShown) {
|
||||
UserActivityLogger.openedTablet();
|
||||
showTabletUI();
|
||||
} else if (!HMD.showTablet && tabletShown) {
|
||||
UserActivityLogger.closedTablet();
|
||||
hideTabletUI();
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +88,6 @@
|
|||
var accumulatedLevel = 0.0;
|
||||
// Note: Might have to tweak the following two based on the rate we're getting the data
|
||||
var AVERAGING_RATIO = 0.05;
|
||||
var MIC_LEVEL_UPDATE_INTERVAL_MS = 100;
|
||||
|
||||
// Calculate microphone level with the same scaling equation (log scale, exponentially averaged) in AvatarInputs and pal.js
|
||||
function getMicLevel() {
|
||||
|
|
Loading…
Reference in a new issue