Compare commits

..

18 Commits

Author SHA1 Message Date
Sanjay Bhadra 4c54c818f3 Rename searchBar to commandBar 2020-06-22 22:53:32 -04:00
Sanjay Bhadra 80c8f479bd Merge branch 'master' into rewrite-tevx 2020-06-22 22:49:07 -04:00
Sanjay Bhadra f713a64176 Add Search Bar UI to topbar 2020-06-22 22:42:50 -04:00
Jay ef3f0d9178 fixed home screen membership text 2020-06-21 10:36:38 +01:00
teverse 83ce0d18ef Bad FXAA shader 2020-06-19 17:45:10 +01:00
teverse 4e9bfdb964 Shader fix 2020-06-19 14:12:04 +01:00
Jay e8f01cc121 0.23.1 2020-06-19 13:10:37 +01:00
Jay d58e532de6 0.23.1 api dump 2020-06-19 13:07:07 +01:00
Sanjay c4e0a5be67
TevX - Workshop Revamp (#76)
* Refactor .parent change in teverse.construct

* Redesign to fit dashboard screen
2020-06-15 18:05:57 +01:00
Jay 498473127e 0.22.0 2020-06-05 17:31:06 +01:00
teverse ed5dae7849
Create bad-test.lua 2020-05-28 00:47:24 +01:00
teverse dff83bc1e7
Update lua.yml 2020-05-28 00:43:40 +01:00
teverse 4fa5b82d39
Update lua.yml 2020-05-28 00:40:05 +01:00
teverse 767017edc5
Update lua.yml 2020-05-28 00:34:51 +01:00
teverse 8e8871a074
Update lua.yml 2020-05-28 00:30:31 +01:00
teverse 4c9e746bdc
Update lua.yml 2020-05-28 00:29:26 +01:00
teverse 8d528248ee
Update lua.yml 2020-05-28 00:15:55 +01:00
teverse 05fc03c2c1
Create lua.yml 2020-05-28 00:09:04 +01:00
19 changed files with 919 additions and 555 deletions

22
.github/workflows/lua.yml vendored Normal file
View File

@ -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" \;

647
api.json
View File

@ -1,8 +1,8 @@
{
"os": "OSX",
"arch": "x64",
"version": "0.21.0",
"generatedAt": "24/05/2020 00:46:08",
"version": "0.23.1",
"generatedAt": "19/06/2020 13:05:51",
"sandbox": {
"coroutine": {
"status": "function",
@ -20,10 +20,10 @@
"xpcall": "function",
"_DEVICE_PAD_BOTTOM": 0,
"ipairs": "function",
"_TEV_BUILD": "0210",
"_TEV_BUILD": "0231",
"colour": "cdata",
"print": "function",
"_TEV_VERSION_MINOR": 21,
"_TEV_VERSION_MINOR": 23,
"pcall": "function",
"gcinfo": "function",
"loadstring": "function",
@ -45,13 +45,13 @@
"insert": "function"
},
"error": "function",
"_TEV_VERSION": "0.21.0",
"_TEV_VERSION": "0.23.1",
"quaternion": "cdata",
"_DEVICE": "Mac",
"require": "function",
"unpack": "function",
"_VERSION": "Lua 5.1",
"_TEV_VERSION_PATCH": 0,
"_TEV_VERSION_PATCH": 1,
"next": "function",
"math": {
"ceil": "function",
@ -96,21 +96,24 @@
"vector2": "cdata",
"select": "function",
"string": {
"split": "function",
"find": "function",
"gsub": "function",
"rep": "function",
"format": "function",
"lower": "function",
"len": "function",
"match": "function",
"dump": "function",
"gmatch": "function",
"upper": "function",
"sub": "function",
"char": "function",
"byte": "function",
"split": "function",
"rep": "function",
"lower": "function",
"startsWith": "function",
"dump": "function",
"gmatch": "function",
"reverse": "function",
"len": "function"
"byte": "function",
"lastIndexOf": "function",
"format": "function",
"gsub": "function",
"endsWith": "function"
},
"type": "function",
"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": {
"methods": {
"begin": {
@ -1352,6 +1310,104 @@
"constructable": false,
"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": {
"methods": [],
"className": "guiFrame",
@ -1478,84 +1534,267 @@
}
}
},
"scene": {
"block": {
"methods": {
"child": {
"applyImpulse": {
"parameters": [
{
"type": "string",
"name": "name"
"type": "vector3",
"name": "force"
}
],
"returns": [
"sceneObject"
],
"description": "Returns nil if not found"
},
"destroyChildren": {
"parameters": [],
"returns": [],
"description": "Destroys all children"
"description": ""
},
"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": "scene",
"className": "block",
"events": [],
"constructable": false,
"constructable": true,
"extends": "sceneObject",
"properties": {
"camera": {
"velocity": {
"hasGetter": true,
"type": "Undocumented",
"hasSetter": false
},
"children": {
"hasGetter": true,
"type": "table",
"type": "vector3",
"description": "",
"hasSetter": false
"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
}
}
},
"json": {
"apps": {
"methods": {
"decode": {
"reset": {
"parameters": [],
"returns": [],
"description": "Resets the environment"
},
"getSource": {
"parameters": [],
"returns": [
"string"
],
"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"
},
"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": [
{
"type": "string",
"name": "json"
"name": "lua"
}
],
"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": [
{
"type": "variant",
"name": "toEncode"
"type": "string",
"name": "file"
}
],
"returns": [
"string"
"boolean"
],
"description": ""
"description": "Resets the environment and loads the Lua file at the provided path as an app."
},
"encode": {
"parameters": [
{
"type": "variant",
"name": "toEncode"
}
],
"prompt": {
"parameters": [],
"returns": [
"string"
"boolean"
],
"description": ""
"description": "Prompts the user to select a Lua file, this method then triggers app:loadScript(path)"
}
},
"className": "apps",
"events": {
"changed": {
"parameters": [
{
"type": "string",
"name": "property"
},
{
"type": "variant",
"name": "oldValue"
},
{
"type": "variant",
"name": "newValue"
}
],
"description": "Fired when a property is changed."
},
"upload": {
"parameters": [
{
"type": "boolean",
"name": "success"
},
{
"type": "table",
"name": "app"
}
],
"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,
"properties": []
},
@ -1805,44 +2044,49 @@
}
}
},
"block": {
"methods": [],
"className": "block",
"events": [],
"constructable": true,
"extends": "sceneObject",
"properties": {
"roughness": {
"hasGetter": true,
"type": "number",
"description": "",
"hasSetter": true
"json": {
"methods": {
"decode": {
"parameters": [
{
"type": "string",
"name": "json"
}
],
"returns": [
"table"
],
"description": ""
},
"scale": {
"hasGetter": true,
"type": "vector3",
"description": "",
"hasSetter": true
"encodeWithTypes": {
"parameters": [
{
"type": "variant",
"name": "toEncode"
}
],
"returns": [
"string"
],
"description": ""
},
"colour": {
"hasGetter": true,
"type": "colour",
"description": "",
"hasSetter": true
},
"metalness": {
"hasGetter": true,
"type": "number",
"description": "",
"hasSetter": true
},
"mesh": {
"hasGetter": true,
"type": "string",
"description": "",
"hasSetter": true
"encode": {
"parameters": [
{
"type": "variant",
"name": "toEncode"
}
],
"returns": [
"string"
],
"description": ""
}
}
},
"className": "json",
"events": [],
"constructable": false,
"properties": []
},
"debug": {
"methods": {
@ -1898,13 +2142,54 @@
"constructable": false,
"properties": []
},
"directionalLight": {
"methods": [],
"className": "directionalLight",
"scene": {
"methods": {
"child": {
"parameters": [
{
"type": "string",
"name": "name"
}
],
"returns": [
"sceneObject"
],
"description": "Returns nil if not found"
},
"destroyChildren": {
"parameters": [],
"returns": [],
"description": "Destroys all children"
}
},
"className": "scene",
"events": [],
"constructable": true,
"extends": "light",
"properties": []
"constructable": false,
"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": {
"methods": {
@ -1937,78 +2222,20 @@
},
"localTevGit": {
"hasGetter": true,
"type": "boolean",
"description": "True if a local tevgit repo is in use",
"type": "string",
"description": "Returns path to local tevgit",
"hasSetter": false
}
}
},
"apps": {
"methods": {
"loadDashboard": {
"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",
"directionalLight": {
"methods": [],
"className": "directionalLight",
"events": [],
"constructable": false,
"constructable": true,
"extends": "light",
"properties": []
}
},
"build": "0210"
"build": "0231"
}

1
bad-test.lua Normal file
View File

@ -0,0 +1 @@
br0ken lua()

View File

@ -26,159 +26,80 @@ end)
share:on("mouseLeftUp", function()
share.visible = false
reload.visible = false
local dialog = teverse.construct("guiFrame", {
local backdrop = teverse.construct("guiFrame", {
parent = teverse.coreInterface,
size = guiCoord(0, 300, 0, 200),
position = guiCoord(0.5, -150, 0.5, -100),
strokeRadius = 4,
strokeAlpha = 0.3
size = guiCoord(1, 0, 1, 0),
position = guiCoord(0, 0, 0, 0),
backgroundColour = colour(.25, .25, .25),
backgroundAlpha = 0.6,
zIndex = 1000
})
local appsContainer = teverse.construct("guiFrame", {
parent = dialog,
size = guiCoord(1.0, -10, 1, -30),
position = guiCoord(0, 5, 0, 5),
backgroundAlpha = 0
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
})
teverse.guiHelper
.gridConstraint(appsContainer, {
cellSize = guiCoord(0, 130, 0, 24),
cellMargin = guiCoord(0, 10, 0, 15)
})
teverse.http:get("https://teverse.com/api/users/" .. teverse.networking.localClient.id .. "/apps", {
["Authorization"] = "BEARER " .. teverse.userToken
}, function(code, body)
if code == 200 then
local apps = teverse.json:decode(body)
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,
textAlign = "topLeft",
textWrap = true
})
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"
})
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,
textAlign = "middle",
textFont = "tevurl:fonts/openSansBold.ttf",
text = "Create New",
textColour = colour(1, 1, 1),
strokeRadius = 2,
zIndex = 2
})
createNew:on("mouseLeftUp", function()
local newApp = {
name = nameBox.text
}
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
msg.text = "Something went wrong (" .. code .. ")"
end
end)
end)
else
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"
})
spawn(function()
while sleep() and spinner.alive do
spinner.rotation = spinner.rotation + math.rad(1)
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,
})
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
title.backgroundColour = colour.rgb(70, 179, 88)
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
else
title.backgroundColour = colour.rgb(179, 70, 70)
title.textColour = colour.white()
title.text = "Something went wrong"
label.text = result
end
teverse.input:waitFor("mouseLeftUp")
teverse.apps:reload()
end)

View File

@ -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

View File

@ -121,20 +121,11 @@ return {
appGui:on("mouseLeftUp", function()
if not loading.visible then
loading.text = "Working..."
loading.text = "Loading App"
loading.visible = true
teverse.http:get("https://teverse.com/api/apps/" .. app.id .. "/script", {
["Authorization"] = "BEARER " .. teverse.userToken
}, function(code, body)
if code == 200 then
loading.visible = false
teverse.apps:loadString(body)
else
loading.text = "Unable to load app."
sleep(1.5)
loading.visible = false
end
end)
teverse.apps:loadRemote(app.id)
teverse.apps:waitFor("download")
loading.visible = false
end
end)
end
@ -191,20 +182,11 @@ return {
appGui.parent = appsContainer
appGui:on("mouseLeftUp", function()
if not loading.visible then
loading.text = "Working..."
loading.text = "Loading App"
loading.visible = true
teverse.http:get("https://teverse.com/api/apps/" .. app.id .. "/script", {
["Authorization"] = "BEARER " .. teverse.userToken
}, function(code, body)
if code == 200 then
loading.visible = false
teverse.apps:loadString(body)
else
loading.text = "Unable to load app."
sleep(1.5)
loading.visible = false
end
end)
teverse.apps:loadRemote(app.id)
teverse.apps:waitFor("download")
loading.visible = false
end
end)
end

View File

@ -13,65 +13,39 @@ return {
textAlign = "middleLeft"
})
local newSandboxBtn = teverse.construct("guiFrame", {
parent = page,
size = guiCoord(1/3, -20, 0, 70),
position = guiCoord(0, 10, 0, 60),
backgroundColour = colour.rgb(74, 140, 122),
strokeRadius = 2,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05
})
teverse.guiHelper
.bind(newSandboxBtn, "xs", {
size = guiCoord(1, -20, 0, 70),
position = guiCoord(0, 10, 0, 60)
})
.bind(newSandboxBtn, "sm", {
size = guiCoord(1/3, -20, 0, 70),
position = guiCoord(0, 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))
newSandboxBtn:on("mouseLeftUp", function()
teverse.apps:prompt()
end)
teverse.construct("guiTextBox", {
parent = newSandboxBtn,
size = guiCoord(0.5, -10, 0, 18),
position = guiCoord(0.5, 0, 0.5, -9),
backgroundAlpha = 0,
text = "Run Script",
textSize = 18,
textAlign = "middleLeft",
textColour = colour(1, 1, 1),
active = false
--textFont = "tevurl:fonts/openSansLight.ttf"
})
teverse.construct("guiIcon", {
parent = newSandboxBtn,
size = guiCoord(0, 40, 0, 40),
position = guiCoord(0.5, -60, 0.5, -20),
iconMax = 40,
iconColour = colour(1, 1, 1),
iconType = "faSolid",
iconId = "code",
iconAlpha = 0.9,
active = false
})
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
local workshopBtn = teverse.construct("guiFrame", {
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", {
parent = page,
size = guiCoord(1/3, -20, 0, 70),
position = guiCoord(1/3, 10, 0, 0),
size = guiCoord(btnWidth, -20, 0, 70),
position = guiCoord((i-1)*btnWidth, 10, 0, 60),
backgroundColour = colour.rgb(74, 140, 122),
strokeRadius = 2,
dropShadowAlpha = 0.15,
@ -79,45 +53,39 @@ return {
})
teverse.guiHelper
.bind(workshopBtn, "xs", {
.bind(newSandboxBtn, "xs", {
size = guiCoord(1, -20, 0, 70),
position = guiCoord(0, 10, 0, 140)
position = guiCoord(0, 10, 0, 60 + ((i - 1) * 90))
})
.bind(workshopBtn, "sm", {
size = guiCoord(1/3, -20, 0, 70),
position = guiCoord(1/3, 10, 0, 60)
.bind(newSandboxBtn, "md", {
size = guiCoord(btnWidth, -20, 0, 70),
position = guiCoord((i-1)*btnWidth, 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))
.hoverColour(newSandboxBtn, colour.rgb(235, 187, 83))
workshopBtn:on("mouseLeftUp", function()
teverse.apps:loadWorkshop()
end)
newSandboxBtn:on("mouseLeftUp", cb[3])
teverse.construct("guiTextBox", {
parent = workshopBtn,
size = guiCoord(0.5, -10, 0, 18),
position = guiCoord(0.5, 0, 0.5, -9),
parent = newSandboxBtn,
size = guiCoord(0.75, -20, 0, 18),
position = guiCoord(0.25, 10, 0.5, -9),
backgroundAlpha = 0,
text = "Workshop",
text = cb[1],
textSize = 18,
textAlign = "middleLeft",
textAlign = "middle",
textColour = colour(1, 1, 1),
active = false
--textFont = "tevurl:fonts/openSansLight.ttf"
})
teverse.construct("guiIcon", {
parent = workshopBtn,
parent = newSandboxBtn,
size = guiCoord(0, 40, 0, 40),
position = guiCoord(0.5, -60, 0.5, -20),
position = guiCoord(0.25, -20, 0.5, -20),
iconMax = 40,
iconColour = colour(1, 1, 1),
iconType = "faSolid",
iconId = "tools",
iconId = cb[2],
iconAlpha = 0.9,
active = false
})

View File

@ -65,7 +65,7 @@ local function createFlair(parent, data)
end
-- Plus Membership Insignia
if data.postedBy.membership == "plus" then
if data.postedBy.membership == 1 then
teverse.construct("guiIcon", {
parent = parent:child("username"),
size = guiCoord(0, 10, 0, 10),
@ -76,6 +76,9 @@ local function createFlair(parent, data)
})
addTag(parent, "star", "PLUS", colour.rgb(67, 67, 67))
flairCount = flairCount + 1
parent:child("username").textColour = globals.defaultColours.purple
parent:child("body").textColour = globals.defaultColours.purple
end
-- Pro Membership Insignia
@ -385,9 +388,9 @@ return {
})
local membertype = teverse.networking.localClient.membership
if membership == "plus" then
if membertype == "Plus" then
membershipText.text = "Plus"
elseif membership == "pro" then
elseif membertype == "Pro" then
membershipText.text = "Pro"
else
membershipText.text = "Free"

View File

@ -149,13 +149,16 @@ controller.setup = function()
table.insert(pages, {container, icon})
end
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
if _DEVICE:sub(0, 6) ~= "iPhone" then
if _DEVICE:sub(0, 4) == "iPad" then
--setupPage(require("tevgit:core/dashboard/pages/developTablet.lua"))
else
setupPage(require("tevgit:core/dashboard/pages/developDesktop.lua"))
if not (_TEV_VERSION_MINOR == 21 and _TEV_VERSION_PATCH == 0) then
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
if _DEVICE:sub(0, 6) ~= "iPhone" then
if _DEVICE:sub(0, 4) == "iPad" then
--setupPage(require("tevgit:core/dashboard/pages/developTablet.lua"))
else
setupPage(require("tevgit:core/dashboard/pages/developDesktop.lua"))
end
end
end
end

View File

@ -14,5 +14,5 @@ vec3 colourAt(vec2 coord){
void main()
{
gl_FragColor = vec4(colourAt(v_texcoord0), 1.0);
gl_FragColor = vec4(colourAt(v_texcoord0), texture2D(sColour, v_texcoord0).w);
}

102
shaders/fxaa/fragment.sc Normal file
View File

@ -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);
}

View File

@ -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;

51
shaders/fxaa/vertex.sc Normal file
View File

@ -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);
}

View File

@ -88,7 +88,7 @@ void main()
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);
vec3 L = lightDir;
@ -100,7 +100,7 @@ void main()
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 kS = F;
vec3 kD = vec3(1.0) - kS;
vec3 kD = vec3(1.0, 1.0, 1.0) - kS;
kD *= 1.0 - metallic;
vec3 numerator = NDF * G * F;
@ -110,5 +110,5 @@ void main()
// add to outgoing radiance Lo
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);
}

View File

@ -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);
}

View File

@ -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;

8
shaders/skybox/vertex.sc Normal file
View File

@ -0,0 +1,8 @@
$input a_position
#include <teverse.sh>
void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0));
}

View File

@ -32,6 +32,10 @@ return {
self.defaultPage = nil
self.currentPage = nil
self.animate = function(page, pos)
teverse.tween:begin(page, 0.5, { position = pos }, "inOutQuad")
end
local container = teverse.construct("guiFrame", {
parent = teverse.interface,
name = idValue,
@ -57,7 +61,7 @@ return {
local menuContainer = teverse.construct("guiFrame", {
parent = container,
size = guiCoord(0, 140, 0.01, 0),
size = guiCoord(0, 140, 2.2, 0),
position = guiCoord(0, 8, 0, 35),
backgroundColour = globals.defaultColours.primary,
backgroundAlpha = 0,
@ -65,10 +69,6 @@ return {
zIndex = 900
})
self.animate = function(page, pos)
teverse.tween:begin(page, 0.5, { position = pos }, "inOutQuad")
end
local headerIcon = teverse.construct("guiIcon", {
parent = subContainer,
size = guiCoord(0, 32, 0, 32),
@ -83,80 +83,12 @@ return {
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()
if (clicked) then
menuContainer.backgroundAlpha = 1
menuContainer.strokeAlpha = 0.15
teverse.tween:begin(menuContainer, 0.5, { size = guiCoord(0, 140, 2.2, 0) }, "inOutQuad", buildTabMenu())
-- idk
else
-- idk
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)
end)
@ -174,6 +106,60 @@ return {
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)
local icon = teverse.construct("guiIcon", {
parent = container,
@ -216,9 +202,6 @@ return {
_count = _count + 1
end
--self.defaultPage = nil
--self.currentPage = nil
return data
end
}

View File

@ -29,13 +29,14 @@ defaultPage.registerIcon("exportFileIcon", "file-export", nil)
--globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default
--globals.sideBarPageActive = defaultPage -- Set default sidebar page as active
--[[
local designPage = sideBar.registerPage("Design") -- Register design page to sidebar instance
designPage.registerIcon("screenContainerIcon", "tv", nil)
designPage.registerIcon("guiFrameIcon", "square-full", nil)
designPage.registerIcon("guiTextBoxIcon", "i-cursor", nil)
designPage.registerIcon("guiImageIcon", "image", nil)
--[[
local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance
modelPage.registerIcon("modelIcon", "shapes", nil)
@ -54,7 +55,7 @@ testPage.registerIcon("fullScreenIcon", "expand-alt", nil)
-- Bind pages to labels in menu
topBar.bindDefaultMenu(defaultPage.getContainer())
--topBar.bindMenu("Design", designPage.getContainer())
topBar.bindMenu("Design", designPage.getContainer())
--topBar.bindMenu("Model", modelPage.getContainer())
--topBar.bindMenu("Insert", insertPage.getContainer())
--topBar.bindMenu("Test", testPage.getContainer())