Esempio n. 1
0
        public void DeleteStep(PercentageStep step)
        {
            LayoutDisplay.UnlockPanels(step.PanelIds);

            _profile.Steps.Remove(step);
            BuildStepList();
        }
Esempio n. 2
0
        public PercentageProfileWindow()
        {
            InitializeComponent();

            LayoutDisplay.SetWithAndHeight((int)LayoutDisplay.Width, (int)LayoutDisplay.Height);
            LayoutDisplay.DrawLayout();
            LayoutDisplay.EnableClick();
            LayoutDisplay.DisableColorTimer();

            if (UserSettings.Settings.ActiveDevice.PercentageProfile != null)
            {
                var serialized = JsonConvert.SerializeObject(UserSettings.Settings.ActiveDevice.PercentageProfile); //Deep copy the profile when editing
                _profile = JsonConvert.DeserializeObject <PercentageProfile>(serialized);

                BuildStepList();

                foreach (var step in _profile.Steps)
                {
                    LayoutDisplay.LockPanels(step.PanelIds);
                }
            }
            else
            {
                _profile = new PercentageProfile();
            }
        }
Esempio n. 3
0
        private void Plus_Click(object sender, RoutedEventArgs e)
        {
            if (LayoutDisplay.SelectedPanelIds.Count <= 0)
            {
                return;
            }

            var newStep = new PercentageStep();

            foreach (var panelId in LayoutDisplay.SelectedPanelIds)
            {
                newStep.PanelIds.Add(panelId);
            }

            _profile.Steps.Add(newStep);

            BuildStepList();

            LayoutDisplay.LockPanels(LayoutDisplay.SelectedPanelIds);

            LayoutDisplay.ClearSelectedPanels();
        }
Esempio n. 4
0
    void OnGUI()
    {
        if (titleStyle == null)
        {
            titleStyle = new GUIStyle();
            titleStyle.normal.textColor = Color.green;
            titleStyle.fontSize         = 25;
        }
        if (textStyle == null)
        {
            textStyle = new GUIStyle();
            textStyle.normal.textColor = Color.yellow;
            textStyle.fontSize         = 16;
        }

        GUILayout.Space(15);
        EditorGUILayout.LabelField("----> 引用查询器", titleStyle);
        GUILayout.Space(30);

        _target = EditorGUILayout.ObjectField("当前查询物体:", _target, typeof(Object), false);

        if (_target)
        {
            recursive    = EditorGUILayout.ToggleLeft("递归查找", recursive);
            _mode        = (ShowMode)EditorGUILayout.EnumPopup("查找模式", (System.Enum)_mode);
            _displayMode = (LayoutDisplay)EditorGUILayout.EnumPopup("显示模式", (System.Enum)_displayMode);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("->");
            if (GUILayout.Button("重新寻找引用", GUILayout.Height(25)))
            {
                BeginFindReference();
            }
            EditorGUILayout.EndHorizontal();
        }

        GUILayout.Space(10);

        EditorGUILayout.BeginVertical(GUI.skin.box);
        //if (_referenceList != null)
        //    for (int i = 0; i < _referenceList.Length; i++)
        //    {
        //        EditorGUILayout.TextField(_referenceList[i]);
        //    }
        _scroll = EditorGUILayout.BeginScrollView(_scroll);
        switch (_mode)
        {
        case ShowMode.FolderMode:
            if (_refFolderItem != null)
            {
                ShowRefFolderItems(_refFolderItem);
            }
            break;

        case ShowMode.ReferenceMode:
            if (_refItem != null)
            {
                switch (_displayMode)
                {
                case LayoutDisplay.NestMode:
                    ShowRefItemsNest(_refItem);
                    break;

                case LayoutDisplay.DirectMode:
                    ShowRefItemsDirect(_refItem);
                    break;
                }
            }
            break;
        }
        EditorGUILayout.EndScrollView();

        EditorGUILayout.EndVertical();
    }
Esempio n. 5
0
 public void UnhighlightPanles(HashSet <int> panelIds)
 {
     LayoutDisplay.UnhighlightPanels(panelIds);
 }
Esempio n. 6
0
 public LayoutTest()
 {
     _renderer = new TestRenderer();
     _layoutDisplayComponent   = new LayoutDisplay();
     _layoutDisplayComponentId = _renderer.AssignRootComponentId(_layoutDisplayComponent);
 }