Compare commits

..

No commits in common. "9f5ad0ee7fc911a1b9039ae442f789a998abe963" and "fa2a04db52edbd15276c0080cf6e44b6063800e8" have entirely different histories.

8 changed files with 100 additions and 272 deletions

114
api.json
View File

@ -1,17 +1,17 @@
{ {
"os": "OSX", "os": "OSX",
"arch": "x64", "arch": "x64",
"version": "0.20.9", "version": "0.20.8",
"generatedAt": "08/05/2020 20:22:50", "generatedAt": "07/05/2020 21:23:22",
"sandbox": { "sandbox": {
"coroutine": { "coroutine": {
"status": "function", "create": "function",
"yield": "function",
"resume": "function", "resume": "function",
"running": "function",
"wrap": "function", "wrap": "function",
"isyieldable": "function", "isyieldable": "function",
"create": "function", "running": "function",
"yield": "function" "status": "function"
}, },
"assert": "function", "assert": "function",
"tostring": "function", "tostring": "function",
@ -20,36 +20,33 @@
"xpcall": "function", "xpcall": "function",
"_DEVICE_PAD_BOTTOM": 0, "_DEVICE_PAD_BOTTOM": 0,
"ipairs": "function", "ipairs": "function",
"_TEV_BUILD": "0209", "_TEV_BUILD": "0208",
"colour": "cdata", "colour": "cdata",
"print": "function", "print": "function",
"_TEV_VERSION_MINOR": 20,
"pcall": "function", "pcall": "function",
"gcinfo": "function", "gcinfo": "function",
"loadstring": "function", "loadstring": "function",
"_TEV_VERSION_MAJOR": 0,
"sleep": "function", "sleep": "function",
"spawn": "function", "spawn": "function",
"_OS": "OSX", "vector2": "cdata",
"guiCoord": "function", "guiCoord": "function",
"pairs": "function", "pairs": "function",
"table": { "table": {
"maxn": "function", "maxn": "function",
"foreach": "function", "foreach": "function",
"sort": "function", "move": "function",
"remove": "function", "remove": "function",
"foreachi": "function", "foreachi": "function",
"move": "function", "sort": "function",
"getn": "function", "getn": "function",
"concat": "function", "concat": "function",
"insert": "function" "insert": "function"
}, },
"error": "function", "error": "function",
"_TEV_VERSION": "0.20.9", "_TEV_VERSION": "0.20.8",
"_DEVICE": "Mac", "_DEVICE": "Mac",
"require": "function",
"_VERSION": "Lua 5.1", "_VERSION": "Lua 5.1",
"_TEV_VERSION_PATCH": 9, "require": "function",
"next": "function", "next": "function",
"math": { "math": {
"ceil": "function", "ceil": "function",
@ -58,32 +55,32 @@
"huge": 0, "huge": 0,
"cos": "function", "cos": "function",
"sinh": "function", "sinh": "function",
"pi": 3.1415926535898, "asin": "function",
"max": "function", "cosh": "function",
"random": "function", "modf": "function",
"randomseed": "function",
"tanh": "function", "tanh": "function",
"pow": "function",
"ldexp": "function", "ldexp": "function",
"floor": "function", "floor": "function",
"sqrt": "function", "sqrt": "function",
"deg": "function", "deg": "function",
"atan": "function", "atan": "function",
"abs": "function", "log": "function",
"acos": "function", "acos": "function",
"fmod": "function",
"cosh": "function",
"min": "function",
"sin": "function",
"frexp": "function", "frexp": "function",
"atan2": "function", "atan2": "function",
"log": "function", "min": "function",
"sin": "function",
"fmod": "function",
"abs": "function",
"pow": "function",
"exp": "function", "exp": "function",
"modf": "function", "random": "function",
"asin": "function", "max": "function",
"randomseed": "function", "pi": 3.1415926535898,
"rad": "function" "rad": "function"
}, },
"unpack": "function", "_OS": "OSX",
"os": { "os": {
"difftime": "function", "difftime": "function",
"date": "function", "date": "function",
@ -91,26 +88,26 @@
"clock": "function", "clock": "function",
"parseISO8601": "function" "parseISO8601": "function"
}, },
"vector2": "cdata", "type": "function",
"select": "function", "select": "function",
"string": { "string": {
"split": "function", "split": "function",
"find": "function", "find": "function",
"gsub": "function", "sub": "function",
"rep": "function", "rep": "function",
"format": "function",
"lower": "function", "lower": "function",
"match": "function", "len": "function",
"upper": "function",
"dump": "function", "dump": "function",
"gmatch": "function", "gmatch": "function",
"upper": "function",
"sub": "function",
"char": "function",
"byte": "function",
"reverse": "function", "reverse": "function",
"len": "function" "byte": "function",
"char": "function",
"match": "function",
"format": "function",
"gsub": "function"
}, },
"type": "function", "unpack": "function",
"thread": { "thread": {
"create": "function" "create": "function"
}, },
@ -805,10 +802,10 @@
"description": "Increasing the zIndex will render this element above others. Currently a signed 16 bit integer.", "description": "Increasing the zIndex will render this element above others. Currently a signed 16 bit integer.",
"hasSetter": true "hasSetter": true
}, },
"active": { "rotation": {
"hasGetter": true, "hasGetter": true,
"type": "boolean", "type": "number",
"description": "When true, this element can capture the mouse's hover", "description": "",
"hasSetter": true "hasSetter": true
}, },
"visible": { "visible": {
@ -835,10 +832,10 @@
"description": "Parent of a guiBase must be another gui element", "description": "Parent of a guiBase must be another gui element",
"hasSetter": true "hasSetter": true
}, },
"rotation": { "active": {
"hasGetter": true, "hasGetter": true,
"type": "number", "type": "boolean",
"description": "", "description": "When true, this element can capture the mouse's hover",
"hasSetter": true "hasSetter": true
} }
} }
@ -1009,18 +1006,18 @@
"description": "", "description": "",
"hasSetter": true "hasSetter": true
}, },
"canvasOffset": {
"hasGetter": true,
"type": "vector2",
"description": "",
"hasSetter": true
},
"canvasSize": { "canvasSize": {
"hasGetter": true, "hasGetter": true,
"type": "guiCoord", "type": "guiCoord",
"description": "If bigger than 1,0,1,0, scrollvars will be visible", "description": "If bigger than 1,0,1,0, scrollvars will be visible",
"hasSetter": true "hasSetter": true
}, },
"canvasOffset": {
"hasGetter": true,
"type": "vector2",
"description": "",
"hasSetter": true
},
"scrollbarAlpha": { "scrollbarAlpha": {
"hasGetter": true, "hasGetter": true,
"type": "number", "type": "number",
@ -1680,22 +1677,13 @@
"methods": { "methods": {
"traceback": { "traceback": {
"parameters": [], "parameters": [],
"returns": [ "returns": [],
"string" "description": "Undocumented"
],
"description": "Returns a string with a traceback of the stack call."
}, },
"schedulerUi": { "schedulerUi": {
"parameters": [], "parameters": [],
"returns": [], "returns": [],
"description": "Undocumented" "description": "Undocumented"
},
"getOutputHistory": {
"parameters": [],
"returns": [
"table"
],
"description": "Returns a table of dictionaries: {time, message}"
} }
}, },
"className": "debug", "className": "debug",
@ -1883,5 +1871,5 @@
"properties": [] "properties": []
} }
}, },
"build": "0209" "build": "0208"
} }

View File

@ -2,96 +2,74 @@
-- Used to display the home screen of the teverse application -- Used to display the home screen of the teverse application
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
local modal = require("tevgit:workshop/library/ui/components/modal.lua") -- UI component
local count = 0
local function addTag(parent, icon, name, iconColour)
local frame = teverse.construct("guiFrame", {
parent = parent:child("_container"):child("_content"),
size = guiCoord(0.3, 0, 0.25, 0),
position = guiCoord(0, (count*43)+5, 0, 40),
backgroundColour = globals.defaultColours.white,
strokeRadius = 2,
dropShadowAlpha = 0.4,
dropShadowBlur = 2,
dropShadowColour = colour.rgb(127, 127, 127),
dropShadowOffset = vector2(0.5 , 1),
zIndex = 500
})
teverse.construct("guiIcon", {
parent = frame,
size = guiCoord(0, 10, 0, 10),
position = guiCoord(0.05, 0, 0.21, 0),
iconType = "faSolid",
iconId = icon,
iconColour = iconColour
})
teverse.construct("guiTextBox", {
parent = frame,
size = guiCoord(0.6, 0, 0.6, 0),
position = guiCoord(0.3, 0, 0.23, 0),
text = name,
textEditable = false,
textAlign = "middle",
textColour = globals.defaultColours.primary,
textSize = 12,
textWrap = false,
textFont = "tevurl:fonts/openSansBold.ttf",
zIndex = 100
})
count = count + 1
end
local function createFlair(parent, data) local function createFlair(parent, data)
local username = parent:child("username").text local username = parent:child("username")
if data then if data then
local flairCount = 0 local x = username.textDimensions.x + 3
-- Beta(Tester) Insignia -- Beta(Tester) Insignia
if data.postedBy.beta == true then if data.postedBy.beta == true then
teverse.construct("guiIcon", { teverse.construct("guiIcon", {
parent = parent:child("username"), parent = username,
size = guiCoord(0, 10, 0, 10), size = guiCoord(0, 10, 0, 10),
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6), position = guiCoord(0, x, 0, 6),
iconType = "faSolid", iconType = "faSolid",
iconId = "flask", iconId = "flask",
iconColour = globals.defaultColours.red iconColour = colour.rgb(220, 53, 69),
}) })
addTag(parent, "flask", "BETA", globals.defaultColours.red) x = x + 11
flairCount = flairCount + 1
end end
-- Plus Membership Insignia -- Plus Membership Insignia
if data.postedBy.membership == "plus" then if data.postedBy.membership == 1 then
local badge = teverse.construct("guiFrame", {
parent = username,
size = guiCoord(0, 32, 0, 12),
position = guiCoord(0, x, 0, 5),
strokeRadius = 5,
backgroundColour = globals.defaultColours.red,
strokeAlpha = 0.2
})
teverse.construct("guiIcon", { teverse.construct("guiIcon", {
parent = parent:child("username"), parent = badge,
size = guiCoord(0, 10, 0, 10), size = guiCoord(0, 8, 0, 8),
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6), position = guiCoord(0, 2, 0, 2),
iconType = "faSolid", iconType = "faSolid",
iconId = "star", iconId = "star",
iconColour = globals.defaultColours.primary iconColour = globals.defaultColours.secondary
}) })
addTag(parent, "star", "PLUS", colour.rgb(67, 67, 67))
flairCount = flairCount + 1 teverse.construct("guiTextBox", {
parent = badge,
size = guiCoord(0, 18, 0, 10),
position = guiCoord(0, 11, 0, 1),
textSize = 10,
text = "PLUS",
textColour = globals.defaultColours.secondary,
textFont = "tevurl:fonts/openSansSemiBold.ttf",
backgroundAlpha = 0
})
username.textColour = globals.defaultColours.red
parent:child("body").textColour = globals.defaultColours.red
x = x + 33
end end
-- Pro Membership Insignia -- Pro Membership Insignia
if data.postedBy.membership == "pro" then if data.postedBy.membership == 2 then
teverse.construct("guiIcon", { teverse.construct("guiIcon", {
parent = parent:child("username"), parent = username,
size = guiCoord(0, 10, 0, 10), size = guiCoord(0, 10, 0, 10),
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6), position = guiCoord(0, x, 0, 6),
iconType = "faSolid", iconType = "faSolid",
iconId = "thermometer-full", iconId = "thermometer-full",
iconColour = globals.defaultColours.purple iconColour = globals.defaultColours.purple
}) })
parent:child("username").textColour = globals.defaultColours.purple username.textColour = globals.defaultColours.purple
parent:child("body").textColour = globals.defaultColours.purple parent:child("body").textColour = globals.defaultColours.purple
addTag(parent, "thermometer-full", "PRO", globals.defaultColours.purple) x = x + 11
flairCount = flairCount + 1
end end
-- Mod/Staff Insignia -- Mod/Staff Insignia
@ -107,12 +85,9 @@ local function createFlair(parent, data)
}) })
parent:child("username").textColour = globals.defaultColours.blue parent:child("username").textColour = globals.defaultColours.blue
parent:child("body").textColour = globals.defaultColours.blue parent:child("body").textColour = globals.defaultColours.blue
addTag(parent, "shield-alt", "STAFF", globals.defaultColours.blue)
flairCount = flairCount + 1 flairCount = flairCount + 1
end end
]]-- ]]--
count = 0
end end
end end
@ -136,15 +111,14 @@ local function newFeedItem(date, data)
local username = teverse.construct("guiTextBox", { local username = teverse.construct("guiTextBox", {
name = "username", name = "username",
size = guiCoord(0.8, -50, 0, 20), size = guiCoord(1, -40, 0, 20),
position = guiCoord(0, 40, 0, 3), position = guiCoord(0, 40, 0, 3),
backgroundAlpha = 0, backgroundAlpha = 0,
parent = item, parent = item,
text = data.postedBy.username, text = data.postedBy.username,
textSize = 20, textSize = 20,
textAlpha = 0.6, textAlpha = 0.6,
textFont = "tevurl:fonts/openSansBold.ttf", textFont = "tevurl:fonts/openSansBold.ttf"
zIndex = 500
}) })
teverse.construct("guiTextBox", { teverse.construct("guiTextBox", {
@ -172,80 +146,6 @@ local function newFeedItem(date, data)
textSize = 16, textSize = 16,
}) })
-- Create User Modal (profile click/touch on feed)
local _modal = modal.construct(guiCoord(0, 130, 0, 60), guiCoord(0, 40, 0, 25))
_modal.content.parent = item
local content = teverse.construct("guiFrame", {
parent = _modal.content,
name = "_content",
position = guiCoord(0, 0, 0, 0),
size = guiCoord(1, 0, 1, 0),
backgroundColour = globals.defaultColours.white,
strokeColour = globals.defaultColours.white,
strokeRadius = 5,
strokeWidth = 1
})
teverse.construct("guiImage", {
parent = content,
name = "profilePicture",
size = guiCoord(0, 32, 0, 32),
position = guiCoord(0, 3, 0, 6),
image = "tevurl:asset/user/"..(data.postedBy.id),
strokeRadius = 3,
backgroundColour = globals.defaultColours.white,
dropShadowAlpha = 0.4,
dropShadowBlur = 2,
dropShadowColour = colour.rgb(127, 127, 127),
dropShadowOffset = vector2(0.5, 1.5)
})
teverse.construct("guiTextBox", {
parent = content,
name = "username",
size = guiCoord(0, 92, 0, 20),
position = guiCoord(0, 38, 0, 1),
text = data.postedBy.username,
textEditable = false,
textAlign = "middleLeft",
textColour = globals.defaultColours.primary,
textFont = "tevurl:fonts/openSansBold.ttf",
backgroundAlpha = 0,
zIndex = 500
})
local messageButton = teverse.construct("guiTextBox", {
parent = content,
name = "messageButton",
size = guiCoord(0.68, 0, 0.25, 0),
position = guiCoord(0, 38, 0, 23),
text = "MESSAGE",
textEditable = false,
textAlign = "middle",
textColour = globals.defaultColours.primary,
textSize = 12,
textFont = "tevurl:fonts/openSansBold.ttf",
backgroundColour = globals.defaultColours.white,
strokeRadius = 2,
dropShadowAlpha = 0.4,
dropShadowBlur = 2,
dropShadowColour = colour.rgb(127, 127, 127),
dropShadowOffset = vector2(0.5, 1),
zIndex = 500
})
-- When mouse hovers over label, display user modal
item:child("username"):on("mouseLeftDown", function()
_modal.display()
item.zIndex = 300
end)
-- When mouse leaves from label, hide user modal
item:child("username"):on("mouseExit", function()
_modal.hide()
item.zIndex = 1
end)
createFlair(item, data) createFlair(item, data)
return item return item

