mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 03:50:40 +02:00
changing back to avatar only and making some changes to avoid multiple calls to dependency manager
This commit is contained in:
parent
6a971e1362
commit
f8f76d6757
4 changed files with 13 additions and 16 deletions
|
@ -17,14 +17,6 @@ CheckoutProxy::CheckoutProxy(QObject* qmlObject, QObject* parent) : QmlWrapper(q
|
|||
|
||||
WalletScriptingInterface::WalletScriptingInterface() {
|
||||
|
||||
_entityPropertyFlags += PROP_POSITION;
|
||||
_entityPropertyFlags += PROP_ROTATION;
|
||||
_entityPropertyFlags += PROP_MARKETPLACE_ID;
|
||||
_entityPropertyFlags += PROP_DIMENSIONS;
|
||||
_entityPropertyFlags += PROP_REGISTRATION_POINT;
|
||||
_entityPropertyFlags += PROP_CERTIFICATE_ID;
|
||||
_entityPropertyFlags += PROP_CLIENT_ONLY;
|
||||
_entityPropertyFlags += PROP_OWNING_AVATAR_ID;
|
||||
}
|
||||
|
||||
void WalletScriptingInterface::refreshWalletStatus() {
|
||||
|
@ -37,11 +29,17 @@ void WalletScriptingInterface::setWalletStatus(const uint& status) {
|
|||
emit DependencyManager::get<Wallet>()->walletStatusResult(status);
|
||||
}
|
||||
|
||||
void WalletScriptingInterface::proveEntityOwnershipVerification(const QUuid& entityID) {
|
||||
EntityItemProperties entityProperties = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(entityID, _entityPropertyFlags);
|
||||
if (!entityID.isNull() && entityProperties.getMarketplaceID().length() > 0) {
|
||||
DependencyManager::get<ContextOverlayInterface>()->requestOwnershipVerification(entityID);
|
||||
void WalletScriptingInterface::proveAvatarEntityOwnershipVerification(const QUuid& entityID) {
|
||||
QSharedPointer<ContextOverlayInterface> contextOverlayInterface = DependencyManager::get<ContextOverlayInterface>();
|
||||
EntityItemProperties entityProperties = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(entityID,
|
||||
contextOverlayInterface->getEntityPropertyFlags());
|
||||
if (entityProperties.getClientOnly()) {
|
||||
if (!entityID.isNull() && entityProperties.getCertificateID().length() > 0) {
|
||||
contextOverlayInterface->requestOwnershipVerification(entityID);
|
||||
} else {
|
||||
qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is null or not a certified item";
|
||||
}
|
||||
} else {
|
||||
qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is null or not a marketplace item";
|
||||
qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is not an avatar entity";
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
Q_INVOKABLE void refreshWalletStatus();
|
||||
Q_INVOKABLE uint getWalletStatus() { return _walletStatus; }
|
||||
Q_INVOKABLE void proveEntityOwnershipVerification(const QUuid& entityID);
|
||||
Q_INVOKABLE void proveAvatarEntityOwnershipVerification(const QUuid& entityID);
|
||||
// setWalletStatus() should never be made Q_INVOKABLE. If it were,
|
||||
// scripts could cause the Wallet to incorrectly report its status.
|
||||
void setWalletStatus(const uint& status);
|
||||
|
@ -51,7 +51,6 @@ signals:
|
|||
|
||||
private:
|
||||
uint _walletStatus;
|
||||
EntityPropertyFlags _entityPropertyFlags;
|
||||
};
|
||||
|
||||
#endif // hifi_WalletScriptingInterface_h
|
||||
|
|
|
@ -189,7 +189,6 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID&
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool ContextOverlayInterface::contextOverlayFilterPassed(const EntityItemID& entityItemID) {
|
||||
EntityItemProperties entityProperties = _entityScriptingInterface->getEntityProperties(entityItemID, _entityPropertyFlags);
|
||||
Setting::Handle<bool> _settingSwitch{ "commerce", true };
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
bool getIsInMarketplaceInspectionMode() { return _isInMarketplaceInspectionMode; }
|
||||
void setIsInMarketplaceInspectionMode(bool mode) { _isInMarketplaceInspectionMode = mode; }
|
||||
void requestOwnershipVerification(const QUuid& entityID);
|
||||
EntityPropertyFlags getEntityPropertyFlags() { return _entityPropertyFlags; }
|
||||
|
||||
signals:
|
||||
void contextOverlayClicked(const QUuid& currentEntityWithContextOverlay);
|
||||
|
|
Loading…
Reference in a new issue