using Microsoft.Xna.Framework; using Penguloon.Scenes; namespace Penguloon.Controls { public class MuteButton : ControlBase { public MuteButton(SceneBase parentScene, Vector2 position, Vector2 size) : base(parentScene, position, size) { this.BackgroundIdle = ContentManager.GetTexture("UI/BtnMuteIdle"); this.BackgroundPressed = ContentManager.GetTexture("UI/BtnMutePressed"); this.BackgroundDisabled = ContentManager.GetTexture("UI/BtnMutePressed"); this.ForeColor = Color.White; this.BorderColor = Color.Gray; this.BorderWidth = 0; this.Font = ContentManager.GetFont(StaticUIValues.MenuFont); OnClick += Button_OnClick; } private void Button_OnClick(object sender, ClickArgs e) { SoundManager.Muted = !SoundManager.Muted; if (SoundManager.Muted) { this.BackgroundIdle = ContentManager.GetTexture("UI/BtnUnmuteIdle"); this.BackgroundPressed = ContentManager.GetTexture("UI/BtnUnmutePressed"); } else { this.BackgroundIdle = ContentManager.GetTexture("UI/BtnMuteIdle"); this.BackgroundPressed = ContentManager.GetTexture("UI/BtnMutePressed"); } SoundManager.PlayClickSound(); } } }