diff options
Diffstat (limited to 'client/menu')
-rw-r--r-- | client/menu/book/book.tscn | 4 | ||||
-rw-r--r-- | client/menu/scroll_container_custom.gd | 24 | ||||
-rw-r--r-- | client/menu/settings.tscn | 4 | ||||
-rw-r--r-- | client/menu/setup.tscn | 4 |
4 files changed, 33 insertions, 3 deletions
diff --git a/client/menu/book/book.tscn b/client/menu/book/book.tscn index a23977d4..824c062d 100644 --- a/client/menu/book/book.tscn +++ b/client/menu/book/book.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://bdggwo8un3mys"] +[gd_scene load_steps=3 format=3 uid="uid://bdggwo8un3mys"] [ext_resource type="Script" path="res://menu/book/book.gd" id="1_gyisx"] +[ext_resource type="Script" path="res://menu/scroll_container_custom.gd" id="2_0d0p0"] [node name="Book" type="Control"] layout_mode = 3 @@ -19,6 +20,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +script = ExtResource("2_0d0p0") [node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"] layout_mode = 2 diff --git a/client/menu/scroll_container_custom.gd b/client/menu/scroll_container_custom.gd new file mode 100644 index 00000000..b8b25652 --- /dev/null +++ b/client/menu/scroll_container_custom.gd @@ -0,0 +1,24 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 tpart +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends ScrollContainer +class_name ScrollContainerCustom + +# Adds support for scrolling with joypad + +const SCROLL_SPEED := 1000. + +func _process(delta): + set_deferred("scroll_vertical", scroll_vertical + Input.get_axis("scroll_up", "scroll_down") * delta * SCROLL_SPEED) diff --git a/client/menu/settings.tscn b/client/menu/settings.tscn index e5a0d1c5..b36f8c29 100644 --- a/client/menu/settings.tscn +++ b/client/menu/settings.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=3 uid="uid://8ic77jmadadj"] +[gd_scene load_steps=5 format=3 uid="uid://8ic77jmadadj"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_foq3a"] [ext_resource type="Script" path="res://menu/settings.gd" id="2_3hgm8"] [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_8nykw"] +[ext_resource type="Script" path="res://menu/scroll_container_custom.gd" id="4_vfb63"] [node name="SettingsMenu" type="Control"] layout_mode = 3 @@ -52,6 +53,7 @@ text = "Settings" layout_mode = 2 size_flags_vertical = 3 follow_focus = true +script = ExtResource("4_vfb63") [node name="Options" type="VBoxContainer" parent="OuterGap/Panel/InnerGap/VBoxContainer/ScrollContainer"] layout_mode = 2 diff --git a/client/menu/setup.tscn b/client/menu/setup.tscn index 626f20c4..9d8e4975 100644 --- a/client/menu/setup.tscn +++ b/client/menu/setup.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=14 format=3 uid="uid://ddl3efikvqp66"] +[gd_scene load_steps=15 format=3 uid="uid://ddl3efikvqp66"] [ext_resource type="Script" path="res://menu/setup.gd" id="1_mo46n"] [ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://menu/theme/paper.tres" id="1_yq0aa"] +[ext_resource type="Script" path="res://menu/scroll_container_custom.gd" id="2_4caf2"] [ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="3_2vg4d"] [ext_resource type="AudioStream" uid="uid://do7ii5hx71p0m" path="res://menu/sounds/page.ogg" id="5_xac6d"] [ext_resource type="AudioStream" uid="uid://5b3noxjmasmu" path="res://menu/sounds/sign.ogg" id="6_wf0gh"] @@ -94,6 +95,7 @@ grow_horizontal = 2 grow_vertical = 2 follow_focus = true horizontal_scroll_mode = 0 +script = ExtResource("2_4caf2") [node name="Control" type="Control" parent="ScrollContainer"] custom_minimum_size = Vector2(0, 1500) |