34 lines
1.0 KiB
GDScript
34 lines
1.0 KiB
GDScript
extends TextureButton
|
|
|
|
|
|
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")
|
|
|
|
|
|
func _on_toggled(_button_pressed):
|
|
Call.request_call()
|
|
|
|
|
|
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
|