diff options
author | tpart <tpart120@proton.me> | 2024-08-15 22:01:46 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-08-15 22:01:46 +0200 |
commit | 04f18f7be5457a7d2fc25a86996078eb6b245663 (patch) | |
tree | 76c47646505c899fecf9c72581a28571eb573042 | |
parent | 919e7b26cc5b32bdc23b9cb79c7300a4ff772aa2 (diff) | |
download | hurrycurry-04f18f7be5457a7d2fc25a86996078eb6b245663.tar hurrycurry-04f18f7be5457a7d2fc25a86996078eb6b245663.tar.bz2 hurrycurry-04f18f7be5457a7d2fc25a86996078eb6b245663.tar.zst |
Add bot spawning logic based on UI configuration
-rw-r--r-- | client/menu/lobby.gd | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd index 5385f6d6..d3172e70 100644 --- a/client/menu/lobby.gd +++ b/client/menu/lobby.gd @@ -23,6 +23,7 @@ var map_count var selected_map := 0 var selected_map_name: String +var bots_enabled := false var bot_counts := {} var bot_reset_buttons := {} var bot_display_names := { @@ -156,7 +157,14 @@ func _on_right_pressed(): func _on_controller_button_pressed(): if selected_map_name != null: - game.mp.send_chat(game.player_id, "/start %s" % selected_map_name) + var start_msg := "/start %s" % selected_map_name + + if bots_enabled: + for k in bot_counts.keys(): + for i in range(bot_counts[k]): + start_msg += "\nsummon-bot %s" % k + + game.mp.send_chat(game.player_id, start_msg) Sound.play_music("stop") # TODO: Game music enter func _on_join_spectate_pressed(): @@ -174,5 +182,6 @@ func check_for_music(): Sound.play_music("stop") # TODO: Game music enter func _on_enable_bots_toggled(toggled_on): + bots_enabled = toggled_on bot_settings_conainer.visible = toggled_on bots_container.size_flags_vertical = SIZE_EXPAND_FILL if toggled_on else SIZE_FILL |