diff --git a/README.md b/README.md index 939c005..c4066a2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Hold right click to move around the map. Left click is your main way of placing In any menu, you can hover over the name of an option or field for a detailed tooltip explaining its meaning and usage. -Lönn supports a couple of keybinds and special mouse functionality, with more to come. The following list might not be comprehensive. Note that you can change all keybinds in the configuration file. +Lönn supports a couple of keybinds and special mouse functionality, with more to come. The following list might not be comprehensive. Note that you can change all keybinds in the settings window or the configuration file. --- @@ -87,9 +87,12 @@ Lönn supports a couple of keybinds and special mouse functionality, with more t - Left click: Select object - Left click existing selection: Cycle through objects under cursor (smallest to largest) + - Double Left click: Select all similar objects + - Ctrl + Double Left click: Select all similar objects but more strict - Left click & drag: Select multiple objects - Shift + Left click & drag: Add to current selection - Ctrl + A: Select all objects + - Ctrl + Shift + A: Clear current selection - Right click selection: Open properties of selected object(s) - Holding Left mouse button over selection: Drag selected objects - Shift + Holding Left mouse button over selection: Axis-bound object dragging diff --git a/src/lang/en_gb.lang b/src/lang/en_gb.lang index 24656fe..57f6b8b 100644 --- a/src/lang/en_gb.lang +++ b/src/lang/en_gb.lang @@ -1837,7 +1837,7 @@ settings.hotkeys.description.itemsCopy=Copy the selected objects to the clipboar settings.hotkeys.description.itemsCut=Cut the selected objects to the clipboard. settings.hotkeys.description.itemsPaste=Paste a selection from the clipboard if possible. settings.hotkeys.description.itemsSelectAll=Select all objects. -settings.hotkeys.description.itemsDeselect=Cancels the current selection. +settings.hotkeys.description.itemsDeselect=Clears the current selection. settings.editor.description.selectionAddModifier=While held, add to the current selection rather than replacing it. settings.editor.description.itemAddNode=Add a node to the selected object if possible. settings.editor.description.objectCloneButton=Mouse button to use for cloning hovered objects. diff --git a/src/tools/selection.lua b/src/tools/selection.lua index b43e023..ab679f8 100644 --- a/src/tools/selection.lua +++ b/src/tools/selection.lua @@ -1448,17 +1448,19 @@ function tool.mouseclicked(x, y, button, istouch, presses) local cursorX, cursorY = toolUtils.getCursorPositionInRoom(x, y) if cursorX and cursorY then - if presses == 1 then + local addSelections = keyboardHelper.modifierHeld(configs.editor.selectionAddModifier) + + if addSelections and presses % 2 == 0 then + local strict = keyboardHelper.modifierHeld(configs.editor.precisionModifier) + + selectSimilar(strict) + + else selectionChanged(cursorX - 1, cursorY - 1, 3, 3, true) selectionFinished(cursorX, cursorY, true) resizeFinished(cursorX, cursorY) movementFinished(cursorX, cursorY) - - else - local strict = keyboardHelper.modifierHeld(configs.editor.precisionModifier) - - selectSimilar(strict) end end