Exemple #1
0
        public void BuildFsmVariableList(bool keepSelection = true)
        {
            if (this.target == null)
            {
                return;
            }
            string name = "";

            if (this.selectedFsmVariable != null)
            {
                name = this.selectedFsmVariable.Name;
            }
            this.fsmVariables = SkillVariable.GetFsmVariableList(this.owner);
            this.SortVariableList();
            this.listIsDirty = false;
            this.categoryLabels.Clear();
            while (this.categoryLabels.get_Count() < this.target.get_Categories().Length)
            {
                string        text          = this.target.get_Categories()[this.categoryLabels.get_Count()];
                EditableLabel editableLabel = new EditableLabel(this.window, text)
                {
                    ID           = this.categoryLabels.get_Count(),
                    EditCommited = new EditableLabel.EditCommitedCallback(this.CommitCategoryEdit),
                    ContextClick = new EditableLabel.ContextClickCallback(this.DoCategoryContextMenu),
                    Style        = EditorStyles.get_boldLabel()
                };
                this.categoryLabels.Add(editableLabel);
            }
            if (keepSelection && this.categoryTextField != null)
            {
                this.SelectVariable(name);
            }
            this.BuildFilteredList();
        }
        public static List <IFormatOption> GetDefaultOptionsForStyle(EditorStyles style)
        {
            switch (style)
            {
            case EditorStyles.Custom:
                break;

            case EditorStyles.LLVM:
                return(new FormatOptionsData().FormatOptions);

            case EditorStyles.Google:
                return(new FormatOptionsGoogleData().FormatOptions);

            case EditorStyles.Chromium:
                return(new FormatOptionsChromiumData().FormatOptions);

            case EditorStyles.Microsoft:
                return(new FormatOptionsMicrosoftData().FormatOptions);

            case EditorStyles.Mozilla:
                return(new FormatOptionsMozillaData().FormatOptions);

            case EditorStyles.WebKit:
                return(new FormatOptionsWebKitData().FormatOptions);

            default:
                break;
            }
            return(new FormatOptionsData().FormatOptions);
        }
Exemple #3
0
        internal override void DrawHeaderHelpAndSettingsGUI(Rect r)
        {
            Vector2 vector = EditorStyles.get_iconButton().CalcSize(EditorGUI.GUIContents.get_helpIcon());
            Object  target = base.get_target();

            EditorGUI.HelpIconButton(new Rect(r.get_xMax() - vector.x, r.get_y() + 5f, vector.x, vector.y), target);
        }
Exemple #4
0
        private static void DoDebugControls()
        {
            int    num  = FsmErrorChecker.CountAllErrors();
            string text = Strings.get_DebugToolbar_No_errors();

            if (num > 0)
            {
                text = string.Format("{0} {1}", num, (num > 1) ? Strings.get_DebugToolbar_Label_Errors() : Strings.get_DebugToolbar_Label_Error());
            }
            SkillEditorContent.DebugToolbarErrorCount.set_text(text);
            if (GUILayout.Button(SkillEditorContent.DebugToolbarErrorCount, SkillEditorStyles.ErrorCount, new GUILayoutOption[0]))
            {
                SkillEditor.OpenErrorWindow();
                GUIUtility.ExitGUI();
            }
            if (Event.get_current().get_type() == 7)
            {
                Rect lastRect = GUILayoutUtility.GetLastRect();
                lastRect.set_x(lastRect.get_x() + 4f);
                lastRect.set_y(lastRect.get_y() + 2f);
                float width;
                lastRect.set_height(width = 14f);
                lastRect.set_width(width);
                GUIHelpers.DrawTexture(lastRect, (num > 0) ? SkillEditorStyles.Errors : SkillEditorStyles.NoErrors, Color.get_white(), 0);
            }
            GUILayout.Space(10f);
            if (GUILayout.Button(SkillEditorContent.DebugToolbarDebug, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[0]))
            {
                DebugToolbar.DoDebugMenu();
            }
        }
