Compare commits

..

38 Commits

Author SHA1 Message Date
Jay 00abd0fa2d update core ui again 2020-08-15 22:57:06 +01:00
Jay 2d1edef756 fixed 2020-08-15 22:44:37 +01:00
Jay 2254ea0567 Merge branch 'master' of https://github.com/teverse/teverse 2020-08-15 22:38:05 +01:00
Jay 101ebdd612 new core ui 2020-08-15 22:38:02 +01:00
Sanjay 016135116c
Merge pull request #82 from teverse/rewrite-tevx
Comment Correction
2020-08-15 12:06:14 -04:00
Sanjay Bhadra 4a2bbd66b4 Comment Correction 2020-08-15 12:05:42 -04:00
Sanjay 687898493f
Merge pull request #81 from teverse/rewrite-tevx
Ignore camera inputs when typing in command bar
2020-08-15 12:00:30 -04:00
Sanjay Bhadra d3841a3db7 ignoreCamerInput global var & restrict camera from moving when typing in command bar 2020-08-15 11:57:55 -04:00
Sanjay Bhadra 5218fa7804 Merge branch 'master' into rewrite-tevx 2020-08-15 11:38:06 -04:00
Sanjay Bhadra 57fdb64a08 Merge branch 'master' into rewrite-tevx 2020-07-31 11:03:53 -04:00
Sanjay Bhadra ca16ccbd55 Implement PlayerScripts ChatSystem 2020-07-31 10:55:21 -04:00
Sanjay Bhadra 279552d399 Init Client & Server base directories 2020-07-22 16:26:59 -04:00
Sanjay Bhadra 2961293ec0 Move legacy playerscripts to archived folder (references) 2020-07-22 16:23:18 -04:00
Sanjay Bhadra 4b0a2d0d04 Merge branch 'master' into rewrite-tevx 2020-07-22 15:45:05 -04:00
Sanjay Bhadra 1b62b5147b Merge branch 'master' into rewrite-tevx 2020-07-20 10:14:02 -04:00
Sanjay Bhadra ef40aa99e4 Merge branch 'master' into rewrite-tevx 2020-07-19 22:00:06 -04:00
Sanjay Bhadra 9c7cd0d0e2 Enabled callbacks for Topbar buttons 2020-07-12 12:50:47 -04:00
Sanjay Bhadra 241a6189af Remove debounce in Camera for more fluid camera movements 2020-07-12 12:46:20 -04:00
Sanjay Bhadra 55c2de261a Remove testing dump method 2020-07-12 12:06:32 -04:00
Sanjay Bhadra 4d54028ded Merge branch 'master' into rewrite-tevx 2020-07-12 11:53:27 -04:00
Sanjay Bhadra 40082cf91b Enabled Callbacks for sidebar options 2020-07-12 11:52:39 -04:00
Sanjay Bhadra 6e3549231b Enabled Camera for 3D Environment 2020-07-12 11:47:59 -04:00
Sanjay Bhadra a0a1c718e4 Enable 3D viewport & setup env. presets 2020-07-12 11:40:57 -04:00
Sanjay Bhadra 29d3d91245 File cleanup 2020-07-03 12:32:22 -04:00
Sanjay Bhadra b706eb031a Command hooks registry 2020-07-03 12:28:50 -04:00
Sanjay Bhadra dc3ad175a1 Merge branch 'master' into rewrite-tevx 2020-07-02 13:17:32 -04:00
Sanjay Bhadra 65134d6b3c Commandbar registers 2020-07-02 13:16:55 -04:00
Sanjay Bhadra c89cb736d9 Command Bar Trigger Setup 2020-06-23 18:03:40 -04:00
Sanjay Bhadra 4c54c818f3 Rename searchBar to commandBar 2020-06-22 22:53:32 -04:00
Sanjay Bhadra 80c8f479bd Merge branch 'master' into rewrite-tevx 2020-06-22 22:49:07 -04:00
Sanjay Bhadra f713a64176 Add Search Bar UI to topbar 2020-06-22 22:42:50 -04:00
Sanjay Bhadra f632affc57 Fix default side menu registers 2020-06-17 13:48:05 -04:00
Sanjay Bhadra 681050139d Merge branch 'master' into rewrite-tevx 2020-05-27 15:00:47 -04:00
Sanjay Bhadra 89ff5aba45 Redesign to fit dashboard screen 2020-05-27 14:59:16 -04:00
Sanjay Bhadra a82eddab75 Merge branch 'master' into rewrite-tevx 2020-05-18 09:29:17 -04:00
Sanjay Bhadra 68cff74b1f Merge branch 'master' into rewrite-tevx 2020-05-17 10:49:56 -04:00
Sanjay Bhadra 81a3ca294c Merge branch 'master' into rewrite-tevx 2020-04-24 21:34:38 -04:00
Sanjay Bhadra 299c254c9f Refactor .parent change in teverse.construct 2020-04-23 19:05:47 -04:00
5 changed files with 154 additions and 34 deletions

