mirror of
https://github.com/lubosz/overte.git
synced 2025-08-27 08:25:53 +02:00
when the user clicks on it should take the user to the marketplace info page of the avatar
This commit is contained in:
parent
9f7fd3faa2
commit
17acb5e106
2 changed files with 18 additions and 2 deletions
|
@ -373,6 +373,10 @@ Rectangle {
|
|||
anchors.leftMargin: 30
|
||||
anchors.top: star.bottom
|
||||
anchors.topMargin: 11
|
||||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
onClicked: emitSendToScript({'method' : 'navigate', 'url' : allAvatars.makeMarketItemUrl(currentAvatar.avatarUrl)})
|
||||
}
|
||||
}
|
||||
|
||||
TextStyle3 {
|
||||
|
|
|
@ -4,15 +4,27 @@ ListModel {
|
|||
id: model
|
||||
property url externalAvatarThumbnailUrl;
|
||||
|
||||
function makeThumbnailUrl(avatarUrl) {
|
||||
function extractMarketId(avatarUrl) {
|
||||
var splittedUrl = avatarUrl.split('/');
|
||||
var marketId = splittedUrl[splittedUrl.length - 2];
|
||||
var indexOfVSuffix = marketId.indexOf('-v');
|
||||
if(indexOfVSuffix !== -1) {
|
||||
marketId = marketId.substring(0, indexOfVSuffix);
|
||||
}
|
||||
|
||||
return marketId;
|
||||
}
|
||||
|
||||
function makeMarketItemUrl(avatarUrl) {
|
||||
var marketItemUrl = "https://highfidelity.com/marketplace/items/%marketId%"
|
||||
.split('%marketId%').join(extractMarketId(avatarUrl));
|
||||
|
||||
return marketItemUrl;
|
||||
}
|
||||
|
||||
function makeThumbnailUrl(avatarUrl) {
|
||||
var avatarThumbnailUrl = "https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/previews/%marketId%/large/hifi-mp-%marketId%.jpg"
|
||||
.split('%marketId%').join(marketId);
|
||||
.split('%marketId%').join(extractMarketId(avatarUrl));
|
||||
|
||||
return avatarThumbnailUrl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue