aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-07 15:25:56 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-07 15:25:56 +0200
commit84100fac9f1ba4c283b58c429821f7daae38d151 (patch)
treed729f2ee9d61c1d1336fac69c1de191fb66c9893
parent3ebb7582afc24992674cf6ebc0d6f314569d727f (diff)
parent99f0cb63c85a86485b1a6f2f14ca8abaa5ceb5d6 (diff)
downloadhurrycurry-84100fac9f1ba4c283b58c429821f7daae38d151.tar
hurrycurry-84100fac9f1ba4c283b58c429821f7daae38d151.tar.bz2
hurrycurry-84100fac9f1ba4c283b58c429821f7daae38d151.tar.zst
Merge branch 'master' of https://codeberg.org/metamuffin/undercooked
-rw-r--r--client/menu/menu.gd3
-rw-r--r--client/menu/setup.gd7
-rw-r--r--client/menu/setup.tscn2
3 files changed, 10 insertions, 2 deletions
diff --git a/client/menu/menu.gd b/client/menu/menu.gd
index 46dd7351..7ae7f3a0 100644
--- a/client/menu/menu.gd
+++ b/client/menu/menu.gd
@@ -78,7 +78,8 @@ func focus_first(node: Node) -> bool:
func connect_button_sounds(node: Node):
if node is Button:
- node.pressed.connect(Sound.play_click)
+ if not node.is_in_group("no_click_sound"):
+ node.pressed.connect(Sound.play_click)
if node is Button or node is LineEdit or node is Slider:
node.mouse_entered.connect(Sound.play_hover)
for c in node.get_children():
diff --git a/client/menu/setup.gd b/client/menu/setup.gd
index 9bbaf772..c3638d34 100644
--- a/client/menu/setup.gd
+++ b/client/menu/setup.gd
@@ -15,16 +15,23 @@
#
extends Menu
+const SCROLL_SPEED := 500.
+
@onready var anim: AnimationPlayer = $AnimationPlayer
@onready var username: LineEdit = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry/LineEdit
@onready var character_opts: Container = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/UniformEntry
@onready var sign: AudioStreamPlayer = $Sign
@onready var sign_button: Button = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature
+@onready var scroll: ScrollContainer = $ScrollContainer
func _ready():
anim.play("paper_slide")
super()
+func _process(delta):
+ var s = Input.get_axis("rotate_up", "rotate_down")
+ scroll.set_deferred("scroll_vertical", scroll.scroll_vertical + s * delta * SCROLL_SPEED)
+
func _on_sign_pressed():
var character = -1
for i in character_opts.get_children().size():
diff --git a/client/menu/setup.tscn b/client/menu/setup.tscn
index 696d1288..6a255b95 100644
--- a/client/menu/setup.tscn
+++ b/client/menu/setup.tscn
@@ -346,7 +346,7 @@ text = "Signature of the Employee:
fit_content = true
scroll_active = false
-[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"]
+[node name="Signature" type="Button" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign" groups=["no_click_sound"]]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
text = "Click to sign"