Exemple #5
0
        private static void TransitionTools()
        {
            ToolWindow.Header(Strings.get_ToolWindow_Header_Transition_Tools());
            SkillState      selectedState      = SkillEditor.SelectedState;
            SkillTransition selectedTransition = SkillEditor.SelectedTransition;

            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(Strings.get_Label_Event(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });
            if (GUILayout.Button(Labels.GetEventLabel(selectedTransition), EditorStyles.get_popup(), new GUILayoutOption[0]))
            {
                ToolWindow.editingTransition = selectedTransition;
                SkillEditorGUILayout.GenerateEventSelectionMenu(SkillEditor.SelectedFsm, selectedTransition.get_FsmEvent(), new GenericMenu.MenuFunction2(ToolWindow.SelectEvent), new GenericMenu.MenuFunction(SkillEditor.OpenEventManager)).ShowAsContext();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Label(Strings.get_Label_State(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });
            if (GUILayout.Button(Labels.GetStateLabel(selectedTransition.get_ToState()), EditorStyles.get_popup(), new GUILayoutOption[0]))
            {
                ToolWindow.editingTransition = selectedTransition;
                SkillEditorGUILayout.GenerateStateSelectionMenu(SkillEditor.SelectedFsm, selectedTransition.get_ToState(), new GenericMenu.MenuFunction2(ToolWindow.SelectToState)).ShowAsContext();
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button(Strings.get_Command_Delete(), new GUILayoutOption[0]))
            {
                EditorCommands.DeleteTransition(selectedState, selectedTransition);
                SkillEditor.Selection.SelectTransition(null);
                SkillEditor.RepaintAll();
            }
        }
Exemple #6
0
 private void DoToolbar()
 {
     GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     GUILayout.Space(10f);
     GUILayout.EndHorizontal();
 }
Exemple #7
0
        public void OnGUI(Rect area)
        {
            this.area = area;
            Event     current = Event.get_current();
            EventType type    = Event.get_current().get_type();

            this.toolbarHeight = EditorStyles.get_toolbar().get_fixedHeight();
            this.UpdateTicks();
            this.labelColor = EditorStyles.get_label().get_normal().get_textColor();
            this.line.SetColor(this.labelColor);
            this.toolbarRect.Set(area.get_x(), area.get_y(), area.get_width(), this.toolbarHeight);
            GUI.Box(this.toolbarRect, GUIContent.none, EditorStyles.get_toolbar());
            GUI.BeginGroup(area);
            if (type == 7)
            {
                this.graphRect.Set(0f, this.toolbarHeight, area.get_width(), area.get_height() - this.toolbarHeight);
                SkillEditorStyles.DarkPreviewBg.Draw(this.graphRect, false, false, false, false);
                this.DrawTicks(area);
            }
            if (type == 6 && current.get_mousePosition().x > 0f)
            {
                this.Zoom(current.get_mousePosition().x, -current.get_delta().y);
                current.Use();
            }
            if (type == 3 && (current.get_button() == 2 || Keyboard.AltAction()))
            {
                this.Move(-current.get_delta().x);
                current.Use();
            }
            GUI.EndGroup();
            if (area.Contains(current.get_mousePosition()) && type == null && current.get_mousePosition().y < this.toolbarHeight && this.TimelineClicked != null)
            {
                this.TimelineClicked(this.ScreenPositionToTime(current.get_mousePosition().x - area.get_x()));
            }
        }
Exemple #8
0
        private void DrawTicks(Rect area)
        {
            float num  = this.majorTickUnits * this.timeScale;
            float num2 = this.majorTickUnits * Mathf.Floor(this.offset / this.majorTickUnits);
            float num3 = this.TimeToScreenPosition(num2);
            float num4 = this.offset * this.timeScale + area.get_width();

            while (num3 < num4)
            {
                this.tickLabelRect.set_x(num3);
                GUI.Label(this.tickLabelRect, this.FormatTime(num2), EditorStyles.get_miniLabel());
                this.line.DrawVerticalLine(0.75f, num3, 7f, this.toolbarHeight);
                this.line.DrawVerticalLine(0.25f, num3, this.toolbarHeight, area.get_height());
                if (this.minorTickUnits > 0f)
                {
                    float num5 = this.majorTickUnits / this.minorTickUnits;
                    float num6 = num / num5;
                    float num7 = num3 + num6;
                    int   num8 = 0;
                    while ((float)num8 < num5 - 1f)
                    {
                        this.line.DrawVerticalLine(0.5f, num7, 14f, this.toolbarHeight);
                        this.line.DrawVerticalLine(0.15f, num7, this.toolbarHeight, area.get_height());
                        num7 += num6;
                        num8++;
                    }
                }
                num3 += num;
                num2 += this.majorTickUnits;
            }
        }
Exemple #9
0
        public override void DoGUI()
        {
            SkillEditorStyles.Init();
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            SkillEditorGUILayout.PlaymakerHeader(this);
            GUI.Label(this.versionLabelRect, VersionInfo.PlayMakerVersionLabel, SkillEditorStyles.RightAlignedLabel);
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Space(20f);
            GUILayout.FlexibleSpace();
            switch (this.pageNumber)
            {
            case 0:
                WelcomeWindow.Link(SkillEditorStyles.SamplesIcon, Strings.get_WelcomeWindow_Samples(), Strings.get_WelcomeWindow_Samples_More(), new WelcomeWindow.LinkFunction(this.OpenUrl), "http://www.hutonggames.com/samples.php");
                WelcomeWindow.Link(SkillEditorStyles.VideoIcon, Strings.get_WelcomeWindow_Tutorials(), Strings.get_WelcomeWindow_Tutorials_More(), new WelcomeWindow.LinkFunction(this.OpenUrl), "http://www.hutonggames.com/tutorials.html");
                WelcomeWindow.Link(SkillEditorStyles.DocsIcon, Strings.get_WelcomeWindow_Docs(), Strings.get_WelcomeWindow_Docs_More(), new WelcomeWindow.LinkFunction(this.OpenUrl), "https://hutonggames.fogbugz.com/default.asp?W1");
                WelcomeWindow.Link(SkillEditorStyles.ForumIcon, Strings.get_WelcomeWindow_Forums(), Strings.get_WelcomeWindow_Forums_More(), new WelcomeWindow.LinkFunction(this.OpenUrl), "http://hutonggames.com/playmakerforum/index.php");
                WelcomeWindow.Link(SkillEditorStyles.AddonsIcon, Strings.get_WelcomeWindow_Addons(), Strings.get_WelcomeWindow_Addons_More(), new WelcomeWindow.LinkFunction(this.GotoPage), 1);
                break;

            case 1:
                WelcomeWindow.Link(SkillEditorStyles.BlackBerryAddonIcon, "BlackBerry Add-On", "NEW! Develop for the new BlackBerry10 platform.", new WelcomeWindow.LinkFunction(this.OpenInAssetStore), "10530");
                WelcomeWindow.Link(SkillEditorStyles.MetroAddonIcon, "Windows Phone 8 Add-On", "NEW! Develop for Windows Phone 8 devices.", new WelcomeWindow.LinkFunction(this.OpenInAssetStore), "10602");
                WelcomeWindow.Link(SkillEditorStyles.MetroAddonIcon, "Windows Store Apps Add-On", "Coming Soon: Develop Windows 8 Store Apps.", new WelcomeWindow.LinkFunction(this.OpenInAssetStore), "http://www.hutonggames.com/store.html");
                if (WelcomeWindow.setupPhoton)
                {
                    WelcomeWindow.Link(SkillEditorStyles.PhotonIcon, Strings.get_WelcomeWindow_Photon_Cloud(), Strings.get_WelcomeWindow_Photon_Cloud_More(), new WelcomeWindow.LinkFunction(this.LaunchPhotonSetupWizard), null);
                }
                else
                {
                    WelcomeWindow.Link(SkillEditorStyles.PhotonIcon, Strings.get_WelcomeWindow_Photon_Cloud(), Strings.get_WelcomeWindow_Photon_Cloud_More(), new WelcomeWindow.LinkFunction(this.OpenUrl), "https://hutonggames.fogbugz.com/default.asp?W928");
                }
                WelcomeWindow.Link(SkillEditorStyles.AddonsIcon, "Browse Add-Ons Online", "Find action packs and add-ons for NGUI, 2D Toolkit, Mecanim, Pathfinding, Smooth Moves, Ultimate FPS...", new WelcomeWindow.LinkFunction(this.OpenUrl), "https://hutonggames.fogbugz.com/default.asp?W714");
                break;
            }
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            if (this.pageNumber > 0)
            {
                GUILayout.Space(10f);
                if (GUILayout.Button("Back to Welcome Screen", EditorStyles.get_label(), new GUILayoutOption[0]))
                {
                    this.GotoPage(0);
                    GUIUtility.ExitGUI();
                    return;
                }
                EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4);
            }
            GUILayout.FlexibleSpace();
            bool flag = GUILayout.Toggle(this.showAtStartup, Strings.get_WelcomeWindow_Show_at_Startup(), new GUILayoutOption[0]);

            if (flag != this.showAtStartup)
            {
                this.showAtStartup = flag;
                EditorPrefs.SetBool(EditorPrefStrings.get_ShowWelcomeScreen(), this.showAtStartup);
            }
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            GUILayout.EndVertical();
        }
