mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 14:17:29 -04:00
help button, scroll with prompt
This commit is contained in:
parent
00fa349440
commit
647b0ca20c
6 changed files with 142 additions and 15 deletions
17
app/scripts/ui/menu/scroll_container.gd
Normal file
17
app/scripts/ui/menu/scroll_container.gd
Normal file
|
@ -0,0 +1,17 @@
|
|||
extends ScrollContainer
|
||||
|
||||
@export var search: Search
|
||||
@export var scroll_speed: float
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not search.has_focus(): return
|
||||
if event is not InputEventMouseButton: return
|
||||
if not get_global_rect().has_point(event.position): return
|
||||
if not search.prompt_panel.get_global_rect().has_point(event.position): return
|
||||
|
||||
if event.button_index == MouseButton.MOUSE_BUTTON_WHEEL_UP:
|
||||
scroll_vertical -= scroll_speed * event.factor
|
||||
|
||||
if event.button_index == MouseButton.MOUSE_BUTTON_WHEEL_DOWN:
|
||||
scroll_vertical += scroll_speed * event.factor
|
Loading…
Add table
Add a link
Reference in a new issue