mirror of
https://github.com/overte-org/overte.git
synced 2025-06-06 10:02:47 +02:00
Merge branch 'PAL_v2' of https://github.com/highfidelity/hifi into PAL_v2
This commit is contained in:
commit
58ac34b336
7 changed files with 47 additions and 48 deletions
|
@ -156,7 +156,10 @@ Item {
|
||||||
autoScroll: false;
|
autoScroll: false;
|
||||||
// Signals
|
// Signals
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
pal.sendToScript({method: 'displayNameUpdate', params: text})
|
if (MyAvatar.displayName !== text) {
|
||||||
|
MyAvatar.displayName = text;
|
||||||
|
UserActivityLogger.palAction("display_name_change", text);
|
||||||
|
}
|
||||||
cursorPosition = 0
|
cursorPosition = 0
|
||||||
focus = false
|
focus = false
|
||||||
myDisplayName.border.width = 0
|
myDisplayName.border.width = 0
|
||||||
|
@ -233,7 +236,10 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "";
|
enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "";
|
||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
onClicked: pal.sendToScript({method: 'goToUser', params: thisNameCard.userName});
|
onClicked: {
|
||||||
|
AddressManager.goToUser(thisNameCard.userName);
|
||||||
|
UserActivityLogger.palAction("go_to_user", thisNameCard.userName);
|
||||||
|
}
|
||||||
onEntered: {
|
onEntered: {
|
||||||
displayNameText.color = hifi.colors.blueHighlight;
|
displayNameText.color = hifi.colors.blueHighlight;
|
||||||
userNameText.color = hifi.colors.blueHighlight;
|
userNameText.color = hifi.colors.blueHighlight;
|
||||||
|
@ -323,7 +329,10 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "";
|
enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "";
|
||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
onClicked: pal.sendToScript({method: 'goToUser', params: thisNameCard.userName});
|
onClicked: {
|
||||||
|
AddressManager.goToUser(thisNameCard.userName);
|
||||||
|
UserActivityLogger.palAction("go_to_user", thisNameCard.userName);
|
||||||
|
}
|
||||||
onEntered: {
|
onEntered: {
|
||||||
displayNameText.color = hifi.colors.blueHighlight;
|
displayNameText.color = hifi.colors.blueHighlight;
|
||||||
userNameText.color = hifi.colors.blueHighlight;
|
userNameText.color = hifi.colors.blueHighlight;
|
||||||
|
|
|
@ -42,7 +42,6 @@ Rectangle {
|
||||||
property var connectionsUserModelData: []; // This simple list is essentially a mirror of the connectionsUserModel listModel without all the extra complexities.
|
property var connectionsUserModelData: []; // This simple list is essentially a mirror of the connectionsUserModel listModel without all the extra complexities.
|
||||||
property bool iAmAdmin: false;
|
property bool iAmAdmin: false;
|
||||||
property var activeTab: "nearbyTab";
|
property var activeTab: "nearbyTab";
|
||||||
property int usernameAvailability;
|
|
||||||
property bool currentlyEditingDisplayName: false
|
property bool currentlyEditingDisplayName: false
|
||||||
|
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
@ -162,6 +161,18 @@ Rectangle {
|
||||||
verticalAlignment: Text.AlignTop;
|
verticalAlignment: Text.AlignTop;
|
||||||
}
|
}
|
||||||
HifiControlsUit.TabletComboBox {
|
HifiControlsUit.TabletComboBox {
|
||||||
|
function determineAvailabilityIndex() {
|
||||||
|
var globalServicesAvailability = GlobalServices.findableBy;
|
||||||
|
if (globalServicesAvailability === "all") {
|
||||||
|
return 0;
|
||||||
|
} else if (globalServicesAvailability === "friends") {
|
||||||
|
return 1;
|
||||||
|
} else if (globalServicesAvailability === "none") {
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
id: availabilityComboBox;
|
id: availabilityComboBox;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
|
@ -169,14 +180,18 @@ Rectangle {
|
||||||
// Size
|
// Size
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: 40;
|
height: 40;
|
||||||
currentIndex: usernameAvailability;
|
currentIndex: determineAvailabilityIndex();
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
id: availabilityComboBoxListItems
|
id: availabilityComboBoxListItems
|
||||||
ListElement { text: "Everyone"; value: "all"; }
|
ListElement { text: "Everyone"; value: "all"; }
|
||||||
ListElement { text: "Friends Only"; value: "friends"; }
|
ListElement { text: "Friends Only"; value: "friends"; }
|
||||||
ListElement { text: "Appear Offline"; value: "none" }
|
ListElement { text: "Appear Offline"; value: "none" }
|
||||||
}
|
}
|
||||||
onCurrentIndexChanged: { pal.sendToScript({method: 'setAvailability', params: availabilityComboBoxListItems.get(currentIndex).value})}
|
onCurrentIndexChanged: {
|
||||||
|
GlobalServices.findableBy = availabilityComboBoxListItems.get(currentIndex).value;
|
||||||
|
UserActivityLogger.palAction("set_availability", availabilityComboBoxListItems.get(currentIndex).value);
|
||||||
|
print('Setting availability:', JSON.stringify(GlobalServices.findableBy));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -928,7 +943,10 @@ Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
enabled: connectionsNameCard.selected && pal.activeTab == "connectionsTab"
|
enabled: connectionsNameCard.selected && pal.activeTab == "connectionsTab"
|
||||||
onClicked: pal.sendToScript({method: 'goToUser', params: model.userName});
|
onClicked: {
|
||||||
|
AddressManager.goToUser(model.userName);
|
||||||
|
UserActivityLogger.palAction("go_to_user", model.userName);
|
||||||
|
}
|
||||||
onEntered: connectionsLocationData.color = hifi.colors.blueHighlight;
|
onEntered: connectionsLocationData.color = hifi.colors.blueHighlight;
|
||||||
onExited: connectionsLocationData.color = hifi.colors.darkGray;
|
onExited: connectionsLocationData.color = hifi.colors.darkGray;
|
||||||
}
|
}
|
||||||
|
@ -1260,9 +1278,6 @@ Rectangle {
|
||||||
var sessionID = message.params[0];
|
var sessionID = message.params[0];
|
||||||
delete ignored[sessionID];
|
delete ignored[sessionID];
|
||||||
break;
|
break;
|
||||||
case 'updateAvailability':
|
|
||||||
usernameAvailability = message.params;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
console.log('Unrecognized message:', JSON.stringify(message));
|
console.log('Unrecognized message:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <QScriptValue>
|
#include <QScriptValue>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <DiscoverabilityManager.h>
|
||||||
|
|
||||||
class DownloadInfoResult {
|
class DownloadInfoResult {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
#include "FileDialogHelper.h"
|
#include "FileDialogHelper.h"
|
||||||
#include <OffscreenUi.h>
|
#include <OffscreenUi.h>
|
||||||
|
#include "avatar/AvatarManager.h"
|
||||||
|
#include "scripting/GlobalServicesScriptingInterface.h"
|
||||||
|
|
||||||
static const float DPI = 30.47f;
|
static const float DPI = 30.47f;
|
||||||
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
||||||
|
@ -171,6 +173,8 @@ void Web3DOverlay::loadSourceURL() {
|
||||||
_webSurface->getRootContext()->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
_webSurface->getRootContext()->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
||||||
_webSurface->getRootContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
_webSurface->getRootContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("fileDialogHelper", new FileDialogHelper());
|
_webSurface->getRootContext()->setContextProperty("fileDialogHelper", new FileDialogHelper());
|
||||||
|
_webSurface->getRootContext()->setContextProperty("MyAvatar", DependencyManager::get<AvatarManager>()->getMyAvatar().get());
|
||||||
|
_webSurface->getRootContext()->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||||
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
||||||
|
|
||||||
// Override min fps for tablet UI, for silky smooth scrolling
|
// Override min fps for tablet UI, for silky smooth scrolling
|
||||||
|
|
|
@ -340,7 +340,7 @@ class AvatarData : public QObject, public SpatiallyNestable {
|
||||||
Q_PROPERTY(float audioLoudness READ getAudioLoudness WRITE setAudioLoudness)
|
Q_PROPERTY(float audioLoudness READ getAudioLoudness WRITE setAudioLoudness)
|
||||||
Q_PROPERTY(float audioAverageLoudness READ getAudioAverageLoudness WRITE setAudioAverageLoudness)
|
Q_PROPERTY(float audioAverageLoudness READ getAudioAverageLoudness WRITE setAudioAverageLoudness)
|
||||||
|
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName)
|
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
|
||||||
// sessionDisplayName is sanitized, defaulted version displayName that is defined by the AvatarMixer rather than by Interface clients.
|
// sessionDisplayName is sanitized, defaulted version displayName that is defined by the AvatarMixer rather than by Interface clients.
|
||||||
// The result is unique among all avatars present at the time.
|
// The result is unique among all avatars present at the time.
|
||||||
Q_PROPERTY(QString sessionDisplayName READ getSessionDisplayName WRITE setSessionDisplayName)
|
Q_PROPERTY(QString sessionDisplayName READ getSessionDisplayName WRITE setSessionDisplayName)
|
||||||
|
@ -614,6 +614,9 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void displayNameChanged();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void sendAvatarDataPacket();
|
void sendAvatarDataPacket();
|
||||||
void sendIdentityPacket();
|
void sendIdentityPacket();
|
||||||
|
|
|
@ -41,7 +41,7 @@ class AddressManager : public QObject, public Dependency {
|
||||||
Q_PROPERTY(QString pathname READ currentPath)
|
Q_PROPERTY(QString pathname READ currentPath)
|
||||||
Q_PROPERTY(QString placename READ getPlaceName)
|
Q_PROPERTY(QString placename READ getPlaceName)
|
||||||
Q_PROPERTY(QString domainId READ getDomainId)
|
Q_PROPERTY(QString domainId READ getDomainId)
|
||||||
Q_PROPERTY(QUrl metaverseServerUrl READ getMetaverseServerUrl)
|
Q_PROPERTY(QUrl metaverseServerUrl READ getMetaverseServerUrl NOTIFY metaverseServerUrlChanged)
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE QString protocolVersion();
|
Q_INVOKABLE QString protocolVersion();
|
||||||
using PositionGetter = std::function<glm::vec3()>;
|
using PositionGetter = std::function<glm::vec3()>;
|
||||||
|
@ -123,6 +123,8 @@ signals:
|
||||||
void goBackPossible(bool isPossible);
|
void goBackPossible(bool isPossible);
|
||||||
void goForwardPossible(bool isPossible);
|
void goForwardPossible(bool isPossible);
|
||||||
|
|
||||||
|
void metaverseServerUrlChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AddressManager();
|
AddressManager();
|
||||||
private slots:
|
private slots:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
/*jslint vars:true, plusplus:true, forin:true*/
|
/*jslint vars:true, plusplus:true, forin:true*/
|
||||||
/*global Tablet, Settings, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, HMD, Controller, Account, UserActivityLogger, Messages, Window, XMLHttpRequest, print, location, getControllerWorldLocation, GlobalServices*/
|
/*global Tablet, Settings, Script, AvatarList, Users, Entities, MyAvatar, Camera, Overlays, Vec3, Quat, HMD, Controller, Account, UserActivityLogger, Messages, Window, XMLHttpRequest, print, location, getControllerWorldLocation*/
|
||||||
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
|
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
|
||||||
//
|
//
|
||||||
// pal.js
|
// pal.js
|
||||||
|
@ -265,24 +265,6 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
||||||
getConnectionData();
|
getConnectionData();
|
||||||
UserActivityLogger.palAction("refresh_connections", "");
|
UserActivityLogger.palAction("refresh_connections", "");
|
||||||
break;
|
break;
|
||||||
case 'displayNameUpdate':
|
|
||||||
if (MyAvatar.displayName !== message.params) {
|
|
||||||
MyAvatar.displayName = message.params;
|
|
||||||
UserActivityLogger.palAction("display_name_change", "");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'goToUser':
|
|
||||||
location.goToUser(message.params);
|
|
||||||
UserActivityLogger.palAction("go_to_user", "");
|
|
||||||
break;
|
|
||||||
case 'setAvailability':
|
|
||||||
GlobalServices.findableBy = message.params;
|
|
||||||
UserActivityLogger.palAction("set_availability", "");
|
|
||||||
print('Setting availability:', JSON.stringify(message));
|
|
||||||
break;
|
|
||||||
case 'getAvailability':
|
|
||||||
findableByChanged(GlobalServices.findableBy);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
@ -709,7 +691,6 @@ function startup() {
|
||||||
Messages.subscribe(CHANNEL);
|
Messages.subscribe(CHANNEL);
|
||||||
Messages.messageReceived.connect(receiveMessage);
|
Messages.messageReceived.connect(receiveMessage);
|
||||||
Users.avatarDisconnected.connect(avatarDisconnected);
|
Users.avatarDisconnected.connect(avatarDisconnected);
|
||||||
GlobalServices.findableByChanged.connect(findableByChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startup();
|
startup();
|
||||||
|
@ -747,7 +728,6 @@ function onTabletButtonClicked() {
|
||||||
onPalScreen = true;
|
onPalScreen = true;
|
||||||
Users.requestsDomainListData = true;
|
Users.requestsDomainListData = true;
|
||||||
populateNearbyUserList();
|
populateNearbyUserList();
|
||||||
findableByChanged(GlobalServices.findableBy);
|
|
||||||
isWired = true;
|
isWired = true;
|
||||||
Script.update.connect(updateOverlays);
|
Script.update.connect(updateOverlays);
|
||||||
Controller.mousePressEvent.connect(handleMouseEvent);
|
Controller.mousePressEvent.connect(handleMouseEvent);
|
||||||
|
@ -857,20 +837,6 @@ function avatarDisconnected(nodeID) {
|
||||||
sendToQml({method: 'avatarDisconnected', params: [nodeID]});
|
sendToQml({method: 'avatarDisconnected', params: [nodeID]});
|
||||||
}
|
}
|
||||||
|
|
||||||
function findableByChanged(usernameAvailability) {
|
|
||||||
// Update PAL availability dropdown
|
|
||||||
// Default to "friends" if undeterminable
|
|
||||||
var availability = 1;
|
|
||||||
if (usernameAvailability === "all") {
|
|
||||||
availability = 0;
|
|
||||||
} else if (usernameAvailability === "friends") {
|
|
||||||
availability = 1;
|
|
||||||
} else if (usernameAvailability === "none") {
|
|
||||||
availability = 2;
|
|
||||||
}
|
|
||||||
sendToQml({ method: 'updateAvailability', params: availability });
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearLocalQMLDataAndClosePAL() {
|
function clearLocalQMLDataAndClosePAL() {
|
||||||
sendToQml({ method: 'clearLocalQMLData' });
|
sendToQml({ method: 'clearLocalQMLData' });
|
||||||
}
|
}
|
||||||
|
@ -888,7 +854,6 @@ function shutdown() {
|
||||||
Messages.subscribe(CHANNEL);
|
Messages.subscribe(CHANNEL);
|
||||||
Messages.messageReceived.disconnect(receiveMessage);
|
Messages.messageReceived.disconnect(receiveMessage);
|
||||||
Users.avatarDisconnected.disconnect(avatarDisconnected);
|
Users.avatarDisconnected.disconnect(avatarDisconnected);
|
||||||
GlobalServices.findableByChanged.disconnect(findableByChanged);
|
|
||||||
off();
|
off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue