Added draw game option for non hotseat games
This commit is contained in:
parent
0385858d4f
commit
416c48891d
4 changed files with 241 additions and 74 deletions
32
DrawInfo.gd
Normal file
32
DrawInfo.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
extends Control
|
||||
|
||||
@onready var offer_received = $PanelContainer/MarginContainer/OfferReceived
|
||||
@onready var offer_sent = $PanelContainer/MarginContainer/OfferSent
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
GameEvents.draw_offer_sent.connect(_on_draw_offer_sent)
|
||||
GameEvents.draw_offer_received.connect(_on_draw_offer_received)
|
||||
GameEvents.draw_answer_received.connect(_on_draw_answer_received)
|
||||
|
||||
func _on_draw_answer_received(accepted: bool) -> void:
|
||||
visible = false
|
||||
|
||||
func _on_draw_offer_sent() -> void:
|
||||
offer_received.visible = false
|
||||
offer_sent.visible = true
|
||||
visible = true
|
||||
|
||||
func _on_draw_offer_received() -> void:
|
||||
offer_received.visible = true
|
||||
offer_sent.visible = false
|
||||
visible = true
|
||||
|
||||
func _on_yes_button_pressed():
|
||||
GameEvents.draw_answer_sent.emit(true)
|
||||
visible = false
|
||||
|
||||
func _on_no_button_pressed():
|
||||
GameEvents.draw_answer_sent.emit(false)
|
||||
visible = false
|
||||
Loading…
Add table
Add a link
Reference in a new issue