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"); }
void Save() { QStock.Instance.Reset(); //QuickMute.BlizzyToolbar.Reset(); QSettings.Instance.Save(); QDebug.Log("Save", "QGui"); }
internal void HideSettings() { windowSettings = false; QStock.Instance.Set(windowSettings, false); Save(); QDebug.Log("HideSettings", "QGui"); }
internal static void Verify() { if (!QSettings.Instance.Muted) { return; } refreshAudioSource(); QDebug.Log("Verify", "QMute"); }
internal void Show() { if (_window) { return; } Window = true; QDebug.Log("Show", "QLevel"); }
internal void OnHover() { if (!QSettings.Instance.Level) { return; } Show(); QDebug.Log("OnHover", "QLevel"); }
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"); }
internal void Hide(bool force) { Window = false; if (force) { keep = false; } QSettings.Instance.Save(); QuickMute.Instance.Refresh(); QDebug.Log("Hide force: " + force, "QLevel"); }
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"); }
public void Settings() { if (windowSettings) { HideSettings(); } else { ShowSettings(); } QDebug.Log("Settings", "QGui"); }
internal void ShowSettings() { windowSettings = true; QStock.Instance.Set(windowSettings, false); QDebug.Log("ShowSettings", "QGui"); }
void SetCurrentKey(Key key, KeyCode currentKey) { QSettings.Instance.KeyMute = currentKey; QDebug.Log(string.Format("SetCurrentKey({0}): {1}", GetText(key), currentKey), "QKey"); }