mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 05:17:22 +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
|
||||
onClicked: function() {
|
||||
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);
|
||||
|
||||
// TODO: make the dialog modal
|
||||
|
|
|
@ -156,6 +156,8 @@ Item {
|
|||
colorScheme: root.colorScheme
|
||||
onClicked: function() {
|
||||
console.log("Opening in inventory");
|
||||
|
||||
AvatarPackagerCore.currentAvatarProject.openInInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#include <QDebug>
|
||||
#include <QQmlEngine>
|
||||
|
||||
#include <ui/TabletScriptingInterface.h>
|
||||
#include "scripting/HMDScriptingInterface.h"
|
||||
|
||||
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
||||
const auto pathToLower = path.toLower();
|
||||
if (pathToLower.endsWith(".fst")) {
|
||||
|
@ -40,7 +43,6 @@ AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
|||
|
||||
AvatarProject::AvatarProject(const QString& fstPath, const QByteArray& data) :
|
||||
_fstPath(fstPath), _fst(fstPath, FSTReader::readMapping(data)) {
|
||||
|
||||
_fstFilename = QFileInfo(_fstPath).fileName();
|
||||
qDebug() << "Pointers: " << this << &_fst;
|
||||
|
||||
|
@ -70,6 +72,16 @@ void AvatarProject::refreshProjectFiles() {
|
|||
appendDirectory("", _directory);
|
||||
}
|
||||
|
||||
Q_INVOKABLE MarketplaceItemUploader* AvatarProject::upload() {
|
||||
MarketplaceItemUploader* AvatarProject::upload() {
|
||||
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 void openInInventory();
|
||||
|
||||
/**
|
||||
* returns the AvatarProject or a nullptr on failure.
|
||||
|
|
Loading…
Reference in a new issue