mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-08 05:29:46 +02:00
Add controller name and update version in tutorial user stats
This commit is contained in:
parent
a1fea65aa5
commit
f3f6317c91
3 changed files with 11 additions and 5 deletions
|
@ -25,14 +25,15 @@ void UserActivityLoggerScriptingInterface::toggledAway(bool isAway) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::tutorialProgress( QString stepName, int stepNumber, float secondsToComplete,
|
void UserActivityLoggerScriptingInterface::tutorialProgress( QString stepName, int stepNumber, float secondsToComplete,
|
||||||
float tutorialElapsedTime, QString tutorialRunID, int tutorialVersion) {
|
float tutorialElapsedTime, QString tutorialRunID, int tutorialVersion, QString controllerType = "") {
|
||||||
logAction("tutorial_progress", {
|
logAction("tutorial_progress", {
|
||||||
{ "tutorial_run_id", tutorialRunID },
|
{ "tutorial_run_id", tutorialRunID },
|
||||||
{ "tutorial_version", tutorialVersion },
|
{ "tutorial_version", tutorialVersion },
|
||||||
{ "step", stepName },
|
{ "step", stepName },
|
||||||
{ "step_number", stepNumber },
|
{ "step_number", stepNumber },
|
||||||
{ "seconds_to_complete", secondsToComplete },
|
{ "seconds_to_complete", secondsToComplete },
|
||||||
{ "tutorial_elapsed_seconds", tutorialElapsedTime }
|
{ "tutorial_elapsed_seconds", tutorialElapsedTime },
|
||||||
|
{ "controller_type", controllerType }
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
Q_INVOKABLE void openedMarketplace();
|
Q_INVOKABLE void openedMarketplace();
|
||||||
Q_INVOKABLE void toggledAway(bool isAway);
|
Q_INVOKABLE void toggledAway(bool isAway);
|
||||||
Q_INVOKABLE void tutorialProgress(QString stepName, int stepNumber, float secondsToComplete,
|
Q_INVOKABLE void tutorialProgress(QString stepName, int stepNumber, float secondsToComplete,
|
||||||
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0);
|
float tutorialElapsedTime, QString tutorialRunID = "", int tutorialVersion = 0, QString controllerType = "");
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void logAction(QString action, QJsonObject details = {});
|
void logAction(QString action, QJsonObject details = {});
|
||||||
|
|
|
@ -1020,18 +1020,23 @@ TutorialManager = function() {
|
||||||
var didFinishTutorial = false;
|
var didFinishTutorial = false;
|
||||||
|
|
||||||
var wentToEntryStepNum;
|
var wentToEntryStepNum;
|
||||||
var VERSION = 1;
|
var VERSION = 2;
|
||||||
var tutorialID;
|
var tutorialID;
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
// The real controller name is the actual detected controller name, or 'unknown'
|
||||||
|
// if one is not found.
|
||||||
if (HMD.isSubdeviceContainingNameAvailable("OculusTouch")) {
|
if (HMD.isSubdeviceContainingNameAvailable("OculusTouch")) {
|
||||||
this.controllerName = "touch";
|
this.controllerName = "touch";
|
||||||
|
this.realControllerName = "touch";
|
||||||
} else if (HMD.isHandControllerAvailable("OpenVR")) {
|
} else if (HMD.isHandControllerAvailable("OpenVR")) {
|
||||||
this.controllerName = "vive";
|
this.controllerName = "vive";
|
||||||
|
this.realControllerName = "vive";
|
||||||
} else {
|
} else {
|
||||||
info("ERROR, no known hand controller found, defaulting to Vive");
|
info("ERROR, no known hand controller found, defaulting to Vive");
|
||||||
this.controllerName = "vive";
|
this.controllerName = "vive";
|
||||||
|
this.realControllerName = "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.startTutorial = function() {
|
this.startTutorial = function() {
|
||||||
|
@ -1120,7 +1125,7 @@ TutorialManager = function() {
|
||||||
var tutorialTimeElapsed = (Date.now() - startedTutorialAt) / 1000;
|
var tutorialTimeElapsed = (Date.now() - startedTutorialAt) / 1000;
|
||||||
UserActivityLogger.tutorialProgress(
|
UserActivityLogger.tutorialProgress(
|
||||||
name, stepNum, timeToFinishStep, tutorialTimeElapsed,
|
name, stepNum, timeToFinishStep, tutorialTimeElapsed,
|
||||||
tutorialID, VERSION);
|
tutorialID, VERSION, this.realControllerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a message sent from the "entry" portal in the courtyard,
|
// This is a message sent from the "entry" portal in the courtyard,
|
||||||
|
|
Loading…
Reference in a new issue