mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-06 22:10:54 +02:00
This works, but is it correct?
This commit is contained in:
parent
3a7e626463
commit
679d53e2cf
5 changed files with 18 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -86,3 +86,6 @@ android/app/src/main/assets
|
||||||
|
|
||||||
# Resource binary file
|
# Resource binary file
|
||||||
interface/compiledResources
|
interface/compiledResources
|
||||||
|
|
||||||
|
# GPUCache
|
||||||
|
interface/resources/GPUCache/*
|
|
@ -256,6 +256,7 @@ Rectangle {
|
||||||
|
|
||||||
// "Close" button
|
// "Close" button
|
||||||
HiFiGlyphs {
|
HiFiGlyphs {
|
||||||
|
z: 999;
|
||||||
id: closeGlyphButton;
|
id: closeGlyphButton;
|
||||||
text: hifi.glyphs.close;
|
text: hifi.glyphs.close;
|
||||||
color: hifi.colors.white;
|
color: hifi.colors.white;
|
||||||
|
@ -562,6 +563,7 @@ Rectangle {
|
||||||
case 'inspectionCertificate_setCertificateId':
|
case 'inspectionCertificate_setCertificateId':
|
||||||
resetCert(false);
|
resetCert(false);
|
||||||
root.certificateId = message.certificateId;
|
root.certificateId = message.certificateId;
|
||||||
|
sendToScript({method: 'inspectionCertificate_requestOwnershipVerification', certificateId: root.certificateId});
|
||||||
break;
|
break;
|
||||||
case 'inspectionCertificate_resetCert':
|
case 'inspectionCertificate_resetCert':
|
||||||
resetCert(true);
|
resetCert(true);
|
||||||
|
|
|
@ -221,13 +221,13 @@ bool ContextOverlayInterface::destroyContextOverlay(const EntityItemID& entityIt
|
||||||
void ContextOverlayInterface::contextOverlays_mousePressOnOverlay(const OverlayID& overlayID, const PointerEvent& event) {
|
void ContextOverlayInterface::contextOverlays_mousePressOnOverlay(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (overlayID == _contextOverlayID && event.getButton() == PointerEvent::PrimaryButton) {
|
if (overlayID == _contextOverlayID && event.getButton() == PointerEvent::PrimaryButton) {
|
||||||
qCDebug(context_overlay) << "Clicked Context Overlay. Entity ID:" << _currentEntityWithContextOverlay << "Overlay ID:" << overlayID;
|
qCDebug(context_overlay) << "Clicked Context Overlay. Entity ID:" << _currentEntityWithContextOverlay << "Overlay ID:" << overlayID;
|
||||||
|
emit contextOverlayClicked(_currentEntityWithContextOverlay);
|
||||||
Setting::Handle<bool> _settingSwitch{ "commerce", true };
|
Setting::Handle<bool> _settingSwitch{ "commerce", true };
|
||||||
if (_settingSwitch.get()) {
|
if (_settingSwitch.get()) {
|
||||||
openInspectionCertificate();
|
openInspectionCertificate();
|
||||||
} else {
|
} else {
|
||||||
openMarketplace();
|
openMarketplace();
|
||||||
}
|
}
|
||||||
emit contextOverlayClicked(_currentEntityWithContextOverlay);
|
|
||||||
_contextOverlayJustClicked = true;
|
_contextOverlayJustClicked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,6 +350,12 @@ void ContextOverlayInterface::requestOwnershipVerification(const QUuid& entityID
|
||||||
emit DependencyManager::get<WalletScriptingInterface>()->ownershipVerificationFailed(_lastInspectedEntity);
|
emit DependencyManager::get<WalletScriptingInterface>()->ownershipVerificationFailed(_lastInspectedEntity);
|
||||||
qCDebug(context_overlay) << "Entity" << _lastInspectedEntity << "failed static certificate verification!";
|
qCDebug(context_overlay) << "Entity" << _lastInspectedEntity << "failed static certificate verification!";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// We don't currently verify ownership of entities that aren't Avatar Entities,
|
||||||
|
// so they always pass Ownership Verification. It's necessary to emit this signal
|
||||||
|
// so that the Inspection Certificate can continue its information-grabbing process.
|
||||||
|
auto ledger = DependencyManager::get<Ledger>();
|
||||||
|
emit ledger->updateCertificateStatus(entityProperties.getCertificateID(), (uint)(ledger->CERTIFICATE_STATUS_VERIFICATION_SUCCESS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,12 +363,10 @@ static const QString INSPECTION_CERTIFICATE_QML_PATH = "hifi/commerce/inspection
|
||||||
void ContextOverlayInterface::openInspectionCertificate() {
|
void ContextOverlayInterface::openInspectionCertificate() {
|
||||||
// lets open the tablet to the inspection certificate QML
|
// lets open the tablet to the inspection certificate QML
|
||||||
if (!_currentEntityWithContextOverlay.isNull() && _entityMarketplaceID.length() > 0) {
|
if (!_currentEntityWithContextOverlay.isNull() && _entityMarketplaceID.length() > 0) {
|
||||||
|
setLastInspectedEntity(_currentEntityWithContextOverlay);
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
auto tablet = dynamic_cast<TabletProxy*>(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
tablet->loadQMLSource(INSPECTION_CERTIFICATE_QML_PATH);
|
tablet->loadQMLSource(INSPECTION_CERTIFICATE_QML_PATH);
|
||||||
_hmdScriptingInterface->openTablet();
|
_hmdScriptingInterface->openTablet();
|
||||||
|
|
||||||
setLastInspectedEntity(_currentEntityWithContextOverlay);
|
|
||||||
requestOwnershipVerification(_lastInspectedEntity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
bool getEnabled() { return _enabled; }
|
bool getEnabled() { return _enabled; }
|
||||||
bool getIsInMarketplaceInspectionMode() { return _isInMarketplaceInspectionMode; }
|
bool getIsInMarketplaceInspectionMode() { return _isInMarketplaceInspectionMode; }
|
||||||
void setIsInMarketplaceInspectionMode(bool mode) { _isInMarketplaceInspectionMode = mode; }
|
void setIsInMarketplaceInspectionMode(bool mode) { _isInMarketplaceInspectionMode = mode; }
|
||||||
void requestOwnershipVerification(const QUuid& entityID);
|
Q_INVOKABLE void requestOwnershipVerification(const QUuid& entityID);
|
||||||
EntityPropertyFlags getEntityPropertyFlags() { return _entityPropertyFlags; }
|
EntityPropertyFlags getEntityPropertyFlags() { return _entityPropertyFlags; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -583,6 +583,9 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
||||||
case 'inspectionCertificate_closeClicked':
|
case 'inspectionCertificate_closeClicked':
|
||||||
tablet.gotoHomeScreen();
|
tablet.gotoHomeScreen();
|
||||||
break;
|
break;
|
||||||
|
case 'inspectionCertificate_requestOwnershipVerification':
|
||||||
|
ContextOverlay.requestOwnershipVerification(message.certificateId);
|
||||||
|
break;
|
||||||
case 'inspectionCertificate_showInMarketplaceClicked':
|
case 'inspectionCertificate_showInMarketplaceClicked':
|
||||||
tablet.gotoWebScreen(message.marketplaceUrl, MARKETPLACES_INJECT_SCRIPT_URL);
|
tablet.gotoWebScreen(message.marketplaceUrl, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue