aboutsummaryrefslogtreecommitdiff
path: root/client/menu
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-08-15 21:40:26 +0200
committertpart <tpart120@proton.me>2024-08-15 21:40:26 +0200
commite95cbb5ce2897d99be79c34a0b75eb844ab5b26d (patch)
tree5083e2bb0a0e1eed2053f636d8de795663e0a1cd /client/menu
parentbac2a7a1bae77b6aae1f65de894fb634a8b077d6 (diff)
downloadhurrycurry-e95cbb5ce2897d99be79c34a0b75eb844ab5b26d.tar
hurrycurry-e95cbb5ce2897d99be79c34a0b75eb844ab5b26d.tar.bz2
hurrycurry-e95cbb5ce2897d99be79c34a0b75eb844ab5b26d.tar.zst
Make bots scrollable
Diffstat (limited to 'client/menu')
-rw-r--r--client/menu/lobby.gd9
-rw-r--r--client/menu/lobby.tscn8
2 files changed, 13 insertions, 4 deletions
diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd
index ed46e848..d47a76f2 100644
--- a/client/menu/lobby.gd
+++ b/client/menu/lobby.gd
@@ -44,7 +44,9 @@ var difficulty_names = [tr("Easy"), tr("Moderate"), tr("Hard"), tr("Very hard"),
@onready var prev_map = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Left
@onready var next_map = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/Right
-@onready var bot_settings = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots/BotSettings
+@onready var bots_container = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots
+@onready var bot_settings = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom/BotSettings
+@onready var bot_settings_conainer = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom
@onready var join_spectate = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/VBoxContainer/JoinSpectate
@onready var start_button = $HBoxContainer/Bottom/MarginContainer/VBoxContainer/VBoxContainer/Start
@@ -82,7 +84,7 @@ func initialize():
var reset := Button.new()
bot_reset_buttons[algo_id] = reset
update_bot_reset_text(algo_id)
- reset.size_flags_horizontal = Control.SIZE_EXPAND_FILL
+ reset.size_flags_horizontal = SIZE_EXPAND_FILL
var remove := Button.new()
remove.text = "-"
h.add_child(remove)
@@ -172,4 +174,5 @@ func check_for_music():
Sound.play_music("stop") # TODO: Game music enter
func _on_enable_bots_toggled(toggled_on):
- bot_settings.visible = toggled_on
+ bot_settings_conainer.visible = toggled_on
+ bots_container.size_flags_vertical = SIZE_EXPAND_FILL if toggled_on else SIZE_FILL
diff --git a/client/menu/lobby.tscn b/client/menu/lobby.tscn
index 69ad83fd..3c732627 100644
--- a/client/menu/lobby.tscn
+++ b/client/menu/lobby.tscn
@@ -130,10 +130,16 @@ layout_mode = 2
layout_mode = 2
text = "Enable bots"
-[node name="BotSettings" type="VBoxContainer" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots"]
+[node name="ScrollContainerCustom" type="ScrollContainer" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots"]
visible = false
layout_mode = 2
size_flags_vertical = 3
+script = ExtResource("10_bgene")
+
+[node name="BotSettings" type="VBoxContainer" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots/ScrollContainerCustom"]
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer"]
layout_mode = 2