Exemple #10
0
 public override void OnInspectorGUI()
 {
     base.OnInspectorGUI();
     Object[] targets = base.get_targets();
     for (int i = 0; i < targets.Length; i++)
     {
         Object     @object    = targets[i];
         GroupTrack groupTrack = @object as GroupTrack;
         if (groupTrack == null)
         {
             break;
         }
         List <TrackAsset> subTracks = groupTrack.subTracks;
         string            name      = groupTrack.get_name();
         GUILayout.Label((subTracks.Count <= 0) ? name : string.Concat(new object[]
         {
             name,
             " (",
             subTracks.Count,
             ")"
         }), EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
         GUILayout.Space(3f);
         this.m_SubTracks.set_list(groupTrack.subTracks);
         this.m_SubTracks.DoLayoutList();
         this.m_SubTracks.set_index(-1);
     }
 }
Exemple #11
0
        /// <summary>
        /// Set all possible values to the OptionInput and use Levenshtein Diff to find best one
        /// </summary>
        /// <param name="inputModel"></param>
        /// <param name="input"></param>
        private void SetOptionInput(FormatOptionInputModel inputModel, string input, EditorStyles formatStyle, List <IFormatOption> formatOptions)
        {
            if (FormatOptionsInputValues.inputValues.ContainsKey(inputModel.Name) == false)
            {
                return;
            }

            if (customInput.Contains(inputModel.Name))
            {
                if (int.TryParse(inputModel.Input, out int result))
                {
                    inputModel.Input = SetColumnTab(result, inputModel.Name);
                }
            }
            else
            {
                var      inputValuesLevenshtein = new Dictionary <string, int>();
                string[] inputValues            = FormatOptionsInputValues.inputValues[inputModel.Name];
                var      previousInput          = inputModel.Input;
                foreach (var item in inputValues)
                {
                    inputModel.Input = item;
                    var levenshtein = GetLevenshteinAfterFormat(input, formatStyle, formatOptions);
                    inputValuesLevenshtein.Add(item, levenshtein);
                }

                var inputValue = inputValuesLevenshtein.OrderBy(e => e.Value).First();
                inputModel.Input = inputValue.Value == inputValuesLevenshtein[previousInput] ?
                                   previousInput : inputValue.Key;
            }
        }
Exemple #12
0
        private static void DoPlaybackControls()
        {
            Color contentColor = GUI.get_contentColor();

            GUI.set_contentColor((!SkillEditorStyles.UsingProSkin()) ? Color.get_black() : EditorStyles.get_label().get_normal().get_textColor());
            EditorGUI.BeginChangeCheck();
            bool isPlaying = GUILayout.Toggle(EditorApplication.get_isPlayingOrWillChangePlaymode(), SkillEditorContent.Play, EditorStyles.get_toolbarButton(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });

            if (EditorGUI.EndChangeCheck())
            {
                EditorApplication.set_isPlaying(isPlaying);
            }
            EditorGUI.BeginChangeCheck();
            bool isPaused = GUILayout.Toggle(EditorApplication.get_isPaused(), SkillEditorContent.Pause, EditorStyles.get_toolbarButton(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            });

            if (EditorGUI.EndChangeCheck())
            {
                EditorApplication.set_isPaused(isPaused);
            }
            if (GUILayout.Button(SkillEditorContent.Step, EditorStyles.get_toolbarButton(), new GUILayoutOption[]
            {
                GUILayout.MaxWidth(40f)
            }))
            {
                FsmDebugger.Instance.Step();
                GUIUtility.ExitGUI();
            }
            GUI.set_contentColor(contentColor);
        }
        private void DrawExtrapolationOptions()
        {
            EditorGUI.BeginChangeCheck();
            double doubleValue = this.m_PreExtrapolationTimeProperty.get_doubleValue();
            bool   flag        = doubleValue > 0.0;

            if (flag)
            {
                EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                EditorGUILayout.PropertyField(this.m_PreExtrapolationModeProperty, ClipInspector.Styles.PreExtrapolateLabel, new GUILayoutOption[0]);
                EditorGUI.set_showMixedValue(this.m_PreExtrapolationTimeProperty.get_hasMultipleDifferentValues());
                EditorGUILayout.DoubleField(doubleValue, EditorStyles.get_label(), new GUILayoutOption[0]);
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_PostExtrapolationModeProperty, ClipInspector.Styles.PostExtrapolateLabel, new GUILayoutOption[0]);
            EditorGUI.set_showMixedValue(this.m_PostExtrapolationTimeProperty.get_hasMultipleDifferentValues());
            EditorGUILayout.DoubleField(this.m_PostExtrapolationTimeProperty.get_doubleValue(), EditorStyles.get_label(), new GUILayoutOption[0]);
            EditorGUILayout.EndHorizontal();
            if (EditorGUI.EndChangeCheck())
            {
                if (TimelineWindow.IsEditingTimelineAsset(this.m_TimelineAsset) && TimelineWindow.instance.state != null)
                {
                    TimelineWindow.instance.state.Refresh();
                }
            }
        }
 void OnEnable()
 {
     flock = (Flock)target;
     color = new Color(Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), .2f);
     // Tools.hidden = true;
     whiteTextStyle = EditorStyles.TextStyle(Color.white);
 }
Exemple #15
0
 public override void DoGUI()
 {
     SkillEditorStyles.Init();
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     SkillEditorGUILayout.PlaymakerHeader(this);
     GUILayout.Label(FsmEditorSettings.ProductCopyright, EditorStyles.get_miniLabel(), new GUILayoutOption[0]);
     GUILayout.Label((!EditorApp.IsSourceCodeVersion) ? string.Format(Strings.get_AboutPlaymaker_Version_Info(), VersionInfo.GetAssemblyInformationalVersion()) : "Source Code Version", new GUILayoutOption[0]);
     if (VersionInfo.PlayMakerVersionInfo != "")
     {
         EditorGUILayout.HelpBox(VersionInfo.PlayMakerVersionInfo, 0);
     }
     EditorGUILayout.HelpBox(string.Format(Strings.get_AboutPlaymaker_Special_Thanks(), "Erin Ko, Kemal Amarasingham, Bruce Blumberg, Steve Gargolinski, Lee Hepler, Bart Simon, Lucas Meijer, Joachim Ante, Jaydee Alley, James Murchison, XiaoHang Zheng, Andrzej Łukasik, Vanessa Wesley, Marek Ledvina, Bob Berkebile, Jean Fabre, MaDDoX, gamesonytablet, Marc 'Dreamora' Schaerer, Eugenio 'Ryo567' Martínez, Steven 'Nightreaver' Barthen, Damiangto, VisionaiR3D, 黄峻, Nilton Felicio, Andre Dantas Lima, Ramprasad Madhavan, and the PlayMaker Community!\r\n"), 0);
     if (GUILayout.Button(Strings.get_AboutPlaymaker_Release_Notes(), new GUILayoutOption[0]))
     {
         EditorCommands.OpenWikiPage(WikiPages.ReleaseNotes);
     }
     if (GUILayout.Button(Strings.get_AboutPlaymaker_Hutong_Games_Link(), new GUILayoutOption[0]))
     {
         Application.OpenURL("http://hutonggames.com/");
     }
     GUILayout.Space(5f);
     GUILayout.EndVertical();
     if (!AboutPlaymaker.heightHasBeenSet && Event.get_current().get_type() == 7)
     {
         this.SetWindowHeightToFitContents();
     }
 }
 public void OnGUI()
 {
     if (!SkillEditorStyles.IsInitialized())
     {
         SkillEditorStyles.Init();
     }
     GUILayout.Label(this.titleLabel, EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
     this.editField.OnGUI(new GUILayoutOption[0]);
     if (!string.IsNullOrEmpty(this.validationError))
     {
         GUILayout.Box(this.validationError, SkillEditorStyles.ErrorBox, new GUILayoutOption[0]);
     }
     else
     {
         EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(this.editField.Text));
         if (GUILayout.Button(Strings.get_Label_Create_Variable(), new GUILayoutOption[0]))
         {
             this.editField.CommitEdit();
         }
         EditorGUI.EndDisabledGroup();
     }
     if (Event.get_current().get_type() == 7)
     {
         Color labelTextColor = SkillEditorStyles.LabelTextColor;
         labelTextColor.a = 0.5f;
         Handles.set_color(labelTextColor);
         Handles.DrawPolyLine(this.framePoints);
     }
 }
 public static bool ToolbarSettingsButton()
 {
     return(GUILayout.Button(SkillEditorContent.SettingsButton, EditorStyles.get_label(), new GUILayoutOption[]
     {
         GUILayout.MaxWidth(24f)
     }));
 }
        public static GUIStyle UssStyleForType(Type type)
        {
            ClearCacheIfInvalid();

            GUIStyle cachedStyle;

            if (s_CustomStyles.TryGetValue(type, out cachedStyle))
            {
                return(cachedStyle);
            }

            var style = new GUIStyle(DirectorStyles.markerDefaultStyle);

            var customStyleForType = CustomStyleForType(type);

            if (customStyleForType != null)
            {
                if (IsStyleValid(customStyleForType))
                {
                    style = EditorStyles.FromUSS(customStyleForType);
                }
                else
                {
                    Debug.LogWarningFormat(k_ErrorCannotFindStyle, customStyleForType, type.Name);
                }
            }

            s_CustomStyles.Add(type, style);
            return(style);
        }
    public static bool Foldout(bool expanded, string label, EditorStyles style = null)
    {
        var content = new GUIContent(label, FoldOutTooltip);

        expanded = EditorGUILayout.Foldout(expanded, content);

        return(expanded);
    }
 public static bool ToolbarDeleteButton()
 {
     SkillEditorContent.DeleteButton.set_tooltip((DragAndDropManager.mode == DragAndDropManager.DragMode.None) ? Strings.get_Command_Delete() : null);
     return(GUILayout.Button(SkillEditorContent.DeleteButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[]
     {
         GUILayout.MaxWidth(24f)
     }));
 }
