Compare commits

..

8 Commits

Author SHA1 Message Date
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
Jay 53875f6611 Increased canvas size 2020-07-02 20:41:28 +01:00
7 changed files with 33 additions and 26 deletions

View File

@ -1,3 +1,6 @@
-- Copyright 2020- Teverse
-- This script is required when workshop is loaded & acts as the 3D Camera for the 3D Environment
local keyMap = { local keyMap = {
[tonumber(enums.keys.KEY_W)] = vector3(0, 0, 1), [tonumber(enums.keys.KEY_W)] = vector3(0, 0, 1),
[tonumber(enums.keys.KEY_S)] = vector3(0, 0, -1), [tonumber(enums.keys.KEY_S)] = vector3(0, 0, -1),
@ -14,17 +17,12 @@ local cam = teverse.scene.camera
local db = false local db = false
teverse.input:on("keyDown", function(key) teverse.input:on("keyDown", function(key)
if db then return end
db = true
local mapped = keyMap[tonumber(key)] local mapped = keyMap[tonumber(key)]
if mapped then if mapped then
while sleep() and teverse.input:isKeyDown(key) do while sleep() and teverse.input:isKeyDown(key) do
cam.position = cam.position + (cam.rotation * mapped * moveStep) cam.position = cam.position + (cam.rotation * mapped * moveStep)
end end
end end
db = false
end) end)
teverse.input:on("mouseMoved", function( movement ) teverse.input:on("mouseMoved", function( movement )

View File

@ -108,7 +108,7 @@ return {
local function calculateScrollHeight() local function calculateScrollHeight()
local y = 0 local y = 0
for _,v in pairs(appsContainer.children) do for _,v in pairs(appsContainer.children) do
y = math.max(y, v.absolutePosition.y + 320) y = math.max(y, v.absolutePosition.y + 350)
end end
appsContainer.size = guiCoord(1.0, -20, 0, y - appsContainer.absolutePosition.y) appsContainer.size = guiCoord(1.0, -20, 0, y - appsContainer.absolutePosition.y)
page.canvasSize = guiCoord(1, 0, 0, y - appsContainer.absolutePosition.y) page.canvasSize = guiCoord(1, 0, 0, y - appsContainer.absolutePosition.y)

View File

@ -0,0 +1,21 @@
-- Copyright 2020- Teverse
-- This script constructs (or builds) the baseline (or default) environment
return {
default = function()
teverse.scene.simulate = true
teverse.scene.camera.position = vector3(0, 1, -10)
teverse.scene.camera.rotation = quaternion.euler(math.rad(25), 0, 0)
local light = teverse.construct("directionalLight", {
rotation = quaternion.euler(math.rad(-45), math.rad(20), 0),
colour = colour(5, 5, 5)
})
local base = teverse.construct("block", {
position = vector3(0, -10, 0),
scale = vector3(30, 1, 30),
colour = colour(1, 1, 1)
})
end
}

View File

@ -3,20 +3,6 @@
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
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
return { return {
createGroup = function(id) createGroup = function(id)
local data = {} local data = {}

View File

@ -21,8 +21,6 @@ return {
local count = 0 local count = 0
self = data self = data
self.id = idValue -- Unique Indentifier self.id = idValue -- Unique Indentifier
--self.pages = {} -- Where we store our pages for sidebar
--self.activeTool = nil
local toolsContainer = teverse.construct("guiFrame", { local toolsContainer = teverse.construct("guiFrame", {
parent = teverse.interface, parent = teverse.interface,
@ -83,7 +81,7 @@ return {
end) end)
_icon:on("mouseLeftUp", function() _icon:on("mouseLeftUp", function()
_icon.dropShadowAlpha = 0.2 callback()
end) end)
_count = _count + 1 _count = _count + 1
@ -114,7 +112,7 @@ return {
end) end)
icon:on("mouseLeftUp", function() icon:on("mouseLeftUp", function()
icon.dropShadowAlpha = 0.2 callback()
end) end)
count = count + 1 count = count + 1

View File

@ -195,8 +195,7 @@ return {
end) end)
icon:on("mouseLeftUp", function() icon:on("mouseLeftUp", function()
icon.iconAlpha = 1.0 callback()
icon.dropShadowAlpha = 0.2
end) end)
count = count + 1 count = count + 1

View File

@ -2,6 +2,8 @@
-- This script is required when workshop is loaded. -- This script is required when workshop is loaded.
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 environmentPresets = require("tevgit:workshop/library/environment/presets.lua") -- 3D environment presets (or defaults)
local camera = require("tevgit:core/3d/camera.lua") -- 3D Camera for 3D Environment
local function init(dev) local function init(dev)
--[[ --[[
@ -42,6 +44,9 @@ local function init(dev)
if loadingScreen then if loadingScreen then
loadingScreen:destroy() loadingScreen:destroy()
end end
-- Setup Basic Default Scene (3D viewport)
environmentPresets.default()
end end
return function(dev) return function(dev)