View File

@ -113,29 +113,16 @@ controller.setup = function()
strokeRadius = 3 strokeRadius = 3
}) })
icon:on("mouseEnter", function()
icon.backgroundAlpha = 0.15
end)
icon:on("mouseExit", function()
-- container is visible if button is 'active'
if not container.visible then
icon.backgroundAlpha = 0
end
end)
icon:on("mouseLeftUp", function() icon:on("mouseLeftUp", function()
for _,v in pairs(pages) do for _,v in pairs(pages) do
v[1].visible = false v[1].visible = false
v[2].iconAlpha = 0.75 v[2].iconAlpha = 0.75
v[2].backgroundAlpha = 0.0 v[2].backgroundAlpha = 0.0
v[2].dropShadowAlpha = 0.0
end end
container.visible = true container.visible = true
icon.iconAlpha = 1.0 icon.iconAlpha = 1.0
icon.backgroundAlpha = 0.2 icon.backgroundAlpha = 0.2
icon.dropShadowAlpha = 0.15
end) end)
page.setup(container) page.setup(container)

View File

@ -29,18 +29,7 @@ local txt = teverse.construct("guiTextBox", {
}) })
teverse.debug:on("print", function(msg) teverse.debug:on("print", function(msg)
-- TODO Not a great solution txt.text = string.sub(os.date("%H:%M:%S") .. " : " .. msg .. "\n" .. txt.text, 0, 500)
pcall(function()
txt.text = string.sub(os.date("%H:%M:%S") .. " : " .. msg .. "\n" .. txt.text, 0, 500)
end)
end) end)
if _TEV_VERSION_PATCH and _TEV_VERSION_PATCH >= 9 then
for _,v in pairs(teverse.debug:getOutputHistory()) do
txt.text = txt.text .. "\n" .. os.date("%H:%M:%S (h)", v.time) .. " : " .. v.message
end
else
print("History not supported")
end
return container return container

