Add support for return dice
This commit is contained in:
parent
634c9e9d30
commit
08a265a14b
@ -76,4 +76,5 @@ margin_left = 1.52588e-05
|
||||
margin_top = -7.62939e-06
|
||||
grow_horizontal = 0
|
||||
|
||||
[connection signal="return_dice" from="UI/CardView" to="UI/DiceView" method="roll_dice"]
|
||||
[connection signal="dice_selected" from="UI/DiceView" to="UI/CardView" method="set_currently_holding_dice"]
|
||||
|
@ -1,5 +1,7 @@
|
||||
extends Control
|
||||
|
||||
signal return_dice(dice_number)
|
||||
|
||||
const card = preload("res://UI/Card.tscn")
|
||||
const card_db_string = "res://Assets/CardDB/%s.tres"
|
||||
|
||||
@ -12,6 +14,10 @@ var current_cards = []
|
||||
var currently_holding_dice = null
|
||||
|
||||
|
||||
func emit_return_dice(dice_number):
|
||||
emit_signal("return_dice", dice_number)
|
||||
|
||||
|
||||
func set_currently_holding_dice(dice_number : int):
|
||||
currently_holding_dice = dice_number
|
||||
|
||||
@ -72,5 +78,8 @@ func draw_card(specific_card : String = ""):
|
||||
else: #no card choosen, pick default
|
||||
new_card.card_info = load(card_db_string % "Default")
|
||||
|
||||
# connect new_card.return_dice signal to self.emit_return_dice
|
||||
new_card.connect("return_dice", self, "emit_return_dice")
|
||||
|
||||
# add the current card to the list of card
|
||||
current_cards.append(new_card)
|
||||
|
Loading…
Reference in New Issue
Block a user