mirror of https://github.com/teverse/teverse
Compare commits
7 Commits
fa2a04db52
...
9f5ad0ee7f
Author | SHA1 | Date |
---|---|---|
![]() |
9f5ad0ee7f | |
![]() |
55a1ca4454 | |
![]() |
44c6d455dc | |
![]() |
1a340567a5 | |
![]() |
f170c4eac2 | |
![]() |
6d3fcbc08a | |
![]() |
2da7b377ef |
114
api.json
114
api.json
|
@ -1,17 +1,17 @@
|
||||||
{
|
{
|
||||||
"os": "OSX",
|
"os": "OSX",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"version": "0.20.8",
|
"version": "0.20.9",
|
||||||
"generatedAt": "07/05/2020 21:23:22",
|
"generatedAt": "08/05/2020 20:22:50",
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
"coroutine": {
|
"coroutine": {
|
||||||
"create": "function",
|
"status": "function",
|
||||||
"yield": "function",
|
|
||||||
"resume": "function",
|
"resume": "function",
|
||||||
|
"running": "function",
|
||||||
"wrap": "function",
|
"wrap": "function",
|
||||||
"isyieldable": "function",
|
"isyieldable": "function",
|
||||||
"running": "function",
|
"create": "function",
|
||||||
"status": "function"
|
"yield": "function"
|
||||||
},
|
},
|
||||||
"assert": "function",
|
"assert": "function",
|
||||||
"tostring": "function",
|
"tostring": "function",
|
||||||
|
@ -20,33 +20,36 @@
|
||||||
"xpcall": "function",
|
"xpcall": "function",
|
||||||
"_DEVICE_PAD_BOTTOM": 0,
|
"_DEVICE_PAD_BOTTOM": 0,
|
||||||
"ipairs": "function",
|
"ipairs": "function",
|
||||||
"_TEV_BUILD": "0208",
|
"_TEV_BUILD": "0209",
|
||||||
"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",
|
||||||
"vector2": "cdata",
|
"_OS": "OSX",
|
||||||
"guiCoord": "function",
|
"guiCoord": "function",
|
||||||
"pairs": "function",
|
"pairs": "function",
|
||||||
"table": {
|
"table": {
|
||||||
"maxn": "function",
|
"maxn": "function",
|
||||||
"foreach": "function",
|
"foreach": "function",
|
||||||
"move": "function",
|
"sort": "function",
|
||||||
"remove": "function",
|
"remove": "function",
|
||||||
"foreachi": "function",
|
"foreachi": "function",
|
||||||
"sort": "function",
|
"move": "function",
|
||||||
"getn": "function",
|
"getn": "function",
|
||||||
"concat": "function",
|
"concat": "function",
|
||||||
"insert": "function"
|
"insert": "function"
|
||||||
},
|
},
|
||||||
"error": "function",
|
"error": "function",
|
||||||
"_TEV_VERSION": "0.20.8",
|
"_TEV_VERSION": "0.20.9",
|
||||||
"_DEVICE": "Mac",
|
"_DEVICE": "Mac",
|
||||||
"_VERSION": "Lua 5.1",
|
|
||||||
"require": "function",
|
"require": "function",
|
||||||
|
"_VERSION": "Lua 5.1",
|
||||||
|
"_TEV_VERSION_PATCH": 9,
|
||||||
"next": "function",
|
"next": "function",
|
||||||
"math": {
|
"math": {
|
||||||
"ceil": "function",
|
"ceil": "function",
|
||||||
|
@ -55,32 +58,32 @@
|
||||||
"huge": 0,
|
"huge": 0,
|
||||||
"cos": "function",
|
"cos": "function",
|
||||||
"sinh": "function",
|
"sinh": "function",
|
||||||
"asin": "function",
|
"pi": 3.1415926535898,
|
||||||
"cosh": "function",
|
"max": "function",
|
||||||
"modf": "function",
|
"random": "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",
|
||||||
"log": "function",
|
"abs": "function",
|
||||||
"acos": "function",
|
"acos": "function",
|
||||||
"frexp": "function",
|
"fmod": "function",
|
||||||
"atan2": "function",
|
"cosh": "function",
|
||||||
"min": "function",
|
"min": "function",
|
||||||
"sin": "function",
|
"sin": "function",
|
||||||
"fmod": "function",
|
"frexp": "function",
|
||||||
"abs": "function",
|
"atan2": "function",
|
||||||
"pow": "function",
|
"log": "function",
|
||||||
"exp": "function",
|
"exp": "function",
|
||||||
"random": "function",
|
"modf": "function",
|
||||||
"max": "function",
|
"asin": "function",
|
||||||
"pi": 3.1415926535898,
|
"randomseed": "function",
|
||||||
"rad": "function"
|
"rad": "function"
|
||||||
},
|
},
|
||||||
"_OS": "OSX",
|
"unpack": "function",
|
||||||
"os": {
|
"os": {
|
||||||
"difftime": "function",
|
"difftime": "function",
|
||||||
"date": "function",
|
"date": "function",
|
||||||
|
@ -88,26 +91,26 @@
|
||||||
"clock": "function",
|
"clock": "function",
|
||||||
"parseISO8601": "function"
|
"parseISO8601": "function"
|
||||||
},
|
},
|
||||||
"type": "function",
|
"vector2": "cdata",
|
||||||
"select": "function",
|
"select": "function",
|
||||||
"string": {
|
"string": {
|
||||||
"split": "function",
|
"split": "function",
|
||||||
"find": "function",
|
"find": "function",
|
||||||
"sub": "function",
|
"gsub": "function",
|
||||||
"rep": "function",
|
"rep": "function",
|
||||||
|
"format": "function",
|
||||||
"lower": "function",
|
"lower": "function",
|
||||||
"len": "function",
|
"match": "function",
|
||||||
"upper": "function",
|
|
||||||
"dump": "function",
|
"dump": "function",
|
||||||
"gmatch": "function",
|
"gmatch": "function",
|
||||||
"reverse": "function",
|
"upper": "function",
|
||||||
"byte": "function",
|
"sub": "function",
|
||||||
"char": "function",
|
"char": "function",
|
||||||
"match": "function",
|
"byte": "function",
|
||||||
"format": "function",
|
"reverse": "function",
|
||||||
"gsub": "function"
|
"len": "function"
|
||||||
},
|
},
|
||||||
"unpack": "function",
|
"type": "function",
|
||||||
"thread": {
|
"thread": {
|
||||||
"create": "function"
|
"create": "function"
|
||||||
},
|
},
|
||||||
|
@ -802,10 +805,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
|
||||||
},
|
},
|
||||||
"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
|
||||||
},
|
},
|
||||||
"visible": {
|
"visible": {
|
||||||
|
@ -832,10 +835,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
|
||||||
},
|
},
|
||||||
"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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1006,18 +1009,18 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"hasSetter": true
|
"hasSetter": true
|
||||||
},
|
},
|
||||||
"canvasSize": {
|
|
||||||
"hasGetter": true,
|
|
||||||
"type": "guiCoord",
|
|
||||||
"description": "If bigger than 1,0,1,0, scrollvars will be visible",
|
|
||||||
"hasSetter": true
|
|
||||||
},
|
|
||||||
"canvasOffset": {
|
"canvasOffset": {
|
||||||
"hasGetter": true,
|
"hasGetter": true,
|
||||||
"type": "vector2",
|
"type": "vector2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"hasSetter": true
|
"hasSetter": true
|
||||||
},
|
},
|
||||||
|
"canvasSize": {
|
||||||
|
"hasGetter": true,
|
||||||
|
"type": "guiCoord",
|
||||||
|
"description": "If bigger than 1,0,1,0, scrollvars will be visible",
|
||||||
|
"hasSetter": true
|
||||||
|
},
|
||||||
"scrollbarAlpha": {
|
"scrollbarAlpha": {
|
||||||
"hasGetter": true,
|
"hasGetter": true,
|
||||||
"type": "number",
|
"type": "number",
|
||||||
|
@ -1677,13 +1680,22 @@
|
||||||
"methods": {
|
"methods": {
|
||||||
"traceback": {
|
"traceback": {
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"returns": [],
|
"returns": [
|
||||||
"description": "Undocumented"
|
"string"
|
||||||
|
],
|
||||||
|
"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",
|
||||||
|
@ -1871,5 +1883,5 @@
|
||||||
"properties": []
|
"properties": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"build": "0208"
|
"build": "0209"
|
||||||
}
|
}
|
|
@ -2,74 +2,96 @@
|
||||||
-- 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")
|
local username = parent:child("username").text
|
||||||
if data then
|
if data then
|
||||||
local x = username.textDimensions.x + 3
|
local flairCount = 0
|
||||||
|
|
||||||
-- 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 = username,
|
parent = parent:child("username"),
|
||||||
size = guiCoord(0, 10, 0, 10),
|
size = guiCoord(0, 10, 0, 10),
|
||||||
position = guiCoord(0, x, 0, 6),
|
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6),
|
||||||
iconType = "faSolid",
|
iconType = "faSolid",
|
||||||
iconId = "flask",
|
iconId = "flask",
|
||||||
iconColour = colour.rgb(220, 53, 69),
|
iconColour = globals.defaultColours.red
|
||||||
})
|
})
|
||||||
x = x + 11
|
addTag(parent, "flask", "BETA", globals.defaultColours.red)
|
||||||
|
flairCount = flairCount + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Plus Membership Insignia
|
-- Plus Membership Insignia
|
||||||
if data.postedBy.membership == 1 then
|
if data.postedBy.membership == "plus" 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 = badge,
|
parent = parent:child("username"),
|
||||||
size = guiCoord(0, 8, 0, 8),
|
size = guiCoord(0, 10, 0, 10),
|
||||||
position = guiCoord(0, 2, 0, 2),
|
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6),
|
||||||
iconType = "faSolid",
|
iconType = "faSolid",
|
||||||
iconId = "star",
|
iconId = "star",
|
||||||
iconColour = globals.defaultColours.secondary
|
iconColour = globals.defaultColours.primary
|
||||||
})
|
})
|
||||||
|
addTag(parent, "star", "PLUS", colour.rgb(67, 67, 67))
|
||||||
teverse.construct("guiTextBox", {
|
flairCount = flairCount + 1
|
||||||
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 == 2 then
|
if data.postedBy.membership == "pro" then
|
||||||
teverse.construct("guiIcon", {
|
teverse.construct("guiIcon", {
|
||||||
parent = username,
|
parent = parent:child("username"),
|
||||||
size = guiCoord(0, 10, 0, 10),
|
size = guiCoord(0, 10, 0, 10),
|
||||||
position = guiCoord(0, x, 0, 6),
|
position = guiCoord(0, parent:child("username").textDimensions.x+((flairCount*10)+2), 0, 6),
|
||||||
iconType = "faSolid",
|
iconType = "faSolid",
|
||||||
iconId = "thermometer-full",
|
iconId = "thermometer-full",
|
||||||
iconColour = globals.defaultColours.purple
|
iconColour = globals.defaultColours.purple
|
||||||
})
|
})
|
||||||
username.textColour = globals.defaultColours.purple
|
parent:child("username").textColour = globals.defaultColours.purple
|
||||||
parent:child("body").textColour = globals.defaultColours.purple
|
parent:child("body").textColour = globals.defaultColours.purple
|
||||||
x = x + 11
|
addTag(parent, "thermometer-full", "PRO", globals.defaultColours.purple)
|
||||||
|
flairCount = flairCount + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Mod/Staff Insignia
|
-- Mod/Staff Insignia
|
||||||
|
@ -85,9 +107,12 @@ 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
|
||||||
|
|
||||||
|
@ -111,14 +136,15 @@ local function newFeedItem(date, data)
|
||||||
|
|
||||||
local username = teverse.construct("guiTextBox", {
|
local username = teverse.construct("guiTextBox", {
|
||||||
name = "username",
|
name = "username",
|
||||||
size = guiCoord(1, -40, 0, 20),
|
size = guiCoord(0.8, -50, 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", {
|
||||||
|
@ -146,6 +172,80 @@ 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
|
||||||
|
|
|
@ -113,16 +113,29 @@ 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)
|
||||||
|
|
|
@ -29,7 +29,18 @@ local txt = teverse.construct("guiTextBox", {
|
||||||
})
|
})
|
||||||
|
|
||||||
teverse.debug:on("print", function(msg)
|
teverse.debug:on("print", function(msg)
|
||||||
|
-- TODO Not a great solution
|
||||||
|
pcall(function()
|
||||||
txt.text = string.sub(os.date("%H:%M:%S") .. " : " .. msg .. "\n" .. txt.text, 0, 500)
|
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
|
|
@ -37,8 +37,10 @@ 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
|
||||||
|
|
||||||
return container, text
|
return container, text
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
-- 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
|
||||||
|
}
|
Loading…
Reference in New Issue