fix: shadowing issues in card-board.
This commit is contained in:
parent
aefc236baa
commit
59356c6b9d
|
|
@ -34,7 +34,7 @@ func get_ready():
|
||||||
func start_room():
|
func start_room():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func pull_save_state(save: SaveGame) -> void:
|
func pull_save_state(_save: SaveGame) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func save_room():
|
func save_room():
|
||||||
|
|
|
||||||
|
|
@ -181,23 +181,23 @@ func populate_board(card_names: Array[StringName]):
|
||||||
#currently_active_node = area_dict["dropzone_content"][0] # set first Card as currently selected node by default
|
#currently_active_node = area_dict["dropzone_content"][0] # set first Card as currently selected node by default
|
||||||
currently_active_node = dropzone.get_child(0)
|
currently_active_node = dropzone.get_child(0)
|
||||||
|
|
||||||
func add_card(card: Card, reparent:bool = true):
|
func add_card(card: Card, re_parent:bool = true):
|
||||||
if reparent:
|
if re_parent:
|
||||||
card.reparent(self)
|
card.reparent(self)
|
||||||
else:
|
else:
|
||||||
add_child(card)
|
add_child(card)
|
||||||
card.position = Vector2(randi_range(dropzone_padding, dropzone_size.x), randi_range(dropzone_padding, dropzone_size.y))
|
card.position = Vector2(randi_range(dropzone_padding, int(dropzone_size.x)), randi_range(dropzone_padding, int(dropzone_size.y)))
|
||||||
insert_area(dropzone, card)
|
insert_area(dropzone, card)
|
||||||
card.set_owner(self)
|
card.set_owner(self)
|
||||||
card.is_dragable = true
|
card.is_dragable = true
|
||||||
|
|
||||||
func add_sticky_note(sticky: StickyNote, reparent:bool = true):
|
func add_sticky_note(sticky: StickyNote, re_parent:bool = true):
|
||||||
var new_panel = StickyNotePanel.new()
|
var new_panel := StickyNotePanel.new()
|
||||||
sticky_note_container.add_child(new_panel, true, Node.INTERNAL_MODE_DISABLED)
|
sticky_note_container.add_child(new_panel, true, Node.INTERNAL_MODE_DISABLED)
|
||||||
#WARNING this for some reason would break the tweens
|
#WARNING this for some reason would break the tweens
|
||||||
new_panel.set_owner(self)
|
new_panel.set_owner(self)
|
||||||
sticky.current_handle = self
|
sticky.current_handle = self
|
||||||
new_panel.attatch_sticky_note(sticky, self, false, reparent)
|
new_panel.attatch_sticky_note(sticky, self, false, re_parent)
|
||||||
|
|
||||||
# Checks if a Node is currently inside the dropzone
|
# Checks if a Node is currently inside the dropzone
|
||||||
func is_in_dropzone(to_check: Node) -> bool:
|
func is_in_dropzone(to_check: Node) -> bool:
|
||||||
|
|
@ -663,10 +663,9 @@ func rebuild_from_savedict(board_state:Dictionary):
|
||||||
sticky.picked_random = randoms.has( sticky.sticky_id )
|
sticky.picked_random = randoms.has( sticky.sticky_id )
|
||||||
|
|
||||||
func validate_board():
|
func validate_board():
|
||||||
return
|
|
||||||
if current_context == NAVIGATE:
|
if current_context == NAVIGATE:
|
||||||
|
|
||||||
var needs_rebuild = false
|
var needs_rebuild := false
|
||||||
for node in dropzone.get_children():
|
for node in dropzone.get_children():
|
||||||
if node is Card:
|
if node is Card:
|
||||||
match validate_card(node):
|
match validate_card(node):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue