mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:37:22 +02:00
feedback changes/don't switch modes on login in-world
This commit is contained in:
parent
f63c1b3fc5
commit
b3911e466f
4 changed files with 10 additions and 5 deletions
|
@ -33,6 +33,7 @@
|
||||||
HIFI_QML_DEF(LoginDialog)
|
HIFI_QML_DEF(LoginDialog)
|
||||||
|
|
||||||
static const QUrl TABLET_LOGIN_DIALOG_URL("dialogs/TabletLoginDialog.qml");
|
static const QUrl TABLET_LOGIN_DIALOG_URL("dialogs/TabletLoginDialog.qml");
|
||||||
|
const QUrl OVERLAY_LOGIN_DIALOG = PathUtils::qmlUrl("dialogs/OverlayLoginDialog.qml");
|
||||||
|
|
||||||
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) {
|
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) {
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
|
|
||||||
|
extern const QUrl OVERLAY_LOGIN_DIALOG;
|
||||||
|
|
||||||
class LoginDialog : public OffscreenQmlDialog {
|
class LoginDialog : public OffscreenQmlDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool isLogIn READ getIsLogIn WRITE setIsLogIn)
|
Q_PROPERTY(bool isLogIn READ getIsLogIn WRITE setIsLogIn)
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include "avatar/AvatarManager.h"
|
#include "avatar/AvatarManager.h"
|
||||||
#include "AudioClient.h"
|
#include "AudioClient.h"
|
||||||
#include "LODManager.h"
|
#include "LODManager.h"
|
||||||
|
#include "ui/LoginDialog.h"
|
||||||
#include "ui/OctreeStatsProvider.h"
|
#include "ui/OctreeStatsProvider.h"
|
||||||
#include "ui/DomainConnectionModel.h"
|
#include "ui/DomainConnectionModel.h"
|
||||||
#include "ui/AvatarInputs.h"
|
#include "ui/AvatarInputs.h"
|
||||||
|
@ -190,7 +191,7 @@ void Web3DOverlay::buildWebSurface() {
|
||||||
} else {
|
} else {
|
||||||
_webSurface = QSharedPointer<OffscreenQmlSurface>(new OffscreenQmlSurface(), qmlSurfaceDeleter);
|
_webSurface = QSharedPointer<OffscreenQmlSurface>(new OffscreenQmlSurface(), qmlSurfaceDeleter);
|
||||||
connect(_webSurface.data(), &hifi::qml::OffscreenSurface::rootContextCreated, [this](QQmlContext* surfaceContext) {
|
connect(_webSurface.data(), &hifi::qml::OffscreenSurface::rootContextCreated, [this](QQmlContext* surfaceContext) {
|
||||||
setupQmlSurface(_url == TabletScriptingInterface::QML);
|
setupQmlSurface(_url == TabletScriptingInterface::QML, _url == OVERLAY_LOGIN_DIALOG.toString());
|
||||||
});
|
});
|
||||||
_webSurface->load(_url);
|
_webSurface->load(_url);
|
||||||
_cachedWebSurface = false;
|
_cachedWebSurface = false;
|
||||||
|
@ -221,9 +222,8 @@ bool Web3DOverlay::isWebContent() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Web3DOverlay::setupQmlSurface(bool isTablet) {
|
void Web3DOverlay::setupQmlSurface(bool isTablet, bool isLoginDialog) {
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("Users", DependencyManager::get<UsersScriptingInterface>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("Users", DependencyManager::get<UsersScriptingInterface>().data());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("Account", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("Preferences", DependencyManager::get<Preferences>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("Preferences", DependencyManager::get<Preferences>().data());
|
||||||
|
@ -236,7 +236,9 @@ void Web3DOverlay::setupQmlSurface(bool isTablet) {
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
|
_webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("KeyboardScriptingInterface", DependencyManager::get<KeyboardScriptingInterface>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("KeyboardScriptingInterface", DependencyManager::get<KeyboardScriptingInterface>().data());
|
||||||
|
|
||||||
if (isTablet) {
|
if (isTablet || isLoginDialog) {
|
||||||
|
_webSurface->getSurfaceContext()->setContextProperty("Account", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
||||||
|
} else if (isTablet) {
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
auto flags = tabletScriptingInterface->getFlags();
|
auto flags = tabletScriptingInterface->getFlags();
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ protected:
|
||||||
Transform evalRenderTransform() override;
|
Transform evalRenderTransform() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupQmlSurface(bool isTablet);
|
void setupQmlSurface(bool isTablet, bool isLoginDialog);
|
||||||
void rebuildWebSurface();
|
void rebuildWebSurface();
|
||||||
bool isWebContent() const;
|
bool isWebContent() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue