2022-05-24 21:31:30 +02:00
extends TextureButton
2022-06-05 14:22:08 +02:00
const START_CALL_NORMAL = preload ( " res://user_interface/tool_bar/icons/start_call.png " )
const START_CALL_HOVER = preload ( " res://user_interface/tool_bar/icons/start_call_hover.png " )
const START_CALL_PRESSED = preload ( " res://user_interface/tool_bar/icons/start_call_pressed.png " )
const END_CALL_NORMAL = preload ( " res://user_interface/tool_bar/icons/end_call.png " )
const END_CALL_HOVER = preload ( " res://user_interface/tool_bar/icons/end_call_hover.png " )
const END_CALL_PRESSED = preload ( " res://user_interface/tool_bar/icons/end_call_pressed.png " )
2022-06-04 13:33:00 +02:00
func _on_toggled ( _button_pressed ) :
2022-05-24 21:31:30 +02:00
Call . request_call ( )
2022-06-05 14:22:08 +02:00
func _on_pressed ( ) :
if Call . is_call_active :
Call . is_call_active = false
texture_normal = START_CALL_NORMAL
texture_hover = START_CALL_HOVER
texture_pressed = START_CALL_PRESSED
else :
Call . is_call_active = true
texture_normal = END_CALL_NORMAL
texture_hover = END_CALL_HOVER
texture_pressed = END_CALL_PRESSED
func _on_mouse_exited ( ) :
if Call . is_call_active :
#texture_hover = END_CALL_HOVER
pass