mirror of https://github.com/teverse/teverse
Compare commits
3 Commits
96da67ed50
...
ea94bd1415
Author | SHA1 | Date |
---|---|---|
Jay | ea94bd1415 | |
Jay | 964fb857c9 | |
Jay | f604b3df0b |
209
api.json
209
api.json
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"os": "OSX",
|
||||
"arch": "x64",
|
||||
"version": "0.23.1",
|
||||
"generatedAt": "19/06/2020 13:05:51",
|
||||
"version": "0.24.0",
|
||||
"generatedAt": "28/06/2020 20:32:30",
|
||||
"sandbox": {
|
||||
"coroutine": {
|
||||
"status": "function",
|
||||
|
@ -20,10 +20,10 @@
|
|||
"xpcall": "function",
|
||||
"_DEVICE_PAD_BOTTOM": 0,
|
||||
"ipairs": "function",
|
||||
"_TEV_BUILD": "0231",
|
||||
"_TEV_BUILD": "0240",
|
||||
"colour": "cdata",
|
||||
"print": "function",
|
||||
"_TEV_VERSION_MINOR": 23,
|
||||
"_TEV_VERSION_MINOR": 24,
|
||||
"pcall": "function",
|
||||
"gcinfo": "function",
|
||||
"loadstring": "function",
|
||||
|
@ -45,13 +45,13 @@
|
|||
"insert": "function"
|
||||
},
|
||||
"error": "function",
|
||||
"_TEV_VERSION": "0.23.1",
|
||||
"_TEV_VERSION": "0.24.0",
|
||||
"quaternion": "cdata",
|
||||
"_DEVICE": "Mac",
|
||||
"require": "function",
|
||||
"unpack": "function",
|
||||
"_VERSION": "Lua 5.1",
|
||||
"_TEV_VERSION_PATCH": 1,
|
||||
"_TEV_VERSION_PATCH": 0,
|
||||
"next": "function",
|
||||
"math": {
|
||||
"ceil": "function",
|
||||
|
@ -1391,7 +1391,7 @@
|
|||
"fov": {
|
||||
"hasGetter": true,
|
||||
"type": "number",
|
||||
"description": "",
|
||||
"description": "field of view",
|
||||
"hasSetter": true
|
||||
},
|
||||
"position": {
|
||||
|
@ -1503,6 +1503,19 @@
|
|||
},
|
||||
"networking": {
|
||||
"methods": {
|
||||
"broadcast": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "eventName"
|
||||
},
|
||||
{
|
||||
"type": "..."
|
||||
}
|
||||
],
|
||||
"returns": [],
|
||||
"description": "Reliably sends the information you pass to all direct connections. Note that a client cannot broadcast to other clients as they are not directly connected."
|
||||
},
|
||||
"getClient": {
|
||||
"parameters": [
|
||||
{
|
||||
|
@ -1514,10 +1527,121 @@
|
|||
"client"
|
||||
],
|
||||
"description": "Returns the client for the matching name or id you provide"
|
||||
},
|
||||
"initiate": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "appId"
|
||||
}
|
||||
],
|
||||
"returns": [],
|
||||
"description": ""
|
||||
},
|
||||
"sendToClient": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "client",
|
||||
"name": "client"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "eventName"
|
||||
},
|
||||
{
|
||||
"type": "..."
|
||||
}
|
||||
],
|
||||
"returns": [],
|
||||
"description": "[SERVER ONLY] Reliably sends the information you pass"
|
||||
},
|
||||
"sendToServer": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "eventName"
|
||||
},
|
||||
{
|
||||
"type": "..."
|
||||
}
|
||||
],
|
||||
"returns": [],
|
||||
"description": "This is an alias for broadcast that only works on the client side."
|
||||
}
|
||||
},
|
||||
"className": "networking",
|
||||
"events": [],
|
||||
"events": {
|
||||
"changed": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "property"
|
||||
},
|
||||
{
|
||||
"type": "variant",
|
||||
"name": "oldValue"
|
||||
},
|
||||
{
|
||||
"type": "variant",
|
||||
"name": "newValue"
|
||||
}
|
||||
],
|
||||
"description": "Fired when a property is changed."
|
||||
},
|
||||
"_clientConnected": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "client",
|
||||
"name": "user"
|
||||
}
|
||||
],
|
||||
"description": "Fired when a user connects"
|
||||
},
|
||||
"_disconnected": {
|
||||
"parameters": [],
|
||||
"description": "Fired when a connection fails or stops"
|
||||
},
|
||||
"_update": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "message"
|
||||
}
|
||||
],
|
||||
"description": "Fired when an update begins"
|
||||
},
|
||||
"_connected": {
|
||||
"parameters": [],
|
||||
"description": "Fired when a connection has started"
|
||||
},
|
||||
"_clientDisconnected": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "client",
|
||||
"name": "user"
|
||||
}
|
||||
],
|
||||
"description": "Fired when a user disconnects"
|
||||
},
|
||||
"_downloadProgress": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "percentage"
|
||||
}
|
||||
],
|
||||
"description": "Fired when an update progresses"
|
||||
},
|
||||
"_localAuthenticating": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "status"
|
||||
}
|
||||
],
|
||||
"description": "Fired when the local user authenticates"
|
||||
}
|
||||
},
|
||||
"constructable": false,
|
||||
"properties": {
|
||||
"clients": {
|
||||
|
@ -1526,6 +1650,12 @@
|
|||
"description": "A readonly list of clients, excluding local client when offline",
|
||||
"hasSetter": false
|
||||
},
|
||||
"isConnected": {
|
||||
"hasGetter": true,
|
||||
"type": "boolean",
|
||||
"description": "True when a connection is established",
|
||||
"hasSetter": false
|
||||
},
|
||||
"localClient": {
|
||||
"hasGetter": true,
|
||||
"type": "client",
|
||||
|
@ -1598,7 +1728,33 @@
|
|||
}
|
||||
},
|
||||
"className": "block",
|
||||
"events": [],
|
||||
"events": {
|
||||
"changed": {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "property"
|
||||
},
|
||||
{
|
||||
"type": "variant",
|
||||
"name": "oldValue"
|
||||
},
|
||||
{
|
||||
"type": "variant",
|
||||
"name": "newValue"
|
||||
}
|
||||
],
|
||||
"description": "Fired when a property is changed."
|
||||
},
|
||||
"collisionEnded": {
|
||||
"parameters": [],
|
||||
"description": ""
|
||||
},
|
||||
"collisionStarted": {
|
||||
"parameters": [],
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"constructable": true,
|
||||
"extends": "sceneObject",
|
||||
"properties": {
|
||||
|
@ -1644,9 +1800,9 @@
|
|||
"description": "",
|
||||
"hasSetter": true
|
||||
},
|
||||
"linearFactor": {
|
||||
"roughness": {
|
||||
"hasGetter": true,
|
||||
"type": "vector3",
|
||||
"type": "number",
|
||||
"description": "",
|
||||
"hasSetter": true
|
||||
},
|
||||
|
@ -1656,9 +1812,9 @@
|
|||
"description": "",
|
||||
"hasSetter": true
|
||||
},
|
||||
"roughness": {
|
||||
"linearFactor": {
|
||||
"hasGetter": true,
|
||||
"type": "number",
|
||||
"type": "vector3",
|
||||
"description": "",
|
||||
"hasSetter": true
|
||||
}
|
||||
|
@ -1678,21 +1834,28 @@
|
|||
],
|
||||
"description": "Returns the source code of the loaded app or nil if no app is loaded."
|
||||
},
|
||||
"loadRemote": {
|
||||
"parameters": [],
|
||||
"returns": [],
|
||||
"description": "Starts uploading the currently loaded UNPACKAGED app"
|
||||
},
|
||||
"loadDashboard": {
|
||||
"parameters": [],
|
||||
"returns": [],
|
||||
"description": "Resets the environment and loads the default Dashboard app"
|
||||
},
|
||||
"loadRemote": {
|
||||
"parameters": [],
|
||||
"returns": [],
|
||||
"description": "Starts uploading the currently loaded UNPACKAGED app"
|
||||
},
|
||||
"upload": {
|
||||
"parameters": [],
|
||||
"returns": [],
|
||||
"description": "Starts uploading the currently loaded UNPACKAGED app"
|
||||
},
|
||||
"promptAppDirectory": {
|
||||
"parameters": [],
|
||||
"returns": [
|
||||
"boolean"
|
||||
],
|
||||
"description": "Prompts the user to select a directory containing the manifest.json file"
|
||||
},
|
||||
"promptApp": {
|
||||
"parameters": [],
|
||||
"returns": [
|
||||
|
@ -1717,12 +1880,10 @@
|
|||
],
|
||||
"description": "Resets the environment and loads the Lua string provided as an app."
|
||||
},
|
||||
"promptAppDirectory": {
|
||||
"test": {
|
||||
"parameters": [],
|
||||
"returns": [
|
||||
"boolean"
|
||||
],
|
||||
"description": "Prompts the user to select a directory containing the manifest.json file"
|
||||
"returns": [],
|
||||
"description": "Uploads the unpackaged app and spins up a temporary test server on our cloud"
|
||||
},
|
||||
"loadWorkshop": {
|
||||
"parameters": [],
|
||||
|
@ -2237,5 +2398,5 @@
|
|||
"properties": []
|
||||
}
|
||||
},
|
||||
"build": "0231"
|
||||
"build": "0240"
|
||||
}
|
|
@ -3,8 +3,8 @@
|
|||
local share = teverse.construct("guiTextBox", {
|
||||
parent = teverse.coreInterface,
|
||||
size = guiCoord(0, 60, 0, 16),
|
||||
position = guiCoord(0.5, -65, 1, -20),
|
||||
strokeRadius = 4,
|
||||
position = guiCoord(0.5, -65, 1, -26),
|
||||
strokeRadius = 2,
|
||||
text = "Share",
|
||||
textAlign = "middle",
|
||||
textSize = 12
|
||||
|
@ -13,13 +13,23 @@ local share = teverse.construct("guiTextBox", {
|
|||
local reload = teverse.construct("guiTextBox", {
|
||||
parent = teverse.coreInterface,
|
||||
size = guiCoord(0, 60, 0, 16),
|
||||
position = guiCoord(0.5, 5, 1, -20),
|
||||
strokeRadius = 4,
|
||||
position = guiCoord(0.5, 5, 1, -26),
|
||||
strokeRadius = 2,
|
||||
text = "Reload",
|
||||
textAlign = "middle",
|
||||
textSize = 12
|
||||
})
|
||||
|
||||
local test = teverse.construct("guiTextBox", {
|
||||
parent = teverse.coreInterface,
|
||||
size = guiCoord(0, 90, 0, 16),
|
||||
position = guiCoord(1.0, -140, 1, -26),
|
||||
strokeRadius = 2,
|
||||
text = "Remote Test",
|
||||
textAlign = "middle",
|
||||
textSize = 12
|
||||
})
|
||||
|
||||
reload:on("mouseLeftUp", function()
|
||||
teverse.apps:reload()
|
||||
end)
|
||||
|
@ -103,3 +113,78 @@ share:on("mouseLeftUp", function()
|
|||
teverse.input:waitFor("mouseLeftUp")
|
||||
teverse.apps:reload()
|
||||
end)
|
||||
|
||||
|
||||
test:on("mouseLeftUp", function()
|
||||
test.visible = false
|
||||
reload.visible = false
|
||||
|
||||
local backdrop = teverse.construct("guiFrame", {
|
||||
parent = teverse.coreInterface,
|
||||
size = guiCoord(1, 0, 1, 0),
|
||||
position = guiCoord(0, 0, 0, 0),
|
||||
backgroundColour = colour(.25, .25, .25),
|
||||
backgroundAlpha = 0.6,
|
||||
zIndex = 1000
|
||||
})
|
||||
|
||||
local spinner = teverse.construct("guiIcon", {
|
||||
parent = backdrop,
|
||||
size = guiCoord(0, 40, 0, 40),
|
||||
position = guiCoord(0.5, -20, 0.5, -20),
|
||||
iconMax = 40,
|
||||
iconColour = colour(1, 1, 1),
|
||||
iconType = "faSolid",
|
||||
iconId = "spinner",
|
||||
iconAlpha = 0.9
|
||||
})
|
||||
|
||||
spawn(function()
|
||||
while sleep() and spinner.alive do
|
||||
spinner.rotation = spinner.rotation + math.rad(1)
|
||||
end
|
||||
end)
|
||||
|
||||
teverse.apps:test()
|
||||
local success, result = teverse.apps:waitFor("upload")
|
||||
spinner:destroy()
|
||||
|
||||
local container = teverse.construct("guiTextBox", {
|
||||
parent = backdrop,
|
||||
size = guiCoord(0, 460, 0, 120),
|
||||
position = guiCoord(0.5, -230, 0.5, -60),
|
||||
backgroundColour = colour(1, 1, 1),
|
||||
dropShadowAlpha = 0.3,
|
||||
})
|
||||
|
||||
local label = teverse.construct("guiTextBox", {
|
||||
parent = container,
|
||||
size = guiCoord(1.0, -20, 1.0, -20),
|
||||
position = guiCoord(0, 10, 0, 10),
|
||||
backgroundAlpha = 0.0,
|
||||
textSize = 16,
|
||||
textWrap = true,
|
||||
textAlign = "topLeft",
|
||||
textFont = "tevurl:fonts/firaCodeRegular.otf"
|
||||
})
|
||||
|
||||
local title = teverse.construct("guiTextBox", {
|
||||
parent = backdrop,
|
||||
size = guiCoord(0, 460, 0, 20),
|
||||
position = guiCoord(0.5, -230, 0.5, -80),
|
||||
backgroundColour = colour(0.9, 0.9, 0.9),
|
||||
textSize = 18,
|
||||
dropShadowAlpha = 0.3,
|
||||
textAlign = "middle",
|
||||
zIndex = 2
|
||||
})
|
||||
|
||||
if success then
|
||||
teverse.apps:reload()
|
||||
else
|
||||
title.backgroundColour = colour.rgb(179, 70, 70)
|
||||
title.textColour = colour.white()
|
||||
title.text = "Something went wrong"
|
||||
label.text = result
|
||||
end
|
||||
end)
|
Loading…
Reference in New Issue