A bunch of fixes, plus added a debug mode Settings switch

This commit is contained in:
Zach Fox 2019-10-09 14:18:36 -07:00
parent 601f7ac5e9
commit bed1192d70
5 changed files with 70 additions and 20 deletions

View file

@ -83,6 +83,10 @@ Rectangle {
emptyInventoryContainer.visible = true;
}
if (Settings.getValue("simplifiedUI/debugFTUE", 0) === 4) {
emptyInventoryContainer.visible = true;
}
avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result);
root.updatePreviewUrl();
}
@ -360,6 +364,8 @@ Rectangle {
return;
}
}
root.avatarPreviewUrl = "../../images/defaultAvatar.svg";
}
function fromScript(message) {

View file

@ -125,6 +125,26 @@ Rectangle {
var simplifiedAvatarColors = ["Blue", "Cyan", "Green", "Magenta", "Red", "Yellow"];
var simplifiedAvatarSuffix = "/avatar.fst";
// Use `Settings.setValue("simplifiedUI/debugFTUE", 0);` to turn off FTUE Debug Mode.
// Use `Settings.setValue("simplifiedUI/debugFTUE", 1);` to debug FTUE Screen 1.
// Use `Settings.setValue("simplifiedUI/debugFTUE", 2);` to debug FTUE Screen 2.
// Use `Settings.setValue("simplifiedUI/debugFTUE", 3);` to debug FTUE Screen 3.
// Use `Settings.setValue("simplifiedUI/debugFTUE", 4);` to force the UI to show what would happen if the user had an empty Inventory.
var debugFTUE = Settings.getValue("simplifiedUI/debugFTUE", 0);
if (debugFTUE === 1 || debugFTUE === 2) {
scriptExecutionCount = 1;
currentAvatarURLContainsDefaultAvatar = true;
if (debugFTUE === 1) {
userHasValidAvatarInInventory = false;
currentAvatarURLContainsSimplifiedAvatar = false;
}
} else if (debugFTUE === 3) {
scriptExecutionCount = 2;
currentAvatarURLContainsDefaultAvatar = false;
currentAvatarURLContainsSimplifiedAvatar = true;
}
// If we have never auto-selected and the user is still using a default avatar or if the current avatar is not valid (fst), or if
// the current avatar is the old default (Woody), use top avatar from inventory or one of the new defaults.
@ -591,7 +611,7 @@ Rectangle {
}
function updatePreviewUrl() {
function updatePreviewUrl() {
var previewUrl = "";
var downloadUrl = "";
for (var i = 0; i < topBarInventoryModel.count; ++i) {
@ -605,6 +625,8 @@ Rectangle {
return;
}
}
avatarButtonImage.source = "../images/defaultAvatar.svg";
}

View file

@ -450,11 +450,7 @@ function onGeometryChanged(rect) {
function onWindowMinimizedChanged(isMinimized) {
if (isMinimized) {
handleEmoteIndicatorVisibleChanged(false);
} else if (!HMD.active) {
handleEmoteIndicatorVisibleChanged(true);
}
maybeChangeEmoteIndicatorVisibility(!isMinimized);
}
@ -550,10 +546,14 @@ function showEmoteAppBar() {
}
function handleEmoteIndicatorVisibleChanged(shouldBeVisible) {
if (shouldBeVisible && !emoteAppBarWindow) {
function maybeChangeEmoteIndicatorVisibility(desiredVisibility) {
if (Window.minimized || HMD.active) {
desiredVisibility = false;
}
if (desiredVisibility && !emoteAppBarWindow) {
showEmoteAppBar();
} else if (emoteAppBarWindow) {
} else if (!desiredVisibility && emoteAppBarWindow) {
emoteAppBarWindow.fromQml.disconnect(onMessageFromEmoteAppBar);
emoteAppBarWindow.close();
emoteAppBarWindow = false;
@ -561,16 +561,17 @@ function handleEmoteIndicatorVisibleChanged(shouldBeVisible) {
}
function handleFTUEScreensVisibilityChanged(ftueScreenVisible) {
maybeChangeEmoteIndicatorVisibility(!ftueScreenVisible);
}
function onDisplayModeChanged(isHMDMode) {
reactionsBegun.forEach(function(react) {
endReactionWrapper(react);
});
if (isHMDMode) {
handleEmoteIndicatorVisibleChanged(false);
} else {
handleEmoteIndicatorVisibleChanged(true);
}
maybeChangeEmoteIndicatorVisibility(!isHMDMode);
}
@ -578,6 +579,7 @@ var emojiAPI = Script.require("./emojiApp/simplifiedEmoji.js?" + Date.now());
var keyPressSignalsConnected = false;
var emojiCodeMap;
var customEmojiCodeMap;
var _this;
function setup() {
deleteOldReticles();
@ -609,12 +611,22 @@ function setup() {
HMD.displayModeChanged.connect(onDisplayModeChanged);
getSounds();
handleEmoteIndicatorVisibleChanged(true);
maybeChangeEmoteIndicatorVisibility(true);
Controller.keyPressEvent.connect(keyPressHandler);
Controller.keyReleaseEvent.connect(keyReleaseHandler);
keyPressSignalsConnected = true;
Script.scriptEnding.connect(unload);
function Emote() {
_this = this;
}
Emote.prototype = {
handleFTUEScreensVisibilityChanged: handleFTUEScreensVisibilityChanged
};
return new Emote();
}
@ -671,7 +683,6 @@ function unload() {
// #region EMOJI_UTILITY
var EMOJI_52_BASE_URL = "../../resources/images/emojis/52px/";
function selectedEmoji(code) {
emojiAPI.addEmoji(code);
// this URL needs to be relative to SimplifiedEmoteIndicator.qml
@ -786,4 +797,6 @@ function toggleEmojiApp() {
// END EMOJI
// *************************************
setup();
var emote = setup();
module.exports = emote;

View file

@ -28,7 +28,8 @@ Rectangle {
Component.onCompleted: {
if (Settings.getValue("simplifiedUI/alreadyAutoSelectedAvatarFromInventory", false) ||
Settings.getValue("simplifiedUI/closedAvatarPageOfInitialLaunchWindow", false)) {
Settings.getValue("simplifiedUI/closedAvatarPageOfInitialLaunchWindow", false) ||
Settings.getValue("simplifiedUI/debugFTUE", 0) === 2) {
tempAvatarPageContainer.visible = false;
controlsContainer.visible = true;
}
@ -95,7 +96,7 @@ Rectangle {
"for today. If you see this avatar in-world, walk up and " +
"say hello to other new users!<br><br>" +
"<b>We want you to be you</b> so we've built " +
"<a href=\"https://www.highfidelity.com/knowledge/virtual-you\">Virtual You</a>, an Avatar Creator " +
'<a href="https://www.highfidelity.com/knowledge/virtual-you/">Virtual You</a>, an Avatar Creator ' +
"App. Creating an avatar is as easy as taking a selfie and picking your " +
"outfits! Available now on iOS and Android."
color: simplifiedUI.colors.text.black

View file

@ -371,6 +371,8 @@ function displayInitialLaunchWindow() {
return;
}
simplifiedEmote.handleFTUEScreensVisibilityChanged(true);
initialLaunchWindow = Desktop.createWindow(INITIAL_LAUNCH_QML_PATH, {
title: INITIAL_LAUNCH_WINDOW_TITLE,
presentationMode: INITIAL_LAUNCH_PRESENTATION_MODE,
@ -402,6 +404,8 @@ function displaySecondLaunchWindow() {
return;
}
simplifiedEmote.handleFTUEScreensVisibilityChanged(true);
secondLaunchWindow = Desktop.createWindow(SECOND_LAUNCH_QML_PATH, {
title: SECOND_LAUNCH_WINDOW_TITLE,
presentationMode: SECOND_LAUNCH_PRESENTATION_MODE,
@ -427,6 +431,8 @@ function closeInitialLaunchWindow() {
initialLaunchWindow.close();
initialLaunchWindow = null;
}
simplifiedEmote.handleFTUEScreensVisibilityChanged(false);
}
function closeSecondLaunchWindow() {
@ -435,6 +441,8 @@ function closeSecondLaunchWindow() {
secondLaunchWindow.close();
secondLaunchWindow = null;
}
simplifiedEmote.handleFTUEScreensVisibilityChanged(false);
}
var INITIAL_LAUNCH_WINDOW_MESSAGE_SOURCE = "InitialLaunchWindow.qml";
@ -764,7 +772,7 @@ function restoreLODSettings() {
var nametag = Script.require("./simplifiedNametag/simplifiedNametag.js?" + Date.now());
var si = Script.require("./simplifiedStatusIndicator/simplifiedStatusIndicator.js?" + Date.now());
var emote = Script.require("../simplifiedEmote/simplifiedEmote.js?" + Date.now());
var simplifiedEmote = Script.require("../simplifiedEmote/simplifiedEmote.js?" + Date.now());
var oldShowAudioTools;
var oldShowBubbleTools;
var keepExistingUIAndScriptsSetting = Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false);