Example #1
0
        internal static void refreshAudioSource()
        {
            AudioSource[] _audios = AudioSources;

            for (int _i = _audios.Length - 1; _i >= 0; --_i)
            {
                AudioSource _audio = _audios[_i];

                if (_audio != null)
                {
                    if (QSettings.Instance.Muted)
                    {
                        audioVolume[_audio.name] = _audio.volume;
                        _audio.volume            = 0;
                    }
                    else
                    {
                        if (audioVolume.ContainsKey(_audio.name))
                        {
                            _audio.volume = audioVolume[_audio.name];
                        }
                    }
                }
            }
            QDebug.Log("refreshAudioSource", "QMute");
        }
Example #2
0
 void Save()
 {
     QStock.Instance.Reset();
     //QuickMute.BlizzyToolbar.Reset();
     QSettings.Instance.Save();
     QDebug.Log("Save", "QGui");
 }
Example #3
0
 internal void HideSettings()
 {
     windowSettings = false;
     QStock.Instance.Set(windowSettings, false);
     Save();
     QDebug.Log("HideSettings", "QGui");
 }
Example #4
0
 internal static void Verify()
 {
     if (!QSettings.Instance.Muted)
     {
         return;
     }
     refreshAudioSource();
     QDebug.Log("Verify", "QMute");
 }
Example #5
0
 internal void Show()
 {
     if (_window)
     {
         return;
     }
     Window = true;
     QDebug.Log("Show", "QLevel");
 }
Example #6
0
 internal void OnHover()
 {
     if (!QSettings.Instance.Level)
     {
         return;
     }
     Show();
     QDebug.Log("OnHover", "QLevel");
 }
Example #7
0
 public QLevel(QVolume volume)
 {
     styleWindow         = new GUIStyle(HighLogic.Skin.window);
     styleWindow.padding = new RectOffset();
     styleSlider         = new GUIStyle(HighLogic.Skin.verticalSlider);
     styleSlider.padding = new RectOffset();
     styleThumb          = new GUIStyle(HighLogic.Skin.verticalSliderThumb);
     this.volume         = volume;
     QDebug.Log("Init", "QLevel");
 }
Example #8
0
 internal void Hide(bool force)
 {
     Window = false;
     if (force)
     {
         keep = false;
     }
     QSettings.Instance.Save();
     QuickMute.Instance.Refresh();
     QDebug.Log("Hide force: " + force, "QLevel");
 }
Example #9
0
 void VerifyKey()
 {
     try {
         Input.GetKey(CurrentKey(Key.Mute));
     }
     catch {
         QDebug.Warning("Wrong key: " + CurrentKey(Key.Mute), "QKey");
         SetCurrentKey(Key.Mute, DefaultKey(Key.Mute));
     }
     QDebug.Log("VerifyKey", "QKey");
 }
Example #10
0
 public void Settings()
 {
     if (windowSettings)
     {
         HideSettings();
     }
     else
     {
         ShowSettings();
     }
     QDebug.Log("Settings", "QGui");
 }
Example #11
0
 internal void ShowSettings()
 {
     windowSettings = true;
     QStock.Instance.Set(windowSettings, false);
     QDebug.Log("ShowSettings", "QGui");
 }
Example #12
0
 void SetCurrentKey(Key key, KeyCode currentKey)
 {
     QSettings.Instance.KeyMute = currentKey;
     QDebug.Log(string.Format("SetCurrentKey({0}): {1}", GetText(key), currentKey), "QKey");
 }