Compare commits

...

12 Commits

Author SHA1 Message Date
Sanjay Bhadra 81a3ca294c Merge branch 'master' into rewrite-tevx 2020-04-24 21:34:38 -04:00
Jay deb10db9da Hide scrollbar on ios 2020-04-24 23:59:28 +01:00
Jay 98ea58ce13 colour fixes 2020-04-24 23:19:34 +01:00
Jay f372771de9 Debounce fix feed 2020-04-24 22:56:54 +01:00
Jay e2ea779051 Hide develop tab on iPhone 2020-04-24 22:52:45 +01:00
Jay 0f6af4a587 Splash screen 2020-04-24 21:55:28 +01:00
teverse 62b6aad1e7 Basic progress bar on updator. 2020-04-24 17:12:21 +01:00
Jay 2dfc1f6dd5 TevX support 2020-04-24 14:14:26 +01:00
Sanjay e5d3561d1a
Refactored Workshop to TevX Format (#71)
* Refactored Workshop to TevX Format

* Refactor .parent change in teverse.construct
2020-04-24 09:05:07 +01:00
teverse ff3fac5c47 Merge branch 'master' of https://github.com/teverse/teverse 2020-04-22 18:00:33 +01:00
teverse 5a1d65ca95 Login screen friendlier for 1080p 2020-04-22 18:00:29 +01:00
Jay cc1f2659b1 fix 2020-04-22 17:59:20 +01:00
15 changed files with 230 additions and 123 deletions

View File

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

View File

@ -64,5 +64,59 @@ 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,7 +61,6 @@ 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,
@ -74,11 +73,13 @@ 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", {
@ -270,7 +271,7 @@ return {
local feedItems = teverse.construct("guiFrame", { local feedItems = teverse.construct("guiFrame", {
parent = feed, parent = feed,
backgroundAlpha = 1, backgroundAlpha = 0,
clip = true clip = true
}) })
@ -309,30 +310,34 @@ 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[1].id == newestFeed then if #json > 0 then
-- no change from last refresh if json[1].id == newestFeed then
return nil -- no change from last refresh
else return nil
-- may require refactoring else
for _,v in pairs(feedItems.children) do -- may require refactoring
if v.name == "feedItem" then for _,v in pairs(feedItems.children) do
v:destroy() if v.name == "feedItem" then
v:destroy()
end
end end
end end
end newestFeed = json[1].id
newestFeed = json[1].id local y = 50
local y = 50 for _,v in pairs(json) do
for _,v in pairs(json) do local date = os.date("%d/%m/%Y %H:%M", os.parseISO8601(v.postedAt))
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)
local item = newFeedItem("tevurl:asset/user/" .. v.postedBy.id, v.postedBy.username, date, v.message) item.parent = feedItems
item.parent = feedItems local dy = item:child("body").textDimensions.y
local dy = item:child("body").textDimensions.y item.size = guiCoord(1, -20, 0, dy + 28)
item.size = guiCoord(1, -20, 0, dy + 28) item.position = guiCoord(0, 10, 0, y)
item.position = guiCoord(0, 10, 0, y) y = y + dy + 28
y = y + dy + 28 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
@ -352,6 +357,7 @@ 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,7 +137,10 @@ 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"))
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 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, -750, 0.5, -750), position = guiCoord(0.5, -1500, 0.5, -750),
size = guiCoord(0, 1500, 0, 1500), size = guiCoord(0, 3000, 0, 1500),
parent = main, parent = main,
backgroundAlpha = 0, backgroundAlpha = 0,
image = "tevurl:img/tTiled.png", image = "tevurl:img/tTiled.png",
imageBottomRight = vector2(90, 90), imageBottomRight = vector2(180, 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, login.textDimensions.x + 30, 0, 26) login.size = guiCoord(0, 100, 0, 26)
login.position = guiCoord(0.5, -(login.textDimensions.x + 30)/2, 0.5, 45) login.position = guiCoord(0.5, -50, 0.5, 45)
local db = false local db = false
local listenerid = login:on("mouseLeftDown", function() local listenerid = login:on("mouseLeftDown", function()

View File

@ -23,7 +23,8 @@ 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,6 +50,13 @@ 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."
@ -58,4 +65,9 @@ end
teverse.networking:on("_update", function(message) teverse.networking:on("_update", function(message)
print('got ', message) print('got ', message)
gui.text = message gui.text = message
end)
teverse.networking:on("_downloadProgress", function(str)
local pcnt = tonumber(str)
progressBar.size = guiCoord(pcnt/100, 0, 0, 5)
end) 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,
align = enums.align.middle textAlign = 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:destroyAllChildren() workspace:destroyChildren()
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:destroyAllChildren() mainContainer:destroyChildren()
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:destroyAllChildren() instructions:destroyChildren()
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,
wrap = true, textWrap = 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:destroyAllChildren() mainContainer:destroyChildren()
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,12 +37,13 @@ return {
backgroundAlpha = 0 backgroundAlpha = 0
}) })
teverse.construct("guiImage", { teverse.construct("guiIcon", {
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),
texture = "fa:s-caret-up", iconId = "caret-up",
imageColour = globals.defaultColours.secondary, iconType = "faSolid",
iconColour = globals.defaultColours.secondary,
backgroundColour = globals.defaultColours.red, backgroundColour = globals.defaultColours.red,
backgroundAlpha = 0 backgroundAlpha = 0
}) })
@ -58,12 +59,13 @@ return {
borderColour = globals.defaultColours.secondary borderColour = globals.defaultColours.secondary
}) })
teverse.construct("guiImage", { teverse.construct("guiIcon", {
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),
texture = "fa:s-info-circle", iconId = "info-circle",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -75,8 +77,8 @@ return {
fontSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
align = enums.align.middle, textAlign = enums.align.middle,
wrap = true textWrap = true
}) })
self.display = function() container.visible = true end -- Display tooltip method self.display = function() container.visible = true end -- Display tooltip method
@ -93,12 +95,13 @@ return {
backgroundAlpha = 0 backgroundAlpha = 0
}) })
teverse.construct("guiImage", { teverse.construct("guiIcon", {
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),
texture = "fa:s-caret-left", iconId = "caret-left",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.red, backgroundColour = globals.defaultColours.red,
backgroundAlpha = 0 backgroundAlpha = 0
}) })
@ -114,12 +117,13 @@ return {
borderColour = globals.defaultColours.primary borderColour = globals.defaultColours.primary
}) })
teverse.construct("guiImage", { teverse.construct("guiIcon", {
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),
texture = "fa:s-info-circle", iconId = "fa:s-info-circle",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -131,8 +135,8 @@ return {
fontSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
align = enums.align.middle, textAlign = enums.align.middle,
wrap = true textWrap = true
}) })
self.display = function() container.visible = true end -- Display tooltip method self.display = function() container.visible = true end -- Display tooltip method

