mirror of https://github.com/teverse/teverse
Compare commits
18 Commits
f632affc57
...
4c54c818f3
Author | SHA1 | Date |
---|---|---|
Sanjay Bhadra | 4c54c818f3 | |
Sanjay Bhadra | 80c8f479bd | |
Sanjay Bhadra | f713a64176 | |
Jay | ef3f0d9178 | |
teverse | 83ce0d18ef | |
teverse | 4e9bfdb964 | |
Jay | e8f01cc121 | |
Jay | d58e532de6 | |
Sanjay | c4e0a5be67 | |
Jay | 498473127e | |
teverse | ed5dae7849 | |
teverse | dff83bc1e7 | |
teverse | 4fa5b82d39 | |
teverse | 767017edc5 | |
teverse | 8e8871a074 | |
teverse | 4c9e746bdc | |
teverse | 8d528248ee | |
teverse | 05fc03c2c1 |
|
@ -0,0 +1,22 @@
|
||||||
|
name: Loadstring
|
||||||
|
|
||||||
|
# this could be modified to be more helpful when there's a headless teverse client
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
loadstring:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install LuaJIT
|
||||||
|
run: sudo apt-get install luajit -y
|
||||||
|
- name: Load all Lua files
|
||||||
|
run: |
|
||||||
|
echo ${{env.GITHUB_WORKSPACE}}
|
||||||
|
find ${{env.GITHUB_WORKSPACE}} -type f -name '*.lua' -exec echo "{}" \; -exec luajit -e "local loaded,res = loadfile('{}') if not loaded then print('Fail', res) os.execute('exit 1') end" \;
|
649
api.json
649
api.json
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"os": "OSX",
|
"os": "OSX",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"version": "0.21.0",
|
"version": "0.23.1",
|
||||||
"generatedAt": "24/05/2020 00:46:08",
|
"generatedAt": "19/06/2020 13:05:51",
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
"coroutine": {
|
"coroutine": {
|
||||||
"status": "function",
|
"status": "function",
|
||||||
|
@ -20,10 +20,10 @@
|
||||||
"xpcall": "function",
|
"xpcall": "function",
|
||||||
"_DEVICE_PAD_BOTTOM": 0,
|
"_DEVICE_PAD_BOTTOM": 0,
|
||||||
"ipairs": "function",
|
"ipairs": "function",
|
||||||
"_TEV_BUILD": "0210",
|
"_TEV_BUILD": "0231",
|
||||||
"colour": "cdata",
|
"colour": "cdata",
|
||||||
"print": "function",
|
"print": "function",
|
||||||
"_TEV_VERSION_MINOR": 21,
|
"_TEV_VERSION_MINOR": 23,
|
||||||
"pcall": "function",
|
"pcall": "function",
|
||||||
"gcinfo": "function",
|
"gcinfo": "function",
|
||||||
"loadstring": "function",
|
"loadstring": "function",
|
||||||
|
@ -45,13 +45,13 @@
|
||||||
"insert": "function"
|
"insert": "function"
|
||||||
},
|
},
|
||||||
"error": "function",
|
"error": "function",
|
||||||
"_TEV_VERSION": "0.21.0",
|
"_TEV_VERSION": "0.23.1",
|
||||||
"quaternion": "cdata",
|
"quaternion": "cdata",
|
||||||
"_DEVICE": "Mac",
|
"_DEVICE": "Mac",
|
||||||
"require": "function",
|
"require": "function",
|
||||||
"unpack": "function",
|
"unpack": "function",
|
||||||
"_VERSION": "Lua 5.1",
|
"_VERSION": "Lua 5.1",
|
||||||
"_TEV_VERSION_PATCH": 0,
|
"_TEV_VERSION_PATCH": 1,
|
||||||
"next": "function",
|
"next": "function",
|
||||||
"math": {
|
"math": {
|
||||||
"ceil": "function",
|
"ceil": "function",
|
||||||
|
@ -96,21 +96,24 @@
|
||||||
"vector2": "cdata",
|
"vector2": "cdata",
|
||||||
"select": "function",
|
"select": "function",
|
||||||
"string": {
|
"string": {
|
||||||
"split": "function",
|
|
||||||
"find": "function",
|
"find": "function",
|
||||||
"gsub": "function",
|
"len": "function",
|
||||||
"rep": "function",
|
|
||||||
"format": "function",
|
|
||||||
"lower": "function",
|
|
||||||
"match": "function",
|
"match": "function",
|
||||||
"dump": "function",
|
|
||||||
"gmatch": "function",
|
|
||||||
"upper": "function",
|
"upper": "function",
|
||||||
"sub": "function",
|
"sub": "function",
|
||||||
"char": "function",
|
"char": "function",
|
||||||
"byte": "function",
|
"split": "function",
|
||||||
|
"rep": "function",
|
||||||
|
"lower": "function",
|
||||||
|
"startsWith": "function",
|
||||||
|
"dump": "function",
|
||||||
|
"gmatch": "function",
|
||||||
"reverse": "function",
|
"reverse": "function",
|
||||||
"len": "function"
|
"byte": "function",
|
||||||
|
"lastIndexOf": "function",
|
||||||
|
"format": "function",
|
||||||
|
"gsub": "function",
|
||||||
|
"endsWith": "function"
|
||||||
},
|
},
|
||||||
"type": "function",
|
"type": "function",
|
||||||
"thread": {
|
"thread": {
|
||||||
|
@ -1247,51 +1250,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"guiLine": {
|
|
||||||
"methods": [],
|
|
||||||
"className": "guiLine",
|
|
||||||
"events": [],
|
|
||||||
"constructable": true,
|
|
||||||
"extends": "guiBase",
|
|
||||||
"properties": {
|
|
||||||
"pointA": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "guiCoord",
|
|
||||||
"description": "Position of where the line starts relative to the parent element.",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"lineAlpha": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "number",
|
|
||||||
"description": "An alpha value of 1.0 is completely visible, 0.0 is invisible.",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"pointB": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "guiCoord",
|
|
||||||
"description": "Position of where the line ends relative to the parent element.",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"lineCap": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "enums.lineCap",
|
|
||||||
"description": "Determines how lines are capped",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"lineColour": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "colour",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"lineWidth": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "number",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tween": {
|
"tween": {
|
||||||
"methods": {
|
"methods": {
|
||||||
"begin": {
|
"begin": {
|
||||||
|
@ -1352,6 +1310,104 @@
|
||||||
"constructable": false,
|
"constructable": false,
|
||||||
"properties": []
|
"properties": []
|
||||||
},
|
},
|
||||||
|
"guiLine": {
|
||||||
|
"methods": [],
|
||||||
|
"className": "guiLine",
|
||||||
|
"events": [],
|
||||||
|
"constructable": true,
|
||||||
|
"extends": "guiBase",
|
||||||
|
"properties": {
|
||||||
|
"pointA": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "guiCoord",
|
||||||
|
"description": "Position of where the line starts relative to the parent element.",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"lineAlpha": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "number",
|
||||||
|
"description": "An alpha value of 1.0 is completely visible, 0.0 is invisible.",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"pointB": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "guiCoord",
|
||||||
|
"description": "Position of where the line ends relative to the parent element.",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"lineCap": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "enums.lineCap",
|
||||||
|
"description": "Determines how lines are capped",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"lineColour": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "colour",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"lineWidth": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "number",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"camera": {
|
||||||
|
"methods": {
|
||||||
|
"screenToWorld": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector2",
|
||||||
|
"name": "screenPos"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"vector3",
|
||||||
|
" number"
|
||||||
|
],
|
||||||
|
"description": "Returns a 3d vector"
|
||||||
|
},
|
||||||
|
"worldToScreen": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "wPos"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"vector2",
|
||||||
|
" number"
|
||||||
|
],
|
||||||
|
"description": "Returns a 2d screen space vector and a number representing depth"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"className": "camera",
|
||||||
|
"events": [],
|
||||||
|
"constructable": false,
|
||||||
|
"properties": {
|
||||||
|
"fov": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "number",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"position": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"rotation": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "quaternion",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"guiFrame": {
|
"guiFrame": {
|
||||||
"methods": [],
|
"methods": [],
|
||||||
"className": "guiFrame",
|
"className": "guiFrame",
|
||||||
|
@ -1478,84 +1534,267 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scene": {
|
"block": {
|
||||||
"methods": {
|
"methods": {
|
||||||
"child": {
|
"applyImpulse": {
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "vector3",
|
||||||
"name": "name"
|
"name": "force"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returns": [
|
"returns": [],
|
||||||
"sceneObject"
|
"description": ""
|
||||||
],
|
|
||||||
"description": "Returns nil if not found"
|
|
||||||
},
|
},
|
||||||
"destroyChildren": {
|
"applyTorque": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "force"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"applyForce": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "force"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"applyForceAtPosition": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "force,"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"applyImpulseAtPosition": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "force,"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"applyTorqueImpulse": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "vector3",
|
||||||
|
"name": "force"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"className": "block",
|
||||||
|
"events": [],
|
||||||
|
"constructable": true,
|
||||||
|
"extends": "sceneObject",
|
||||||
|
"properties": {
|
||||||
|
"velocity": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"scale": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"colour": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "colour",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"angularFactor": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"metalness": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "number",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"static": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"mesh": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "string",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"linearFactor": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"angularVelocity": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"roughness": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "number",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"apps": {
|
||||||
|
"methods": {
|
||||||
|
"reset": {
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"returns": [],
|
"returns": [],
|
||||||
"description": "Destroys all children"
|
"description": "Resets the environment"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"className": "scene",
|
"getSource": {
|
||||||
"events": [],
|
"parameters": [],
|
||||||
"constructable": false,
|
"returns": [
|
||||||
"properties": {
|
"string"
|
||||||
"camera": {
|
],
|
||||||
"hasGetter": true,
|
"description": "Returns the source code of the loaded app or nil if no app is loaded."
|
||||||
"type": "Undocumented",
|
|
||||||
"hasSetter": false
|
|
||||||
},
|
},
|
||||||
"children": {
|
"loadRemote": {
|
||||||
"hasGetter": true,
|
"parameters": [],
|
||||||
"type": "table",
|
"returns": [],
|
||||||
"description": "",
|
"description": "Starts uploading the currently loaded UNPACKAGED app"
|
||||||
"hasSetter": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"json": {
|
"loadDashboard": {
|
||||||
"methods": {
|
"parameters": [],
|
||||||
"decode": {
|
"returns": [],
|
||||||
|
"description": "Resets the environment and loads the default Dashboard app"
|
||||||
|
},
|
||||||
|
"upload": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [],
|
||||||
|
"description": "Starts uploading the currently loaded UNPACKAGED app"
|
||||||
|
},
|
||||||
|
"promptApp": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [
|
||||||
|
"boolean"
|
||||||
|
],
|
||||||
|
"description": "Prompts the user to select a .tevapp file"
|
||||||
|
},
|
||||||
|
"reload": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [],
|
||||||
|
"description": "Resets the environment and reloads the loaded app"
|
||||||
|
},
|
||||||
|
"loadString": {
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"name": "json"
|
"name": "lua"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returns": [
|
"returns": [
|
||||||
"table"
|
"boolean"
|
||||||
],
|
],
|
||||||
"description": ""
|
"description": "Resets the environment and loads the Lua string provided as an app."
|
||||||
},
|
},
|
||||||
"encodeWithTypes": {
|
"promptAppDirectory": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [
|
||||||
|
"boolean"
|
||||||
|
],
|
||||||
|
"description": "Prompts the user to select a directory containing the manifest.json file"
|
||||||
|
},
|
||||||
|
"loadWorkshop": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [],
|
||||||
|
"description": "Resets the environment and loads the default Workshop app"
|
||||||
|
},
|
||||||
|
"loadScript": {
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "variant",
|
"type": "string",
|
||||||
"name": "toEncode"
|
"name": "file"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returns": [
|
"returns": [
|
||||||
"string"
|
"boolean"
|
||||||
],
|
],
|
||||||
"description": ""
|
"description": "Resets the environment and loads the Lua file at the provided path as an app."
|
||||||
},
|
},
|
||||||
"encode": {
|
"prompt": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [
|
||||||
|
"boolean"
|
||||||
|
],
|
||||||
|
"description": "Prompts the user to select a Lua file, this method then triggers app:loadScript(path)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"className": "apps",
|
||||||
|
"events": {
|
||||||
|
"changed": {
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "property"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "variant",
|
"type": "variant",
|
||||||
"name": "toEncode"
|
"name": "oldValue"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "variant",
|
||||||
|
"name": "newValue"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"returns": [
|
"description": "Fired when a property is changed."
|
||||||
"string"
|
},
|
||||||
|
"upload": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "success"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "table",
|
||||||
|
"name": "app"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"description": ""
|
"description": "Fired when an upload fails or succeeds"
|
||||||
|
},
|
||||||
|
"download": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "success"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "message"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Fired when an download fails or succeeds"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"className": "json",
|
|
||||||
"events": [],
|
|
||||||
"constructable": false,
|
"constructable": false,
|
||||||
"properties": []
|
"properties": []
|
||||||
},
|
},
|
||||||
|
@ -1805,44 +2044,49 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"block": {
|
"json": {
|
||||||
"methods": [],
|
"methods": {
|
||||||
"className": "block",
|
"decode": {
|
||||||
"events": [],
|
"parameters": [
|
||||||
"constructable": true,
|
{
|
||||||
"extends": "sceneObject",
|
|
||||||
"properties": {
|
|
||||||
"roughness": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "number",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"scale": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "vector3",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"colour": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "colour",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"metalness": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "number",
|
|
||||||
"description": "",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"mesh": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "",
|
"name": "json"
|
||||||
"hasSetter": true
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"table"
|
||||||
|
],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"encodeWithTypes": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "variant",
|
||||||
|
"name": "toEncode"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"encode": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "variant",
|
||||||
|
"name": "toEncode"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"className": "json",
|
||||||
|
"events": [],
|
||||||
|
"constructable": false,
|
||||||
|
"properties": []
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"methods": {
|
"methods": {
|
||||||
|
@ -1898,13 +2142,54 @@
|
||||||
"constructable": false,
|
"constructable": false,
|
||||||
"properties": []
|
"properties": []
|
||||||
},
|
},
|
||||||
"directionalLight": {
|
"scene": {
|
||||||
"methods": [],
|
"methods": {
|
||||||
"className": "directionalLight",
|
"child": {
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "name"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [
|
||||||
|
"sceneObject"
|
||||||
|
],
|
||||||
|
"description": "Returns nil if not found"
|
||||||
|
},
|
||||||
|
"destroyChildren": {
|
||||||
|
"parameters": [],
|
||||||
|
"returns": [],
|
||||||
|
"description": "Destroys all children"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"className": "scene",
|
||||||
"events": [],
|
"events": [],
|
||||||
"constructable": true,
|
"constructable": false,
|
||||||
"extends": "light",
|
"properties": {
|
||||||
"properties": []
|
"simulate": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "bool",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
|
"camera": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "Undocumented",
|
||||||
|
"hasSetter": false
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "table",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": false
|
||||||
|
},
|
||||||
|
"gravity": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "vector3",
|
||||||
|
"description": "",
|
||||||
|
"hasSetter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"methods": {
|
"methods": {
|
||||||
|
@ -1937,78 +2222,20 @@
|
||||||
},
|
},
|
||||||
"localTevGit": {
|
"localTevGit": {
|
||||||
"hasGetter": true,
|
"hasGetter": true,
|
||||||
"type": "boolean",
|
"type": "string",
|
||||||
"description": "True if a local tevgit repo is in use",
|
"description": "Returns path to local tevgit",
|
||||||
"hasSetter": false
|
"hasSetter": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"apps": {
|
"directionalLight": {
|
||||||
"methods": {
|
"methods": [],
|
||||||
"loadDashboard": {
|
"className": "directionalLight",
|
||||||
"parameters": [],
|
|
||||||
"returns": [],
|
|
||||||
"description": "Resets the environment and loads the default Dashboard app"
|
|
||||||
},
|
|
||||||
"reset": {
|
|
||||||
"parameters": [],
|
|
||||||
"returns": [],
|
|
||||||
"description": "Resets the environment"
|
|
||||||
},
|
|
||||||
"reload": {
|
|
||||||
"parameters": [],
|
|
||||||
"returns": [],
|
|
||||||
"description": "Resets the environment and reloads the loaded app"
|
|
||||||
},
|
|
||||||
"loadString": {
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"name": "lua"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returns": [
|
|
||||||
"boolean"
|
|
||||||
],
|
|
||||||
"description": "Resets the environment and loads the Lua string provided as an app."
|
|
||||||
},
|
|
||||||
"getSource": {
|
|
||||||
"parameters": [],
|
|
||||||
"returns": [
|
|
||||||
"string"
|
|
||||||
],
|
|
||||||
"description": "Returns the source code of the loaded app or nil if no app is loaded."
|
|
||||||
},
|
|
||||||
"loadScript": {
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"name": "file"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returns": [
|
|
||||||
"boolean"
|
|
||||||
],
|
|
||||||
"description": "Resets the environment and loads the Lua file at the provided path as an app."
|
|
||||||
},
|
|
||||||
"loadWorkshop": {
|
|
||||||
"parameters": [],
|
|
||||||
"returns": [],
|
|
||||||
"description": "Resets the environment and loads the default Workshop app"
|
|
||||||
},
|
|
||||||
"prompt": {
|
|
||||||
"parameters": [],
|
|
||||||
"returns": [
|
|
||||||
"boolean"
|
|
||||||
],
|
|
||||||
"description": "Prompts the user to select a Lua file, this method then triggers app:loadScript(path)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"className": "apps",
|
|
||||||
"events": [],
|
"events": [],
|
||||||
"constructable": false,
|
"constructable": true,
|
||||||
|
"extends": "light",
|
||||||
"properties": []
|
"properties": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"build": "0210"
|
"build": "0231"
|
||||||
}
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
br0ken lua()
|
|
@ -26,159 +26,80 @@ end)
|
||||||
|
|
||||||
share:on("mouseLeftUp", function()
|
share:on("mouseLeftUp", function()
|
||||||
share.visible = false
|
share.visible = false
|
||||||
|
reload.visible = false
|
||||||
|
|
||||||
local dialog = teverse.construct("guiFrame", {
|
local backdrop = teverse.construct("guiFrame", {
|
||||||
parent = teverse.coreInterface,
|
parent = teverse.coreInterface,
|
||||||
size = guiCoord(0, 300, 0, 200),
|
size = guiCoord(1, 0, 1, 0),
|
||||||
position = guiCoord(0.5, -150, 0.5, -100),
|
position = guiCoord(0, 0, 0, 0),
|
||||||
strokeRadius = 4,
|
backgroundColour = colour(.25, .25, .25),
|
||||||
strokeAlpha = 0.3
|
backgroundAlpha = 0.6,
|
||||||
|
zIndex = 1000
|
||||||
})
|
})
|
||||||
|
|
||||||
local appsContainer = teverse.construct("guiFrame", {
|
local spinner = teverse.construct("guiIcon", {
|
||||||
parent = dialog,
|
parent = backdrop,
|
||||||
size = guiCoord(1.0, -10, 1, -30),
|
size = guiCoord(0, 40, 0, 40),
|
||||||
position = guiCoord(0, 5, 0, 5),
|
position = guiCoord(0.5, -20, 0.5, -20),
|
||||||
backgroundAlpha = 0
|
iconMax = 40,
|
||||||
|
iconColour = colour(1, 1, 1),
|
||||||
|
iconType = "faSolid",
|
||||||
|
iconId = "spinner",
|
||||||
|
iconAlpha = 0.9
|
||||||
})
|
})
|
||||||
|
|
||||||
teverse.guiHelper
|
spawn(function()
|
||||||
.gridConstraint(appsContainer, {
|
while sleep() and spinner.alive do
|
||||||
cellSize = guiCoord(0, 130, 0, 24),
|
spinner.rotation = spinner.rotation + math.rad(1)
|
||||||
cellMargin = guiCoord(0, 10, 0, 15)
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
teverse.apps:upload()
|
||||||
|
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,
|
||||||
})
|
})
|
||||||
|
|
||||||
teverse.http:get("https://teverse.com/api/users/" .. teverse.networking.localClient.id .. "/apps", {
|
local label = teverse.construct("guiTextBox", {
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken
|
parent = container,
|
||||||
}, function(code, body)
|
size = guiCoord(1.0, -20, 1.0, -20),
|
||||||
if code == 200 then
|
position = guiCoord(0, 10, 0, 10),
|
||||||
local apps = teverse.json:decode(body)
|
backgroundAlpha = 0.0,
|
||||||
for _,app in pairs(apps) do
|
|
||||||
local appGui = teverse.construct("guiFrame", {
|
|
||||||
parent = appsContainer,
|
|
||||||
strokeAlpha = 0.1,
|
|
||||||
strokeRadius = 4
|
|
||||||
})
|
|
||||||
|
|
||||||
teverse.guiHelper.hoverColour(appGui, colour.rgb(247, 247, 247))
|
|
||||||
|
|
||||||
teverse.construct("guiTextBox", {
|
|
||||||
parent = appGui,
|
|
||||||
size = guiCoord(1.0, -20, 1, -10),
|
|
||||||
position = guiCoord(0, 10, 0, 5),
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
text = app.name,
|
|
||||||
textSize = 16,
|
|
||||||
textAlign = "middleLeft",
|
|
||||||
textFont = "tevurl:fonts/openSansBold.ttf",
|
|
||||||
active = false
|
|
||||||
})
|
|
||||||
|
|
||||||
appGui:on("mouseLeftUp", function()
|
|
||||||
dialog:destroyChildren()
|
|
||||||
local msg = teverse.construct("guiTextBox", {
|
|
||||||
parent = dialog,
|
|
||||||
size = guiCoord(1.0, -20, 1, -10),
|
|
||||||
position = guiCoord(0, 10, 0, 5),
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
text = "We're updating your app.",
|
|
||||||
textSize = 16,
|
textSize = 16,
|
||||||
|
textWrap = true,
|
||||||
textAlign = "topLeft",
|
textAlign = "topLeft",
|
||||||
textWrap = true
|
textFont = "tevurl:fonts/firaCodeRegular.otf"
|
||||||
})
|
})
|
||||||
|
|
||||||
local code, body = teverse.http:put("https://teverse.com/api/apps/" .. app.id .. "/script",
|
local title = teverse.construct("guiTextBox", {
|
||||||
teverse.json:encode(teverse.apps:getSource()),
|
parent = backdrop,
|
||||||
{
|
size = guiCoord(0, 460, 0, 20),
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken,
|
position = guiCoord(0.5, -230, 0.5, -80),
|
||||||
["Content-Type"] = "application/json"
|
backgroundColour = colour(0.9, 0.9, 0.9),
|
||||||
})
|
|
||||||
|
|
||||||
if code == 200 then
|
|
||||||
msg.text = "Your app was updated! Please note apps may be subject to moderation before becoming public."
|
|
||||||
else
|
|
||||||
msg.text = "Something went wrong: "..code..body
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
local nameBox = teverse.construct("guiTextBox", {
|
|
||||||
parent = dialog,
|
|
||||||
size = guiCoord(1, -105, 0, 20),
|
|
||||||
position = guiCoord(0, 5, 1, -25),
|
|
||||||
textSize = 16,
|
|
||||||
textAlign = "middleLeft",
|
|
||||||
text = "Name",
|
|
||||||
backgroundColour = colour.rgb(240, 240, 240),
|
|
||||||
strokeRadius = 2,
|
|
||||||
textEditable = true
|
|
||||||
})
|
|
||||||
|
|
||||||
nameBox:on("mouseLeftUp", function()
|
|
||||||
nameBox.text = ""
|
|
||||||
end)
|
|
||||||
|
|
||||||
local createNew = teverse.construct("guiTextBox", {
|
|
||||||
parent = dialog,
|
|
||||||
size = guiCoord(0, 100, 0, 20),
|
|
||||||
position = guiCoord(1, -105, 1, -25),
|
|
||||||
backgroundColour = colour.rgb(216, 100, 89),
|
|
||||||
textSize = 18,
|
textSize = 18,
|
||||||
|
dropShadowAlpha = 0.3,
|
||||||
textAlign = "middle",
|
textAlign = "middle",
|
||||||
textFont = "tevurl:fonts/openSansBold.ttf",
|
|
||||||
text = "Create New",
|
|
||||||
textColour = colour(1, 1, 1),
|
|
||||||
strokeRadius = 2,
|
|
||||||
zIndex = 2
|
zIndex = 2
|
||||||
})
|
})
|
||||||
|
|
||||||
createNew:on("mouseLeftUp", function()
|
if success then
|
||||||
local newApp = {
|
title.backgroundColour = colour.rgb(70, 179, 88)
|
||||||
name = nameBox.text
|
title.textColour = colour.white()
|
||||||
}
|
title.text = "Uploaded"
|
||||||
|
label.text = "Your app has been submitted\n\nApp Id: " .. result.id .. "\nApp Name: " .. result.name .. "\nPckg Id: " .. result.packageId .. "\nPckg Version: " .. result.packageVersion
|
||||||
dialog:destroyChildren()
|
|
||||||
|
|
||||||
local msg = teverse.construct("guiTextBox", {
|
|
||||||
parent = dialog,
|
|
||||||
size = guiCoord(1.0, -20, 1, -10),
|
|
||||||
position = guiCoord(0, 10, 0, 5),
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
text = "We're creating your new app.",
|
|
||||||
textSize = 16,
|
|
||||||
textAlign = "topLeft",
|
|
||||||
textWrap = true
|
|
||||||
})
|
|
||||||
|
|
||||||
teverse.http:post("https://teverse.com/api/apps/", teverse.json:encode(newApp), {
|
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken,
|
|
||||||
["Content-Type"] = "application/json"
|
|
||||||
}, function(code, body)
|
|
||||||
if code == 201 then
|
|
||||||
local app = teverse.json:decode(body)
|
|
||||||
msg.text = "Deploying script to your new app (" .. app.id .. ")..."
|
|
||||||
local code, body = teverse.http:put("https://teverse.com/api/apps/" .. app.id .. "/script",
|
|
||||||
teverse.json:encode(teverse.apps:getSource()),
|
|
||||||
{
|
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken,
|
|
||||||
["Content-Type"] = "application/json"
|
|
||||||
})
|
|
||||||
msg.text = "Your new app has been published; please note apps may be subject to moderation before becoming public."
|
|
||||||
else
|
else
|
||||||
msg.text = "Something went wrong (" .. code .. ")"
|
title.backgroundColour = colour.rgb(179, 70, 70)
|
||||||
|
title.textColour = colour.white()
|
||||||
|
title.text = "Something went wrong"
|
||||||
|
label.text = result
|
||||||
end
|
end
|
||||||
end)
|
|
||||||
end)
|
teverse.input:waitFor("mouseLeftUp")
|
||||||
else
|
teverse.apps:reload()
|
||||||
teverse.construct("guiTextBox", {
|
|
||||||
parent = appsContainer,
|
|
||||||
size = guiCoord(1.0, -20, 1, -10),
|
|
||||||
position = guiCoord(0, 10, 0, 5),
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
text = "Something went wrong",
|
|
||||||
textSize = 16,
|
|
||||||
textAlign = "topLeft"
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
|
@ -0,0 +1,69 @@
|
||||||
|
return function(blacklisted, cancel, allow)
|
||||||
|
-- this function is ran when a untrusted .tevapp is about to run
|
||||||
|
-- invoke cancel to return teverse to a safe state
|
||||||
|
-- invoke allow to run the untrusted code
|
||||||
|
|
||||||
|
local backdrop = teverse.construct("guiFrame", {
|
||||||
|
parent = teverse.coreInterface,
|
||||||
|
size = guiCoord(1, 0, 1, 0),
|
||||||
|
position = guiCoord(0, 0, 0, 0),
|
||||||
|
zIndex = 2000,
|
||||||
|
backgroundColour = colour.rgb(181, 83, 76),
|
||||||
|
backgroundAlpha = 0.85
|
||||||
|
})
|
||||||
|
|
||||||
|
local container = teverse.construct("guiFrame", {
|
||||||
|
parent = backdrop,
|
||||||
|
size = guiCoord(0, 280, 0, 100),
|
||||||
|
position = guiCoord(0.5, -140, 0.5, -50),
|
||||||
|
backgroundColour = colour(0.95, 0.95, 0.95),
|
||||||
|
dropShadowAlpha = 0.3,
|
||||||
|
strokeRadius = 3,
|
||||||
|
strokeAlpha = 0.1
|
||||||
|
})
|
||||||
|
|
||||||
|
local label = teverse.construct("guiTextBox", {
|
||||||
|
parent = container,
|
||||||
|
size = guiCoord(1, -20, 1, -50),
|
||||||
|
position = guiCoord(0, 10, 0, 10),
|
||||||
|
backgroundAlpha = 0,
|
||||||
|
textWrap = true,
|
||||||
|
text = "We blocked an app from an unidentified developer, are you sure you'd like to continue?",
|
||||||
|
textAlign = "middle"
|
||||||
|
})
|
||||||
|
|
||||||
|
if not blacklisted then
|
||||||
|
local allowBtn = teverse.construct("guiTextBox", {
|
||||||
|
parent = container,
|
||||||
|
size = guiCoord(0.5, -5, 0, 30),
|
||||||
|
position = guiCoord(0, 0, 1, -30),
|
||||||
|
backgroundAlpha = 0,
|
||||||
|
text = "ALLOW",
|
||||||
|
textFont = "tevurl:fonts/openSansBold.ttf",
|
||||||
|
textAlign = "middle"
|
||||||
|
})
|
||||||
|
|
||||||
|
allowBtn:on("mouseLeftUp", allow)
|
||||||
|
end
|
||||||
|
|
||||||
|
local cancelBtn = teverse.construct("guiTextBox", {
|
||||||
|
parent = container,
|
||||||
|
size = guiCoord(0.5, -5, 0, 30),
|
||||||
|
position = guiCoord(0.5, 5, 1, -30),
|
||||||
|
backgroundColour = colour.rgb(74, 140, 122),
|
||||||
|
textColour = colour.white(),
|
||||||
|
text = "BLOCK",
|
||||||
|
textFont = "tevurl:fonts/openSansBold.ttf",
|
||||||
|
textAlign = "middle"
|
||||||
|
})
|
||||||
|
|
||||||
|
cancelBtn:on("mouseLeftUp", cancel)
|
||||||
|
|
||||||
|
if blacklisted then
|
||||||
|
cancelBtn.position = guiCoord(0, 0, 1, -30)
|
||||||
|
cancelBtn.size = guiCoord(1, 0, 0, 30)
|
||||||
|
cancelBtn.text = "OK"
|
||||||
|
label.text = "This app was blocked; please speak to Teverse for more details."
|
||||||
|
end
|
||||||
|
--allow()
|
||||||
|
end
|
|
@ -121,20 +121,11 @@ return {
|
||||||
|
|
||||||
appGui:on("mouseLeftUp", function()
|
appGui:on("mouseLeftUp", function()
|
||||||
if not loading.visible then
|
if not loading.visible then
|
||||||
loading.text = "Working..."
|
loading.text = "Loading App"
|
||||||
loading.visible = true
|
loading.visible = true
|
||||||
teverse.http:get("https://teverse.com/api/apps/" .. app.id .. "/script", {
|
teverse.apps:loadRemote(app.id)
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken
|
teverse.apps:waitFor("download")
|
||||||
}, function(code, body)
|
|
||||||
if code == 200 then
|
|
||||||
loading.visible = false
|
loading.visible = false
|
||||||
teverse.apps:loadString(body)
|
|
||||||
else
|
|
||||||
loading.text = "Unable to load app."
|
|
||||||
sleep(1.5)
|
|
||||||
loading.visible = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -191,20 +182,11 @@ return {
|
||||||
appGui.parent = appsContainer
|
appGui.parent = appsContainer
|
||||||
appGui:on("mouseLeftUp", function()
|
appGui:on("mouseLeftUp", function()
|
||||||
if not loading.visible then
|
if not loading.visible then
|
||||||
loading.text = "Working..."
|
loading.text = "Loading App"
|
||||||
loading.visible = true
|
loading.visible = true
|
||||||
teverse.http:get("https://teverse.com/api/apps/" .. app.id .. "/script", {
|
teverse.apps:loadRemote(app.id)
|
||||||
["Authorization"] = "BEARER " .. teverse.userToken
|
teverse.apps:waitFor("download")
|
||||||
}, function(code, body)
|
|
||||||
if code == 200 then
|
|
||||||
loading.visible = false
|
loading.visible = false
|
||||||
teverse.apps:loadString(body)
|
|
||||||
else
|
|
||||||
loading.text = "Unable to load app."
|
|
||||||
sleep(1.5)
|
|
||||||
loading.visible = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,10 +13,39 @@ return {
|
||||||
textAlign = "middleLeft"
|
textAlign = "middleLeft"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local btns = {
|
||||||
|
{
|
||||||
|
"Run packaged .tevapp",
|
||||||
|
"archive",
|
||||||
|
function()
|
||||||
|
teverse.apps:promptApp()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Run unpacked app",
|
||||||
|
"code",
|
||||||
|
function ()
|
||||||
|
teverse.apps:promptAppDirectory()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if teverse.dev.localTevGit then
|
||||||
|
table.insert(btns, {
|
||||||
|
"Run workshop (in dev)",
|
||||||
|
"tools",
|
||||||
|
function ( )
|
||||||
|
teverse.apps:loadWorkshop()
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local btnWidth = 1 / #btns
|
||||||
|
for i, cb in pairs(btns) do
|
||||||
local newSandboxBtn = teverse.construct("guiFrame", {
|
local newSandboxBtn = teverse.construct("guiFrame", {
|
||||||
parent = page,
|
parent = page,
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
size = guiCoord(btnWidth, -20, 0, 70),
|
||||||
position = guiCoord(0, 10, 0, 60),
|
position = guiCoord((i-1)*btnWidth, 10, 0, 60),
|
||||||
backgroundColour = colour.rgb(74, 140, 122),
|
backgroundColour = colour.rgb(74, 140, 122),
|
||||||
strokeRadius = 2,
|
strokeRadius = 2,
|
||||||
dropShadowAlpha = 0.15,
|
dropShadowAlpha = 0.15,
|
||||||
|
@ -26,30 +55,24 @@ return {
|
||||||
teverse.guiHelper
|
teverse.guiHelper
|
||||||
.bind(newSandboxBtn, "xs", {
|
.bind(newSandboxBtn, "xs", {
|
||||||
size = guiCoord(1, -20, 0, 70),
|
size = guiCoord(1, -20, 0, 70),
|
||||||
position = guiCoord(0, 10, 0, 60)
|
position = guiCoord(0, 10, 0, 60 + ((i - 1) * 90))
|
||||||
})
|
})
|
||||||
.bind(newSandboxBtn, "sm", {
|
.bind(newSandboxBtn, "md", {
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
size = guiCoord(btnWidth, -20, 0, 70),
|
||||||
position = guiCoord(0, 10, 0, 60)
|
position = guiCoord((i-1)*btnWidth, 10, 0, 60)
|
||||||
})
|
|
||||||
.bind(newSandboxBtn, "lg", {
|
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
|
||||||
position = guiCoord(0, 10, 0, 60)
|
|
||||||
})
|
})
|
||||||
.hoverColour(newSandboxBtn, colour.rgb(235, 187, 83))
|
.hoverColour(newSandboxBtn, colour.rgb(235, 187, 83))
|
||||||
|
|
||||||
newSandboxBtn:on("mouseLeftUp", function()
|
newSandboxBtn:on("mouseLeftUp", cb[3])
|
||||||
teverse.apps:prompt()
|
|
||||||
end)
|
|
||||||
|
|
||||||
teverse.construct("guiTextBox", {
|
teverse.construct("guiTextBox", {
|
||||||
parent = newSandboxBtn,
|
parent = newSandboxBtn,
|
||||||
size = guiCoord(0.5, -10, 0, 18),
|
size = guiCoord(0.75, -20, 0, 18),
|
||||||
position = guiCoord(0.5, 0, 0.5, -9),
|
position = guiCoord(0.25, 10, 0.5, -9),
|
||||||
backgroundAlpha = 0,
|
backgroundAlpha = 0,
|
||||||
text = "Run Script",
|
text = cb[1],
|
||||||
textSize = 18,
|
textSize = 18,
|
||||||
textAlign = "middleLeft",
|
textAlign = "middle",
|
||||||
textColour = colour(1, 1, 1),
|
textColour = colour(1, 1, 1),
|
||||||
active = false
|
active = false
|
||||||
--textFont = "tevurl:fonts/openSansLight.ttf"
|
--textFont = "tevurl:fonts/openSansLight.ttf"
|
||||||
|
@ -58,66 +81,11 @@ return {
|
||||||
teverse.construct("guiIcon", {
|
teverse.construct("guiIcon", {
|
||||||
parent = newSandboxBtn,
|
parent = newSandboxBtn,
|
||||||
size = guiCoord(0, 40, 0, 40),
|
size = guiCoord(0, 40, 0, 40),
|
||||||
position = guiCoord(0.5, -60, 0.5, -20),
|
position = guiCoord(0.25, -20, 0.5, -20),
|
||||||
iconMax = 40,
|
iconMax = 40,
|
||||||
iconColour = colour(1, 1, 1),
|
iconColour = colour(1, 1, 1),
|
||||||
iconType = "faSolid",
|
iconType = "faSolid",
|
||||||
iconId = "code",
|
iconId = cb[2],
|
||||||
iconAlpha = 0.9,
|
|
||||||
active = false
|
|
||||||
})
|
|
||||||
|
|
||||||
if teverse.dev.localTevGit then
|
|
||||||
local workshopBtn = teverse.construct("guiFrame", {
|
|
||||||
parent = page,
|
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
|
||||||
position = guiCoord(1/3, 10, 0, 0),
|
|
||||||
backgroundColour = colour.rgb(74, 140, 122),
|
|
||||||
strokeRadius = 2,
|
|
||||||
dropShadowAlpha = 0.15,
|
|
||||||
strokeAlpha = 0.05
|
|
||||||
})
|
|
||||||
|
|
||||||
teverse.guiHelper
|
|
||||||
.bind(workshopBtn, "xs", {
|
|
||||||
size = guiCoord(1, -20, 0, 70),
|
|
||||||
position = guiCoord(0, 10, 0, 140)
|
|
||||||
})
|
|
||||||
.bind(workshopBtn, "sm", {
|
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
|
||||||
position = guiCoord(1/3, 10, 0, 60)
|
|
||||||
})
|
|
||||||
.bind(workshopBtn, "lg", {
|
|
||||||
size = guiCoord(1/3, -20, 0, 70),
|
|
||||||
position = guiCoord(1/3, 10, 0, 60)
|
|
||||||
})
|
|
||||||
.hoverColour(workshopBtn, colour.rgb(235, 187, 83))
|
|
||||||
|
|
||||||
workshopBtn:on("mouseLeftUp", function()
|
|
||||||
teverse.apps:loadWorkshop()
|
|
||||||
end)
|
|
||||||
|
|
||||||
teverse.construct("guiTextBox", {
|
|
||||||
parent = workshopBtn,
|
|
||||||
size = guiCoord(0.5, -10, 0, 18),
|
|
||||||
position = guiCoord(0.5, 0, 0.5, -9),
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
text = "Workshop",
|
|
||||||
textSize = 18,
|
|
||||||
textAlign = "middleLeft",
|
|
||||||
textColour = colour(1, 1, 1),
|
|
||||||
active = false
|
|
||||||
--textFont = "tevurl:fonts/openSansLight.ttf"
|
|
||||||
})
|
|
||||||
|
|
||||||
teverse.construct("guiIcon", {
|
|
||||||
parent = workshopBtn,
|
|
||||||
size = guiCoord(0, 40, 0, 40),
|
|
||||||
position = guiCoord(0.5, -60, 0.5, -20),
|
|
||||||
iconMax = 40,
|
|
||||||
iconColour = colour(1, 1, 1),
|
|
||||||
iconType = "faSolid",
|
|
||||||
iconId = "tools",
|
|
||||||
iconAlpha = 0.9,
|
iconAlpha = 0.9,
|
||||||
active = false
|
active = false
|
||||||
})
|
})
|
||||||
|
|
|
@ -65,7 +65,7 @@ local function createFlair(parent, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Plus Membership Insignia
|
-- Plus Membership Insignia
|
||||||
if data.postedBy.membership == "plus" then
|
if data.postedBy.membership == 1 then
|
||||||
teverse.construct("guiIcon", {
|
teverse.construct("guiIcon", {
|
||||||
parent = parent:child("username"),
|
parent = parent:child("username"),
|
||||||
size = guiCoord(0, 10, 0, 10),
|
size = guiCoord(0, 10, 0, 10),
|
||||||
|
@ -76,6 +76,9 @@ local function createFlair(parent, data)
|
||||||
})
|
})
|
||||||
addTag(parent, "star", "PLUS", colour.rgb(67, 67, 67))
|
addTag(parent, "star", "PLUS", colour.rgb(67, 67, 67))
|
||||||
flairCount = flairCount + 1
|
flairCount = flairCount + 1
|
||||||
|
|
||||||
|
parent:child("username").textColour = globals.defaultColours.purple
|
||||||
|
parent:child("body").textColour = globals.defaultColours.purple
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Pro Membership Insignia
|
-- Pro Membership Insignia
|
||||||
|
@ -385,9 +388,9 @@ return {
|
||||||
})
|
})
|
||||||
|
|
||||||
local membertype = teverse.networking.localClient.membership
|
local membertype = teverse.networking.localClient.membership
|
||||||
if membership == "plus" then
|
if membertype == "Plus" then
|
||||||
membershipText.text = "Plus"
|
membershipText.text = "Plus"
|
||||||
elseif membership == "pro" then
|
elseif membertype == "Pro" then
|
||||||
membershipText.text = "Pro"
|
membershipText.text = "Pro"
|
||||||
else
|
else
|
||||||
membershipText.text = "Free"
|
membershipText.text = "Free"
|
||||||
|
|
|
@ -149,6 +149,8 @@ controller.setup = function()
|
||||||
table.insert(pages, {container, icon})
|
table.insert(pages, {container, icon})
|
||||||
end
|
end
|
||||||
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
|
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
|
||||||
|
|
||||||
|
if not (_TEV_VERSION_MINOR == 21 and _TEV_VERSION_PATCH == 0) then
|
||||||
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
|
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
|
||||||
|
|
||||||
if _DEVICE:sub(0, 6) ~= "iPhone" then
|
if _DEVICE:sub(0, 6) ~= "iPhone" then
|
||||||
|
@ -159,5 +161,6 @@ controller.setup = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return controller
|
return controller
|
|
@ -14,5 +14,5 @@ vec3 colourAt(vec2 coord){
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_FragColor = vec4(colourAt(v_texcoord0), 1.0);
|
gl_FragColor = vec4(colourAt(v_texcoord0), texture2D(sColour, v_texcoord0).w);
|
||||||
}
|
}
|
|
@ -0,0 +1,102 @@
|
||||||
|
/*
|
||||||
|
Portions of this file are subject to the following licenes
|
||||||
|
|
||||||
|
Copyright (c) 2011 by Armin Ronacher.
|
||||||
|
Some rights reserved.
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
* The names of the contributors may not be used to endorse or
|
||||||
|
promote products derived from this software without specific
|
||||||
|
prior written permission.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$input v_texcoord0, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM
|
||||||
|
|
||||||
|
#include <teverse.sh>
|
||||||
|
SAMPLER2D(sColour, 0);
|
||||||
|
|
||||||
|
#ifndef FXAA_REDUCE_MIN
|
||||||
|
#define FXAA_REDUCE_MIN (1.0/ 64.0)
|
||||||
|
#endif
|
||||||
|
#ifndef FXAA_REDUCE_MUL
|
||||||
|
#define FXAA_REDUCE_MUL (1.0 / 4.0)
|
||||||
|
#endif
|
||||||
|
#ifndef FXAA_SPAN_MAX
|
||||||
|
#define FXAA_SPAN_MAX 4.0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//optimized version for mobile, where dependent
|
||||||
|
//texture reads can be a bottleneck
|
||||||
|
vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,
|
||||||
|
vec2 v_rgbNW, vec2 v_rgbNE,
|
||||||
|
vec2 v_rgbSW, vec2 v_rgbSE,
|
||||||
|
vec2 v_rgbM) {
|
||||||
|
vec4 color;
|
||||||
|
mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);
|
||||||
|
vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
|
||||||
|
vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
|
||||||
|
vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
|
||||||
|
vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
|
||||||
|
vec4 texColor = texture2D(tex, v_rgbM);
|
||||||
|
vec3 rgbM = texColor.xyz;
|
||||||
|
vec3 luma = vec3(0.299, 0.587, 0.114);
|
||||||
|
float lumaNW = dot(rgbNW, luma);
|
||||||
|
float lumaNE = dot(rgbNE, luma);
|
||||||
|
float lumaSW = dot(rgbSW, luma);
|
||||||
|
float lumaSE = dot(rgbSE, luma);
|
||||||
|
float lumaM = dot(rgbM, luma);
|
||||||
|
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||||||
|
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||||||
|
|
||||||
|
mediump vec2 dir;
|
||||||
|
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||||||
|
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||||
|
|
||||||
|
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||||||
|
(0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
|
||||||
|
|
||||||
|
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||||
|
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||||||
|
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||||||
|
dir * rcpDirMin)) * inverseVP;
|
||||||
|
|
||||||
|
vec3 rgbA = 0.5 * (
|
||||||
|
texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
|
||||||
|
texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
|
||||||
|
vec3 rgbB = rgbA * 0.5 + 0.25 * (
|
||||||
|
texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
|
||||||
|
texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
|
||||||
|
|
||||||
|
float lumaB = dot(rgbB, luma);
|
||||||
|
if ((lumaB < lumaMin) || (lumaB > lumaMax))
|
||||||
|
color = vec4(rgbA, texColor.a);
|
||||||
|
else
|
||||||
|
color = vec4(rgbB, texColor.a);
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec2 resolution = u_viewRect.zw;
|
||||||
|
vec2 fragCoord = v_texcoord0 * resolution;
|
||||||
|
gl_FragColor = fxaa(sColour, fragCoord, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
|
||||||
|
vec2 v_rgbNW : TEXCOORD1 = vec2(0.0, 0.0);
|
||||||
|
vec2 v_rgbNE : TEXCOORD2 = vec2(0.0, 0.0);
|
||||||
|
vec2 v_rgbSW : TEXCOORD3 = vec2(0.0, 0.0);
|
||||||
|
vec2 v_rgbSE : TEXCOORD4 = vec2(0.0, 0.0);
|
||||||
|
vec2 v_rgbM : TEXCOORD5 = vec2(0.0, 0.0);
|
||||||
|
|
||||||
|
vec3 a_position : POSITION;
|
||||||
|
vec2 a_texcoord0 : TEXCOORD0;
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
Portions of this file are subject to the following licenes
|
||||||
|
|
||||||
|
Copyright (c) 2011 by Armin Ronacher.
|
||||||
|
Some rights reserved.
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
* The names of the contributors may not be used to endorse or
|
||||||
|
promote products derived from this software without specific
|
||||||
|
prior written permission.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$input a_position, a_texcoord0
|
||||||
|
$output v_texcoord0, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM
|
||||||
|
|
||||||
|
#include <teverse.sh>
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec2 resolution = u_viewRect.zw;
|
||||||
|
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
|
||||||
|
v_texcoord0 = a_texcoord0;
|
||||||
|
|
||||||
|
vec2 fragCoord = v_texcoord0 * resolution;
|
||||||
|
|
||||||
|
vec2 inverseVP = 1.0 / resolution.xy;
|
||||||
|
v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
|
||||||
|
v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
|
||||||
|
v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
|
||||||
|
v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
|
||||||
|
v_rgbM = vec2(fragCoord * inverseVP);
|
||||||
|
}
|
|
@ -88,7 +88,7 @@ void main()
|
||||||
|
|
||||||
vec3 V = normalize(uniformCameraPosition.xyz - wpos);
|
vec3 V = normalize(uniformCameraPosition.xyz - wpos);
|
||||||
|
|
||||||
vec3 F0 = vec3(0.04);
|
vec3 F0 = vec3(0.04, 0.04, 0.04);
|
||||||
F0 = mix(F0, colour, metallic);
|
F0 = mix(F0, colour, metallic);
|
||||||
|
|
||||||
vec3 L = lightDir;
|
vec3 L = lightDir;
|
||||||
|
@ -100,7 +100,7 @@ void main()
|
||||||
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
|
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
|
||||||
|
|
||||||
vec3 kS = F;
|
vec3 kS = F;
|
||||||
vec3 kD = vec3(1.0) - kS;
|
vec3 kD = vec3(1.0, 1.0, 1.0) - kS;
|
||||||
kD *= 1.0 - metallic;
|
kD *= 1.0 - metallic;
|
||||||
|
|
||||||
vec3 numerator = NDF * G * F;
|
vec3 numerator = NDF * G * F;
|
||||||
|
@ -110,5 +110,5 @@ void main()
|
||||||
// add to outgoing radiance Lo
|
// add to outgoing radiance Lo
|
||||||
float NdotL = max(dot(normal.xyz, L), 0.0);
|
float NdotL = max(dot(normal.xyz, L), 0.0);
|
||||||
|
|
||||||
gl_FragColor = vec4(((kD * colour / PI + specular) * lightColour * NdotL), 1.0);
|
gl_FragColor = vec4(((kD * colour / PI + specular) * lightColour * NdotL), colour.w);
|
||||||
}
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <teverse.sh>
|
||||||
|
|
||||||
|
//SAMPLER2D(sDepth, 0);
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
// vec2 coord = u_viewRect.xy/u_viewRect.zw;
|
||||||
|
//gl_FragDepth = 0.0;
|
||||||
|
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
vec3 a_position : POSITION;
|
||||||
|
vec4 a_color0 : COLOR0;
|
|
@ -0,0 +1,8 @@
|
||||||
|
$input a_position
|
||||||
|
|
||||||
|
#include <teverse.sh>
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0));
|
||||||
|
}
|
|
@ -32,6 +32,10 @@ return {
|
||||||
self.defaultPage = nil
|
self.defaultPage = nil
|
||||||
self.currentPage = nil
|
self.currentPage = nil
|
||||||
|
|
||||||
|
self.animate = function(page, pos)
|
||||||
|
teverse.tween:begin(page, 0.5, { position = pos }, "inOutQuad")
|
||||||
|
end
|
||||||
|
|
||||||
local container = teverse.construct("guiFrame", {
|
local container = teverse.construct("guiFrame", {
|
||||||
parent = teverse.interface,
|
parent = teverse.interface,
|
||||||
name = idValue,
|
name = idValue,
|
||||||
|
@ -57,7 +61,7 @@ return {
|
||||||
|
|
||||||
local menuContainer = teverse.construct("guiFrame", {
|
local menuContainer = teverse.construct("guiFrame", {
|
||||||
parent = container,
|
parent = container,
|
||||||
size = guiCoord(0, 140, 0.01, 0),
|
size = guiCoord(0, 140, 2.2, 0),
|
||||||
position = guiCoord(0, 8, 0, 35),
|
position = guiCoord(0, 8, 0, 35),
|
||||||
backgroundColour = globals.defaultColours.primary,
|
backgroundColour = globals.defaultColours.primary,
|
||||||
backgroundAlpha = 0,
|
backgroundAlpha = 0,
|
||||||
|
@ -65,10 +69,6 @@ return {
|
||||||
zIndex = 900
|
zIndex = 900
|
||||||
})
|
})
|
||||||
|
|
||||||
self.animate = function(page, pos)
|
|
||||||
teverse.tween:begin(page, 0.5, { position = pos }, "inOutQuad")
|
|
||||||
end
|
|
||||||
|
|
||||||
local headerIcon = teverse.construct("guiIcon", {
|
local headerIcon = teverse.construct("guiIcon", {
|
||||||
parent = subContainer,
|
parent = subContainer,
|
||||||
size = guiCoord(0, 32, 0, 32),
|
size = guiCoord(0, 32, 0, 32),
|
||||||
|
@ -83,80 +83,12 @@ return {
|
||||||
strokeRadius = 3,
|
strokeRadius = 3,
|
||||||
})
|
})
|
||||||
|
|
||||||
local function buildTabMenu()
|
|
||||||
local itemCount = 0
|
|
||||||
if (#data.pages == 0) then return end
|
|
||||||
for _,v in pairs(data.pages) do
|
|
||||||
for key, value in pairs(v) do
|
|
||||||
|
|
||||||
-- Key = (String) name of label
|
|
||||||
-- Value = (Object(guiFrame)) instance page
|
|
||||||
local _itemContainer = teverse.construct("guiFrame", {
|
|
||||||
parent = menuContainer,
|
|
||||||
size = guiCoord(1, 0, 0.3, 0),
|
|
||||||
position = guiCoord(0, 0, 0, (itemCount*21)+0),
|
|
||||||
backgroundColour = globals.defaultColours.red,
|
|
||||||
backgroundAlpha = 0,
|
|
||||||
zIndex = 200
|
|
||||||
})
|
|
||||||
|
|
||||||
local _itemButton = teverse.construct("guiTextBox", {
|
|
||||||
parent = _itemContainer,
|
|
||||||
size = guiCoord(0.97, 0, 1, 0),
|
|
||||||
position = guiCoord(0.03, 0, 0, 0),
|
|
||||||
text = key,
|
|
||||||
textAlign = "middle",
|
|
||||||
textSize = 20,
|
|
||||||
textFont = "tevurl:fonts/openSansBold.ttf",
|
|
||||||
textColour = globals.defaultColours.white,
|
|
||||||
backgroundColour = globals.defaultColours.primary,
|
|
||||||
backgroundAlpha = 1,
|
|
||||||
zIndex = 200
|
|
||||||
})
|
|
||||||
|
|
||||||
local _itemContainerShader = teverse.construct("guiFrame", {
|
|
||||||
parent = _itemContainer,
|
|
||||||
size = guiCoord(0.03, 0, 1, 0),
|
|
||||||
position = guiCoord(0, 0, 0, 0),
|
|
||||||
backgroundColour = globals.defaultColours.white,
|
|
||||||
backgroundAlpha = 0
|
|
||||||
})
|
|
||||||
|
|
||||||
_itemButton:on("mouseEnter", function()
|
|
||||||
_itemContainerShader.backgroundAlpha = 0.15
|
|
||||||
end)
|
|
||||||
|
|
||||||
_itemButton:on("mouseExit", function()
|
|
||||||
_itemContainerShader.backgroundAlpha = 0
|
|
||||||
end)
|
|
||||||
|
|
||||||
_itemButton:on("mouseLeftUp", function()
|
|
||||||
print("Clicked")
|
|
||||||
--[[data.animate(data.currentPage, guiCoord(-1, 0, 0, 200))
|
|
||||||
sleep(0.5)
|
|
||||||
data.animate(value, guiCoord(1, 0, 0, 200))
|
|
||||||
data.currentPage = page]]--
|
|
||||||
end)
|
|
||||||
|
|
||||||
itemCount = itemCount + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
headerIcon:on("mouseLeftUp", function()
|
headerIcon:on("mouseLeftUp", function()
|
||||||
if (clicked) then
|
if (clicked) then
|
||||||
menuContainer.backgroundAlpha = 1
|
-- idk
|
||||||
menuContainer.strokeAlpha = 0.15
|
else
|
||||||
teverse.tween:begin(menuContainer, 0.5, { size = guiCoord(0, 140, 2.2, 0) }, "inOutQuad", buildTabMenu())
|
-- idk
|
||||||
end
|
end
|
||||||
|
|
||||||
if (not clicked) then
|
|
||||||
teverse.tween:begin(menuContainer, 0.5, { size = guiCoord(0, 140, 0.01, 0) }, "inOutQuad", menuContainer:destroyChildren())
|
|
||||||
sleep(0.5)
|
|
||||||
menuContainer.strokeAlpha = 0
|
|
||||||
menuContainer.backgroundAlpha = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
clicked = (not clicked)
|
clicked = (not clicked)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -174,6 +106,60 @@ return {
|
||||||
strokeRadius = 3
|
strokeRadius = 3
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Test command Bar
|
||||||
|
local commandBarIcon = teverse.construct("guiIcon", {
|
||||||
|
parent = container,
|
||||||
|
size = guiCoord(0, 32, 0, 32),
|
||||||
|
position = guiCoord(0, 160, 0, 4),
|
||||||
|
iconId = "search",
|
||||||
|
iconType = "faSolid",
|
||||||
|
iconColour = globals.defaultColours.primary,
|
||||||
|
backgroundColour = globals.defaultColours.primary,
|
||||||
|
backgroundAlpha = 0.1,
|
||||||
|
iconAlpha = 0.75,
|
||||||
|
iconMax = 16,
|
||||||
|
strokeRadius = 3,
|
||||||
|
})
|
||||||
|
|
||||||
|
local commandBarField = teverse.construct("guiTextBox", {
|
||||||
|
parent = container,
|
||||||
|
size = guiCoord(0, 200, 0, 32),
|
||||||
|
position = guiCoord(0, 191, 0, 4),
|
||||||
|
text = " PlaceHolder",
|
||||||
|
textAlign = "middleLeft",
|
||||||
|
textSize = 15,
|
||||||
|
textColour = globals.defaultColours.primary,
|
||||||
|
backgroundColour = globals.defaultColours.primary,
|
||||||
|
backgroundAlpha = 0.1,
|
||||||
|
strokeRadius = 3,
|
||||||
|
textEditable = true,
|
||||||
|
textMultiline = false,
|
||||||
|
visible = false
|
||||||
|
})
|
||||||
|
|
||||||
|
commandBarIcon:on("mouseLeftDown", function()
|
||||||
|
if (clicked) then
|
||||||
|
commandBarIcon.iconColour = globals.defaultColours.white
|
||||||
|
commandBarIcon.backgroundAlpha = 1
|
||||||
|
commandBarField.visible = true
|
||||||
|
else
|
||||||
|
commandBarIcon.iconColour = globals.defaultColours.primary
|
||||||
|
commandBarIcon.backgroundAlpha = 0.1
|
||||||
|
commandBarField.visible = false
|
||||||
|
end
|
||||||
|
clicked = (not clicked)
|
||||||
|
end)
|
||||||
|
|
||||||
|
commandBarField:on("changed", function(property)
|
||||||
|
--if property == "text" then
|
||||||
|
print("Property: "..property)
|
||||||
|
|
||||||
|
--end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
-- End Test Command Bar
|
||||||
|
|
||||||
self.registerIcon = function(icon, callback)
|
self.registerIcon = function(icon, callback)
|
||||||
local icon = teverse.construct("guiIcon", {
|
local icon = teverse.construct("guiIcon", {
|
||||||
parent = container,
|
parent = container,
|
||||||
|
@ -216,9 +202,6 @@ return {
|
||||||
_count = _count + 1
|
_count = _count + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
--self.defaultPage = nil
|
|
||||||
--self.currentPage = nil
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
}
|
}
|
|
@ -29,13 +29,14 @@ defaultPage.registerIcon("exportFileIcon", "file-export", nil)
|
||||||
--globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default
|
--globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default
|
||||||
--globals.sideBarPageActive = defaultPage -- Set default sidebar page as active
|
--globals.sideBarPageActive = defaultPage -- Set default sidebar page as active
|
||||||
|
|
||||||
--[[
|
|
||||||
local designPage = sideBar.registerPage("Design") -- Register design page to sidebar instance
|
local designPage = sideBar.registerPage("Design") -- Register design page to sidebar instance
|
||||||
designPage.registerIcon("screenContainerIcon", "tv", nil)
|
designPage.registerIcon("screenContainerIcon", "tv", nil)
|
||||||
designPage.registerIcon("guiFrameIcon", "square-full", nil)
|
designPage.registerIcon("guiFrameIcon", "square-full", nil)
|
||||||
designPage.registerIcon("guiTextBoxIcon", "i-cursor", nil)
|
designPage.registerIcon("guiTextBoxIcon", "i-cursor", nil)
|
||||||
designPage.registerIcon("guiImageIcon", "image", nil)
|
designPage.registerIcon("guiImageIcon", "image", nil)
|
||||||
|
|
||||||
|
--[[
|
||||||
local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance
|
local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance
|
||||||
modelPage.registerIcon("modelIcon", "shapes", nil)
|
modelPage.registerIcon("modelIcon", "shapes", nil)
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ testPage.registerIcon("fullScreenIcon", "expand-alt", nil)
|
||||||
|
|
||||||
-- Bind pages to labels in menu
|
-- Bind pages to labels in menu
|
||||||
topBar.bindDefaultMenu(defaultPage.getContainer())
|
topBar.bindDefaultMenu(defaultPage.getContainer())
|
||||||
--topBar.bindMenu("Design", designPage.getContainer())
|
topBar.bindMenu("Design", designPage.getContainer())
|
||||||
--topBar.bindMenu("Model", modelPage.getContainer())
|
--topBar.bindMenu("Model", modelPage.getContainer())
|
||||||
--topBar.bindMenu("Insert", insertPage.getContainer())
|
--topBar.bindMenu("Insert", insertPage.getContainer())
|
||||||
--topBar.bindMenu("Test", testPage.getContainer())
|
--topBar.bindMenu("Test", testPage.getContainer())
|
||||||
|
|
Loading…
Reference in New Issue