mirror of https://github.com/teverse/teverse
Compare commits
12 Commits
299c254c9f
...
81a3ca294c
Author | SHA1 | Date |
---|---|---|
Sanjay Bhadra | 81a3ca294c | |
Jay | deb10db9da | |
Jay | 98ea58ce13 | |
Jay | f372771de9 | |
Jay | e2ea779051 | |
Jay | 0f6af4a587 | |
teverse | 62b6aad1e7 | |
Jay | 2dfc1f6dd5 | |
Sanjay | e5d3561d1a | |
teverse | ff3fac5c47 | |
teverse | 5a1d65ca95 | |
Jay | cc1f2659b1 |
|
@ -1,2 +1,17 @@
|
|||
local loadingText = teverse.construct("guiTextBox", {
|
||||
parent = teverse.interface,
|
||||
size = guiCoord(2, 0, 2, 0),
|
||||
position = guiCoord(-0.5, 0, -0.5, 0),
|
||||
backgroundColour = colour.black(),
|
||||
textColour = colour.white(),
|
||||
text = "teverse",
|
||||
textAlign = "middle",
|
||||
textSize = 38,
|
||||
textFont = "tevurl:fonts/moskUltraBold.ttf",
|
||||
zIndex = 2000
|
||||
})
|
||||
|
||||
local ui = require("tevgit:core/dashboard/ui.lua")
|
||||
ui.setup()
|
||||
ui.setup()
|
||||
|
||||
loadingText:destroy()
|
|
@ -64,5 +64,59 @@ return {
|
|||
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 = 3
|
||||
})
|
||||
|
||||
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,
|
||||
active = false
|
||||
})
|
||||
end
|
||||
end
|
||||
}
|
|
@ -61,7 +61,6 @@ return {
|
|||
iconId = "sliders-h",
|
||||
iconType = "faSolid",
|
||||
setup = function(page)
|
||||
page.backgroundAlpha = 1.0
|
||||
|
||||
local feed = teverse.construct("guiScrollView", {
|
||||
parent = page,
|
||||
|
@ -74,11 +73,13 @@ return {
|
|||
teverse.guiHelper
|
||||
.bind(feed, "xs", {
|
||||
size = guiCoord(1, 0, 1, 50),
|
||||
position = guiCoord(0, 0, 0, -50)
|
||||
position = guiCoord(0, 0, 0, -50),
|
||||
scrollbarAlpha = 0.0
|
||||
})
|
||||
.bind(feed, "lg", {
|
||||
size = guiCoord(1, 0, 1, 0),
|
||||
position = guiCoord(0, 0, 0, 0)
|
||||
position = guiCoord(0, 0, 0, 0),
|
||||
scrollbarAlpha = 1.0
|
||||
})
|
||||
|
||||
local tevs = teverse.construct("guiFrame", {
|
||||
|
@ -270,7 +271,7 @@ return {
|
|||
|
||||
local feedItems = teverse.construct("guiFrame", {
|
||||
parent = feed,
|
||||
backgroundAlpha = 1,
|
||||
backgroundAlpha = 0,
|
||||
clip = true
|
||||
})
|
||||
|
||||
|
@ -309,30 +310,34 @@ return {
|
|||
if code == 200 then
|
||||
lastRefresh = os.clock()
|
||||
local json = teverse.json:decode(body)
|
||||
if json[1].id == newestFeed then
|
||||
-- no change from last refresh
|
||||
return nil
|
||||
else
|
||||
-- may require refactoring
|
||||
for _,v in pairs(feedItems.children) do
|
||||
if v.name == "feedItem" then
|
||||
v:destroy()
|
||||
if #json > 0 then
|
||||
if json[1].id == newestFeed then
|
||||
-- no change from last refresh
|
||||
return nil
|
||||
else
|
||||
-- may require refactoring
|
||||
for _,v in pairs(feedItems.children) do
|
||||
if v.name == "feedItem" then
|
||||
v:destroy()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
newestFeed = json[1].id
|
||||
local y = 50
|
||||
for _,v in pairs(json) do
|
||||
local date = os.date("%d/%m/%Y %H:%M", os.parseISO8601(v.postedAt))
|
||||
local item = newFeedItem("tevurl:asset/user/" .. v.postedBy.id, v.postedBy.username, date, v.message)
|
||||
item.parent = feedItems
|
||||
local dy = item:child("body").textDimensions.y
|
||||
item.size = guiCoord(1, -20, 0, dy + 28)
|
||||
item.position = guiCoord(0, 10, 0, y)
|
||||
y = y + dy + 28
|
||||
end
|
||||
newestFeed = json[1].id
|
||||
local y = 50
|
||||
for _,v in pairs(json) do
|
||||
local date = os.date("%d/%m/%Y %H:%M", os.parseISO8601(v.postedAt))
|
||||
local item = newFeedItem("tevurl:asset/user/" .. v.postedBy.id, v.postedBy.username, date, v.message)
|
||||
item.parent = feedItems
|
||||
local dy = item:child("body").textDimensions.y
|
||||
item.size = guiCoord(1, -20, 0, dy + 28)
|
||||
item.position = guiCoord(0, 10, 0, y)
|
||||
y = y + dy + 28
|
||||
end
|
||||
|
||||
feed.canvasSize = guiCoord(1, 0, 0, feedItems.absolutePosition.y + y + 100)
|
||||
feed.canvasSize = guiCoord(1, 0, 0, feedItems.absolutePosition.y + y + 100)
|
||||
else
|
||||
feed.canvasSize = guiCoord(1, 0, 0, 0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -352,6 +357,7 @@ return {
|
|||
input.text = ""
|
||||
input.textEditable = true
|
||||
input.textAlpha = 1.0
|
||||
submitting = false
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -137,7 +137,10 @@ controller.setup = function()
|
|||
end
|
||||
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
|
||||
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
|
||||
setupPage(require("tevgit:core/dashboard/pages/develop.lua"))
|
||||
|
||||
if _DEVICE:sub(0,6) ~= "iPhone" then
|
||||
setupPage(require("tevgit:core/dashboard/pages/develop.lua"))
|
||||
end
|
||||
end
|
||||
|
||||
return controller
|
|
@ -6,12 +6,12 @@ local main = teverse.construct("guiFrame", {
|
|||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
position = guiCoord(0.5, -750, 0.5, -750),
|
||||
size = guiCoord(0, 1500, 0, 1500),
|
||||
position = guiCoord(0.5, -1500, 0.5, -750),
|
||||
size = guiCoord(0, 3000, 0, 1500),
|
||||
parent = main,
|
||||
backgroundAlpha = 0,
|
||||
image = "tevurl:img/tTiled.png",
|
||||
imageBottomRight = vector2(90, 90),
|
||||
imageBottomRight = vector2(180, 90),
|
||||
imageColour = colour:rgb(28, 33, 38),
|
||||
imageAlpha = 0.25,
|
||||
zIndex = -1
|
||||
|
@ -43,8 +43,8 @@ local login = teverse.construct("guiTextBox", {
|
|||
visible = false
|
||||
})
|
||||
|
||||
login.size = guiCoord(0, login.textDimensions.x + 30, 0, 26)
|
||||
login.position = guiCoord(0.5, -(login.textDimensions.x + 30)/2, 0.5, 45)
|
||||
login.size = guiCoord(0, 100, 0, 26)
|
||||
login.position = guiCoord(0.5, -50, 0.5, 45)
|
||||
|
||||
local db = false
|
||||
local listenerid = login:on("mouseLeftDown", function()
|
||||
|
|
|
@ -23,7 +23,8 @@ local ico = teverse.construct("guiIcon", {
|
|||
iconAlpha = 0.75,
|
||||
strokeRadius = 10,
|
||||
strokeAlpha = 0.5,
|
||||
backgroundAlpha = 1
|
||||
backgroundAlpha = 1,
|
||||
visible = teverse.networking.localClient ~= nil
|
||||
})
|
||||
|
||||
local lastClick = 0
|
||||
|
|
|
@ -50,6 +50,13 @@ local gui = teverse.construct("guiTextBox", {
|
|||
textColour = colour.rgb(61, 66, 71)
|
||||
})
|
||||
|
||||
local progressBar = teverse.construct("guiFrame", {
|
||||
parent = dialog,
|
||||
size = guiCoord(0, 0, 0, 5),
|
||||
position = guiCoord(0, 0, 1, -5),
|
||||
backgroundColour = colour.rgb(74, 140, 122)
|
||||
})
|
||||
|
||||
if _OS == "OSX" or _OS == "IOS" then
|
||||
-- We distribute updates via the app store on iOS/OSX
|
||||
gui.text = "A new version is available, please check the App Store."
|
||||
|
@ -58,4 +65,9 @@ end
|
|||
teverse.networking:on("_update", function(message)
|
||||
print('got ', message)
|
||||
gui.text = message
|
||||
end)
|
||||
|
||||
teverse.networking:on("_downloadProgress", function(str)
|
||||
local pcnt = tonumber(str)
|
||||
progressBar.size = guiCoord(pcnt/100, 0, 0, 5)
|
||||
end)
|
|
@ -19,7 +19,7 @@ local boomBtn = engine.construct("guiTextBox", engine.interface, {
|
|||
fontSize = 18,
|
||||
backgroundColour = colour(0.2, 0.2, 0.25),
|
||||
borderRadius = 4,
|
||||
align = enums.align.middle
|
||||
textAlign = enums.align.middle
|
||||
})
|
||||
boomBtn:on("mouseLeftReleased", function()
|
||||
boomMode = not boomMode
|
||||
|
|
|
@ -6,7 +6,7 @@ print("Hello Server!")
|
|||
require("tevgit:core/server/debug.lua")
|
||||
require("tevgit:core/server/chat.lua")
|
||||
|
||||
workspace:destroyAllChildren()
|
||||
workspace:destroyChildren()
|
||||
|
||||
local mainLight = engine.construct("light", workspace, {
|
||||
name = "mainLight",
|
||||
|
|
|
@ -18,7 +18,7 @@ local mainContainer = nil
|
|||
local workshop = nil
|
||||
|
||||
local function runTutorial(module)
|
||||
mainContainer:destroyAllChildren()
|
||||
mainContainer:destroyChildren()
|
||||
local tutorial = require("tevgit:"..module)
|
||||
|
||||
local tutorialContainer = engine.construct("guiFrame", mainContainer, {
|
||||
|
@ -85,14 +85,14 @@ local function runTutorial(module)
|
|||
})
|
||||
|
||||
for _,page in pairs(tutorial.tutorial) do
|
||||
instructions:destroyAllChildren()
|
||||
instructions:destroyChildren()
|
||||
if type(page) == "string" then
|
||||
local txt = engine.construct("guiTextBox", instructions, {
|
||||
size = guiCoord(1,-10,1,-10),
|
||||
position = guiCoord(0,5,0,5),
|
||||
backgroundAlpha = 0,
|
||||
align = enums.align.topLeft,
|
||||
wrap = true,
|
||||
textWrap = true,
|
||||
fontFile = "local:OpenSans-Regular.ttf",
|
||||
fontSize = 20,
|
||||
text = page,
|
||||
|
@ -200,7 +200,7 @@ local function runTutorial(module)
|
|||
end
|
||||
|
||||
local function createMainInterface()
|
||||
mainContainer:destroyAllChildren()
|
||||
mainContainer:destroyChildren()
|
||||
local sectionYPos = 0
|
||||
for section, tutorials in pairs(tevEd.tutorials) do
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ return {
|
|||
|
||||
if orientation == "vertical" then -- If orientation is specified to "vertical"
|
||||
local container = teverse.construct("guiFrame", {
|
||||
parent = teverse.interface
|
||||
parent = teverse.interface,
|
||||
size = guiCoord(0.1, 0, 0.1, 0),
|
||||
position = element.position+guiCoord(-0.02, 0, -0.01, 0),
|
||||
backgroundColour = globals.defaultColours.red,
|
||||
|
@ -37,12 +37,13 @@ return {
|
|||
backgroundAlpha = 0
|
||||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 48, 0, 48),
|
||||
position = guiCoord(0.33, 0, -0.15, 0),
|
||||
texture = "fa:s-caret-up",
|
||||
imageColour = globals.defaultColours.secondary,
|
||||
iconId = "caret-up",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.secondary,
|
||||
backgroundColour = globals.defaultColours.red,
|
||||
backgroundAlpha = 0
|
||||
})
|
||||
|
@ -58,12 +59,13 @@ return {
|
|||
borderColour = globals.defaultColours.secondary
|
||||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
teverse.construct("guiIcon", {
|
||||
parent = bodyContainer,
|
||||
size = guiCoord(0, 16, 0, 16),
|
||||
position = guiCoord(0.04, 0, 0.25, 0),
|
||||
texture = "fa:s-info-circle",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "info-circle",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
|
@ -75,8 +77,8 @@ return {
|
|||
fontSize = 16,
|
||||
textColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
align = enums.align.middle,
|
||||
wrap = true
|
||||
textAlign = enums.align.middle,
|
||||
textWrap = true
|
||||
})
|
||||
|
||||
self.display = function() container.visible = true end -- Display tooltip method
|
||||
|
@ -93,12 +95,13 @@ return {
|
|||
backgroundAlpha = 0
|
||||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 48, 0, 48),
|
||||
position = guiCoord(-0.03, 0, -0.06, 0),
|
||||
texture = "fa:s-caret-left",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "caret-left",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.red,
|
||||
backgroundAlpha = 0
|
||||
})
|
||||
|
@ -114,12 +117,13 @@ return {
|
|||
borderColour = globals.defaultColours.primary
|
||||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
teverse.construct("guiIcon", {
|
||||
parent = bodyContainer,
|
||||
size = guiCoord(0, 16, 0, 16),
|
||||
position = guiCoord(0.05, 0, 0.3, 0),
|
||||
texture = "fa:s-info-circle",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "fa:s-info-circle",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
|
@ -131,8 +135,8 @@ return {
|
|||
fontSize = 16,
|
||||
textColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
align = enums.align.middle,
|
||||
wrap = true
|
||||
textAlign = enums.align.middle,
|
||||
textWrap = true
|
||||
})
|
||||
|
||||
self.display = function() container.visible = true end -- Display tooltip method
|
||||
|
|
|
@ -43,39 +43,43 @@ return {
|
|||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local selectTool = teverse.construct("guiImage", {
|
||||
local selectTool = teverse.construct("guiIcon", {
|
||||
parent = toolsContainer,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.25, 0, 0.1, 0),
|
||||
texture = "fa:s-location-arrow",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "location-arrow",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local moveTool = teverse.construct("guiImage", {
|
||||
local moveTool = teverse.construct("guiIcon", {
|
||||
parent = toolsContainer,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.25, 0, 0.32, 0),
|
||||
texture = "fa:s-arrows-alt-h",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "arrows-alt-h",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local rotateTool = teverse.construct("guiImage", {
|
||||
local rotateTool = teverse.construct("guiIcon", {
|
||||
parent = toolsContainer,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.25, 0, 0.54, 0),
|
||||
texture = "fa:s-sync",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "sync",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local sizeTool = teverse.construct("guiImage", {
|
||||
local sizeTool = teverse.construct("guiIcon", {
|
||||
parent = toolsContainer,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.25, 0, 0.76, 0),
|
||||
texture = "fa:s-expand",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "fa:s-expand",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
|
@ -138,13 +142,14 @@ return {
|
|||
local args = {...} -- Holds overrides
|
||||
local xPositionOverride = args[1] or 0 -- Override if specified, else 0
|
||||
local positionToolTipOverride = args[2] or guiCoord(0, 0, 0, 0) -- Override if specified, else guiCoord(0, 0, 0, 0)
|
||||
local iconImage = teverse.construct("guiImage", {
|
||||
parent = page
|
||||
local iconImage = teverse.construct("guiIcon", {
|
||||
parent = page,
|
||||
name = name,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord((0.25+xPositionOverride), 0, 0.02+(#page.children*0.04), 0), -- Shorthand positioning w/o a for-loop
|
||||
texture = icon,
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = icon,
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
|
|
|
@ -33,14 +33,15 @@ return {
|
|||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
teverse.construct("guiImage", {
|
||||
teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 28, 0, 28),
|
||||
position = guiCoord(0.01, 0, 0.1, 0),
|
||||
texture = titleIconValue,
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = titleIconValue,
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
handleEvents = false,
|
||||
active = false,
|
||||
})
|
||||
|
||||
teverse.construct("guiTextBox", {
|
||||
|
@ -73,7 +74,7 @@ return {
|
|||
})
|
||||
|
||||
local statusIcon = teverse.construct("guiFrame", {
|
||||
parent = container
|
||||
parent = container,
|
||||
size = guiCoord(0, 16, 0, 16),
|
||||
position = guiCoord(0.836, 0, 0.5, 0),
|
||||
backgroundColour = globals.defaultColours.green,
|
||||
|
@ -84,30 +85,33 @@ return {
|
|||
zIndex = 100
|
||||
})
|
||||
|
||||
local undoButton = teverse.construct("guiImage", {
|
||||
local undoButton = teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.92, 0, 0.2, 0),
|
||||
texture = "fa:s-arrow-left",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "arrow-left",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local redoButton = teverse.construct("guiImage", {
|
||||
local redoButton = teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.94, 0, 0.2, 0),
|
||||
texture = "fa:s-arrow-right",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "arrow-right",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
local settingsButton = teverse.construct("guiImage", {
|
||||
local settingsButton = teverse.construct("guiIcon", {
|
||||
parent = container,
|
||||
size = guiCoord(0, 20, 0, 20),
|
||||
position = guiCoord(0.97, 0, 0.2, 0),
|
||||
texture = "fa:s-sliders-h",
|
||||
imageColour = globals.defaultColours.primary,
|
||||
iconId = "sliders-h",
|
||||
iconType = "faSolid",
|
||||
iconColour = globals.defaultColours.primary,
|
||||
backgroundColour = globals.defaultColours.white,
|
||||
})
|
||||
|
||||
|
@ -133,7 +137,7 @@ return {
|
|||
text = name,
|
||||
textColour = globals.defaultColours.primary,
|
||||
fontSize = 30,
|
||||
align = enums.align.middle,
|
||||
textAlign = enums.align.middle,
|
||||
zIndex = 100
|
||||
})
|
||||
|
||||
|
|
|
@ -2,49 +2,49 @@
|
|||
-- This script is responsible for creating the workshop interface
|
||||
|
||||
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
|
||||
local prompt = require("tevgit:workshop/library/ui/components/prompt.lua") -- UI Component
|
||||
--local prompt = require("tevgit:workshop/library/ui/components/prompt.lua") -- UI Component
|
||||
local topbarInterface = require("tevgit:workshop/library/ui/controllers/topbarInterface.lua") -- UI Controller
|
||||
local sidebarInterface = require("tevgit:workshop/library/ui/controllers/sidebarInterface.lua") -- UI Controller
|
||||
|
||||
local topBar = topbarInterface.construct("horizontalNavbar", "fa:s-cloud", "Test Place 1") -- Create initial topbar instance
|
||||
local topBar = topbarInterface.construct("horizontalNavbar", "cloud", "Test Place 1") -- Create initial topbar instance
|
||||
local sideBar = sidebarInterface.construct("verticalNavbar") -- Create initial sidebar instance
|
||||
|
||||
local defaultPage = sideBar.registerPage("Default") -- Register default page to sidebar instance
|
||||
sideBar.registerIcon(defaultPage, "openFolderIcon", "fa:s-folder-open", "Open Folder", nil)
|
||||
sideBar.registerIcon(defaultPage, "newFileIcon", "fa:s-file", "Create new file", nil)
|
||||
sideBar.registerIcon(defaultPage, "uploadFileIcon", "fa:s-file-upload", "Upload current file", nil)
|
||||
sideBar.registerIcon(defaultPage, "downloadFileIcon", "fa:s-file-download", "Download current file", nil)
|
||||
sideBar.registerIcon(defaultPage, "importFileIcon", "fa:s-file-import", "Import a file", nil, -0.048, guiCoord(0.048, 0, 0, 0))
|
||||
sideBar.registerIcon(defaultPage, "exportFileIcon", "fa:s-file-export", "Export current file", nil, 0.048, guiCoord(-0.048, 0, 0, 0))
|
||||
sideBar.registerIcon(defaultPage, "openFolderIcon", "folder-open", "Open Folder", nil)
|
||||
sideBar.registerIcon(defaultPage, "newFileIcon", "file", "Create new file", nil)
|
||||
sideBar.registerIcon(defaultPage, "uploadFileIcon", "file-upload", "Upload current file", nil)
|
||||
sideBar.registerIcon(defaultPage, "downloadFileIcon", "file-download", "Download current file", nil)
|
||||
sideBar.registerIcon(defaultPage, "importFileIcon", "file-import", "Import a file", nil, -0.048, guiCoord(0.048, 0, 0, 0))
|
||||
sideBar.registerIcon(defaultPage, "exportFileIcon", "file-export", "Export current file", nil, 0.048, guiCoord(-0.048, 0, 0, 0))
|
||||
defaultPage.visible = true -- Set default sidebar page to visible
|
||||
globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default
|
||||
globals.sideBarPageActive = defaultPage -- Set default sidebar page as active
|
||||
|
||||
|
||||
local designPage = sideBar.registerPage("Design") -- Design default page to sidebar instance
|
||||
sideBar.registerIcon(designPage, "screenContainerIcon", "fa:s-tv", "Create a container instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiFrameIcon", "fa:s-square-full", "Create a guiFrame instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiTextBoxIcon", "fa:s-i-cursor", "Create a guiTextBox instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiImageIcon", "fa:s-image", "Create a guiImage instance", nil)
|
||||
sideBar.registerIcon(designPage, "screenContainerIcon", "tv", "Create a container instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiFrameIcon", "square-full", "Create a guiFrame instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiTextBoxIcon", "i-cursor", "Create a guiTextBox instance", nil)
|
||||
sideBar.registerIcon(designPage, "guiImageIcon", "image", "Create a guiImage instance", nil)
|
||||
|
||||
|
||||
local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance
|
||||
sideBar.registerIcon(modelPage, "modelIcon", "fa:s-shapes", "Group instance(s) together", nil)
|
||||
sideBar.registerIcon(modelPage, "modelIcon", "shapes", "Group instance(s) together", nil)
|
||||
|
||||
|
||||
local insertPage = sideBar.registerPage("Insert") -- Register insert page to sidebar instance
|
||||
sideBar.registerIcon(insertPage, "blockIcon", "fa:s-cube", "Create a cube instance", nil)
|
||||
sideBar.registerIcon(insertPage, "circleIcon", "fa:s-circle", "Create a cylinder instance", nil)
|
||||
--sideBar.registerIcon(designPage, "triangleIcon", "fa:s-i-cursor", nil, nil) -- Triangle / Wedge Icon doesn't exist
|
||||
sideBar.registerIcon(insertPage, "scriptIcon", "fa:s-code", "Create a script instance", nil)
|
||||
sideBar.registerIcon(insertPage, "lightIcon", "fa:s-lightbulb", "Create a light instance", nil)
|
||||
sideBar.registerIcon(insertPage, "blockIcon", "cube", "Create a cube instance", nil)
|
||||
sideBar.registerIcon(insertPage, "circleIcon", "circle", "Create a cylinder instance", nil)
|
||||
--sideBar.registerIcon(designPage, "triangleIcon", "i-cursor", nil, nil) -- Triangle / Wedge Icon doesn't exist
|
||||
sideBar.registerIcon(insertPage, "scriptIcon", "code", "Create a script instance", nil)
|
||||
sideBar.registerIcon(insertPage, "lightIcon", "lightbulb", "Create a light instance", nil)
|
||||
|
||||
|
||||
local testPage = sideBar.registerPage("Test") -- Register test page to sidebar instance
|
||||
sideBar.registerIcon(testPage, "consoleIcon", "fa:s-terminal", " Open console window", nil)
|
||||
sideBar.registerIcon(testPage, "playIcon", "fa:s-play", "Play scene", nil)
|
||||
sideBar.registerIcon(testPage, "serverIcon", "fa:s-server", "Configure server", nil)
|
||||
sideBar.registerIcon(testPage, "fullScreenIcon", "fa:s-fullscreen", "Toggle full screen", nil)
|
||||
sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil)
|
||||
sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil)
|
||||
sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil)
|
||||
sideBar.registerIcon(testPage, "fullScreenIcon", "fullscreen", "Toggle full screen", nil)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ local function init(dev)
|
|||
]]--
|
||||
|
||||
globals.dev = dev -- Set teverse.dev (previously workshop) instance as a global
|
||||
globals.user = teverse:isAuthenticated() -- Set & Streamline user instance as a global
|
||||
globals.developerMode = (not globals.dev.hasLocalTevGit) or (globals.dev:hasLocalTevGit()) -- Set developmode boolean as a global
|
||||
globals.user = teverse.networking.localClient -- Set & Streamline user instance as a global
|
||||
globals.developerMode = not globals.dev.localTevGit -- Set developmode boolean as a global
|
||||
|
||||
local loadingScreen = teverse.construct("guiFrame", {
|
||||
parent = dev.interface,
|
||||
|
@ -30,7 +30,7 @@ local function init(dev)
|
|||
parent = loadingScreen,
|
||||
size = guiCoord(0.5, 0, 0.5, 0),
|
||||
position = guiCoord(0.25, 0, 0.25, 0),
|
||||
align = enums.align.middle,
|
||||
textAlign = enums.align.middle,
|
||||
backgroundAlpha = 0,
|
||||
text = "Downloading the latest workshop...\nThis takes longer than a moment during beta."
|
||||
})
|
||||
|
@ -55,17 +55,18 @@ return function(dev)
|
|||
@Returns
|
||||
function, method
|
||||
]]--
|
||||
|
||||
dev = teverse.dev
|
||||
local success, message = pcall(init, dev)
|
||||
|
||||
-- If initialize phase fails, prompt to the error screen
|
||||
if (not success) then
|
||||
teverse.interface:destroyAllChildren()
|
||||
|
||||
teverse.interface:destroyChildren()
|
||||
|
||||
local errorScreen = teverse.construct("guiFrame", {
|
||||
parent = dev.interface,
|
||||
size = guiCoord(1, 0, 1, 0),
|
||||
backgroundColour = globals.defaultColours.background,
|
||||
backgroundAlpha = 0,
|
||||
zIndex = 10000
|
||||
})
|
||||
|
||||
|
@ -74,24 +75,26 @@ return function(dev)
|
|||
size = guiCoord(0.8, 0, 0.8, 0),
|
||||
position = guiCoord(0.1, 0, 0.1, 0),
|
||||
backgroundColour = globals.defaultColours.background,
|
||||
backgroundAlpha = 0,
|
||||
textColour = globals.defaultColours.red,
|
||||
align = enums.align.topLeft,
|
||||
textAlign = enums.align.topLeft,
|
||||
text = "Error loading Workshop\nIf this isn't your fault, please take a screenshot and report this as a bug. \n\n" .. message .." \n\nPlease press 'ENTER' on your keyboard to restart Teverse.",
|
||||
wrap = true,
|
||||
textWrap = true,
|
||||
textFont = "tevurl:fonts/firaCodeMedium.otf"
|
||||
})
|
||||
|
||||
-- Bind the "return" key on the keyboard as temporary fast-reload keybind
|
||||
teverse.input:on("keyPressed", function(keyboard)
|
||||
if keyboard.key == enums.key["return"] then
|
||||
teverse:reloadCreate()
|
||||
teverse.input:on("keyDown", function(key)
|
||||
if key == "KEY_RETURN" then
|
||||
teverse.apps:loadWorkshop()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Bind the "f12" key on the keyboard as fast-reload keybind if initialize phase is successful
|
||||
teverse.input:on("keyPressed", function(keyboard)
|
||||
if keyboard.key == enums.key["f12"] then
|
||||
teverse:reloadCreate()
|
||||
teverse.input:on("keyDown", function(key)
|
||||
if key == "KEY_F12" then
|
||||
teverse.apps:loadWorkshop()
|
||||
end
|
||||
end)
|
||||
end
|
Loading…
Reference in New Issue