Exemple #21
0
 private void DoMainToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     SkillEditorGUILayout.ToolbarSettingsButton();
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
Exemple #22
0
        private async Task DetectAsync(CancellationToken cancelToken)
        {
            await Task.WhenAll(filesContent.Select(e => CalculateColumTabAsync(e, cancelToken)));

            await Task.WhenAll(filesContent.Select(e => DetectFileStyleAsync(e, cancelToken)));

            detectedStyle = GetStyleByLevenshtein(detectedPredefinedStyles);
            await DetectOptionsForFilesAsync(cancelToken);
        }
Exemple #23
0
 public EditableLabel(EditorWindow window, string text = "") : base(window)
 {
     base.Style             = EditorStyles.get_label();
     this.Text              = text;
     this.editableTextField = new TextField(window, GUIContent.none, text);
     this.editableTextField.EditCommited = new TextField.EditCommitedCallback(this.CommitEdit);
     this.editableTextField.FocusLost    = new TextField.LostFocusCallback(this.CommitEdit);
     this.editableTextField.ControlName  = "Category";
     EditorApplication.update            = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.Update));
 }
 private static void DoFsmSelectorGUI()
 {
     SkillEditorContent.MainToolbarSelectedGO.set_text((SkillEditor.SelectedFsmGameObject == null) ? Strings.get_Label_None() : SkillEditor.SelectedFsmGameObject.get_name());
     SkillEditorContent.MainToolbarSelectedGO.set_tooltip(Strings.get_Hint_Select_Game_Object());
     EditorGUI.BeginDisabledGroup(!SkillEditor.SelectionHistory.CanMoveBack());
     if (GUILayout.Button(SkillEditorContent.BackButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         SkillEditor.SelectFsm(SkillEditor.SelectionHistory.MoveBack());
     }
     EditorGUI.EndDisabledGroup();
     EditorGUI.BeginDisabledGroup(!SkillEditor.SelectionHistory.CanMoveForward());
     if (GUILayout.Button(SkillEditorContent.ForwardButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         SkillEditor.SelectFsm(SkillEditor.SelectionHistory.MoveForward());
     }
     EditorGUI.EndDisabledGroup();
     EditorGUI.BeginDisabledGroup(SkillEditor.SelectionHistory.RecentlySelectedCount <= 0);
     if (GUILayout.Button(SkillEditorContent.RecentButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         GenericMenu  genericMenu          = new GenericMenu();
         List <Skill> recentlySelectedFSMs = SkillEditor.SelectionHistory.GetRecentlySelectedFSMs();
         using (List <Skill> .Enumerator enumerator = recentlySelectedFSMs.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Skill current = enumerator.get_Current();
                 genericMenu.AddItem(new GUIContent(Labels.GetFullFsmLabel(current)), current == SkillEditor.SelectedFsm, new GenericMenu.MenuFunction2(SkillEditor.SelectFsm), current);
             }
         }
         genericMenu.ShowAsContext();
         return;
     }
     EditorGUI.EndDisabledGroup();
     if (GUILayout.Button(SkillEditorContent.MainToolbarSelectedGO, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[]
     {
         GUILayout.MinWidth(100f)
     }))
     {
         SkillEditorGUILayout.GenerateFsmGameObjectSelectionMenu(true).ShowAsContext();
     }
     SkillEditorContent.MainToolbarSelectedFSM.set_text((SkillEditor.SelectedFsm == null) ? "" : SkillEditor.SelectedFsm.get_Name());
     SkillEditorContent.MainToolbarSelectedFSM.set_tooltip(Strings.get_Tooltip_Select_FSM());
     if (GUILayout.Button(SkillEditorContent.MainToolbarSelectedFSM, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[]
     {
         GUILayout.MinWidth(100f)
     }))
     {
         SkillEditorGUILayout.GenerateGameObjectFsmSelectionMenu().ShowAsContext();
     }
     FsmEditorSettings.LockGraphView = GUILayout.Toggle(FsmEditorSettings.LockGraphView, SkillEditorContent.MainToolbarLock, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]);
     if (GUI.get_changed())
     {
         FsmEditorSettings.SaveSettings();
     }
 }
        public static StringBuilder CreateOutput(List <IFormatOption> formatOptions, EditorStyles style)
        {
            List <IFormatOption> options;
            var output = new StringBuilder();

            output.AppendLine("# Format Style Options - Created with Clang Power Tools");
            output.AppendLine("---");
            output.AppendLine("Language: Cpp");

            switch (style)
            {
            case EditorStyles.LLVM:
                output.AppendLine("BasedOnStyle: LLVM");
                options = GetChangedOptions(formatOptions, new FormatOptionsData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            case EditorStyles.Google:
                output.AppendLine("BasedOnStyle: Google");
                options = GetChangedOptions(formatOptions, new FormatOptionsGoogleData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            case EditorStyles.Chromium:
                output.AppendLine("BasedOnStyle: Chromium");
                options = GetChangedOptions(formatOptions, new FormatOptionsChromiumData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            case EditorStyles.Mozilla:
                output.AppendLine("BasedOnStyle: Mozilla");
                options = GetChangedOptions(formatOptions, new FormatOptionsMozillaData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            case EditorStyles.WebKit:
                output.AppendLine("BasedOnStyle: WebKit");
                options = GetChangedOptions(formatOptions, new FormatOptionsWebKitData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            case EditorStyles.Microsoft:
                output.AppendLine("BasedOnStyle: Microsoft");
                options = GetChangedOptions(formatOptions, new FormatOptionsMicrosoftData().FormatOptions);
                AddActiveOptionToFile(options, output);
                break;

            default:
                AddActiveOptionToFile(formatOptions, output);
                break;
            }
            output.AppendLine("...");

            return(output);
        }
 public static void LayerNamePopup(GUIContent label, SkillString variable, object obj = null, FieldInfo field = null)
 {
     SkillEditorGUILayout.PrefixLabel(label);
     if (GUILayout.Button(variable.get_Value(), EditorStyles.get_popup(), new GUILayoutOption[0]))
     {
         StringEditor.editingVariable = variable;
         StringEditor.editingObject   = obj;
         StringEditor.editingField    = field;
         StringEditor.DoLayerMenu();
     }
 }
Exemple #27
0
 private void DoToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     if (SkillEditorGUILayout.ToolbarSettingsButton() && this.SettingsButtonClicked != null)
     {
         this.SettingsButtonClicked.Invoke();
     }
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
 private void DoMainToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     if (SkillEditorGUILayout.ToolbarSettingsButton())
     {
         this.GenerateSettingsMenu().ShowAsContext();
     }
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
 public override void Initialize()
 {
     this.isToolWindow       = true;
     TimelineWindow.instance = this;
     this.InitWindowTitle();
     base.set_minSize(new Vector2(300f, 100f));
     this.toolbarHeight   = EditorStyles.get_toolbar().get_fixedHeight();
     this.scrollbarHeight = GUI.get_skin().get_horizontalScrollbar().get_fixedHeight();
     this.RefreshList();
     this.LoadSettings();
 }
Exemple #30
0
        private static void DoToolbar()
        {
            GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
            string fullFsmLabel = Labels.GetFullFsmLabel(SkillEditor.SelectedFsm);

            if (GUILayout.Button(fullFsmLabel, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[0]))
            {
                SkillEditorGUILayout.GenerateFsmSelectionMenu(true, false).ShowAsContext();
            }
            GUILayout.EndHorizontal();
        }