mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +02:00
Add start of opening uploaded avatar in inventory
This commit is contained in:
parent
720cd90dc7
commit
c2aca64b11
4 changed files with 17 additions and 3 deletions
|
@ -72,7 +72,6 @@ Windows.ScrollingWindow {
|
||||||
height: 30
|
height: 30
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
var avatarProjectsPath = fileDialogHelper.standardPath(/*fileDialogHelper.StandardLocation.DocumentsLocation*/ 1) + "/High Fidelity/Avatar Projects";
|
var avatarProjectsPath = fileDialogHelper.standardPath(/*fileDialogHelper.StandardLocation.DocumentsLocation*/ 1) + "/High Fidelity/Avatar Projects";
|
||||||
var avatarProjectsPath = "C:/Users/ryanh/Documents/High Fidelity Avatars";
|
|
||||||
console.log("path = " + avatarProjectsPath);
|
console.log("path = " + avatarProjectsPath);
|
||||||
|
|
||||||
// TODO: make the dialog modal
|
// TODO: make the dialog modal
|
||||||
|
|
|
@ -156,6 +156,8 @@ Item {
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
console.log("Opening in inventory");
|
console.log("Opening in inventory");
|
||||||
|
|
||||||
|
AvatarPackagerCore.currentAvatarProject.openInInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
|
|
||||||
|
#include <ui/TabletScriptingInterface.h>
|
||||||
|
#include "scripting/HMDScriptingInterface.h"
|
||||||
|
|
||||||
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
||||||
const auto pathToLower = path.toLower();
|
const auto pathToLower = path.toLower();
|
||||||
if (pathToLower.endsWith(".fst")) {
|
if (pathToLower.endsWith(".fst")) {
|
||||||
|
@ -40,7 +43,6 @@ AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
||||||
|
|
||||||
AvatarProject::AvatarProject(const QString& fstPath, const QByteArray& data) :
|
AvatarProject::AvatarProject(const QString& fstPath, const QByteArray& data) :
|
||||||
_fstPath(fstPath), _fst(fstPath, FSTReader::readMapping(data)) {
|
_fstPath(fstPath), _fst(fstPath, FSTReader::readMapping(data)) {
|
||||||
|
|
||||||
_fstFilename = QFileInfo(_fstPath).fileName();
|
_fstFilename = QFileInfo(_fstPath).fileName();
|
||||||
qDebug() << "Pointers: " << this << &_fst;
|
qDebug() << "Pointers: " << this << &_fst;
|
||||||
|
|
||||||
|
@ -70,6 +72,16 @@ void AvatarProject::refreshProjectFiles() {
|
||||||
appendDirectory("", _directory);
|
appendDirectory("", _directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE MarketplaceItemUploader* AvatarProject::upload() {
|
MarketplaceItemUploader* AvatarProject::upload() {
|
||||||
return new MarketplaceItemUploader("test_avatar", "blank description", _fstFilename, QUuid(), _projectFiles);
|
return new MarketplaceItemUploader("test_avatar", "blank description", _fstFilename, QUuid(), _projectFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarProject::openInInventory() {
|
||||||
|
auto tablet = dynamic_cast<TabletProxy*>(
|
||||||
|
DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
|
tablet->loadQMLSource("hifi/commerce/wallet/Wallet.qml");
|
||||||
|
DependencyManager::get<HMDScriptingInterface>()->openTablet();
|
||||||
|
tablet->sendToQml(QVariantMap({
|
||||||
|
{ "method", "updatePurchases" },
|
||||||
|
{ "filterText", "filtertext" } }));
|
||||||
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE MarketplaceItemUploader* upload();
|
Q_INVOKABLE MarketplaceItemUploader* upload();
|
||||||
|
Q_INVOKABLE void openInInventory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the AvatarProject or a nullptr on failure.
|
* returns the AvatarProject or a nullptr on failure.
|
||||||
|
|
Loading…
Reference in a new issue