From 42ab9923979d0df5d9819c1acc7bb33d8e7f4260 Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 3 Apr 2020 01:46:14 -0400 Subject: [PATCH] Even *further* progress. --- scripts/system/inventory/inventory.html | 122 ++++++++++++++++---- scripts/system/inventory/inventory.js | 41 +++++++ scripts/system/inventory/styles/vuetify.css | 4 +- 3 files changed, 143 insertions(+), 24 deletions(-) diff --git a/scripts/system/inventory/inventory.html b/scripts/system/inventory/inventory.html index f1f9061840..d6bb867420 100644 --- a/scripts/system/inventory/inventory.html +++ b/scripts/system/inventory/inventory.html @@ -20,7 +20,7 @@ - -
{{item.type}}
- {{item.name}} - + + +
{{item.type}}
+ {{item.name}} + {{item.url}}
+ + + + + + + + + Use + + mdi-play + + + + Rename + + mdi-pencil + + + + Share + + mdi-share + + + + Remove + + mdi-minus + + + + + - - {{displayIcon(item.type)}} -
- - Share - Remove - - - - Use - +
@@ -168,6 +213,7 @@ Receiving Item @@ -241,8 +287,8 @@ new Vue({ }, { "type": "script", - "name": "TEST", - "url": "https://google.com/vr.js", + "name": "TESTLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG", + "url": "https://google.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js", }, { "type": "avatar", @@ -287,8 +333,13 @@ new Vue({ show: false, }, receiveDialog: { - show: true, + show: false, + user: null, + name: null, + type: null, + url: null, }, + sortBy: "alphabetical", darkTheme: true, drawer: false, }), @@ -299,6 +350,33 @@ new Vue({ methods: { addItem: function(url) { + }, + removeItem: function(url) { + + }, + renameItem: function(url) { + + }, + receivingItem: function(name, url) { + + }, + shareItem: function(url) { + + }, + acceptItem: function(url) { + + }, + useItem: function(url) { + alert(url); + this.sendAppMessage("test", "testData"); + }, + sendAppMessage: function(command, data) { + var JSONtoSend = { + "app": "inventory", + "command": command, + "data": data + }; + EventBridge.emitWebEvent(JSON.stringify(JSONtoSend)); }, displayIcon: function(itemType) { return this.iconType[itemType].icon; diff --git a/scripts/system/inventory/inventory.js b/scripts/system/inventory/inventory.js index e69de29bb2..3079b9a5d8 100644 --- a/scripts/system/inventory/inventory.js +++ b/scripts/system/inventory/inventory.js @@ -0,0 +1,41 @@ +(function () { // BEGIN LOCAL_SCOPE +var AppUi = Script.require('appUi'); +var ui; +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + +// APP EVENT ROUTING + +function onWebAppEventReceived(event) { + var eventJSON = JSON.parse(event); + if (eventJSON.app == "inventory") { // This is our web app! + print("gemstoneApp.js received a web event: " + event); + } +} + +tablet.webEventReceived.connect(onWebAppEventReceived); + +// END APP EVENT ROUTING + +function saveInventory() { + +} + +function onOpened() { + console.log("hello world!"); +} + +function onClosed() { + console.log("hello world!"); +} + +function startup() { + ui = new AppUi({ + buttonName: "INVENTORY", + home: Script.resolvePath("inventory.html"), + graphicsDirectory: Script.resolvePath("./"), // Where your button icons are located + onOpened: onOpened, + onClosed: onClosed + }); +} +startup(); +}()); // END LOCAL_SCOPE \ No newline at end of file diff --git a/scripts/system/inventory/styles/vuetify.css b/scripts/system/inventory/styles/vuetify.css index e570f335ea..a768345613 100644 --- a/scripts/system/inventory/styles/vuetify.css +++ b/scripts/system/inventory/styles/vuetify.css @@ -4443,7 +4443,7 @@ .v-card__subtitle, .v-card__text { - font-size: 1.075rem; + font-size: 0.875rem; font-weight: 400; line-height: 1.375rem; letter-spacing: 0.0071428571em; @@ -14356,7 +14356,7 @@ html.overflow-y-hidden { font-family: "Roboto", sans-serif !important; } .v-application .overline { - font-size: 0.925rem !important; + font-size: 0.625rem !important; font-weight: 400; letter-spacing: 0.1666666667em !important; line-height: 1rem;