View File

@ -37,9 +37,7 @@ return {
if not doNotHook then if not doNotHook then
teverse.debug:on("print", function(msg) teverse.debug:on("print", function(msg)
pcall(function() text.text = string.sub(os.date("%H:%M:%S") .. " : " .. msg .. "\n" .. text.text, 0, 500)
text.text = string.sub(os.date("%H:%M:%S") .. " : " .. msg .. "\n" .. text.text, 0, 500)
end)
end) end)
end end

View File

@ -1,34 +0,0 @@
-- Copyright 2020- Teverse
-- This script constructs (or builds) the modal views
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
return {
construct = function(size, pos)
local data = {}
self = data
local container = teverse.construct("guiFrame", {
parent = teverse.interface,
name = "_container",
size = size,
position = pos,
backgroundColour = globals.defaultColours.white,
strokeColour = globals.defaultColours.white,
strokeRadius = 5,
strokeWidth = 1,
dropShadowAlpha = 0.4,
dropShadowBlur = 2,
dropShadowColour = colour.rgb(127, 127, 127),
dropShadowOffset = vector2(0.5, 1),
zIndex = 100
})
container.visible = false
self.content = container
self.display = function() container.visible = true end -- Display modal method
self.hide = function() container.visible = false end -- Hide modal method
return data
end
}