diary/user_interface/tool_bar/mute_button.gd

27 lines
899 B
GDScript3
Raw Normal View History

2022-05-24 21:31:30 +02:00
extends TextureButton
const MUTE_NORMAL = preload("res://user_interface/tool_bar/icons/mute.png")
const MUTE_HOVER = preload("res://user_interface/tool_bar/icons/mute_hover.png")
const MUTE_PRESSED = preload("res://user_interface/tool_bar/icons/mute_pressed.png")
const UNMUTE_NORMAL = preload("res://user_interface/tool_bar/icons/unmute.png")
const UNMUTE_HOVER = preload("res://user_interface/tool_bar/icons/unmute_hover.png")
const UNMUTE_PRESSED = preload("res://user_interface/tool_bar/icons/unmute_pressed.png")
onready var mute_dash = get_node("MuteDash")
func _on_pressed():
if Call.muted:
Call.muted = false
mute_dash.visible = false
texture_normal = MUTE_NORMAL
texture_hover = MUTE_HOVER
texture_pressed = MUTE_PRESSED
else:
Call.muted = true
mute_dash.visible = true
texture_normal = UNMUTE_NORMAL
texture_hover = UNMUTE_HOVER
texture_pressed = UNMUTE_PRESSED