mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:39:41 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into pop_dynamicTests
This commit is contained in:
commit
27d6cc2657
29 changed files with 361 additions and 1353 deletions
|
@ -4,7 +4,6 @@ Please read the [general build guide](BUILD.md) for information on dependencies
|
||||||
|
|
||||||
[Homebrew](https://brew.sh/) is an excellent package manager for OS X. It makes install of some High Fidelity dependencies very simple.
|
[Homebrew](https://brew.sh/) is an excellent package manager for OS X. It makes install of some High Fidelity dependencies very simple.
|
||||||
|
|
||||||
brew tap homebrew/versions
|
|
||||||
brew install cmake openssl
|
brew install cmake openssl
|
||||||
|
|
||||||
### OpenSSL
|
### OpenSSL
|
||||||
|
|
|
@ -27,6 +27,8 @@ ModalWindow {
|
||||||
destroyOnHidden: true
|
destroyOnHidden: true
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
|
readonly property bool isTablet: false
|
||||||
|
|
||||||
property string iconText: ""
|
property string iconText: ""
|
||||||
property int iconSize: 50
|
property int iconSize: 50
|
||||||
|
|
||||||
|
@ -35,6 +37,10 @@ ModalWindow {
|
||||||
|
|
||||||
keyboardOverride: true // Disable ModalWindow's keyboard.
|
keyboardOverride: true // Disable ModalWindow's keyboard.
|
||||||
|
|
||||||
|
function tryDestroy() {
|
||||||
|
root.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
LoginDialog {
|
LoginDialog {
|
||||||
id: loginDialog
|
id: loginDialog
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,12 @@ Item {
|
||||||
readonly property int maxHeight: 720
|
readonly property int maxHeight: 720
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
var targetWidth = Math.max(titleWidth, Math.max(additionalTextContainer.contentWidth,
|
if (root.isTablet === false) {
|
||||||
termsContainer.contentWidth))
|
var targetWidth = Math.max(titleWidth, Math.max(additionalTextContainer.contentWidth,
|
||||||
|
termsContainer.contentWidth))
|
||||||
|
parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
||||||
|
}
|
||||||
var targetHeight = 5 * hifi.dimensions.contentSpacing.y + buttons.height + additionalTextContainer.height + termsContainer.height
|
var targetHeight = 5 * hifi.dimensions.contentSpacing.y + buttons.height + additionalTextContainer.height + termsContainer.height
|
||||||
|
|
||||||
parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth))
|
|
||||||
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,11 +62,8 @@ Item {
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
|
onClicked: root.tryDestroy()
|
||||||
|
|
||||||
onClicked: root.destroy()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,17 +94,19 @@ Item {
|
||||||
id: termsContainer
|
id: termsContainer
|
||||||
anchors {
|
anchors {
|
||||||
top: additionalTextContainer.bottom
|
top: additionalTextContainer.bottom
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
margins: 0
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
text: qsTr("By creating this user profile, you agree to <a href='https://highfidelity.com/terms'>High Fidelity's Terms of Service</a>")
|
text: qsTr("By creating this user profile, you agree to <a href='https://highfidelity.com/terms'>High Fidelity's Terms of Service</a>")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
color: hifi.colors.baseGrayHighlight
|
color: hifi.colors.baseGrayHighlight
|
||||||
lineHeight: 1
|
lineHeight: 1
|
||||||
lineHeightMode: Text.ProportionalHeight
|
lineHeightMode: Text.ProportionalHeight
|
||||||
horizontalAlignment: Text.AlignHCenter
|
fontSizeMode: Text.HorizontalFit
|
||||||
|
horizontalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
onLinkActivated: loginDialog.openUrl(link)
|
onLinkActivated: loginDialog.openUrl(link)
|
||||||
}
|
}
|
||||||
|
@ -128,8 +128,10 @@ Item {
|
||||||
console.log("Create Failed: " + error)
|
console.log("Create Failed: " + error)
|
||||||
|
|
||||||
bodyLoader.source = "UsernameCollisionBody.qml"
|
bodyLoader.source = "UsernameCollisionBody.qml"
|
||||||
bodyLoader.item.width = root.pane.width
|
if (!root.isTablet) {
|
||||||
bodyLoader.item.height = root.pane.height
|
bodyLoader.item.width = root.pane.width
|
||||||
|
bodyLoader.item.height = root.pane.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onHandleLoginCompleted: {
|
onHandleLoginCompleted: {
|
||||||
console.log("Login Succeeded")
|
console.log("Login Succeeded")
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import Hifi 1.0
|
import Hifi 1.0
|
||||||
import QtQuick 2.4
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
@ -45,8 +45,7 @@ Item {
|
||||||
function resize() {
|
function resize() {
|
||||||
var targetWidth = Math.max(titleWidth, form.contentWidth);
|
var targetWidth = Math.max(titleWidth, form.contentWidth);
|
||||||
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height +
|
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height +
|
||||||
4 * hifi.dimensions.contentSpacing.y + form.height +
|
4 * hifi.dimensions.contentSpacing.y + form.height;
|
||||||
hifi.dimensions.contentSpacing.y + buttons.height;
|
|
||||||
|
|
||||||
if (additionalInformation.visible) {
|
if (additionalInformation.visible) {
|
||||||
targetWidth = Math.max(targetWidth, additionalInformation.width);
|
targetWidth = Math.max(targetWidth, additionalInformation.width);
|
||||||
|
@ -66,9 +65,6 @@ Item {
|
||||||
if (loginDialog.isSteamRunning()) {
|
if (loginDialog.isSteamRunning()) {
|
||||||
additionalInformation.visible = !isLoading
|
additionalInformation.visible = !isLoading
|
||||||
}
|
}
|
||||||
|
|
||||||
leftButton.visible = !isLoading
|
|
||||||
buttons.visible = !isLoading
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator {
|
BusyIndicator {
|
||||||
|
@ -108,30 +104,27 @@ Item {
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: form
|
id: form
|
||||||
|
width: parent.width
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: mainTextContainer.bottom
|
top: mainTextContainer.bottom
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
spacing: 2 * hifi.dimensions.contentSpacing.y
|
spacing: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: usernameField
|
id: usernameField
|
||||||
anchors {
|
width: parent.width
|
||||||
verticalCenter: parent.verticalCenter
|
focus: true
|
||||||
}
|
label: "Username or Email"
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Username or Email"
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
ShortcutText {
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: usernameField.textFieldLabel.verticalCenter
|
||||||
|
left: usernameField.textFieldLabel.right
|
||||||
|
leftMargin: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Username?</a>"
|
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Username?</a>"
|
||||||
|
@ -143,23 +136,19 @@ Item {
|
||||||
onLinkActivated: loginDialog.openUrl(link)
|
onLinkActivated: loginDialog.openUrl(link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: passwordField
|
id: passwordField
|
||||||
anchors {
|
width: parent.width
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Password"
|
label: "Password"
|
||||||
echoMode: TextInput.Password
|
echoMode: showPassword.checked ? TextInput.Normal : TextInput.Password
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
ShortcutText {
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: passwordField.textFieldLabel.verticalCenter
|
||||||
|
left: passwordField.textFieldLabel.right
|
||||||
|
leftMargin: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Password?</a>"
|
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Password?</a>"
|
||||||
|
@ -172,25 +161,76 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
CheckBoxQQC2 {
|
||||||
|
id: showPassword
|
||||||
InfoItem {
|
text: "Show password"
|
||||||
id: additionalInformation
|
|
||||||
anchors {
|
|
||||||
top: form.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: loginDialog.isSteamRunning()
|
InfoItem {
|
||||||
|
id: additionalInformation
|
||||||
|
|
||||||
text: qsTr("Your steam account informations will not be exposed to other users.")
|
visible: loginDialog.isSteamRunning()
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
text: qsTr("Your steam account informations will not be exposed to other users.")
|
||||||
lineHeight: 1
|
wrapMode: Text.WordWrap
|
||||||
lineHeightMode: Text.ProportionalHeight
|
color: hifi.colors.baseGrayHighlight
|
||||||
horizontalAlignment: Text.AlignHCenter
|
lineHeight: 1
|
||||||
|
lineHeightMode: Text.ProportionalHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
spacing: hifi.dimensions.contentSpacing.y*2
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: linkAccountButton
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr(loginDialog.isSteamRunning() ? "Link Account" : "Login")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
|
||||||
|
onClicked: linkAccountBody.login()
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
onClicked: root.tryDestroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: leftButton
|
||||||
|
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: hifi.dimensions.contentSpacing.y*2
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
RalewaySemiBold {
|
||||||
|
size: hifi.fontSizes.inputLabel
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: qsTr("Don't have an account?")
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Sign Up")
|
||||||
|
visible: !loginDialog.isSteamRunning()
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
bodyLoader.setSource("SignUpBody.qml")
|
||||||
|
if (!root.isTablet) {
|
||||||
|
bodyLoader.item.width = root.pane.width
|
||||||
|
bodyLoader.item.height = root.pane.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
||||||
|
@ -200,70 +240,22 @@ Item {
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: buttons.top
|
bottom: parent.bottom
|
||||||
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
|
||||||
id: leftButton
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Sign Up")
|
|
||||||
visible: !loginDialog.isSteamRunning()
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
bodyLoader.setSource("SignUpBody.qml")
|
|
||||||
bodyLoader.item.width = root.pane.width
|
|
||||||
bodyLoader.item.height = root.pane.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
id: linkAccountButton
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr(loginDialog.isSteamRunning() ? "Link Account" : "Login")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: linkAccountBody.login()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
|
|
||||||
onClicked: root.destroy()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
root.title = qsTr("Sign Into High Fidelity")
|
root.title = qsTr("Sign Into High Fidelity")
|
||||||
root.iconText = "<"
|
root.iconText = "<"
|
||||||
keyboardEnabled = HMD.active;
|
|
||||||
|
//dont rise local keyboard
|
||||||
|
keyboardEnabled = !root.isTablet && HMD.active;
|
||||||
|
//but rise Tablet's one instead for Tablet interface
|
||||||
|
if (root.isTablet) {
|
||||||
|
root.keyboardEnabled = HMD.active;
|
||||||
|
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
|
||||||
|
}
|
||||||
d.resize();
|
d.resize();
|
||||||
|
|
||||||
if (failAfterSignUp) {
|
if (failAfterSignUp) {
|
||||||
|
@ -311,11 +303,11 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
linkAccountBody.login()
|
linkAccountBody.login()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import Hifi 1.0
|
import Hifi 1.0
|
||||||
import QtQuick 2.4
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
import "../controls-uit"
|
import "../controls-uit"
|
||||||
|
@ -18,8 +18,8 @@ import "../styles-uit"
|
||||||
Item {
|
Item {
|
||||||
id: signInBody
|
id: signInBody
|
||||||
clip: true
|
clip: true
|
||||||
width: root.pane.width
|
|
||||||
height: root.pane.height
|
height: root.pane.height
|
||||||
|
width: root.pane.width
|
||||||
|
|
||||||
property bool required: false
|
property bool required: false
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
root.destroy()
|
root.tryDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
@ -121,8 +121,10 @@ Item {
|
||||||
console.log("Login Failed")
|
console.log("Login Failed")
|
||||||
|
|
||||||
bodyLoader.source = "CompleteProfileBody.qml"
|
bodyLoader.source = "CompleteProfileBody.qml"
|
||||||
bodyLoader.item.width = root.pane.width
|
if (!root.isTablet) {
|
||||||
bodyLoader.item.height = root.pane.height
|
bodyLoader.item.width = root.pane.width
|
||||||
|
bodyLoader.item.height = root.pane.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import Hifi 1.0
|
import Hifi 1.0
|
||||||
import QtQuick 2.4
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@ Item {
|
||||||
function resize() {
|
function resize() {
|
||||||
var targetWidth = Math.max(titleWidth, form.contentWidth);
|
var targetWidth = Math.max(titleWidth, form.contentWidth);
|
||||||
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height +
|
var targetHeight = hifi.dimensions.contentSpacing.y + mainTextContainer.height +
|
||||||
4 * hifi.dimensions.contentSpacing.y + form.height +
|
4 * hifi.dimensions.contentSpacing.y + form.height;
|
||||||
hifi.dimensions.contentSpacing.y + buttons.height;
|
|
||||||
|
|
||||||
parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth));
|
parent.width = root.width = Math.max(d.minWidth, Math.min(d.maxWidth, targetWidth));
|
||||||
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
parent.height = root.height = Math.max(d.minHeight, Math.min(d.maxHeight, targetHeight))
|
||||||
|
@ -96,44 +95,31 @@ Item {
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: form
|
id: form
|
||||||
|
width: parent.width
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: mainTextContainer.bottom
|
top: mainTextContainer.bottom
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
spacing: 2 * hifi.dimensions.contentSpacing.y
|
spacing: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
Row {
|
TextField {
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
id: emailField
|
||||||
|
width: parent.width
|
||||||
TextField {
|
label: "Email"
|
||||||
id: emailField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Email"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
TextField {
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
id: usernameField
|
||||||
|
width: parent.width
|
||||||
TextField {
|
label: "Username"
|
||||||
id: usernameField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Username"
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
ShortcutText {
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.textFieldLabel.verticalCenter
|
||||||
|
left: parent.textFieldLabel.right
|
||||||
|
leftMargin: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
text: qsTr("No spaces / special chars.")
|
text: qsTr("No spaces / special chars.")
|
||||||
|
@ -145,23 +131,17 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
TextField {
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
id: passwordField
|
||||||
|
width: parent.width
|
||||||
TextField {
|
label: "Password"
|
||||||
id: passwordField
|
echoMode: TextInput.Password
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Password"
|
|
||||||
echoMode: TextInput.Password
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
ShortcutText {
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.textFieldLabel.verticalCenter
|
||||||
|
left: parent.textFieldLabel.right
|
||||||
|
leftMargin: 10
|
||||||
}
|
}
|
||||||
|
|
||||||
text: qsTr("At least 6 characters")
|
text: qsTr("At least 6 characters")
|
||||||
|
@ -173,6 +153,53 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: leftButton
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Existing User")
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
bodyLoader.setSource("LinkAccountBody.qml")
|
||||||
|
if (!root.isTablet) {
|
||||||
|
bodyLoader.item.width = root.pane.width
|
||||||
|
bodyLoader.item.height = root.pane.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: buttons
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: linkAccountButton
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 200
|
||||||
|
|
||||||
|
text: qsTr("Sign Up")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
|
||||||
|
onClicked: signupBody.signup()
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
|
||||||
|
onClicked: root.tryDestroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
||||||
|
@ -182,69 +209,21 @@ Item {
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: buttons.top
|
bottom: parent.bottom
|
||||||
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
|
||||||
id: leftButton
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Existing User")
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
bodyLoader.setSource("LinkAccountBody.qml")
|
|
||||||
bodyLoader.item.width = root.pane.width
|
|
||||||
bodyLoader.item.height = root.pane.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
id: linkAccountButton
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr("Sign Up")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: signupBody.signup()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
|
|
||||||
onClicked: root.destroy()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
root.title = qsTr("Create an Account")
|
root.title = qsTr("Create an Account")
|
||||||
root.iconText = "<"
|
root.iconText = "<"
|
||||||
keyboardEnabled = HMD.active;
|
//dont rise local keyboard
|
||||||
|
keyboardEnabled = !root.isTablet && HMD.active;
|
||||||
|
//but rise Tablet's one instead for Tablet interface
|
||||||
|
if (root.isTablet) {
|
||||||
|
root.keyboardEnabled = HMD.active;
|
||||||
|
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
|
||||||
|
}
|
||||||
d.resize();
|
d.resize();
|
||||||
|
|
||||||
emailField.forceActiveFocus();
|
emailField.forceActiveFocus();
|
||||||
|
@ -275,8 +254,10 @@ Item {
|
||||||
onHandleLoginFailed: {
|
onHandleLoginFailed: {
|
||||||
// we failed to login, show the LoginDialog so the user will try again
|
// we failed to login, show the LoginDialog so the user will try again
|
||||||
bodyLoader.setSource("LinkAccountBody.qml", { "failAfterSignUp": true })
|
bodyLoader.setSource("LinkAccountBody.qml", { "failAfterSignUp": true })
|
||||||
bodyLoader.item.width = root.pane.width
|
if (!root.isTablet) {
|
||||||
bodyLoader.item.height = root.pane.height
|
bodyLoader.item.width = root.pane.width
|
||||||
|
bodyLoader.item.height = root.pane.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ Item {
|
||||||
margins: 0
|
margins: 0
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
width: 250
|
width: parent.width
|
||||||
|
|
||||||
placeholderText: "Choose your own"
|
placeholderText: "Choose your own"
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ Item {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
right: parent.right
|
right: parent.right
|
||||||
margins: 0
|
margins: 0
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
bottomMargin: hifi.dimensions.contentSpacing.y
|
||||||
}
|
}
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
spacing: hifi.dimensions.contentSpacing.x
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||||
|
@ -122,14 +122,21 @@ Item {
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
|
|
||||||
onClicked: root.destroy()
|
onClicked: root.tryDestroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
root.title = qsTr("Complete Your Profile")
|
root.title = qsTr("Complete Your Profile")
|
||||||
root.iconText = "<"
|
root.iconText = "<"
|
||||||
keyboardEnabled = HMD.active;
|
//dont rise local keyboard
|
||||||
|
keyboardEnabled = !root.isTablet && HMD.active;
|
||||||
|
//but rise Tablet's one instead for Tablet interface
|
||||||
|
if (root.isTablet) {
|
||||||
|
root.keyboardEnabled = HMD.active;
|
||||||
|
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
|
||||||
|
}
|
||||||
|
|
||||||
d.resize();
|
d.resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ Item {
|
||||||
|
|
||||||
text: qsTr("Close");
|
text: qsTr("Close");
|
||||||
|
|
||||||
onClicked: root.destroy()
|
onClicked: root.tryDestroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,124 +0,0 @@
|
||||||
//
|
|
||||||
// CompleteProfileBody.qml
|
|
||||||
//
|
|
||||||
// Created by Clement on 7/18/16
|
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: completeProfileBody
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr("Create your profile")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: loginDialog.createAccountFromStream()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
|
|
||||||
onClicked: bodyLoader.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
id: additionalTextContainer
|
|
||||||
anchors {
|
|
||||||
top: buttons.bottom
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
text: "<a href='https://fake.link'>Already have a High Fidelity profile? Link to an existing profile here.</a>"
|
|
||||||
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
lineHeight: 2
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
|
||||||
onLinkActivated: {
|
|
||||||
bodyLoader.setSource("LinkAccountBody.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoItem {
|
|
||||||
id: termsContainer
|
|
||||||
anchors {
|
|
||||||
top: additionalTextContainer.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
text: qsTr("By creating this user profile, you agree to <a href='https://highfidelity.com/terms'>High Fidelity's Terms of Service</a>")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
lineHeight: 1
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
|
||||||
onLinkActivated: loginDialog.openUrl(link)
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loginDialogRoot.title = qsTr("Complete Your Profile")
|
|
||||||
loginDialogRoot.iconText = "<"
|
|
||||||
d.resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: loginDialog
|
|
||||||
onHandleCreateCompleted: {
|
|
||||||
console.log("Create Succeeded")
|
|
||||||
|
|
||||||
loginDialog.loginThroughSteam()
|
|
||||||
}
|
|
||||||
onHandleCreateFailed: {
|
|
||||||
console.log("Create Failed: " + error)
|
|
||||||
|
|
||||||
bodyLoadersetSource("UsernameCollisionBody.qml")
|
|
||||||
}
|
|
||||||
onHandleLoginCompleted: {
|
|
||||||
console.log("Login Succeeded")
|
|
||||||
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack" : false })
|
|
||||||
}
|
|
||||||
onHandleLoginFailed: {
|
|
||||||
console.log("Login Failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,296 +0,0 @@
|
||||||
//
|
|
||||||
// LinkAccountBody.qml
|
|
||||||
//
|
|
||||||
// Created by Clement on 7/18/16
|
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: linkAccountBody
|
|
||||||
clip: true
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width
|
|
||||||
property bool failAfterSignUp: false
|
|
||||||
|
|
||||||
function login() {
|
|
||||||
mainTextContainer.visible = false
|
|
||||||
toggleLoading(true)
|
|
||||||
loginDialog.login(usernameField.text, passwordField.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
|
||||||
property bool keyboardRaised: false
|
|
||||||
property bool punctuationMode: false
|
|
||||||
|
|
||||||
onKeyboardRaisedChanged: d.resize();
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleLoading(isLoading) {
|
|
||||||
linkAccountSpinner.visible = isLoading
|
|
||||||
form.visible = !isLoading
|
|
||||||
|
|
||||||
if (loginDialog.isSteamRunning()) {
|
|
||||||
additionalInformation.visible = !isLoading
|
|
||||||
}
|
|
||||||
|
|
||||||
leftButton.visible = !isLoading
|
|
||||||
buttons.visible = !isLoading
|
|
||||||
}
|
|
||||||
|
|
||||||
BusyIndicator {
|
|
||||||
id: linkAccountSpinner
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
running: true
|
|
||||||
|
|
||||||
width: 48
|
|
||||||
height: 48
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
id: mainTextContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
text: qsTr("Username or password incorrect.")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.redAccent
|
|
||||||
lineHeight: 1
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: form
|
|
||||||
anchors {
|
|
||||||
top: mainTextContainer.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: usernameField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Username or Email"
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Username?</a>"
|
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
linkColor: hifi.colors.blueAccent
|
|
||||||
|
|
||||||
onLinkActivated: loginDialog.openUrl(link)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: passwordField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 350
|
|
||||||
|
|
||||||
label: "Password"
|
|
||||||
echoMode: TextInput.Password
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
text: "<a href='https://highfidelity.com/users/password/new'>Forgot Password?</a>"
|
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
linkColor: hifi.colors.blueAccent
|
|
||||||
|
|
||||||
onLinkActivated: loginDialog.openUrl(link)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoItem {
|
|
||||||
id: additionalInformation
|
|
||||||
anchors {
|
|
||||||
top: form.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: loginDialog.isSteamRunning()
|
|
||||||
|
|
||||||
text: qsTr("Your steam account informations will not be exposed to other users.")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
lineHeight: 1
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
|
||||||
Keyboard {
|
|
||||||
raised: keyboardEnabled && keyboardRaised
|
|
||||||
numeric: punctuationMode
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: buttons.top
|
|
||||||
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: leftButton
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Sign Up")
|
|
||||||
visible: !loginDialog.isSteamRunning()
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
bodyLoader.setSource("SignUpBody.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
id: linkAccountButton
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr(loginDialog.isSteamRunning() ? "Link Account" : "Login")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: linkAccountBody.login()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
onClicked: {
|
|
||||||
bodyLoader.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loginDialogRoot.title = qsTr("Sign Into High Fidelity")
|
|
||||||
loginDialogRoot.iconText = "<"
|
|
||||||
keyboardEnabled = HMD.active;
|
|
||||||
d.resize();
|
|
||||||
|
|
||||||
if (failAfterSignUp) {
|
|
||||||
mainTextContainer.text = "Account created successfully."
|
|
||||||
mainTextContainer.visible = true
|
|
||||||
}
|
|
||||||
|
|
||||||
usernameField.forceActiveFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: loginDialog
|
|
||||||
onHandleLoginCompleted: {
|
|
||||||
console.log("Login Succeeded, linking steam account")
|
|
||||||
|
|
||||||
if (loginDialog.isSteamRunning()) {
|
|
||||||
loginDialog.linkSteam()
|
|
||||||
} else {
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack" : true })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onHandleLoginFailed: {
|
|
||||||
console.log("Login Failed")
|
|
||||||
mainTextContainer.visible = true
|
|
||||||
toggleLoading(false)
|
|
||||||
}
|
|
||||||
onHandleLinkCompleted: {
|
|
||||||
console.log("Link Succeeded")
|
|
||||||
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack" : true })
|
|
||||||
}
|
|
||||||
onHandleLinkFailed: {
|
|
||||||
console.log("Link Failed")
|
|
||||||
toggleLoading(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: {
|
|
||||||
if (!visible) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
case Qt.Key_Return:
|
|
||||||
event.accepted = true
|
|
||||||
linkAccountBody.login()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,109 +0,0 @@
|
||||||
//
|
|
||||||
// SignInBody.qml
|
|
||||||
//
|
|
||||||
// Created by Clement on 7/18/16
|
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: signInBody
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
property bool required: false
|
|
||||||
|
|
||||||
function login() {
|
|
||||||
console.log("Trying to log in")
|
|
||||||
loginDialog.loginThroughSteam()
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancel() {
|
|
||||||
bodyLoader.popup()
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoItem {
|
|
||||||
id: mainTextContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
text: required ? qsTr("This domain's owner requires that you sign in:")
|
|
||||||
: qsTr("Sign in to access your user account:")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
lineHeight: 2
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
top: mainTextContainer.bottom
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
width: undefined // invalidate so that the image's size sets the width
|
|
||||||
height: undefined // invalidate so that the image's size sets the height
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
style: OriginalStyles.ButtonStyle {
|
|
||||||
background: Image {
|
|
||||||
id: buttonImage
|
|
||||||
source: "../../images/steam-sign-in.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: signInBody.login()
|
|
||||||
}
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel");
|
|
||||||
|
|
||||||
onClicked: signInBody.cancel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loginDialogRoot.title = required ? qsTr("Sign In Required")
|
|
||||||
: qsTr("Sign In")
|
|
||||||
loginDialogRoot.iconText = ""
|
|
||||||
d.resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: loginDialog
|
|
||||||
onHandleLoginCompleted: {
|
|
||||||
console.log("Login Succeeded")
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack" : true })
|
|
||||||
}
|
|
||||||
onHandleLoginFailed: {
|
|
||||||
console.log("Login Failed")
|
|
||||||
bodyLoader.setSource("CompleteProfileBody.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,276 +0,0 @@
|
||||||
//
|
|
||||||
// SignUpBody.qml
|
|
||||||
//
|
|
||||||
// Created by Stephen Birarda on 7 Dec 2016
|
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: signupBody
|
|
||||||
clip: true
|
|
||||||
// height: parent.height
|
|
||||||
// width: parent.width
|
|
||||||
|
|
||||||
function signup() {
|
|
||||||
mainTextContainer.visible = false
|
|
||||||
toggleLoading(true)
|
|
||||||
loginDialog.signup(emailField.text, usernameField.text, passwordField.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
|
||||||
property bool keyboardRaised: false
|
|
||||||
property bool punctuationMode: false
|
|
||||||
|
|
||||||
onKeyboardRaisedChanged: d.resize();
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleLoading(isLoading) {
|
|
||||||
linkAccountSpinner.visible = isLoading
|
|
||||||
form.visible = !isLoading
|
|
||||||
|
|
||||||
leftButton.visible = !isLoading
|
|
||||||
buttons.visible = !isLoading
|
|
||||||
}
|
|
||||||
|
|
||||||
BusyIndicator {
|
|
||||||
id: linkAccountSpinner
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
running: true
|
|
||||||
|
|
||||||
width: 48
|
|
||||||
height: 48
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
id: mainTextContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
text: qsTr("There was an unknown error while creating your account.")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.redAccent
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: form
|
|
||||||
anchors {
|
|
||||||
top: mainTextContainer.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: emailField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 300
|
|
||||||
|
|
||||||
label: "Email"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: usernameField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 300
|
|
||||||
|
|
||||||
label: "Username"
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
text: qsTr("No spaces / special chars.")
|
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
|
||||||
color: hifi.colors.blueAccent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: passwordField
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
width: 300
|
|
||||||
|
|
||||||
label: "Password"
|
|
||||||
echoMode: TextInput.Password
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
text: qsTr("At least 6 characters")
|
|
||||||
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
|
||||||
color: hifi.colors.blueAccent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
|
||||||
Keyboard {
|
|
||||||
raised: keyboardEnabled && keyboardRaised
|
|
||||||
numeric: punctuationMode
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: buttons.top
|
|
||||||
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: leftButton
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Existing User")
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
bodyLoader.setSource("LinkAccountBody.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
id: linkAccountButton
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr("Sign Up")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: signupBody.signup()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
|
|
||||||
onClicked: bodyLoader.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loginDialogRoot.title = qsTr("Create an Account")
|
|
||||||
loginDialogRoot.iconText = "<"
|
|
||||||
keyboardEnabled = HMD.active;
|
|
||||||
d.resize();
|
|
||||||
|
|
||||||
emailField.forceActiveFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: loginDialog
|
|
||||||
onHandleSignupCompleted: {
|
|
||||||
console.log("Sign Up Succeeded");
|
|
||||||
|
|
||||||
// now that we have an account, login with that username and password
|
|
||||||
loginDialog.login(usernameField.text, passwordField.text)
|
|
||||||
}
|
|
||||||
onHandleSignupFailed: {
|
|
||||||
console.log("Sign Up Failed")
|
|
||||||
toggleLoading(false)
|
|
||||||
|
|
||||||
mainTextContainer.text = errorString
|
|
||||||
mainTextContainer.visible = true
|
|
||||||
|
|
||||||
d.resize();
|
|
||||||
}
|
|
||||||
onHandleLoginCompleted: {
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack": false })
|
|
||||||
}
|
|
||||||
onHandleLoginFailed: {
|
|
||||||
// we failed to login, show the LoginDialog so the user will try again
|
|
||||||
bodyLoader.setSource("LinkAccountBody.qml", { "failAfterSignUp": true })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: {
|
|
||||||
if (!visible) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
case Qt.Key_Return:
|
|
||||||
event.accepted = true
|
|
||||||
signupBody.signup()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,157 +0,0 @@
|
||||||
//
|
|
||||||
// UsernameCollisionBody.qml
|
|
||||||
//
|
|
||||||
// Created by Clement on 7/18/16
|
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
import QtQuick.Controls.Styles 1.4 as OriginalStyles
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: usernameCollisionBody
|
|
||||||
clip: true
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
|
|
||||||
function create() {
|
|
||||||
mainTextContainer.visible = false
|
|
||||||
loginDialog.createAccountFromStream(textField.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
|
||||||
property bool keyboardRaised: false
|
|
||||||
property bool punctuationMode: false
|
|
||||||
|
|
||||||
onKeyboardRaisedChanged: d.resize();
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
ShortcutText {
|
|
||||||
id: mainTextContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
text: qsTr("Your Steam username is not available.")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.redAccent
|
|
||||||
lineHeight: 1
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: textField
|
|
||||||
anchors {
|
|
||||||
top: mainTextContainer.bottom
|
|
||||||
left: parent.left
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
width: 250
|
|
||||||
|
|
||||||
placeholderText: "Choose your own"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override ScrollingWindow's keyboard that would be at very bottom of dialog.
|
|
||||||
Keyboard {
|
|
||||||
raised: keyboardEnabled && keyboardRaised
|
|
||||||
numeric: punctuationMode
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: buttons.top
|
|
||||||
bottomMargin: keyboardRaised ? 2 * hifi.dimensions.contentSpacing.y : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
bottom: parent.bottom
|
|
||||||
right: parent.right
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
text: qsTr("Create your profile")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
|
|
||||||
onClicked: usernameCollisionBody.create()
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
onClicked: bodyLoader.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loginDialogRoot.title = qsTr("Complete Your Profile")
|
|
||||||
loginDialogRoot.iconText = "<"
|
|
||||||
keyboardEnabled = HMD.active;
|
|
||||||
d.resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: loginDialog
|
|
||||||
onHandleCreateCompleted: {
|
|
||||||
console.log("Create Succeeded")
|
|
||||||
|
|
||||||
loginDialog.loginThroughSteam()
|
|
||||||
}
|
|
||||||
onHandleCreateFailed: {
|
|
||||||
console.log("Create Failed: " + error)
|
|
||||||
|
|
||||||
mainTextContainer.visible = true
|
|
||||||
mainTextContainer.text = "\"" + textField.text + qsTr("\" is invalid or already taken.")
|
|
||||||
}
|
|
||||||
onHandleLoginCompleted: {
|
|
||||||
console.log("Login Succeeded")
|
|
||||||
|
|
||||||
bodyLoader.setSource("WelcomeBody.qml", { "welcomeBack" : false })
|
|
||||||
}
|
|
||||||
onHandleLoginFailed: {
|
|
||||||
console.log("Login Failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: {
|
|
||||||
if (!visible) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
case Qt.Key_Return:
|
|
||||||
event.accepted = true
|
|
||||||
usernameCollisionBody.create()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
//
|
|
||||||
// WelcomeBody.qml
|
|
||||||
//
|
|
||||||
// Created by Clement on 7/18/16
|
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
import Hifi 1.0
|
|
||||||
import QtQuick 2.4
|
|
||||||
|
|
||||||
import "../controls-uit"
|
|
||||||
import "../styles-uit"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: welcomeBody
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
property bool welcomeBack: false
|
|
||||||
|
|
||||||
function setTitle() {
|
|
||||||
loginDialogRoot.title = (welcomeBack ? qsTr("Welcome back <b>") : qsTr("Welcome <b>")) + Account.username + qsTr("</b>!")
|
|
||||||
loginDialogRoot.iconText = ""
|
|
||||||
d.resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: d
|
|
||||||
function resize() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoItem {
|
|
||||||
id: mainTextContainer
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
|
|
||||||
text: qsTr("You are now signed into High Fidelity")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
lineHeight: 2
|
|
||||||
lineHeightMode: Text.ProportionalHeight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttons
|
|
||||||
anchors {
|
|
||||||
top: mainTextContainer.bottom
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
margins: 0
|
|
||||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
|
||||||
}
|
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
|
||||||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
|
||||||
|
|
||||||
Button {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
text: qsTr("Close");
|
|
||||||
|
|
||||||
onClicked: bodyLoader.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
welcomeBody.setTitle()
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: Account
|
|
||||||
onUsernameChanged: welcomeBody.setTitle()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -35,6 +35,7 @@ TextField {
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
font.italic: textField.text == ""
|
font.italic: textField.text == ""
|
||||||
height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered.
|
height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered.
|
||||||
|
property alias textFieldLabel: textFieldLabel
|
||||||
|
|
||||||
y: textFieldLabel.visible ? textFieldLabel.height + textFieldLabel.anchors.bottomMargin : 0
|
y: textFieldLabel.visible ? textFieldLabel.height + textFieldLabel.anchors.bottomMargin : 0
|
||||||
|
|
||||||
|
|
|
@ -16,48 +16,66 @@ import "../controls-uit"
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
import "../windows"
|
import "../windows"
|
||||||
|
|
||||||
|
import "../LoginDialog"
|
||||||
|
|
||||||
TabletModalWindow {
|
TabletModalWindow {
|
||||||
id: loginDialogRoot
|
id: realRoot
|
||||||
objectName: "LoginDialog"
|
objectName: "LoginDialog"
|
||||||
|
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
property bool isHMD: false
|
property bool isHMD: false
|
||||||
property bool gotoPreviousApp: false;
|
property bool gotoPreviousApp: false;
|
||||||
color: hifi.colors.baseGray
|
color: hifi.colors.baseGray
|
||||||
|
title: qsTr("Sign in to High Fidelity")
|
||||||
|
property alias titleWidth: root.titleWidth
|
||||||
|
property alias punctuationMode: root.punctuationMode
|
||||||
|
|
||||||
|
//fake root for shared components expecting root here
|
||||||
|
property var root: QtObject {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool keyboardEnabled: false
|
||||||
|
property bool keyboardRaised: false
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
|
readonly property bool isTablet: true
|
||||||
|
|
||||||
|
property alias title: realRoot.title
|
||||||
|
property real width: realRoot.width
|
||||||
|
property real height: realRoot.height
|
||||||
|
|
||||||
|
property int titleWidth: 0
|
||||||
|
property string iconText: hifi.glyphs.avatar
|
||||||
|
property int iconSize: 35
|
||||||
|
|
||||||
|
property var pane: QtObject {
|
||||||
|
property real width: root.width
|
||||||
|
property real height: root.height
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryDestroy() {
|
||||||
|
canceled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//property int colorScheme: hifi.colorSchemes.dark
|
||||||
|
|
||||||
property int colorScheme: hifi.colorSchemes.dark
|
|
||||||
property int titleWidth: 0
|
|
||||||
property string iconText: ""
|
|
||||||
property int icon: hifi.icons.none
|
|
||||||
property int iconSize: 35
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
width: parent.width
|
width: realRoot.width
|
||||||
height: parent.height
|
height: realRoot.height
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool keyboardOverride: true
|
property bool keyboardOverride: true
|
||||||
onIconChanged: updateIcon();
|
|
||||||
|
|
||||||
property var items;
|
property var items;
|
||||||
property string label: ""
|
property string label: ""
|
||||||
|
|
||||||
onTitleWidthChanged: d.resize();
|
//onTitleWidthChanged: d.resize();
|
||||||
|
|
||||||
property bool keyboardEnabled: false
|
//onKeyboardRaisedChanged: d.resize();
|
||||||
property bool keyboardRaised: false
|
|
||||||
property bool punctuationMode: false
|
|
||||||
|
|
||||||
onKeyboardRaisedChanged: d.resize();
|
|
||||||
|
|
||||||
signal canceled();
|
signal canceled();
|
||||||
|
|
||||||
function updateIcon() {
|
|
||||||
if (!root) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
iconText = hifi.glyphForIcon(root.icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
property alias bodyLoader: bodyLoader
|
property alias bodyLoader: bodyLoader
|
||||||
property alias loginDialog: loginDialog
|
property alias loginDialog: loginDialog
|
||||||
property alias hifi: hifi
|
property alias hifi: hifi
|
||||||
|
@ -65,9 +83,10 @@ TabletModalWindow {
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
onCanceled: {
|
onCanceled: {
|
||||||
if (loginDialogRoot.Stack.view) {
|
if (bodyLoader.active === true) {
|
||||||
loginDialogRoot.Stack.view.pop();
|
//bodyLoader.active = false
|
||||||
} else if (gotoPreviousApp) {
|
}
|
||||||
|
if (gotoPreviousApp) {
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
tablet.returnToPreviousApp();
|
tablet.returnToPreviousApp();
|
||||||
} else {
|
} else {
|
||||||
|
@ -75,45 +94,81 @@ TabletModalWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginDialog {
|
TabletModalFrame {
|
||||||
id: loginDialog
|
id: mfRoot
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
StackView {
|
|
||||||
id: bodyLoader
|
|
||||||
property var item: currentItem
|
|
||||||
property var props
|
|
||||||
property string source: ""
|
|
||||||
|
|
||||||
onCurrentItemChanged: {
|
width: root.width
|
||||||
//cleanup source for future usage
|
height: root.height + frameMarginTop + hifi.dimensions.contentMargin.x
|
||||||
source = ""
|
|
||||||
|
anchors {
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
verticalCenterOffset: -loginKeyboard.height / 2
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginDialog {
|
||||||
|
id: loginDialog
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
topMargin: parent.frameMarginTop
|
||||||
|
leftMargin: hifi.dimensions.contentMargin.x
|
||||||
|
rightMargin: hifi.dimensions.contentMargin.x
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSource(src, props) {
|
Loader {
|
||||||
source = "../TabletLoginDialog/" + src
|
id: bodyLoader
|
||||||
bodyLoader.props = props
|
anchors.fill: parent
|
||||||
}
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
function popup() {
|
source: loginDialog.isSteamRunning() ? "../LoginDialog/SignInBody.qml" : "../LoginDialog/LinkAccountBody.qml"
|
||||||
bodyLoader.pop()
|
|
||||||
|
|
||||||
//check if last screen, if yes, dialog is popped out
|
|
||||||
if (depth === 1)
|
|
||||||
loginDialogRoot.canceled()
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 10
|
|
||||||
onSourceChanged: {
|
|
||||||
if (source !== "") {
|
|
||||||
bodyLoader.push(Qt.resolvedUrl(source), props)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
setSource(loginDialog.isSteamRunning() ?
|
|
||||||
"SignInBody.qml" :
|
|
||||||
"LinkAccountBody.qml")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keyboard {
|
||||||
|
id: loginKeyboard
|
||||||
|
raised: root.keyboardEnabled && root.keyboardRaised
|
||||||
|
numeric: root.punctuationMode
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onPressed: {
|
||||||
|
if (!visible) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.modifiers === Qt.ControlModifier)
|
||||||
|
switch (event.key) {
|
||||||
|
case Qt.Key_A:
|
||||||
|
event.accepted = true
|
||||||
|
detailedText.selectAll()
|
||||||
|
break
|
||||||
|
case Qt.Key_C:
|
||||||
|
event.accepted = true
|
||||||
|
detailedText.copy()
|
||||||
|
break
|
||||||
|
case Qt.Key_Period:
|
||||||
|
if (Qt.platform.os === "osx") {
|
||||||
|
event.accepted = true
|
||||||
|
content.reject()
|
||||||
|
}
|
||||||
|
break
|
||||||
|
} else switch (event.key) {
|
||||||
|
case Qt.Key_Escape:
|
||||||
|
case Qt.Key_Back:
|
||||||
|
event.accepted = true
|
||||||
|
destroy()
|
||||||
|
break
|
||||||
|
|
||||||
|
case Qt.Key_Enter:
|
||||||
|
case Qt.Key_Return:
|
||||||
|
event.accepted = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ public:
|
||||||
Q_INVOKABLE RayToAvatarIntersectionResult findRayIntersection(const PickRay& ray,
|
Q_INVOKABLE RayToAvatarIntersectionResult findRayIntersection(const PickRay& ray,
|
||||||
const QScriptValue& avatarIdsToInclude = QScriptValue(),
|
const QScriptValue& avatarIdsToInclude = QScriptValue(),
|
||||||
const QScriptValue& avatarIdsToDiscard = QScriptValue());
|
const QScriptValue& avatarIdsToDiscard = QScriptValue());
|
||||||
RayToAvatarIntersectionResult findRayIntersectionVector(const PickRay& ray,
|
Q_INVOKABLE RayToAvatarIntersectionResult findRayIntersectionVector(const PickRay& ray,
|
||||||
const QVector<EntityItemID>& avatarsToInclude,
|
const QVector<EntityItemID>& avatarsToInclude,
|
||||||
const QVector<EntityItemID>& avatarsToDiscard);
|
const QVector<EntityItemID>& avatarsToDiscard);
|
||||||
|
|
||||||
// TODO: remove this HACK once we settle on optimal default sort coefficients
|
// TODO: remove this HACK once we settle on optimal default sort coefficients
|
||||||
Q_INVOKABLE float getAvatarSortCoefficient(const QString& name);
|
Q_INVOKABLE float getAvatarSortCoefficient(const QString& name);
|
||||||
|
|
|
@ -119,7 +119,9 @@ void QmlCommerce::history() {
|
||||||
|
|
||||||
void QmlCommerce::changePassphrase(const QString& oldPassphrase, const QString& newPassphrase) {
|
void QmlCommerce::changePassphrase(const QString& oldPassphrase, const QString& newPassphrase) {
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
if ((wallet->getPassphrase()->isEmpty() || wallet->getPassphrase() == oldPassphrase) && !newPassphrase.isEmpty()) {
|
if (wallet->getPassphrase()->isEmpty()) {
|
||||||
|
emit changePassphraseStatusResult(wallet->setPassphrase(newPassphrase));
|
||||||
|
} else if (wallet->getPassphrase() == oldPassphrase && !newPassphrase.isEmpty()) {
|
||||||
emit changePassphraseStatusResult(wallet->changePassphrase(newPassphrase));
|
emit changePassphraseStatusResult(wallet->changePassphrase(newPassphrase));
|
||||||
} else {
|
} else {
|
||||||
emit changePassphraseStatusResult(false);
|
emit changePassphraseStatusResult(false);
|
||||||
|
|
|
@ -293,13 +293,15 @@ Wallet::~Wallet() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Wallet::setPassphrase(const QString& passphrase) {
|
bool Wallet::setPassphrase(const QString& passphrase) {
|
||||||
if (_passphrase) {
|
if (_passphrase) {
|
||||||
delete _passphrase;
|
delete _passphrase;
|
||||||
}
|
}
|
||||||
_passphrase = new QString(passphrase);
|
_passphrase = new QString(passphrase);
|
||||||
|
|
||||||
_publicKeys.clear();
|
_publicKeys.clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wallet::writeSecurityImage(const QPixmap* pixmap, const QString& outputFilePath) {
|
bool Wallet::writeSecurityImage(const QPixmap* pixmap, const QString& outputFilePath) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
void setCKey(const QByteArray& ckey) { _ckey = ckey; }
|
void setCKey(const QByteArray& ckey) { _ckey = ckey; }
|
||||||
QByteArray getCKey() { return _ckey; }
|
QByteArray getCKey() { return _ckey; }
|
||||||
|
|
||||||
void setPassphrase(const QString& passphrase);
|
bool setPassphrase(const QString& passphrase);
|
||||||
QString* getPassphrase() { return _passphrase; }
|
QString* getPassphrase() { return _passphrase; }
|
||||||
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
||||||
bool walletIsAuthenticatedWithPassphrase();
|
bool walletIsAuthenticatedWithPassphrase();
|
||||||
|
|
|
@ -64,7 +64,6 @@ void ModelOverlay::update(float deltatime) {
|
||||||
}
|
}
|
||||||
_isLoaded = _model->isActive();
|
_isLoaded = _model->isActive();
|
||||||
|
|
||||||
|
|
||||||
if (isAnimatingSomething()) {
|
if (isAnimatingSomething()) {
|
||||||
if (!jointsMapped()) {
|
if (!jointsMapped()) {
|
||||||
mapAnimationJoints(_model->getJointNames());
|
mapAnimationJoints(_model->getJointNames());
|
||||||
|
|
|
@ -78,6 +78,8 @@ private:
|
||||||
bool _scaleToFit = { false };
|
bool _scaleToFit = { false };
|
||||||
float _loadPriority { 0.0f };
|
float _loadPriority { 0.0f };
|
||||||
|
|
||||||
|
bool _visibleDirty { false };
|
||||||
|
bool _drawInFrontDirty { false };
|
||||||
AnimationPointer _animation;
|
AnimationPointer _animation;
|
||||||
|
|
||||||
QUrl _animationURL;
|
QUrl _animationURL;
|
||||||
|
@ -95,10 +97,6 @@ private:
|
||||||
QUrl _jointMappingURL;
|
QUrl _jointMappingURL;
|
||||||
bool _jointMappingCompleted { false };
|
bool _jointMappingCompleted { false };
|
||||||
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
|
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
|
||||||
|
|
||||||
bool _visibleDirty { false };
|
|
||||||
bool _drawInFrontDirty { false };
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ModelOverlay_h
|
#endif // hifi_ModelOverlay_h
|
||||||
|
|
|
@ -1620,13 +1620,14 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rig::initAnimGraph(const QUrl& url) {
|
void Rig::initAnimGraph(const QUrl& url) {
|
||||||
if (_animGraphURL != url || !_animNode) {
|
if (_animGraphURL != url || (!_animNode && !_animLoading)) {
|
||||||
_animGraphURL = url;
|
_animGraphURL = url;
|
||||||
|
|
||||||
_animNode.reset();
|
_animNode.reset();
|
||||||
|
|
||||||
// load the anim graph
|
// load the anim graph
|
||||||
_animLoader.reset(new AnimNodeLoader(url));
|
_animLoader.reset(new AnimNodeLoader(url));
|
||||||
|
_animLoading = true;
|
||||||
connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) {
|
connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) {
|
||||||
_animNode = nodeIn;
|
_animNode = nodeIn;
|
||||||
_animNode->setSkeleton(_animSkeleton);
|
_animNode->setSkeleton(_animSkeleton);
|
||||||
|
@ -1637,6 +1638,7 @@ void Rig::initAnimGraph(const QUrl& url) {
|
||||||
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
|
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
|
||||||
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
|
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
|
||||||
}
|
}
|
||||||
|
_animLoading = false;
|
||||||
|
|
||||||
emit onLoadComplete();
|
emit onLoadComplete();
|
||||||
});
|
});
|
||||||
|
|
|
@ -303,6 +303,7 @@ protected:
|
||||||
std::shared_ptr<AnimNode> _animNode;
|
std::shared_ptr<AnimNode> _animNode;
|
||||||
std::shared_ptr<AnimSkeleton> _animSkeleton;
|
std::shared_ptr<AnimSkeleton> _animSkeleton;
|
||||||
std::unique_ptr<AnimNodeLoader> _animLoader;
|
std::unique_ptr<AnimNodeLoader> _animLoader;
|
||||||
|
bool _animLoading { false };
|
||||||
AnimVariantMap _animVars;
|
AnimVariantMap _animVars;
|
||||||
enum class RigRole {
|
enum class RigRole {
|
||||||
Idle = 0,
|
Idle = 0,
|
||||||
|
|
|
@ -1433,7 +1433,7 @@ void EntityItem::recordCreationTime() {
|
||||||
const Transform EntityItem::getTransformToCenter(bool& success) const {
|
const Transform EntityItem::getTransformToCenter(bool& success) const {
|
||||||
Transform result = getTransform(success);
|
Transform result = getTransform(success);
|
||||||
if (getRegistrationPoint() != ENTITY_ITEM_HALF_VEC3) { // If it is not already centered, translate to center
|
if (getRegistrationPoint() != ENTITY_ITEM_HALF_VEC3) { // If it is not already centered, translate to center
|
||||||
result.postTranslate(ENTITY_ITEM_HALF_VEC3 - getRegistrationPoint()); // Position to center
|
result.postTranslate((ENTITY_ITEM_HALF_VEC3 - getRegistrationPoint()) * getDimensions()); // Position to center
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const
|
||||||
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
glm::vec3 position = getPosition() + rotation *
|
glm::vec3 position = getPosition() + rotation *
|
||||||
(dimensions * (getRegistrationPoint() - ENTITY_ITEM_DEFAULT_REGISTRATION_POINT));
|
(dimensions * (ENTITY_ITEM_DEFAULT_REGISTRATION_POINT - getRegistrationPoint()));
|
||||||
|
|
||||||
// FIXME - should set face and surfaceNormal
|
// FIXME - should set face and surfaceNormal
|
||||||
return findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance);
|
return findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance);
|
||||||
|
|
|
@ -112,7 +112,7 @@ bool WebEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const g
|
||||||
glm::vec3 dimensions = getDimensions();
|
glm::vec3 dimensions = getDimensions();
|
||||||
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
glm::vec3 position = getPosition() + rotation * (dimensions * (getRegistrationPoint() - ENTITY_ITEM_DEFAULT_REGISTRATION_POINT));
|
glm::vec3 position = getPosition() + rotation * (dimensions * (ENTITY_ITEM_DEFAULT_REGISTRATION_POINT - getRegistrationPoint()));
|
||||||
|
|
||||||
if (findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance)) {
|
if (findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance)) {
|
||||||
surfaceNormal = rotation * Vectors::UNIT_Z;
|
surfaceNormal = rotation * Vectors::UNIT_Z;
|
||||||
|
|
|
@ -178,7 +178,7 @@
|
||||||
}
|
}
|
||||||
var hudRayPick = controllerData.hudRayPicks[this.hand];
|
var hudRayPick = controllerData.hudRayPicks[this.hand];
|
||||||
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
|
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
|
||||||
if (!Window.isPointOnDesktopWindow(point2d) && !controllerData.triggerClicks[this.hand]) {
|
if (!Window.isPointOnDesktopWindow(point2d) && !this.triggerClicked) {
|
||||||
this.exitModule();
|
this.exitModule();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
||||||
(distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) {
|
(distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (entityIsGrabbable(props)) {
|
if (entityIsGrabbable(props) || entityIsCloneable(props)) {
|
||||||
// give haptic feedback
|
// give haptic feedback
|
||||||
if (props.id !== this.hapticTargetID) {
|
if (props.id !== this.hapticTargetID) {
|
||||||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||||
|
|
Loading…
Reference in a new issue