mirror of
https://github.com/teverse/teverse
synced 2025-08-26 08:04:46 +02:00
Compare commits
7 Commits
713233288a
...
c66a2e37d6
Author | SHA1 | Date | |
---|---|---|---|
c66a2e37d6 | |||
![]() |
9889a3f19f | ||
![]() |
d398e1f7ff | ||
![]() |
f4b85012ae | ||
![]() |
415a69992e | ||
c1f074d0b3 | |||
![]() |
e4e30ca154 |
@ -117,6 +117,8 @@ local function endAction()
|
||||
end
|
||||
eventListeners = {}
|
||||
|
||||
-- if nothing changed dont create an action
|
||||
if count(changes) > 0 or #destroyedObjects > 0 or #newObjects > 0 then
|
||||
pointer = pointer + 1
|
||||
if pointer >= limit then
|
||||
actions[pointer - limit] = nil
|
||||
@ -127,11 +129,12 @@ local function endAction()
|
||||
destroyedObjects = {}
|
||||
newObjects = {}
|
||||
|
||||
actionInProgress = false
|
||||
|
||||
if type(callback) == "function" then
|
||||
callback()
|
||||
end
|
||||
end
|
||||
|
||||
actionInProgress = false
|
||||
end
|
||||
|
||||
local function undo()
|
||||
|
@ -3,7 +3,8 @@
|
||||
local cameraController = {
|
||||
zoomStep = 3,
|
||||
rotateStep = 0.003,
|
||||
moveStep = 0.5
|
||||
moveStep = 0.5,
|
||||
slow = 0.3
|
||||
}
|
||||
|
||||
cameraController.camera = workspace.camera
|
||||
@ -56,7 +57,7 @@ engine.input:keyPressed(function( inputObj )
|
||||
for key, vector in pairs(cameraController.cameraKeyArray) do
|
||||
-- check this key is pressed (still)
|
||||
if engine.input:isKeyDown(key) then
|
||||
cameraPos = cameraPos + (cameraController.camera.rotation * vector * cameraController.moveStep)
|
||||
cameraPos = cameraPos + (cameraController.camera.rotation * vector * cameraController.moveStep) * (engine.input:isKeyDown(enums.key.leftShift) and cameraController.slow or 1)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -6,6 +6,7 @@ local toolDesc = ""
|
||||
local toolIcon = "fa:s-hand-pointer"
|
||||
|
||||
local selection = require("tevgit:workshop/controllers/core/selection.lua")
|
||||
local history = require("tevgit:workshop/controllers/core/history.lua")
|
||||
|
||||
local clickEvent = nil
|
||||
|
||||
@ -43,6 +44,9 @@ return {
|
||||
offsets[v] = v.position - centre
|
||||
end
|
||||
|
||||
-- tell history to monitor changes we make to selected items
|
||||
history.beginAction(selection.selection, "Hand tool drag")
|
||||
|
||||
while engine.input:isMouseButtonDown(enums.mouseButton.left) do
|
||||
-- fire a ray, exclude selected items.
|
||||
local hits, didExclude = engine.physics:rayTestScreenAllHits(engine.input.mousePosition, selection.selection)
|
||||
@ -57,7 +61,8 @@ return {
|
||||
wait()
|
||||
end
|
||||
|
||||
print("Centre:", centre, "MouseOffset:", mouseOffset)
|
||||
history.endAction()
|
||||
|
||||
else
|
||||
-- user clicked an unselected object, let's select it
|
||||
if engine.input:isKeyDown(enums.key.leftShift) then
|
||||
|
@ -45,8 +45,8 @@ for toolName, options in pairs(tools) do
|
||||
|
||||
local newTabBtn = ui.create("guiTextBox", toolBar, {
|
||||
text = toolName,
|
||||
position = guiCoord(0, 5, 0, currentY),
|
||||
size = guiCoord(0, 22, 0, 22),
|
||||
position = guiCoord(0, 4, 0, currentY),
|
||||
size = guiCoord(0, 24, 0, 24),
|
||||
hoverCursor = "fa:s-hand-pointer"
|
||||
}, "primaryText")
|
||||
|
||||
|
@ -16,12 +16,16 @@ local tabs = {
|
||||
{"Properties", "fa:s-clipboard-list", function ()
|
||||
shared.windows.propertyEditor.visible = not shared.windows.propertyEditor.visible
|
||||
end},
|
||||
{"Settings", "fa:s-cog", function ()
|
||||
shared.windows.settings.visible = not shared.windows.settings.visible
|
||||
{"Hierarchy", "fa:s-align-left", function ()
|
||||
shared.windows.hierarchy.visible = not shared.windows.hierarchy.visible
|
||||
end},
|
||||
{"History", "fa:s-history", function ()
|
||||
shared.windows.history.visible = not shared.windows.history.visible
|
||||
end}
|
||||
end},
|
||||
{"Seperator"},
|
||||
{"Settings", "fa:s-cog", function ()
|
||||
shared.windows.settings.visible = not shared.windows.settings.visible
|
||||
end},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,31 +39,35 @@ controller.setupDocks = function ()
|
||||
controller.docks = {
|
||||
engine.construct("guiFrame", shared.workshop.interface, {
|
||||
name = "_dockTop",
|
||||
size = guiCoord(1, -500, 0, 250 - 72),
|
||||
position = guiCoord(250, 0, 0, 72),
|
||||
size = guiCoord(1, -500, 0, 250 - 76),
|
||||
position = guiCoord(250, 0, 0, 76),
|
||||
backgroundAlpha = 0,
|
||||
handleEvents = false
|
||||
handleEvents = false,
|
||||
cropChildren = false,
|
||||
}),
|
||||
engine.construct("guiFrame", shared.workshop.interface, {
|
||||
name = "_dockLeft",
|
||||
size = guiCoord(0, 250, 1, -72),
|
||||
position = guiCoord(0, 0, 0, 72),
|
||||
size = guiCoord(0, 250, 1, -76),
|
||||
position = guiCoord(0, 0, 0, 76),
|
||||
backgroundAlpha = 0,
|
||||
handleEvents = false
|
||||
handleEvents = false,
|
||||
cropChildren = false,
|
||||
}),
|
||||
engine.construct("guiFrame", shared.workshop.interface, {
|
||||
name = "_dockBottom",
|
||||
size = guiCoord(1, -500, 0, 250),
|
||||
position = guiCoord(0, 250, 1, -250),
|
||||
backgroundAlpha = 0,
|
||||
handleEvents = false
|
||||
handleEvents = false,
|
||||
cropChildren = false,
|
||||
}),
|
||||
engine.construct("guiFrame", shared.workshop.interface, {
|
||||
name = "_dockRight",
|
||||
size = guiCoord(0, 250, 1, -72),
|
||||
position = guiCoord(1, -250, 0, 72),
|
||||
size = guiCoord(0, 250, 1, -76),
|
||||
position = guiCoord(1, -250, 0, 76),
|
||||
backgroundAlpha = 0,
|
||||
handleEvents = false
|
||||
handleEvents = false,
|
||||
cropChildren = false,
|
||||
})
|
||||
}
|
||||
end
|
||||
|
@ -81,7 +81,10 @@ return {
|
||||
size = size,
|
||||
name = title,
|
||||
position = position,
|
||||
cropChildren = false
|
||||
cropChildren = false,
|
||||
borderColour = colour:fromRGB(55, 59, 64),
|
||||
borderWidth = 2,
|
||||
borderAlpha = 1,
|
||||
}, themer.types.background)
|
||||
|
||||
container:on("changed", function (property, value)
|
||||
@ -138,7 +141,7 @@ return {
|
||||
backgroundAlpha = 0,
|
||||
size = guiCoord(1, -12, 1, -27),
|
||||
position = guiCoord(0, 3, 0, 24),
|
||||
cropChildren = false
|
||||
cropChildren = false,
|
||||
})
|
||||
|
||||
return container
|
||||
|
@ -84,5 +84,5 @@ return function( workshop )
|
||||
loadingScreen = nil
|
||||
end
|
||||
|
||||
print("Workshop Loaded. ", #engine.workspace.children)
|
||||
--print("Workshop Loaded. ", #engine.workspace.children) Lets not spam the console
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user