mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-14 16:07:01 +02:00
Merge branch 'feat/avatarTools/avatarPackager' of github.com:thoys/hifi into feat/avatarTools/avatarPackager
This commit is contained in:
commit
a035a2f639
5 changed files with 82 additions and 42 deletions
|
@ -146,6 +146,8 @@ Item {
|
|||
}
|
||||
|
||||
AvatarPackagerHeader {
|
||||
z: 100
|
||||
|
||||
id: avatarPackagerHeader
|
||||
colorScheme: root.colorScheme
|
||||
onBackButtonClicked: {
|
||||
|
@ -260,22 +262,49 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
visible: AvatarPackagerCore.recentProjects.length > 0
|
||||
anchors {
|
||||
fill: parent
|
||||
topMargin: 18
|
||||
leftMargin: 16
|
||||
rightMargin: 16
|
||||
}
|
||||
spacing: 10
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Repeater {
|
||||
model: AvatarPackagerCore.recentProjects
|
||||
AvatarProjectCard {
|
||||
title: modelData.name
|
||||
path: modelData.projectPath
|
||||
onOpen: avatarPackager.openProject(modelData.path)
|
||||
visible: AvatarPackagerCore.recentProjects.length > 0
|
||||
|
||||
RalewayRegular {
|
||||
id: recentProjectsText
|
||||
|
||||
color: 'white'
|
||||
|
||||
visible: AvatarPackagerCore.currentAvatarProject !== null
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.topMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
size: 20
|
||||
|
||||
text: "Recent Projects"
|
||||
|
||||
onLinkActivated: fileListPopup.open()
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
top: recentProjectsText.bottom
|
||||
topMargin: 16
|
||||
leftMargin: 16
|
||||
rightMargin: 16
|
||||
}
|
||||
spacing: 10
|
||||
|
||||
Repeater {
|
||||
model: AvatarPackagerCore.recentProjects
|
||||
AvatarProjectCard {
|
||||
title: modelData.name
|
||||
path: modelData.projectPath
|
||||
onOpen: avatarPackager.openProject(modelData.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@ import QtQuick 2.6
|
|||
|
||||
import "../../controlsUit" 1.0 as HifiControls
|
||||
import "../../stylesUit" 1.0
|
||||
import "../avatarapp" 1.0
|
||||
|
||||
Rectangle {
|
||||
ShadowRectangle {
|
||||
id: root
|
||||
|
||||
width: parent.width
|
||||
|
@ -24,30 +25,21 @@ Rectangle {
|
|||
signal backButtonClicked
|
||||
signal docsButtonClicked
|
||||
|
||||
RalewaySemiBold {
|
||||
RalewayButton {
|
||||
id: back
|
||||
|
||||
visible: backButtonEnabled && backButtonVisible
|
||||
|
||||
size: 28
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
anchors.verticalCenter: back.verticalCenter
|
||||
|
||||
text: "◀"
|
||||
color: textColor
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.backButtonClicked()
|
||||
hoverEnabled: true
|
||||
onEntered: { state = "hovering" }
|
||||
onExited: { state = "" }
|
||||
states: [
|
||||
State {
|
||||
name: "hovering"
|
||||
PropertyChanges { target: back; color: hoverTextColor }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
onClicked: root.backButtonClicked()
|
||||
}
|
||||
Item {
|
||||
id: titleArea
|
||||
|
@ -124,7 +116,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
RalewaySemiBold {
|
||||
RalewayButton {
|
||||
id: docs
|
||||
visible: false
|
||||
size: 28
|
||||
|
@ -133,13 +125,12 @@ Rectangle {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
anchors.verticalCenter: docs.verticalCenter
|
||||
|
||||
text: qsTr("Docs")
|
||||
color: "white"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
docsButtonClicked();
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
docsButtonClicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick 2.0
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import "../../controlsUit" 1.0 as HifiControls
|
||||
import "../../stylesUit" 1.0
|
||||
|
@ -63,7 +64,7 @@ Item {
|
|||
rightMargin: 16
|
||||
}
|
||||
text: "<title missing>"
|
||||
size: 16
|
||||
size: 24
|
||||
}
|
||||
|
||||
RalewayRegular {
|
||||
|
@ -88,4 +89,14 @@ Item {
|
|||
onClicked: open()
|
||||
}
|
||||
}
|
||||
|
||||
DropShadow {
|
||||
id: shadow
|
||||
anchors.fill: background
|
||||
radius: 4
|
||||
horizontalOffset: 0
|
||||
verticalOffset: 4
|
||||
color: Qt.rgba(0, 0, 0, 0.25)
|
||||
source: background
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,10 +150,12 @@ Menu::Menu() {
|
|||
qApp, SLOT(packageModel()));
|
||||
|
||||
// Edit > Avatar Packager
|
||||
#ifndef Q_OS_ANDROID
|
||||
action = addActionToQMenuAndActionHash(editMenu, MenuOption::AvatarPackager);
|
||||
connect(action, &QAction::triggered, [] {
|
||||
DependencyManager::get<AvatarPackager>()->open();
|
||||
});
|
||||
#endif
|
||||
|
||||
// Edit > Reload All Content
|
||||
addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
|
||||
|
|
|
@ -14,11 +14,14 @@
|
|||
#include <AccountManager.h>
|
||||
#include <DependencyManager.h>
|
||||
|
||||
#include <QBuffer>
|
||||
#ifndef Q_OS_ANDROID
|
||||
#include <quazip5/quazip.h>
|
||||
#include <quazip5/quazipfile.h>
|
||||
#endif
|
||||
|
||||
#include <QTimer>
|
||||
#include <QBuffer>
|
||||
|
||||
#include <qtimer.h>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
|
||||
|
@ -125,8 +128,12 @@ void MarketplaceItemUploader::doGetCategories() {
|
|||
}
|
||||
|
||||
void MarketplaceItemUploader::doUploadAvatar() {
|
||||
#ifdef Q_OS_ANDROID
|
||||
qWarning() << "Marketplace uploading is not supported on Android";
|
||||
setError(Error::Unknown);
|
||||
return;
|
||||
#else
|
||||
QBuffer buffer{ &_fileData };
|
||||
//buffer.open(QIODevice::WriteOnly);
|
||||
QuaZip zip{ &buffer };
|
||||
if (!zip.open(QuaZip::Mode::mdAdd)) {
|
||||
qWarning() << "Failed to open zip";
|
||||
|
@ -227,6 +234,7 @@ void MarketplaceItemUploader::doUploadAvatar() {
|
|||
});
|
||||
|
||||
setState(State::UploadingAvatar);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MarketplaceItemUploader::doWaitForInventory() {
|
||||
|
@ -277,7 +285,6 @@ void MarketplaceItemUploader::doWaitForInventory() {
|
|||
auto version = assetObject["version"];
|
||||
auto valid = assetObject["valid"];
|
||||
if (version.isDouble() && valid.isBool()) {
|
||||
int versionInt = version.toDouble();
|
||||
if ((int)version.toDouble() >= _itemVersion && valid.toBool()) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue