コード例 #1
0
ファイル: QH_Hide.cs プロジェクト: stasikos/QuickMods
 public void HideMods(bool value)
 {
     if (!QSettings.Instance.isHidden && value)
     {
         PopulateAppLauncherButtons();
     }
     for (int _i = ModsToolbar.Count - 1; _i >= 0; --_i)
     {
         QMods _qMods = ModsToolbar[_i];
         if (!_qMods.CanBeHide)
         {
             continue;
         }
         if (value)
         {
             if (_qMods.CanSetFalse)
             {
                 _qMods.SetFalse();
             }
         }
         _qMods.isHidden = value;
     }
     if (QSettings.Instance.isHidden != value)
     {
         QSettings.Instance.isHidden = value;
         QSettings.Instance.Save();
         QStockToolbar.Instance.Refresh();
         BlizzyToolbar.Refresh();
     }
     Log((QSettings.Instance.isHidden ? "Hide mods buttons" : "Show mods buttons"));
 }
コード例 #2
0
ファイル: QH_Hide.cs プロジェクト: linuxgurugamer/QuickMods
        internal void DrawAppLauncherButtons()
        {
            List <string> _modsName = new List <string>();

            for (int _i = ModsToolbar.Count - 1; _i >= 0; --_i)
            {
                QMods _qMods = ModsToolbar[_i];
                if (_qMods == null)
                {
                    continue;
                }
                if (_qMods.ModName == "None" || _modsName.Contains(_qMods.ModName))
                {
                    continue;
                }

                _modsName.Add(_qMods.ModName);
                GUILayout.BeginHorizontal();
                GUILayout.Label(string.Format("<b>{0}</b>", _qMods.ToolTip), GUILayout.Width(200));
                bool _CanBePin = _qMods.CanBePin;
                //GUILayout.FlexibleSpace ();
                _CanBePin = GUILayout.Toggle(_CanBePin, Localizer.Format("quickhide_pin"), GUILayout.Width(400));
                if (_CanBePin != _qMods.CanBePin)
                {
                    _qMods.CanBePin = _CanBePin;
                }
                bool _CanBeHide = _qMods.CanBeHide;
                GUILayout.FlexibleSpace();
                _CanBeHide = GUILayout.Toggle(_CanBeHide, Localizer.Format("quickhide_canBeHidden"), GUILayout.Width(200));
                if (_CanBeHide != _qMods.CanBeHide)
                {
                    _qMods.CanBeHide = _CanBeHide;
                }

                GUI.enabled = _CanBeHide;
                bool _CanSetFalse = _qMods.CanSetFalse;
                GUILayout.FlexibleSpace();
                _CanSetFalse = GUILayout.Toggle(_CanSetFalse, Localizer.Format("quickhide_setFalse"), GUILayout.Width(300));
                GUI.enabled  = true;
                if (_CanSetFalse != _qMods.CanSetFalse)
                {
                    _qMods.CanSetFalse = _CanSetFalse;
                }

                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
#if DEBUG
                GUILayout.BeginHorizontal();
                GUILayout.Space(210);
                GUILayout.Label("VisibleInScenes: " + _qMods.VisibleInScenes);
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                GUILayout.Space(210);
                GUILayout.Label("AppScenesSaved: " + _qMods.AppScenesSaved);
                GUILayout.EndHorizontal();
#endif
            }
        }
コード例 #3
0
ファイル: QH_Hide.cs プロジェクト: stasikos/QuickMods
        internal void DrawAppLauncherButtons()
        {
            List <string> _modsName = new List <string> ();

            for (int _i = ModsToolbar.Count - 1; _i >= 0; --_i)
            {
                QMods _qMods = ModsToolbar[_i];
                if (_qMods == null)
                {
                    continue;
                }
                if (_qMods.ModName == "None" || _modsName.Contains(_qMods.ModName))
                {
                    continue;
                }
                _modsName.Add(_qMods.ModName);
                GUILayout.BeginHorizontal();
                GUILayout.Label(string.Format("<b>{0}</b>", _qMods.ModName), GUILayout.Width(200));
                bool _CanBePin = _qMods.CanBePin;
                _CanBePin = GUILayout.Toggle(_CanBePin, "Can be pin for the AutoHide", GUILayout.Width(225));
                if (_CanBePin != _qMods.CanBePin)
                {
                    _qMods.CanBePin = _CanBePin;
                }
                bool _CanBeHide = _qMods.CanBeHide;
                _CanBeHide = GUILayout.Toggle(_CanBeHide, "Can be hidden", GUILayout.Width(140));
                if (_CanBeHide != _qMods.CanBeHide)
                {
                    _qMods.CanBeHide = _CanBeHide;
                }
                if (_CanBeHide)
                {
                    bool _CanSetFalse = _qMods.CanSetFalse;
                    _CanSetFalse = GUILayout.Toggle(_CanSetFalse, "Set to False the button on hide", GUILayout.Width(250));
                    if (_CanSetFalse != _qMods.CanSetFalse)
                    {
                        _qMods.CanSetFalse = _CanSetFalse;
                    }
                }
                GUILayout.EndHorizontal();
#if DEBUG
                GUILayout.BeginHorizontal();
                GUILayout.Space(210);
                GUILayout.Label("VisibleInScenes: " + _qMods.VisibleInScenes);
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                GUILayout.Space(210);
                GUILayout.Label("AppScenesSaved: " + _qMods.AppScenesSaved);
                GUILayout.EndHorizontal();
#endif
            }
        }
コード例 #4
0
ファイル: QH_Hide.cs プロジェクト: linuxgurugamer/QuickMods
        void PopulateAppLauncherButtons(bool force = false)
        {
            if (!QStockToolbar.isAvailable || (!First && !force))
            {
                return;
            }

            Log("Begin PopulateAppLauncherButtons", "QHide");
            bool _cansave = false;

            ApplicationLauncherButton[] _appLauncherButtons = (ApplicationLauncherButton[])Resources.FindObjectsOfTypeAll(typeof(ApplicationLauncherButton));
            for (int _i = _appLauncherButtons.Length - 1; _i >= 0; --_i)
            {
                ApplicationLauncherButton _appLauncherButton = _appLauncherButtons[_i];
                if (!QStockToolbar.isModApp(_appLauncherButton) || QStockToolbar.Instance.isThisApp(_appLauncherButton))
                {
                    continue;
                }
                string toolTip;
                Log("Mods: " + QMods.GetModName(_appLauncherButton, out toolTip) + " " + _appLauncherButton.GetInstanceID(), "QHide");
                QMods _QData = ModsToolbar.Find(q => q.AppRef == QMods.GetAppRef(_appLauncherButton));
                if (_QData != null)
                {
                    if (_QData.ModName != "None" && _QData.isActive)
                    {
                        if (!_QData.isThisApp(_appLauncherButton))
                        {
                            _QData.Refresh(_appLauncherButton);
                        }
                        if (_QData.isHidden != QSettings.Instance.isHidden)
                        {
                            _QData.isHidden = QSettings.Instance.isHidden;
                        }
                        continue;
                    }
                    ModsToolbar.Remove(_QData);
                    //Log ("Deleted an lost AppLauncherButton", "QHide");
                }
                _QData = new QMods(_appLauncherButton);
                ModsToolbar.Add(_QData);
                _cansave = true;
                Log("Added the AppLauncherButton of: " + _QData.ToolTip, "QHide");
            }
            if (_cansave)
            {
                QSettings.Instance.Save();
            }
            Log("End PopulateAppLauncherButtons", "QHide");
            Log("AppLauncherButtons count: " + _appLauncherButtons.Length, "QHide");
            Log("ModsToolbar count: " + ModsToolbar.Count, "QHide");
            Log("ModHasFirstConfig count: " + QSettings.Instance.ModHasFirstConfig.Count, "QHide");
        }