Skip to content

Commit 2214736

Browse files
committed
Add an alternative shortcut for creating a pattern variant
Closes #84.
1 parent 59fe4a1 commit 2214736

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

docs/src/arrangements.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ _Bosca Ceoil Blue_ automatically keeps track of every bar that you fill with pat
3636

3737
To add a pattern to the arrangement, drag and drop it from the pattern dock, or <kbd>Left Click</kbd> and drag one of the existing patterns on the grid onto another cell, making a copy. Hold <kbd>Alt</kbd> as you do this, and instead of a copy a new variant of the original pattern will be created. You can also simply <kbd>Alt + Left Click</kbd> on a pattern to turn it into a variant.
3838

39+
<p class="warning">
40+
If your operating system intercepts <kbd>Alt + Left Click</kbd>, you can also create a variant by hovering over a pattern and pressing <kbd>Ctrl/Cmd + D</kbd>.
41+
</p>
42+
3943
<kbd>Right Click</kbd> removes the clicked pattern from the grid. This doesn't delete the pattern, however, and you can still use it later.
4044

4145
![](/images/arrangements-patterns.png)

docs/src/shortcuts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ Shortcuts related to creating pattern arrangements.
8989

9090
### Arrangement building
9191

92-
Drag'n'drop patterns from the dock on the right to add them to the grid.
93-
94-
Drag'n'drop patterns on the grid to copy them to a different bar. Hold <kbd>Alt</kbd> while dragging to create a variant instead!
92+
Drag'n'drop patterns from the dock on the right to add them to the grid. Drag'n'drop patterns on the grid to copy them to a different bar.
9593

9694
| Combination | Description |
9795
|--------------|--------------|
9896
| <kbd>Right Click</kbd> | Remove the clicked pattern |
99-
| <kbd>Alt + Left Click</kbd> | Replace the clicked pattern with a new variant |
97+
| <kbd>Ctrl/Cmd + D</kbd> | Replace the pattern at the cursor with a new variant |
98+
99+
Or hold <kbd>Alt</kbd> while dragging/clicking on the grid to create a pattern variant!
100100

101101

102102
## Timeline

gui/views/pattern_map/PatternMap.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ func _gui_input(event: InputEvent) -> void:
129129
if event is InputEventMouseButton:
130130
var mb := event as InputEventMouseButton
131131

132+
# On mouse button press.
132133
if mb.pressed:
133134
if mb.button_index == MOUSE_BUTTON_WHEEL_UP:
134135
if mb.shift_pressed:
@@ -153,6 +154,7 @@ func _gui_input(event: InputEvent) -> void:
153154
elif mb.button_index == MOUSE_BUTTON_RIGHT:
154155
_clear_pattern_at_cursor()
155156

157+
# On mouse button release.
156158
else:
157159
if mb.button_index == MOUSE_BUTTON_LEFT && mb.alt_pressed:
158160
_clone_pattern_at_cursor()
@@ -168,6 +170,9 @@ func _shortcut_input(event: InputEvent) -> void:
168170
elif event.is_action_pressed("bosca_patternmap_scale_smaller", true, true):
169171
_resize_pattern_width(-1)
170172
get_viewport().set_input_as_handled()
173+
elif event.is_action_pressed("bosca_patternmap_duplicate", false, true):
174+
_clone_pattern_at_cursor()
175+
get_viewport().set_input_as_handled()
171176

172177

173178
func _physics_process(_delta: float) -> void:

gui/widgets/popups/ShortcutHelpPopup.tscn

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,28 +390,31 @@ size_flags_horizontal = 0
390390
theme_type_variation = &"CreditsLabel"
391391
text = "DRAG'N'DROP patterns on grid to copy them."
392392

393-
[node name="Label2" type="Label" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="1"]
394-
auto_translate_mode = 1
395-
layout_mode = 2
396-
size_flags_horizontal = 0
397-
theme_type_variation = &"CreditsLabel"
398-
text = "Hold ALT while dragging to create a variant instead!"
399-
400-
[node name="Spacer" type="Control" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="2"]
393+
[node name="Spacer" type="Control" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="1"]
401394
custom_minimum_size = Vector2(0, 12)
402395
layout_mode = 2
403396

404-
[node name="ShortcutLine3" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="3" instance=ExtResource("2_1wrnf")]
397+
[node name="ShortcutLine3" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="2" instance=ExtResource("2_1wrnf")]
405398
layout_mode = 2
406399
key_text = "RIGHT CLICK"
407400
key_is_action = false
408401
description_text = "Remove the pattern"
409402

410-
[node name="ShortcutLine4" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="4" instance=ExtResource("2_1wrnf")]
403+
[node name="ShortcutLine4" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="3" instance=ExtResource("2_1wrnf")]
411404
layout_mode = 2
412-
key_text = "ALT + LEFT CLICK"
413-
key_is_action = false
414-
description_text = "Create pattern variant"
405+
key_text = "bosca_patternmap_duplicate"
406+
description_text = "Create a pattern variant"
407+
408+
[node name="Spacer2" type="Control" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="4"]
409+
custom_minimum_size = Vector2(0, 6)
410+
layout_mode = 2
411+
412+
[node name="Label2" type="Label" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3/ArrangementBuildingList" index="5"]
413+
auto_translate_mode = 1
414+
layout_mode = 2
415+
size_flags_horizontal = 0
416+
theme_type_variation = &"CreditsLabel"
417+
text = "Or hold ALT while dragging/clicking to create a variant!"
415418

416419
[node name="LastSpacer" type="Control" parent="Layout/Content/ContentBox/ScrollContainer/MarginContainer/Layout/Section3" index="6"]
417420
custom_minimum_size = Vector2(0, 16)

project.godot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ bosca_patternmap_scale_smaller={
139139
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":4194435,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
140140
]
141141
}
142+
bosca_patternmap_duplicate={
143+
"deadzone": 0.5,
144+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
145+
]
146+
}
142147
bosca_debug_1={
143148
"deadzone": 0.5,
144149
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":4194332,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)

0 commit comments

Comments
 (0)