1
0
mirror of https://github.com/teverse/teverse synced 2025-08-27 16:44:45 +02:00

Compare commits

..

No commits in common. "81a3ca294c8035c51a6dfc6e2b69ae7ae0cb9e00" and "299c254c9f7ecaf78605b6c55e0b3e31565770ff" have entirely different histories.

15 changed files with 123 additions and 230 deletions

View File

@ -1,17 +1,2 @@
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") local ui = require("tevgit:core/dashboard/ui.lua")
ui.setup() ui.setup()
loadingText:destroy()

View File

@ -64,59 +64,5 @@ return {
iconAlpha = 0.9, iconAlpha = 0.9,
active = false 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 end
} }

View File

@ -61,6 +61,7 @@ return {
iconId = "sliders-h", iconId = "sliders-h",
iconType = "faSolid", iconType = "faSolid",
setup = function(page) setup = function(page)
page.backgroundAlpha = 1.0
local feed = teverse.construct("guiScrollView", { local feed = teverse.construct("guiScrollView", {
parent = page, parent = page,
@ -73,13 +74,11 @@ return {
teverse.guiHelper teverse.guiHelper
.bind(feed, "xs", { .bind(feed, "xs", {
size = guiCoord(1, 0, 1, 50), size = guiCoord(1, 0, 1, 50),
position = guiCoord(0, 0, 0, -50), position = guiCoord(0, 0, 0, -50)
scrollbarAlpha = 0.0
}) })
.bind(feed, "lg", { .bind(feed, "lg", {
size = guiCoord(1, 0, 1, 0), 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", { local tevs = teverse.construct("guiFrame", {
@ -271,7 +270,7 @@ return {
local feedItems = teverse.construct("guiFrame", { local feedItems = teverse.construct("guiFrame", {
parent = feed, parent = feed,
backgroundAlpha = 0, backgroundAlpha = 1,
clip = true clip = true
}) })
@ -310,7 +309,6 @@ return {
if code == 200 then if code == 200 then
lastRefresh = os.clock() lastRefresh = os.clock()
local json = teverse.json:decode(body) local json = teverse.json:decode(body)
if #json > 0 then
if json[1].id == newestFeed then if json[1].id == newestFeed then
-- no change from last refresh -- no change from last refresh
return nil return nil
@ -335,9 +333,6 @@ return {
end 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) end)
end end
@ -357,7 +352,6 @@ return {
input.text = "" input.text = ""
input.textEditable = true input.textEditable = true
input.textAlpha = 1.0 input.textAlpha = 1.0
submitting = false
end) end)
end end
end) end)

View File

@ -137,10 +137,7 @@ controller.setup = function()
end end
setupPage(require("tevgit:core/dashboard/pages/home.lua")) setupPage(require("tevgit:core/dashboard/pages/home.lua"))
setupPage(require("tevgit:core/dashboard/pages/apps.lua")) setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
if _DEVICE:sub(0,6) ~= "iPhone" then
setupPage(require("tevgit:core/dashboard/pages/develop.lua")) setupPage(require("tevgit:core/dashboard/pages/develop.lua"))
end
end end
return controller return controller

View File

@ -6,12 +6,12 @@ local main = teverse.construct("guiFrame", {
}) })
teverse.construct("guiImage", { teverse.construct("guiImage", {
position = guiCoord(0.5, -1500, 0.5, -750), position = guiCoord(0.5, -750, 0.5, -750),
size = guiCoord(0, 3000, 0, 1500), size = guiCoord(0, 1500, 0, 1500),
parent = main, parent = main,
backgroundAlpha = 0, backgroundAlpha = 0,
image = "tevurl:img/tTiled.png", image = "tevurl:img/tTiled.png",
imageBottomRight = vector2(180, 90), imageBottomRight = vector2(90, 90),
imageColour = colour:rgb(28, 33, 38), imageColour = colour:rgb(28, 33, 38),
imageAlpha = 0.25, imageAlpha = 0.25,
zIndex = -1 zIndex = -1
@ -43,8 +43,8 @@ local login = teverse.construct("guiTextBox", {
visible = false visible = false
}) })
login.size = guiCoord(0, 100, 0, 26) login.size = guiCoord(0, login.textDimensions.x + 30, 0, 26)
login.position = guiCoord(0.5, -50, 0.5, 45) login.position = guiCoord(0.5, -(login.textDimensions.x + 30)/2, 0.5, 45)
local db = false local db = false
local listenerid = login:on("mouseLeftDown", function() local listenerid = login:on("mouseLeftDown", function()

View File

@ -23,8 +23,7 @@ local ico = teverse.construct("guiIcon", {
iconAlpha = 0.75, iconAlpha = 0.75,
strokeRadius = 10, strokeRadius = 10,
strokeAlpha = 0.5, strokeAlpha = 0.5,
backgroundAlpha = 1, backgroundAlpha = 1
visible = teverse.networking.localClient ~= nil
}) })
local lastClick = 0 local lastClick = 0

View File

@ -50,13 +50,6 @@ local gui = teverse.construct("guiTextBox", {
textColour = colour.rgb(61, 66, 71) 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 if _OS == "OSX" or _OS == "IOS" then
-- We distribute updates via the app store on iOS/OSX -- We distribute updates via the app store on iOS/OSX
gui.text = "A new version is available, please check the App Store." gui.text = "A new version is available, please check the App Store."
@ -66,8 +59,3 @@ teverse.networking:on("_update", function(message)
print('got ', message) print('got ', message)
gui.text = message gui.text = message
end) end)
teverse.networking:on("_downloadProgress", function(str)
local pcnt = tonumber(str)
progressBar.size = guiCoord(pcnt/100, 0, 0, 5)
end)

View File

@ -19,7 +19,7 @@ local boomBtn = engine.construct("guiTextBox", engine.interface, {
fontSize = 18, fontSize = 18,
backgroundColour = colour(0.2, 0.2, 0.25), backgroundColour = colour(0.2, 0.2, 0.25),
borderRadius = 4, borderRadius = 4,
textAlign = enums.align.middle align = enums.align.middle
}) })
boomBtn:on("mouseLeftReleased", function() boomBtn:on("mouseLeftReleased", function()
boomMode = not boomMode boomMode = not boomMode

View File

@ -6,7 +6,7 @@ print("Hello Server!")
require("tevgit:core/server/debug.lua") require("tevgit:core/server/debug.lua")
require("tevgit:core/server/chat.lua") require("tevgit:core/server/chat.lua")
workspace:destroyChildren() workspace:destroyAllChildren()
local mainLight = engine.construct("light", workspace, { local mainLight = engine.construct("light", workspace, {
name = "mainLight", name = "mainLight",

View File

@ -18,7 +18,7 @@ local mainContainer = nil
local workshop = nil local workshop = nil
local function runTutorial(module) local function runTutorial(module)
mainContainer:destroyChildren() mainContainer:destroyAllChildren()
local tutorial = require("tevgit:"..module) local tutorial = require("tevgit:"..module)
local tutorialContainer = engine.construct("guiFrame", mainContainer, { local tutorialContainer = engine.construct("guiFrame", mainContainer, {
@ -85,14 +85,14 @@ local function runTutorial(module)
}) })
for _,page in pairs(tutorial.tutorial) do for _,page in pairs(tutorial.tutorial) do
instructions:destroyChildren() instructions:destroyAllChildren()
if type(page) == "string" then if type(page) == "string" then
local txt = engine.construct("guiTextBox", instructions, { local txt = engine.construct("guiTextBox", instructions, {
size = guiCoord(1,-10,1,-10), size = guiCoord(1,-10,1,-10),
position = guiCoord(0,5,0,5), position = guiCoord(0,5,0,5),
backgroundAlpha = 0, backgroundAlpha = 0,
align = enums.align.topLeft, align = enums.align.topLeft,
textWrap = true, wrap = true,
fontFile = "local:OpenSans-Regular.ttf", fontFile = "local:OpenSans-Regular.ttf",
fontSize = 20, fontSize = 20,
text = page, text = page,
@ -200,7 +200,7 @@ local function runTutorial(module)
end end
local function createMainInterface() local function createMainInterface()
mainContainer:destroyChildren() mainContainer:destroyAllChildren()
local sectionYPos = 0 local sectionYPos = 0
for section, tutorials in pairs(tevEd.tutorials) do for section, tutorials in pairs(tevEd.tutorials) do

View File

@ -28,7 +28,7 @@ return {
if orientation == "vertical" then -- If orientation is specified to "vertical" if orientation == "vertical" then -- If orientation is specified to "vertical"
local container = teverse.construct("guiFrame", { local container = teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface
size = guiCoord(0.1, 0, 0.1, 0), size = guiCoord(0.1, 0, 0.1, 0),
position = element.position+guiCoord(-0.02, 0, -0.01, 0), position = element.position+guiCoord(-0.02, 0, -0.01, 0),
backgroundColour = globals.defaultColours.red, backgroundColour = globals.defaultColours.red,
@ -37,13 +37,12 @@ return {
backgroundAlpha = 0 backgroundAlpha = 0
}) })
teverse.construct("guiIcon", { teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 48, 0, 48), size = guiCoord(0, 48, 0, 48),
position = guiCoord(0.33, 0, -0.15, 0), position = guiCoord(0.33, 0, -0.15, 0),
iconId = "caret-up", texture = "fa:s-caret-up",
iconType = "faSolid", imageColour = globals.defaultColours.secondary,
iconColour = globals.defaultColours.secondary,
backgroundColour = globals.defaultColours.red, backgroundColour = globals.defaultColours.red,
backgroundAlpha = 0 backgroundAlpha = 0
}) })
@ -59,13 +58,12 @@ return {
borderColour = globals.defaultColours.secondary borderColour = globals.defaultColours.secondary
}) })
teverse.construct("guiIcon", { teverse.construct("guiImage", {
parent = bodyContainer, parent = bodyContainer,
size = guiCoord(0, 16, 0, 16), size = guiCoord(0, 16, 0, 16),
position = guiCoord(0.04, 0, 0.25, 0), position = guiCoord(0.04, 0, 0.25, 0),
iconId = "info-circle", texture = "fa:s-info-circle",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -77,8 +75,8 @@ return {
fontSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle, align = enums.align.middle,
textWrap = true wrap = true
}) })
self.display = function() container.visible = true end -- Display tooltip method self.display = function() container.visible = true end -- Display tooltip method
@ -95,13 +93,12 @@ return {
backgroundAlpha = 0 backgroundAlpha = 0
}) })
teverse.construct("guiIcon", { teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 48, 0, 48), size = guiCoord(0, 48, 0, 48),
position = guiCoord(-0.03, 0, -0.06, 0), position = guiCoord(-0.03, 0, -0.06, 0),
iconId = "caret-left", texture = "fa:s-caret-left",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.red, backgroundColour = globals.defaultColours.red,
backgroundAlpha = 0 backgroundAlpha = 0
}) })
@ -117,13 +114,12 @@ return {
borderColour = globals.defaultColours.primary borderColour = globals.defaultColours.primary
}) })
teverse.construct("guiIcon", { teverse.construct("guiImage", {
parent = bodyContainer, parent = bodyContainer,
size = guiCoord(0, 16, 0, 16), size = guiCoord(0, 16, 0, 16),
position = guiCoord(0.05, 0, 0.3, 0), position = guiCoord(0.05, 0, 0.3, 0),
iconId = "fa:s-info-circle", texture = "fa:s-info-circle",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -135,8 +131,8 @@ return {
fontSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle, align = enums.align.middle,
textWrap = true wrap = true
}) })
self.display = function() container.visible = true end -- Display tooltip method self.display = function() container.visible = true end -- Display tooltip method

View File

@ -43,43 +43,39 @@ return {
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local selectTool = teverse.construct("guiIcon", { local selectTool = teverse.construct("guiImage", {
parent = toolsContainer, parent = toolsContainer,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.1, 0), position = guiCoord(0.25, 0, 0.1, 0),
iconId = "location-arrow", texture = "fa:s-location-arrow",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local moveTool = teverse.construct("guiIcon", { local moveTool = teverse.construct("guiImage", {
parent = toolsContainer, parent = toolsContainer,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.32, 0), position = guiCoord(0.25, 0, 0.32, 0),
iconId = "arrows-alt-h", texture = "fa:s-arrows-alt-h",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local rotateTool = teverse.construct("guiIcon", { local rotateTool = teverse.construct("guiImage", {
parent = toolsContainer, parent = toolsContainer,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.54, 0), position = guiCoord(0.25, 0, 0.54, 0),
iconId = "sync", texture = "fa:s-sync",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local sizeTool = teverse.construct("guiIcon", { local sizeTool = teverse.construct("guiImage", {
parent = toolsContainer, parent = toolsContainer,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.76, 0), position = guiCoord(0.25, 0, 0.76, 0),
iconId = "fa:s-expand", texture = "fa:s-expand",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -142,14 +138,13 @@ return {
local args = {...} -- Holds overrides local args = {...} -- Holds overrides
local xPositionOverride = args[1] or 0 -- Override if specified, else 0 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 positionToolTipOverride = args[2] or guiCoord(0, 0, 0, 0) -- Override if specified, else guiCoord(0, 0, 0, 0)
local iconImage = teverse.construct("guiIcon", { local iconImage = teverse.construct("guiImage", {
parent = page, parent = page
name = name, name = name,
size = guiCoord(0, 20, 0, 20), 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 position = guiCoord((0.25+xPositionOverride), 0, 0.02+(#page.children*0.04), 0), -- Shorthand positioning w/o a for-loop
iconId = icon, texture = icon,
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })

View File

@ -33,15 +33,14 @@ return {
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
teverse.construct("guiIcon", { teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 28, 0, 28), size = guiCoord(0, 28, 0, 28),
position = guiCoord(0.01, 0, 0.1, 0), position = guiCoord(0.01, 0, 0.1, 0),
iconId = titleIconValue, texture = titleIconValue,
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
active = false, handleEvents = false,
}) })
teverse.construct("guiTextBox", { teverse.construct("guiTextBox", {
@ -74,7 +73,7 @@ return {
}) })
local statusIcon = teverse.construct("guiFrame", { local statusIcon = teverse.construct("guiFrame", {
parent = container, parent = container
size = guiCoord(0, 16, 0, 16), size = guiCoord(0, 16, 0, 16),
position = guiCoord(0.836, 0, 0.5, 0), position = guiCoord(0.836, 0, 0.5, 0),
backgroundColour = globals.defaultColours.green, backgroundColour = globals.defaultColours.green,
@ -85,33 +84,30 @@ return {
zIndex = 100 zIndex = 100
}) })
local undoButton = teverse.construct("guiIcon", { local undoButton = teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.92, 0, 0.2, 0), position = guiCoord(0.92, 0, 0.2, 0),
iconId = "arrow-left", texture = "fa:s-arrow-left",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local redoButton = teverse.construct("guiIcon", { local redoButton = teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.94, 0, 0.2, 0), position = guiCoord(0.94, 0, 0.2, 0),
iconId = "arrow-right", texture = "fa:s-arrow-right",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local settingsButton = teverse.construct("guiIcon", { local settingsButton = teverse.construct("guiImage", {
parent = container, parent = container,
size = guiCoord(0, 20, 0, 20), size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.97, 0, 0.2, 0), position = guiCoord(0.97, 0, 0.2, 0),
iconId = "sliders-h", texture = "fa:s-sliders-h",
iconType = "faSolid", imageColour = globals.defaultColours.primary,
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -137,7 +133,7 @@ return {
text = name, text = name,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
fontSize = 30, fontSize = 30,
textAlign = enums.align.middle, align = enums.align.middle,
zIndex = 100 zIndex = 100
}) })

View File

@ -2,49 +2,49 @@
-- This script is responsible for creating the workshop interface -- 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 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 topbarInterface = require("tevgit:workshop/library/ui/controllers/topbarInterface.lua") -- UI Controller
local sidebarInterface = require("tevgit:workshop/library/ui/controllers/sidebarInterface.lua") -- UI Controller local sidebarInterface = require("tevgit:workshop/library/ui/controllers/sidebarInterface.lua") -- UI Controller
local topBar = topbarInterface.construct("horizontalNavbar", "cloud", "Test Place 1") -- Create initial topbar instance local topBar = topbarInterface.construct("horizontalNavbar", "fa:s-cloud", "Test Place 1") -- Create initial topbar instance
local sideBar = sidebarInterface.construct("verticalNavbar") -- Create initial sidebar instance local sideBar = sidebarInterface.construct("verticalNavbar") -- Create initial sidebar instance
local defaultPage = sideBar.registerPage("Default") -- Register default page to sidebar instance local defaultPage = sideBar.registerPage("Default") -- Register default page to sidebar instance
sideBar.registerIcon(defaultPage, "openFolderIcon", "folder-open", "Open Folder", nil) sideBar.registerIcon(defaultPage, "openFolderIcon", "fa:s-folder-open", "Open Folder", nil)
sideBar.registerIcon(defaultPage, "newFileIcon", "file", "Create new file", nil) sideBar.registerIcon(defaultPage, "newFileIcon", "fa:s-file", "Create new file", nil)
sideBar.registerIcon(defaultPage, "uploadFileIcon", "file-upload", "Upload current file", nil) sideBar.registerIcon(defaultPage, "uploadFileIcon", "fa:s-file-upload", "Upload current file", nil)
sideBar.registerIcon(defaultPage, "downloadFileIcon", "file-download", "Download current file", nil) sideBar.registerIcon(defaultPage, "downloadFileIcon", "fa:s-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, "importFileIcon", "fa:s-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)) sideBar.registerIcon(defaultPage, "exportFileIcon", "fa:s-file-export", "Export current file", nil, 0.048, guiCoord(-0.048, 0, 0, 0))
defaultPage.visible = true -- Set default sidebar page to visible defaultPage.visible = true -- Set default sidebar page to visible
globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default globals.sideBarPageDefault = defaultPage -- Set default sidebar page to default
globals.sideBarPageActive = defaultPage -- Set default sidebar page as active globals.sideBarPageActive = defaultPage -- Set default sidebar page as active
local designPage = sideBar.registerPage("Design") -- Design default page to sidebar instance local designPage = sideBar.registerPage("Design") -- Design default page to sidebar instance
sideBar.registerIcon(designPage, "screenContainerIcon", "tv", "Create a container instance", nil) sideBar.registerIcon(designPage, "screenContainerIcon", "fa:s-tv", "Create a container instance", nil)
sideBar.registerIcon(designPage, "guiFrameIcon", "square-full", "Create a guiFrame instance", nil) sideBar.registerIcon(designPage, "guiFrameIcon", "fa:s-square-full", "Create a guiFrame instance", nil)
sideBar.registerIcon(designPage, "guiTextBoxIcon", "i-cursor", "Create a guiTextBox instance", nil) sideBar.registerIcon(designPage, "guiTextBoxIcon", "fa:s-i-cursor", "Create a guiTextBox instance", nil)
sideBar.registerIcon(designPage, "guiImageIcon", "image", "Create a guiImage instance", nil) sideBar.registerIcon(designPage, "guiImageIcon", "fa:s-image", "Create a guiImage instance", nil)
local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance local modelPage = sideBar.registerPage("Model") -- Register model page to sidebar instance
sideBar.registerIcon(modelPage, "modelIcon", "shapes", "Group instance(s) together", nil) sideBar.registerIcon(modelPage, "modelIcon", "fa:s-shapes", "Group instance(s) together", nil)
local insertPage = sideBar.registerPage("Insert") -- Register insert page to sidebar instance local insertPage = sideBar.registerPage("Insert") -- Register insert page to sidebar instance
sideBar.registerIcon(insertPage, "blockIcon", "cube", "Create a cube instance", nil) sideBar.registerIcon(insertPage, "blockIcon", "fa:s-cube", "Create a cube instance", nil)
sideBar.registerIcon(insertPage, "circleIcon", "circle", "Create a cylinder instance", nil) sideBar.registerIcon(insertPage, "circleIcon", "fa:s-circle", "Create a cylinder instance", nil)
--sideBar.registerIcon(designPage, "triangleIcon", "i-cursor", nil, nil) -- Triangle / Wedge Icon doesn't exist --sideBar.registerIcon(designPage, "triangleIcon", "fa:s-i-cursor", nil, nil) -- Triangle / Wedge Icon doesn't exist
sideBar.registerIcon(insertPage, "scriptIcon", "code", "Create a script instance", nil) sideBar.registerIcon(insertPage, "scriptIcon", "fa:s-code", "Create a script instance", nil)
sideBar.registerIcon(insertPage, "lightIcon", "lightbulb", "Create a light instance", nil) sideBar.registerIcon(insertPage, "lightIcon", "fa:s-lightbulb", "Create a light instance", nil)
local testPage = sideBar.registerPage("Test") -- Register test page to sidebar instance local testPage = sideBar.registerPage("Test") -- Register test page to sidebar instance
sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil) sideBar.registerIcon(testPage, "consoleIcon", "fa:s-terminal", " Open console window", nil)
sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil) sideBar.registerIcon(testPage, "playIcon", "fa:s-play", "Play scene", nil)
sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil) sideBar.registerIcon(testPage, "serverIcon", "fa:s-server", "Configure server", nil)
sideBar.registerIcon(testPage, "fullScreenIcon", "fullscreen", "Toggle full screen", nil) sideBar.registerIcon(testPage, "fullScreenIcon", "fa:s-fullscreen", "Toggle full screen", nil)

View File

@ -16,8 +16,8 @@ local function init(dev)
]]-- ]]--
globals.dev = dev -- Set teverse.dev (previously workshop) instance as a global globals.dev = dev -- Set teverse.dev (previously workshop) instance as a global
globals.user = teverse.networking.localClient -- Set & Streamline user instance as a global globals.user = teverse:isAuthenticated() -- Set & Streamline user instance as a global
globals.developerMode = not globals.dev.localTevGit -- Set developmode boolean as a global globals.developerMode = (not globals.dev.hasLocalTevGit) or (globals.dev:hasLocalTevGit()) -- Set developmode boolean as a global
local loadingScreen = teverse.construct("guiFrame", { local loadingScreen = teverse.construct("guiFrame", {
parent = dev.interface, parent = dev.interface,
@ -30,7 +30,7 @@ local function init(dev)
parent = loadingScreen, parent = loadingScreen,
size = guiCoord(0.5, 0, 0.5, 0), size = guiCoord(0.5, 0, 0.5, 0),
position = guiCoord(0.25, 0, 0.25, 0), position = guiCoord(0.25, 0, 0.25, 0),
textAlign = enums.align.middle, align = enums.align.middle,
backgroundAlpha = 0, backgroundAlpha = 0,
text = "Downloading the latest workshop...\nThis takes longer than a moment during beta." text = "Downloading the latest workshop...\nThis takes longer than a moment during beta."
}) })
@ -55,18 +55,17 @@ return function(dev)
@Returns @Returns
function, method function, method
]]-- ]]--
dev = teverse.dev
local success, message = pcall(init, dev) local success, message = pcall(init, dev)
-- If initialize phase fails, prompt to the error screen -- If initialize phase fails, prompt to the error screen
if (not success) then if (not success) then
teverse.interface:destroyChildren() teverse.interface:destroyAllChildren()
local errorScreen = teverse.construct("guiFrame", { local errorScreen = teverse.construct("guiFrame", {
parent = dev.interface, parent = dev.interface,
size = guiCoord(1, 0, 1, 0), size = guiCoord(1, 0, 1, 0),
backgroundColour = globals.defaultColours.background, backgroundColour = globals.defaultColours.background,
backgroundAlpha = 0,
zIndex = 10000 zIndex = 10000
}) })
@ -75,26 +74,24 @@ return function(dev)
size = guiCoord(0.8, 0, 0.8, 0), size = guiCoord(0.8, 0, 0.8, 0),
position = guiCoord(0.1, 0, 0.1, 0), position = guiCoord(0.1, 0, 0.1, 0),
backgroundColour = globals.defaultColours.background, backgroundColour = globals.defaultColours.background,
backgroundAlpha = 0,
textColour = globals.defaultColours.red, textColour = globals.defaultColours.red,
textAlign = enums.align.topLeft, align = 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.", 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.",
textWrap = true, wrap = true,
textFont = "tevurl:fonts/firaCodeMedium.otf"
}) })
-- Bind the "return" key on the keyboard as temporary fast-reload keybind -- Bind the "return" key on the keyboard as temporary fast-reload keybind
teverse.input:on("keyDown", function(key) teverse.input:on("keyPressed", function(keyboard)
if key == "KEY_RETURN" then if keyboard.key == enums.key["return"] then
teverse.apps:loadWorkshop() teverse:reloadCreate()
end end
end) end)
end end
-- Bind the "f12" key on the keyboard as fast-reload keybind if initialize phase is successful -- Bind the "f12" key on the keyboard as fast-reload keybind if initialize phase is successful
teverse.input:on("keyDown", function(key) teverse.input:on("keyPressed", function(keyboard)
if key == "KEY_F12" then if keyboard.key == enums.key["f12"] then
teverse.apps:loadWorkshop() teverse:reloadCreate()
end end
end) end)
end end