Compare commits

..

No commits in common. "b30fbca7457167cfdcbbe95fb568a715cbfead8e" and "4c83652c300d6c7a62ff79ff74438f7e4c10322b" have entirely different histories.

4 changed files with 48 additions and 46 deletions

View File

@ -53,10 +53,10 @@ return {
size = guiCoord(0.95, 0, 0.4, 0), size = guiCoord(0.95, 0, 0.4, 0),
position = guiCoord(0.025, 0, 0.23, 0), position = guiCoord(0.025, 0, 0.23, 0),
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
strokeAlpha = 1, borderAlpha = 1,
strokeRadius = 5, borderRadius = 5,
strokeWidth = 3, borderWidth = 3,
strokeColour = globals.defaultColours.secondary borderColour = globals.defaultColours.secondary
}) })
teverse.construct("guiIcon", { teverse.construct("guiIcon", {
@ -74,7 +74,7 @@ return {
size = guiCoord(0.82, 0, 1, 0), size = guiCoord(0.82, 0, 1, 0),
position = guiCoord(0.15, 0, 0, 0), position = guiCoord(0.15, 0, 0, 0),
text = text, text = text,
textSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle, textAlign = enums.align.middle,
@ -111,17 +111,17 @@ return {
size = guiCoord(0.8, 0, 0.9, 0), size = guiCoord(0.8, 0, 0.9, 0),
position = guiCoord(0.133, 0, 0.05, 0), position = guiCoord(0.133, 0, 0.05, 0),
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
strokeAlpha = 1, borderAlpha = 1,
strokeRadius = 5, borderRadius = 5,
strokeWidth = 3, borderWidth = 3,
strokeColour = globals.defaultColours.primary borderColour = globals.defaultColours.primary
}) })
teverse.construct("guiIcon", { 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),
iconId = "info-circle", iconId = "fa:s-info-circle",
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
@ -132,7 +132,7 @@ return {
size = guiCoord(0.82, 0, 1, 0), size = guiCoord(0.82, 0, 1, 0),
position = guiCoord(0.15, 0, 0, 0), position = guiCoord(0.15, 0, 0, 0),
text = text, text = text,
textSize = 16, fontSize = 16,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle, textAlign = enums.align.middle,

View File

@ -24,29 +24,29 @@ return {
teverse.construct("guiFrame", { teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
size = guiCoord(0, 40, 0, 10), size = guiCoord(0.04, 0, 0.015, 0),
position = guiCoord(0, 0, 0, 40), position = guiCoord(0, 0, 0.05, 0),
backgroundColour = globals.defaultColours.secondary, backgroundColour = globals.defaultColours.secondary,
}) })
teverse.construct("guiFrame", { teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
size = guiCoord(0, 40, 0, 10), size = guiCoord(0.04, 0, 0.015, 0),
position = guiCoord(0, 0, 0, 180), position = guiCoord(0, 0, 0.24, 0),
backgroundColour = globals.defaultColours.secondary, backgroundColour = globals.defaultColours.secondary,
}) })
local toolsContainer = teverse.construct("guiFrame", { local toolsContainer = teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
size = guiCoord(0, 40, 0, 130), size = guiCoord(0.04, 0, 0.18, 0),
position = guiCoord(0, 0, 0, 50), position = guiCoord(0, 0, 0.065, 0),
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local selectTool = teverse.construct("guiIcon", { 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, 10), position = guiCoord(0.25, 0, 0.1, 0),
iconId = "location-arrow", iconId = "location-arrow",
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
@ -56,7 +56,7 @@ return {
local moveTool = teverse.construct("guiIcon", { 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, 40), position = guiCoord(0.25, 0, 0.32, 0),
iconId = "arrows-alt-h", iconId = "arrows-alt-h",
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
@ -66,7 +66,7 @@ return {
local rotateTool = teverse.construct("guiIcon", { 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, 70), position = guiCoord(0.25, 0, 0.54, 0),
iconId = "sync", iconId = "sync",
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
@ -76,8 +76,8 @@ return {
local sizeTool = teverse.construct("guiIcon", { 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, 100), position = guiCoord(0.25, 0, 0.76, 0),
iconId = "expand", iconId = "fa:s-expand",
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
@ -86,8 +86,8 @@ return {
local moreToolsContainer = teverse.construct("guiFrame", { local moreToolsContainer = teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
name = "moreToolsContainer", name = "moreToolsContainer",
size = guiCoord(0, 40, 1, -190), size = guiCoord(0.04, 0, 1, 0),
position = guiCoord(0, 0, 0, 190), position = guiCoord(0, 0, 0.255, 0),
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -146,7 +146,7 @@ return {
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, 10 + (#page.children*30)), -- 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, iconId = icon,
iconType = "faSolid", iconType = "faSolid",
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
@ -158,12 +158,12 @@ return {
--button:mouseLeftPressed(callback) -- When button is clicked, perform callback action --button:mouseLeftPressed(callback) -- When button is clicked, perform callback action
-- When mouse hovers over button, display tooltip -- When mouse hovers over button, display tooltip
iconImage:on("mouseEnter", function() iconImage:on("mouseFocused", function()
_tooltip.display() _tooltip.display()
end) end)
-- When mouse leaves from button, hide tooltip -- When mouse leaves from button, hide tooltip
iconImage:on("mouseExit", function() iconImage:on("mouseUnfocused", function()
_tooltip.hide() _tooltip.hide()
end) end)
end end

View File

@ -28,7 +28,7 @@ return {
local container = teverse.construct("guiFrame", { local container = teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
size = guiCoord(1, 0, 0, 40), size = guiCoord(1, 0, 0.05, 0),
position = guiCoord(0, 0, 0, 0), position = guiCoord(0, 0, 0, 0),
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
@ -50,17 +50,19 @@ return {
position = guiCoord(0.04, 0, 0.05, 0), position = guiCoord(0.04, 0, 0.05, 0),
text = titleValue, text = titleValue,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
textFont = "tevurl:fonts/openSansBold.ttf", fontFile = "local:OpenSans-Bold.ttf",
textSize = 30 fontSize = 30,
readOnly = true
}) })
teverse.construct("guiTextBox", { teverse.construct("guiTextBox", {
parent = container, parent = container,
size = guiCoord(0.48, 0, 0.1, 0), size = guiCoord(0.48, 0, 0.1, 0),
position = guiCoord(0.86, 0, 0.1, 0), position = guiCoord(0.86, 0, 0.1, 0),
text = globals.user.name, text = globals.user[2],
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
textSize = 25 fontSize = 25,
readOnly = true
}) })
local userIcon = teverse.construct("guiFrame", { local userIcon = teverse.construct("guiFrame", {
@ -68,7 +70,7 @@ return {
size = guiCoord(0, 32, 0, 32), size = guiCoord(0, 32, 0, 32),
position = guiCoord(0.82, 0, 0, 0), position = guiCoord(0.82, 0, 0, 0),
backgroundColour = globals.defaultColours.primary, backgroundColour = globals.defaultColours.primary,
strokeRadius = 100 borderRadius = 100
}) })
local statusIcon = teverse.construct("guiFrame", { local statusIcon = teverse.construct("guiFrame", {
@ -76,10 +78,10 @@ return {
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,
strokeWidth = 2, borderWidth = 2,
strokeColour = globals.defaultColours.white, borderColour = globals.defaultColours.white,
strokeAlpha = 1, borderAlpha = 1,
strokeRadius = 32, borderRadius = 32,
zIndex = 100 zIndex = 100
}) })
@ -112,7 +114,7 @@ return {
iconColour = globals.defaultColours.primary, iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white, backgroundColour = globals.defaultColours.white,
}) })
local test = self
self.register = function(name, tooltip, page) self.register = function(name, tooltip, page)
--[[ --[[
@Description @Description
@ -127,21 +129,21 @@ return {
Void, null, nil Void, null, nil
]]-- ]]--
table.insert(test.keys, {name}) table.insert(self.keys, {name})
local button = teverse.construct("guiTextBox", { local button = teverse.construct("guiButton", {
parent = container, parent = container,
size = guiCoord(0.056, 0, 0.9, 0), size = guiCoord(0.056, 0, 0.9, 0),
position = guiCoord(0.2+(#test.keys*0.07), 0, 0.05, 0), position = guiCoord(0.2+(#self.keys*0.07), 0, 0.05, 0),
text = name, text = name,
textColour = globals.defaultColours.primary, textColour = globals.defaultColours.primary,
textSize = 22, fontSize = 30,
textAlign = enums.align.middle, textAlign = enums.align.middle,
zIndex = 100 zIndex = 100
}) })
local _tooltip = toolTip.construct("vertical", button, tooltip) -- Initialize tooltip instance local _tooltip = toolTip.construct("vertical", button, tooltip) -- Initialize tooltip instance
button:on("mouseLeftDown", function() button:mouseLeftPressed(function()
globals.sideBarPageActive.visible = (not globals.sideBarPageActive.visible) -- Unlist active page from view globals.sideBarPageActive.visible = (not globals.sideBarPageActive.visible) -- Unlist active page from view
if globals.sideBarPageActive == page then -- If the same page is clicked twice, unlist and replace with default page if globals.sideBarPageActive == page then -- If the same page is clicked twice, unlist and replace with default page
globals.sideBarPageActive = globals.sideBarPageDefault globals.sideBarPageActive = globals.sideBarPageDefault
@ -153,12 +155,12 @@ return {
end) end)
-- When mouse hovers over button, display tooltip -- When mouse hovers over button, display tooltip
button:on("mouseEnter", function() button:on("mouseFocused", function()
_tooltip.display() _tooltip.display()
end) end)
-- When mouse leaves from button, hide tooltip -- When mouse leaves from button, hide tooltip
button:on("mouseExit", function() button:on("mouseUnfocused", function()
_tooltip.hide() _tooltip.hide()
end) end)
end end

View File

@ -44,7 +44,7 @@ local testPage = sideBar.registerPage("Test") -- Register test page to sidebar i
sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil) sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil)
sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil) sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil)
sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil) sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil)
sideBar.registerIcon(testPage, "fullScreenIcon", "expand-alt", "Toggle full screen", nil) sideBar.registerIcon(testPage, "fullScreenIcon", "fullscreen", "Toggle full screen", nil)