1
0
mirror of https://github.com/teverse/teverse synced 2025-08-26 08:04:46 +02:00

Compare commits

..

No commits in common. "c66a2e37d62e0559b2de121f2b6ee4cfe8702c0f" and "713233288a0f454fe3bde3b8d36d2103c7804112" have entirely different histories.

8 changed files with 55 additions and 75 deletions

View File

@ -117,24 +117,21 @@ 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
end
actions[pointer] = {os.time(), actionName, changes, destroyedObjects, newObjects}
changes = {}
destroyedObjects = {}
newObjects = {}
if type(callback) == "function" then
callback()
end
pointer = pointer + 1
if pointer >= limit then
actions[pointer - limit] = nil
end
actions[pointer] = {os.time(), actionName, changes, destroyedObjects, newObjects}
changes = {}
destroyedObjects = {}
newObjects = {}
actionInProgress = false
if type(callback) == "function" then
callback()
end
end
local function undo()

View File

@ -3,8 +3,7 @@
local cameraController = {
zoomStep = 3,
rotateStep = 0.003,
moveStep = 0.5,
slow = 0.3
moveStep = 0.5
}
cameraController.camera = workspace.camera
@ -57,7 +56,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) * (engine.input:isKeyDown(enums.key.leftShift) and cameraController.slow or 1)
cameraPos = cameraPos + (cameraController.camera.rotation * vector * cameraController.moveStep)
end
end

View File

@ -6,7 +6,6 @@ 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
@ -44,9 +43,6 @@ 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)
@ -61,8 +57,7 @@ return {
wait()
end
history.endAction()
print("Centre:", centre, "MouseOffset:", mouseOffset)
else
-- user clicked an unselected object, let's select it
if engine.input:isKeyDown(enums.key.leftShift) then

View File

@ -45,8 +45,8 @@ for toolName, options in pairs(tools) do
local newTabBtn = ui.create("guiTextBox", toolBar, {
text = toolName,
position = guiCoord(0, 4, 0, currentY),
size = guiCoord(0, 24, 0, 24),
position = guiCoord(0, 5, 0, currentY),
size = guiCoord(0, 22, 0, 22),
hoverCursor = "fa:s-hand-pointer"
}, "primaryText")

View File

@ -16,16 +16,12 @@ local tabs = {
{"Properties", "fa:s-clipboard-list", function ()
shared.windows.propertyEditor.visible = not shared.windows.propertyEditor.visible
end},
{"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},
{"Seperator"},
{"Settings", "fa:s-cog", function ()
shared.windows.settings.visible = not shared.windows.settings.visible
end},
{"History", "fa:s-history", function ()
shared.windows.history.visible = not shared.windows.history.visible
end}
}
}

View File

@ -39,35 +39,31 @@ controller.setupDocks = function ()
controller.docks = {
engine.construct("guiFrame", shared.workshop.interface, {
name = "_dockTop",
size = guiCoord(1, -500, 0, 250 - 76),
position = guiCoord(250, 0, 0, 76),
size = guiCoord(1, -500, 0, 250 - 72),
position = guiCoord(250, 0, 0, 72),
backgroundAlpha = 0,
handleEvents = false,
cropChildren = false,
handleEvents = false
}),
engine.construct("guiFrame", shared.workshop.interface, {
name = "_dockLeft",
size = guiCoord(0, 250, 1, -76),
position = guiCoord(0, 0, 0, 76),
size = guiCoord(0, 250, 1, -72),
position = guiCoord(0, 0, 0, 72),
backgroundAlpha = 0,
handleEvents = false,
cropChildren = false,
handleEvents = 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,
cropChildren = false,
handleEvents = false
}),
engine.construct("guiFrame", shared.workshop.interface, {
name = "_dockRight",
size = guiCoord(0, 250, 1, -76),
position = guiCoord(1, -250, 0, 76),
size = guiCoord(0, 250, 1, -72),
position = guiCoord(1, -250, 0, 72),
backgroundAlpha = 0,
handleEvents = false,
cropChildren = false,
handleEvents = false
})
}
end

View File

@ -81,10 +81,7 @@ return {
size = size,
name = title,
position = position,
cropChildren = false,
borderColour = colour:fromRGB(55, 59, 64),
borderWidth = 2,
borderAlpha = 1,
cropChildren = false
}, themer.types.background)
container:on("changed", function (property, value)
@ -141,7 +138,7 @@ return {
backgroundAlpha = 0,
size = guiCoord(1, -12, 1, -27),
position = guiCoord(0, 3, 0, 24),
cropChildren = false,
cropChildren = false
})
return container

View File

@ -46,7 +46,7 @@ return function( workshop )
})
emergencyReload:mouseLeftPressed(function()
shared.workshop:reloadCreate()
shared.workshop:reloadCreate()
end)
end
@ -84,5 +84,5 @@ return function( workshop )
loadingScreen = nil
end
--print("Workshop Loaded. ", #engine.workspace.children) Lets not spam the console
print("Workshop Loaded. ", #engine.workspace.children)
end