From 82446e9f9b626f47e18b90e6841b1bec2b7800f6 Mon Sep 17 00:00:00 2001 From: tpart Date: Thu, 15 Aug 2024 23:22:02 +0200 Subject: Implement new message protocol in client --- client/menu/lobby.gd | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'client/menu') diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd index 5136798d..a419c636 100644 --- a/client/menu/lobby.gd +++ b/client/menu/lobby.gd @@ -99,6 +99,7 @@ func initialize(): h.add_child(reset) h.add_child(add) add.pressed.connect(increase_bot_count.bind(algo_id)) + reset.pressed.connect(reset_bot_count.bind(algo_id)) remove.pressed.connect(decrease_bot_count.bind(algo_id)) bot_settings.add_child(h) @@ -124,6 +125,10 @@ func decrease_bot_count(algo_id: String): bot_counts[algo_id] = new_count update_bot_reset_text(algo_id) +func reset_bot_count(algo_id: String): + bot_counts[algo_id] = 0 + update_bot_reset_text(algo_id) + func update_bot_reset_text(algo_id: String): var display_name: String = bot_display_names[algo_id] if bot_display_names.has(algo_id) else algo_id bot_reset_buttons[algo_id].text = "%s (%d)" % [display_name, bot_counts[algo_id]] -- cgit v1.2.3-70-g09d2