Skip to content

Commit 8a37aa2

Browse files
authored
Merge pull request #927 from TokisanGames/hotkeys_46
Fix 1-4 keyboard shortcuts for 4.6, change assignments
2 parents a0aef00 + 2198a39 commit 8a37aa2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

doc/docs/keyboard_shortcuts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ The following mouse and keyboard shortcuts or hotkeys are available.
2929
These toggle the Overlays found in the inspector. The mouse must be in the 3D Viewport with Terrain3D selected for these to work.
3030

3131
* <kbd>1</kbd> - Toggle **Region Grid**.
32-
* <kbd>2</kbd> - Toggle **Instancer Grid**.
33-
* <kbd>3</kbd> - Toggle **Vertex Grid**.
34-
* <kbd>4</kbd> - Toggle **Contour Lines**. Customize in the material when enabled.
32+
* <kbd>2</kbd> - Toggle **Region Label Distance** between 0 and 4096.
33+
* <kbd>3</kbd> - Toggle **Contour Lines**. Customize in the material when enabled.
34+
* <kbd>4</kbd> - Toggle **Instancer Grid**.
35+
* <kbd>5</kbd> - Toggle **Vertex Grid**.
3536

3637

3738
## Tool Selection

project/addons/terrain_3d/src/editor_plugin.gd

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,16 @@ func _read_input(p_event: InputEvent = null) -> AfterGUIInput:
326326
# Returns true if hotkey matches and operation triggered
327327
func consume_hotkey(keycode: int) -> bool:
328328
match keycode:
329-
KEY_1:
329+
KEY_1, KEY_KP_1:
330330
terrain.material.set_show_region_grid(!terrain.material.get_show_region_grid())
331-
KEY_2:
331+
KEY_2, KEY_KP_2:
332+
terrain.label_distance = 4096.0 if is_zero_approx(terrain.label_distance) else 0.0
333+
KEY_3, KEY_KP_3:
334+
terrain.material.set_show_contours(!terrain.material.get_show_contours())
335+
KEY_4, KEY_KP_4:
332336
terrain.material.set_show_instancer_grid(!terrain.material.get_show_instancer_grid())
333-
KEY_3:
337+
KEY_5, KEY_KP_5:
334338
terrain.material.set_show_vertex_grid(!terrain.material.get_show_vertex_grid())
335-
KEY_4:
336-
terrain.material.set_show_contours(!terrain.material.get_show_contours())
337339
KEY_E:
338340
ui.toolbar.get_button("AddRegion").set_pressed(true)
339341
KEY_R:

0 commit comments

Comments
 (0)