1
0
mirror of https://github.com/teverse/teverse synced 2025-08-25 15:44:46 +02:00

Compare commits

..

No commits in common. "9fdca05465d6130f08b744a370575ad5e2045c77" and "89bf079b703254ed573dcad1ed53ce08f2a520ab" have entirely different histories.

7 changed files with 11 additions and 45 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
.DS_Store
notes.txt
.DS_Store

BIN
workshop/.DS_Store vendored Normal file

Binary file not shown.

BIN
workshop/controllers/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -128,23 +128,12 @@ return {
-- fire a ray, exclude selected items.
local hits, didExclude = engine.physics:rayTestScreenAllHits(engine.input.mousePosition, selection.selection)
if (#hits > 0) then
-- We dont want to raytest with create mode objects1
local hit = hits[1]
for _,v in pairs(hits) do
if v.object.name ~= "_CreateMode_" then
hit = v
goto skip
end
end
::skip::
local newCentre = hit.hitPosition - mouseOffset
local newCentre = hits[1].hitPosition - mouseOffset
if gridStep ~= 0 then
newCentre = shared.roundVector3(newCentre, gridStep)
end
local avgPos = vector3(0,0,0)
local minY = hit.hitPosition.y
local minY = hits[1].hitPosition.y
for _,v in pairs(selection.selection) do
if offsets[v] then
v.position = newCentre + (offsets[v][2] * offsets[v][1])
@ -157,8 +146,8 @@ return {
end
-- If the lowest object is less than the mouse's position
if minY < hit.hitPosition.y then
local offsetBy = vector3(0, hit.hitPosition.y - minY, 0)
if minY < hits[1].hitPosition.y then
local offsetBy = vector3(0, hits[1].hitPosition.y - minY, 0)
-- increase height of each selected object so they're above the hovered position.
for _,v in pairs(selection.selection) do

BIN
workshop/controllers/ui/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -132,9 +132,7 @@ local function createHierarchyButton(object, guiParent)
expanded = not expanded
if expanded then
for _, child in pairs(object.children) do
if child.name ~= "_CreateMode_" then
createHierarchyButton(child, btn)
end
createHierarchyButton(child, btn)
end
controller.scrollView.canvasSize =
guiCoord(1, 0, 0, updatePositions())

View File

@ -29,24 +29,11 @@ local function insert(mesh)
insertPos = shared.controllers.env.camera.camera.position + (shared.controllers.env.camera.camera.rotation * vector3(0, 0, 10))
end
history.beginAction(workspace, "Inserter")
local block;
if mesh ~= "light" then
block = engine.construct("block", workspace, {
mesh = mesh,
colour = colour(0.8, 0.8, 0.8),
position = insertPos
})
else
block = engine.construct("light", workspace, {
position = insertPos
})
end
history.endAction()
return block
return engine.construct("block", workspace, {
mesh = mesh,
colour = colour(0.8, 0.8, 0.8),
position = insertPos
})
end
local adders = {
@ -63,13 +50,6 @@ local adders = {
callback = function()
insert("primitive:sphere")
end
},
{
name = "Light",
icon = "fa:s-lightbulb",
callback = function()
insert("light")
end
}
}