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

Compare commits

...

7 Commits

Author SHA1 Message Date
c66a2e37d6 revert file modes (#50) 2019-11-03 21:38:07 +00:00
Jay
9889a3f19f Add hand tool drag to history 2019-11-03 21:37:07 +00:00
Jay
d398e1f7ff make icons 24 pixel so scaling isnt applied 2019-11-03 21:29:04 +00:00
teverse
f4b85012ae
Revert "Revert "Window and Topbar Changes (#46)" (#48)" (#49)
This reverts commit 415a69992eedf4c70e5fad88367fe1bc6614364b.
2019-11-03 21:20:03 +00:00
teverse
415a69992e
Revert "Window and Topbar Changes (#46)" (#48)
This reverts commit e4e30ca15486209f157cb87236843cdafcb8471c.
2019-11-03 21:16:30 +00:00
c1f074d0b3 hold shift for slow camera movement (#47) 2019-11-03 21:10:31 +00:00
Peter-Crawley
e4e30ca154 Window and Topbar Changes (#46)
* fix

* fix

* Topbar Menu Changes

* Add borders to windows so we can tell the difference.

* Fix the topbar of docked windows
2019-11-03 21:10:02 +00:00
8 changed files with 75 additions and 55 deletions

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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},
}
}

View File

@ -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

View File

@ -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

View File

@ -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