View File

@ -1,6 +1,8 @@
-- Copyright 2020- Teverse
-- This script is required when workshop is loaded & acts as the 3D Camera for the 3D Environment
local globals = require("tevgit:workshop/library/globals.lua") -- globals; variables or instances that can be shared between files
local keyMap = {
[tonumber(enums.keys.KEY_W)] = vector3(0, 0, 1),
[tonumber(enums.keys.KEY_S)] = vector3(0, 0, -1),
@ -19,14 +21,14 @@ local db = false
teverse.input:on("keyDown", function(key)
local mapped = keyMap[tonumber(key)]
if mapped then
while sleep() and teverse.input:isKeyDown(key) do
while sleep() and teverse.input:isKeyDown(key) and not globals.ignoreCameraInput do
cam.position = cam.position + (cam.rotation * mapped * moveStep)
end
end
end)
teverse.input:on("mouseMoved", function( movement )
if teverse.input:isMouseButtonDown(3) then
if teverse.input:isMouseButtonDown(3) and not globals.ignoreCameraInput then
local pitch = quaternion.euler(movement.y * rotateStep, 0, 0)
local yaw = quaternion.euler(0, movement.x * rotateStep, 0)

View File

@ -78,6 +78,7 @@ local new = function(properties)
Clears the logs
]]
list = {}
teverse.debug:clearOutputHistory()
viewScroll:destroyChildren()
interface.reload()
viewScroll.canvasOffset = vector2()

View File

