mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
initial cut at some UserActivities for the bubble
This commit is contained in:
parent
b6b2f92af2
commit
37b738ff8b
3 changed files with 14 additions and 2 deletions
|
@ -56,7 +56,7 @@ void UserActivityLoggerScriptingInterface::palAction(QString action, QString tar
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::palOpened(float secondsOpened) {
|
void UserActivityLoggerScriptingInterface::palOpened(float secondsOpened) {
|
||||||
doLogAction("pal_opened", {
|
doLogAction("pal_opened", {
|
||||||
{ "seconds_opened", secondsOpened }
|
{ "seconds_opened", secondsOpened }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,14 @@ void UserActivityLoggerScriptingInterface::makeUserConnection(QString otherID, b
|
||||||
doLogAction("makeUserConnection", payload);
|
doLogAction("makeUserConnection", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserActivityLoggerScriptingInterface::bubbleToggled(bool newValue) {
|
||||||
|
doLogAction(newValue ? "bubbleOn" : "bubbleOff");
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserActivityLoggerScriptingInterface::bubbleActivated() {
|
||||||
|
doLogAction("bubbleActivated");
|
||||||
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::logAction(QString action, QVariantMap details) {
|
void UserActivityLoggerScriptingInterface::logAction(QString action, QVariantMap details) {
|
||||||
doLogAction(action, QJsonObject::fromVariantMap(details));
|
doLogAction(action, QJsonObject::fromVariantMap(details));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@ public:
|
||||||
Q_INVOKABLE void palAction(QString action, QString target);
|
Q_INVOKABLE void palAction(QString action, QString target);
|
||||||
Q_INVOKABLE void palOpened(float secondsOpen);
|
Q_INVOKABLE void palOpened(float secondsOpen);
|
||||||
Q_INVOKABLE void makeUserConnection(QString otherUser, bool success, QString details = "");
|
Q_INVOKABLE void makeUserConnection(QString otherUser, bool success, QString details = "");
|
||||||
|
Q_INVOKABLE void bubbleToggled(bool newValue);
|
||||||
|
Q_INVOKABLE void bubbleActivated();
|
||||||
Q_INVOKABLE void logAction(QString action, QVariantMap details = QVariantMap{});
|
Q_INVOKABLE void logAction(QString action, QVariantMap details = QVariantMap{});
|
||||||
private:
|
private:
|
||||||
void doLogAction(QString action, QJsonObject details = {});
|
void doLogAction(QString action, QJsonObject details = {});
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
/* global Script, Users, Overlays, AvatarList, Controller, Camera, getControllerWorldLocation */
|
/* global Script, Users, Overlays, AvatarList, Controller, Camera, getControllerWorldLocation, UserActivityLogger */
|
||||||
|
|
||||||
(function () { // BEGIN LOCAL_SCOPE
|
(function () { // BEGIN LOCAL_SCOPE
|
||||||
var button;
|
var button;
|
||||||
|
@ -76,6 +76,7 @@
|
||||||
// Called from the C++ scripting interface to show the bubble overlay
|
// Called from the C++ scripting interface to show the bubble overlay
|
||||||
function enteredIgnoreRadius() {
|
function enteredIgnoreRadius() {
|
||||||
createOverlays();
|
createOverlays();
|
||||||
|
UserActivityLogger.bubbleActivated();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used to set the state of the bubble HUD button
|
// Used to set the state of the bubble HUD button
|
||||||
|
@ -142,6 +143,7 @@
|
||||||
function onBubbleToggled() {
|
function onBubbleToggled() {
|
||||||
var bubbleActive = Users.getIgnoreRadiusEnabled();
|
var bubbleActive = Users.getIgnoreRadiusEnabled();
|
||||||
writeButtonProperties(bubbleActive);
|
writeButtonProperties(bubbleActive);
|
||||||
|
UserActivityLogger.bubbleToggled(bubbleActive);
|
||||||
if (bubbleActive) {
|
if (bubbleActive) {
|
||||||
createOverlays();
|
createOverlays();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue