fix/func: added beginnings of turn winning function. Fixed "Card_Container"s not appearing & dissapearing properly
This commit is contained in:
@@ -29,7 +29,7 @@ extends Control
|
||||
|
||||
# Static counter for unique container identification
|
||||
static var next_id: int = 0
|
||||
|
||||
signal played
|
||||
|
||||
@export_group("drop_zone")
|
||||
## Enables or disables the drop zone functionality.
|
||||
@@ -98,6 +98,20 @@ func _ready() -> void:
|
||||
else:
|
||||
drop_zone.sensor_outline.visible = false
|
||||
|
||||
func _redraw_drop_zone():
|
||||
if enable_drop_zone:
|
||||
drop_zone = drop_zone_scene.instantiate()
|
||||
add_child(drop_zone)
|
||||
drop_zone.init(self, [CardManager.CARD_ACCEPT_TYPE])
|
||||
# If sensor_size is not set, they will follow the card size.
|
||||
if sensor_size == Vector2(0, 0):
|
||||
sensor_size = card_manager.card_size
|
||||
drop_zone.set_sensor(sensor_size, sensor_position, sensor_texture, sensor_visibility)
|
||||
if debug_mode:
|
||||
drop_zone.sensor_outline.visible = true
|
||||
else:
|
||||
drop_zone.sensor_outline.visible = false
|
||||
drop_zone.redraw_sensor()
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if card_manager != null:
|
||||
@@ -286,7 +300,7 @@ func get_string() -> String:
|
||||
|
||||
|
||||
func on_card_move_done(_card: Card):
|
||||
pass
|
||||
played.emit()
|
||||
|
||||
|
||||
func on_card_pressed(_card: Card):
|
||||
|
||||
Reference in New Issue
Block a user