Attack animation

added auto fill buttons on the menu
This commit is contained in:
Twirpytherobot
2025-11-12 19:51:47 +00:00
parent bc30cfd6ca
commit c077bd37a7
7 changed files with 96 additions and 24 deletions
+41
View File
@@ -5,6 +5,7 @@ extends Node3D
@onready var address_input: LineEdit = $Menu/MainContainer/MainMenu/Option3/AddressInput
@onready var players_container: Node3D = $PlayersContainer
@onready var menu: Control = $Menu
@onready var main_menu: VBoxContainer = $Menu/MainContainer/MainMenu
@export var player_scene: PackedScene
# multiplayer chat
@@ -19,6 +20,10 @@ func _ready():
multiplayer_chat.hide()
menu.show()
multiplayer_chat.set_process_input(true)
# Add quick-fill preset buttons
_create_preset_buttons()
if not multiplayer.is_server():
return
@@ -121,3 +126,39 @@ func _on_send_pressed() -> void:
@rpc("any_peer", "call_local")
func msg_rpc(nick, msg):
chat.text += str(nick, " : ", msg, "\n")
# ---------- PRESET BUTTONS ----------
func _create_preset_buttons():
# Create a container for preset buttons
var preset_container = HBoxContainer.new()
preset_container.name = "PresetContainer"
var preset_label = Label.new()
preset_label.text = "Quick Fill:"
preset_container.add_child(preset_label)
# Scott button
var scott_button = Button.new()
scott_button.text = "Scott"
scott_button.pressed.connect(_on_scott_preset)
preset_container.add_child(scott_button)
# Jemz button
var jemz_button = Button.new()
jemz_button.text = "Jemz"
jemz_button.pressed.connect(_on_jemz_preset)
preset_container.add_child(jemz_button)
# Add to main menu at the top
main_menu.add_child(preset_container)
main_menu.move_child(preset_container, 0)
func _on_scott_preset():
nick_input.text = "Scott"
skin_input.text = "Blue"
address_input.text = "127.0.0.1"
func _on_jemz_preset():
nick_input.text = "Jemz"
skin_input.text = "Red"
address_input.text = "127.0.0.1"