@ -13,14 +13,16 @@ teverse.construct("guiFrame", {
if teverse.dev.localTevGit then
teverse.construct("guiTextBox", {
parent = teverse.coreInterface,
size = guiCoord(0,60, 0, 12),
position = guiCoord(1, -70, 1, -59),
size = guiCoord(0,40, 0, 8),
position = guiCoord(0, 2, 1, -10),
zIndex = 1000,
textSize = 12,
textSize = 8,
text = "Local TevGit",
textAlign = "middleRight",
textAlpha = 0.5,
backgroundAlpha = 0
textAlpha = 0.8,
backgroundAlpha = 0.5,
textAlign = "middle",
strokeRadius = 4
})
end
@ -38,16 +40,11 @@ teverse.input:on("keyUp", function(key)
end
end)
local settingsButton = teverse.construct("guiIcon", {
local settingsButton = teverse.construct("guiFrame", {
parent = teverse.coreInterface,
size = guiCoord(0, 35, 0, 35),
position = guiCoord(1, -45, 1, -45),
iconId = "wrench",
iconType = "faSolid",
iconColour = colour(0, 0, 0),
iconMax = 12,
iconAlpha = 0.75,
strokeRadius = 2,
size = guiCoord(0, 66, 0, 66),
position = guiCoord(1, -33, 1, -33),
strokeRadius = 33,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05,
backgroundAlpha = 1,
@ -55,44 +52,167 @@ local settingsButton = teverse.construct("guiIcon", {
zIndex = 1000
})
local keyboardSupport = false
if _TEV_VERSION_MINOR >= 27 then
keyboardSupport = not teverse.input.hasScreenKeyboard
end
if keyboardSupport then
settingsButton.visible = false
local reminder = teverse.construct("guiTextBox", {
parent = teverse.coreInterface,
size = guiCoord(0, 145, 0, 14),
position = guiCoord(1, -160, 1, -14),
zIndex = 1000,
textSize = 12,
text = "<ESC> : main menu at anytime",
textAlpha = 0,
textAlign = "middle",
textFont = "tevurl:fonts/openSansBold.ttf",
textWrap = true,
backgroundColour = colour.rgb(45, 45, 45),
textColour = colour.rgb(255, 255, 255),
backgroundAlpha = 0
})
spawn(function()
teverse.tween:begin(reminder, 0.5, {
position = guiCoord(1, -145, 1, -14),
textAlpha = 1.0,
backgroundAlpha = 1.0,
strokeAlpha = 0.1,
dropShadowAlpha = 0.1
}, "inOutQuad")
sleep(1.5)
teverse.tween:begin(reminder, 0.5, {
position = guiCoord(1, 2, 1, -14)
}, "inOutQuad")
sleep(0.5)
reminder:destroy()
end)
end
teverse.construct("guiIcon", {
parent = settingsButton,
size = guiCoord(0, 30, 0, 30),
position = guiCoord(0, 5, 0, 5),
iconId = "wrench",
iconType = "faSolid",
iconColour = colour(0, 0, 0),
iconMax = 10,
iconAlpha = 0.75,
active = false
})
local container = teverse.construct("guiFrame", {
parent = teverse.coreInterface,
size = guiCoord(0, 100, 0, 35),
position = guiCoord(1, -155, 1, -45),
backgroundAlpha = 0,
size = guiCoord(1, 200, 1, 200),
position = guiCoord(0, -100, 0, -100),
backgroundAlpha = 0.85,
backgroundColour = colour.rgb(0, 0, 0),
visible = false
})
local inner = teverse.construct("guiFrame", {
parent = container,
size = guiCoord(0, 100, 0, 50),
position = guiCoord(0.5, -50, 0.5, -25),
strokeRadius = 25,
strokeAlpha = 0.3,
})
local console = require("tevgit:core/teverseUI/console.lua")
local lastClick = 0
settingsButton:on("mouseLeftUp", function()
local function onClick()
if os.clock() - lastClick < 0.4 then
-- double click
lastClick = 0
console.visible = not console.visible
else
lastClick = os.clock()
settingsButton.visible = false
container.visible = true
repeat sleep(0.1) until teverse.input.mousePosition.y < container.absolutePosition.y - 25
container.visible = false
container.backgroundAlpha = 0
container.position = guiCoord(0, -100, 0, -80)
teverse.tween:begin(container, 0.25, {
position = guiCoord(0, -100, 0, -100),
backgroundAlpha = 0.9
}, "inOutQuad")
end
end
settingsButton:on("mouseLeftUp", onClick)
teverse.input:on("keyUp", function(key)
if key == "KEY_ESCAPE" then
if container.visible then
container.visible = false
if not keyboardSupport then
settingsButton.visible = true
end
else
onClick()
end
end
end)
local homeButton = teverse.construct("guiIcon", {
parent = container,
size = guiCoord(0, 35, 0, 35),
position = guiCoord(1, -35, 0, 0),
iconId = "home",
local closeButton = teverse.construct("guiIcon", {
parent = inner,
size = guiCoord(0, 30, 0, 30),
position = guiCoord(0, 10, 0, 10),
iconId = "arrow-left",
iconType = "faSolid",
iconColour = colour(0, 0, 0),
iconMax = 12,
iconAlpha = 0.75,
strokeRadius = 2,
strokeRadius = 15,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05,
backgroundAlpha = 1
})
closeButton:on("mouseEnter", function()
closeButton.backgroundColour = colour.rgb(45, 45, 45)
closeButton.iconColour = colour.rgb(255, 255, 255)
end)
closeButton:on("mouseExit", function()
closeButton.backgroundColour = colour.rgb(255, 255, 2555)
closeButton.iconColour = colour.rgb(0, 0, 0)
end)
closeButton:on("mouseLeftUp", function()
container.visible = false
if not keyboardSupport then
settingsButton.visible = true
end
end)
local homeButton = teverse.construct("guiIcon", {
parent = inner,
size = guiCoord(0, 30, 0, 30),
position = guiCoord(0, 60, 0, 10),
iconId = "home",
iconType = "faSolid",
iconColour = colour(0, 0, 0),
iconMax = 12,
iconAlpha = 0.75,
strokeRadius = 15,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05,
backgroundAlpha = 1
})
homeButton:on("mouseEnter", function()
homeButton.backgroundColour = colour.rgb(45, 45, 45)
homeButton.iconColour = colour.rgb(255, 255, 255)
end)
homeButton:on("mouseExit", function()
homeButton.backgroundColour = colour.rgb(255, 255, 2555)
homeButton.iconColour = colour.rgb(0, 0, 0)
end)
homeButton:on("mouseLeftUp", function()
teverse.apps:loadDashboard()
end)

View File

@ -5,6 +5,7 @@ return {
dev = nil, -- Holds workshop instance and is set in main.lua
user = nil, -- Holds user instance and is set in main.lua
developerMode = false, -- Holds the developer_mode boolean and is set in main.lua
ignoreCameraInput = false, -- Determines if the camera should be able to move or not (useful when we're trying to type and we don't want the camera to move)
commandGroups = {}, -- Holds the command groups that have been registered (~\library\toolchain\commands.lua)
defaultColours = { -- Default colors used for theming UI components (~\library\ui\components)
primary = colour.rgb(52, 58, 64),

View File

@ -111,7 +111,6 @@ return {
strokeRadius = 3
})
-- Test command Bar
local commandBarIcon = teverse.construct("guiIcon", {
parent = container,
size = guiCoord(0, 32, 0, 32),
@ -130,7 +129,6 @@ return {
parent = container,
size = guiCoord(0, 200, 0, 32),
position = guiCoord(0, 191, 0, 4),
--text = " >",
textAlign = "middleLeft",
textFont = "tevurl:fonts/firaCodeBold.otf",
textSize = 15,
@ -158,19 +156,17 @@ return {
end)
commandBarField:on("keyDown", function(key)
globals.ignoreCameraInput = true -- Restrict the camera from moving if typing in command bar
if key == "KEY_RETURN" then
print("Command: "..(commandBarField.text))
-- Invoke Command Trigger
commands.parse(commandBarField.text)
commandBarField.text = " >"
globals.ignoreCameraInput = false -- Re-enable the camera when the commandbar is done being used
end
end)
-- End Test Command Bar
self.registerIcon = function(icon, callback)
local icon = teverse.construct("guiIcon", {
parent = container,