summaryrefslogtreecommitdiff
path: root/UI/spawn_button.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-05 11:34:49 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-05 11:34:49 +0100
commitc8f674ac6fa0914d9e448d2929f2385cdad80d60 (patch)
treea913454c42bb520aa644f4e2dcf0d42ba11c83de /UI/spawn_button.gd
parent84365b6f901a9c0251a9f724a8d9f81a3787e97d (diff)
next commit
Diffstat (limited to 'UI/spawn_button.gd')
-rw-r--r--UI/spawn_button.gd4
1 files changed, 4 insertions, 0 deletions
diff --git a/UI/spawn_button.gd b/UI/spawn_button.gd
index ba67e37..a773406 100644
--- a/UI/spawn_button.gd
+++ b/UI/spawn_button.gd
@@ -2,6 +2,7 @@ extends TextureButton
@export var texture: Texture2D
+@export var sprite_sheet: SpriteFrames
func _on_pressed() -> void:
@@ -11,4 +12,7 @@ func _on_pressed() -> void:
unit.get_node("Sprite2D").texture = texture
unit.get_node("Sprite2D").scale = Vector2(32,32) / texture.get_size()
+ if sprite_sheet:
+ unit.get_node("AnimatedSprite2D").sprite_frames = sprite_sheet
+
Client.spawn_unit(unit, Client.current_stage.get_spawn(), Client.current_stage.get_overwrite_target())