View File

@ -43,39 +43,43 @@ return {
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local selectTool = teverse.construct("guiImage", { local selectTool = teverse.construct("guiIcon", {
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),
texture = "fa:s-location-arrow", iconId = "location-arrow",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local moveTool = teverse.construct("guiImage", { local moveTool = teverse.construct("guiIcon", {
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),
texture = "fa:s-arrows-alt-h", iconId = "arrows-alt-h",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local rotateTool = teverse.construct("guiImage", { local rotateTool = teverse.construct("guiIcon", {
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),
texture = "fa:s-sync", iconId = "sync",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local sizeTool = teverse.construct("guiImage", { local sizeTool = teverse.construct("guiIcon", {
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),
texture = "fa:s-expand", iconId = "fa:s-expand",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -138,13 +142,14 @@ 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("guiImage", { local iconImage = teverse.construct("guiIcon", {
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
texture = icon, iconId = icon,
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })

View File

@ -33,14 +33,15 @@ return {
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
teverse.construct("guiImage", { teverse.construct("guiIcon", {
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),
texture = titleIconValue, iconId = titleIconValue,
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
handleEvents = false, active = false,
}) })
teverse.construct("guiTextBox", { teverse.construct("guiTextBox", {
@ -73,7 +74,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,
@ -84,30 +85,33 @@ return {
zIndex = 100 zIndex = 100
}) })
local undoButton = teverse.construct("guiImage", { local undoButton = teverse.construct("guiIcon", {
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),
texture = "fa:s-arrow-left", iconId = "arrow-left",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local redoButton = teverse.construct("guiImage", { local redoButton = teverse.construct("guiIcon", {
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),
texture = "fa:s-arrow-right", iconId = "arrow-right",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local settingsButton = teverse.construct("guiImage", { local settingsButton = teverse.construct("guiIcon", {
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),
texture = "fa:s-sliders-h", iconId = "sliders-h",
imageColour = globals.defaultColours.primary, iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -133,7 +137,7 @@ return {
text = name, text = name,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
fontSize = 30, fontSize = 30,
align = enums.align.middle, textAlign = 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", "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 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", "fa:s-folder-open", "Open Folder", nil) sideBar.registerIcon(defaultPage, "openFolderIcon", "folder-open", "Open Folder", nil)
sideBar.registerIcon(defaultPage, "newFileIcon", "fa:s-file", "Create new file", nil) sideBar.registerIcon(defaultPage, "newFileIcon", "file", "Create new file", nil)
sideBar.registerIcon(defaultPage, "uploadFileIcon", "fa:s-file-upload", "Upload current file", nil) sideBar.registerIcon(defaultPage, "uploadFileIcon", "file-upload", "Upload current file", nil)
sideBar.registerIcon(defaultPage, "downloadFileIcon", "fa:s-file-download", "Download current file", nil) sideBar.registerIcon(defaultPage, "downloadFileIcon", "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, "importFileIcon", "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, "exportFileIcon", "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", "fa:s-tv", "Create a container instance", nil) sideBar.registerIcon(designPage, "screenContainerIcon", "tv", "Create a container instance", nil)
sideBar.registerIcon(designPage, "guiFrameIcon", "fa:s-square-full", "Create a guiFrame instance", nil) sideBar.registerIcon(designPage, "guiFrameIcon", "square-full", "Create a guiFrame instance", nil)
sideBar.registerIcon(designPage, "guiTextBoxIcon", "fa:s-i-cursor", "Create a guiTextBox instance", nil) sideBar.registerIcon(designPage, "guiTextBoxIcon", "i-cursor", "Create a guiTextBox instance", nil)
sideBar.registerIcon(designPage, "guiImageIcon", "fa:s-image", "Create a guiImage instance", nil) sideBar.registerIcon(designPage, "guiImageIcon", "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", "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 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, "blockIcon", "cube", "Create a cube instance", nil)
sideBar.registerIcon(insertPage, "circleIcon", "fa:s-circle", "Create a cylinder instance", nil) sideBar.registerIcon(insertPage, "circleIcon", "circle", "Create a cylinder instance", nil)
--sideBar.registerIcon(designPage, "triangleIcon", "fa:s-i-cursor", nil, nil) -- Triangle / Wedge Icon doesn't exist --sideBar.registerIcon(designPage, "triangleIcon", "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, "scriptIcon", "code", "Create a script instance", nil)
sideBar.registerIcon(insertPage, "lightIcon", "fa:s-lightbulb", "Create a light instance", nil) sideBar.registerIcon(insertPage, "lightIcon", "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", "fa:s-terminal", " Open console window", nil) sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil)
sideBar.registerIcon(testPage, "playIcon", "fa:s-play", "Play scene", nil) sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil)
sideBar.registerIcon(testPage, "serverIcon", "fa:s-server", "Configure server", nil) sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil)
sideBar.registerIcon(testPage, "fullScreenIcon", "fa:s-fullscreen", "Toggle full screen", nil) sideBar.registerIcon(testPage, "fullScreenIcon", "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:isAuthenticated() -- Set & Streamline user instance as a global globals.user = teverse.networking.localClient -- Set & Streamline user instance as a global
globals.developerMode = (not globals.dev.hasLocalTevGit) or (globals.dev:hasLocalTevGit()) -- Set developmode boolean as a global globals.developerMode = not globals.dev.localTevGit -- 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),
align = enums.align.middle, textAlign = 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,17 +55,18 @@ 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:destroyAllChildren() teverse.interface:destroyChildren()
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
}) })
@ -74,24 +75,26 @@ 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,
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.", 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 -- Bind the "return" key on the keyboard as temporary fast-reload keybind
teverse.input:on("keyPressed", function(keyboard) teverse.input:on("keyDown", function(key)
if keyboard.key == enums.key["return"] then if key == "KEY_RETURN" then
teverse:reloadCreate() teverse.apps:loadWorkshop()
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("keyPressed", function(keyboard) teverse.input:on("keyDown", function(key)
if keyboard.key == enums.key["f12"] then if key == "KEY_F12" then
teverse:reloadCreate() teverse.apps:loadWorkshop()
end end
end) end)
end end