Esempio n. 1
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();
            }
        }
Esempio n. 2
0
        private void DoTableHeaders()
        {
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool changed = GUI.get_changed();

            GUI.set_changed(false);
            GUILayout.BeginHorizontal(SkillEditorStyles.TableRowBox, new GUILayoutOption[0]);
            GUILayout.Toggle(false, SkillEditorContent.EventBroadcastIcon, SkillEditorStyles.TableRowHeader, new GUILayoutOption[0]);
            this.sortByUsageCount = !GUILayout.Toggle(!this.sortByUsageCount, SkillEditorContent.EventHeaderLabel, SkillEditorStyles.TableRowHeader, new GUILayoutOption[]
            {
                GUILayout.MinWidth(244f)
            });
            this.sortByUsageCount = GUILayout.Toggle(this.sortByUsageCount, SkillEditorContent.EventUsedHeaderLabel, SkillEditorStyles.TableRowHeader, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            if (SkillEditorGUILayout.SettingsButtonPadded())
            {
                this.GenerateEventManagerMenu().ShowAsContext();
            }
            GUILayout.EndHorizontal();
            if (GUI.get_changed())
            {
                this.SortEvents();
            }
            else
            {
                GUI.set_changed(changed);
            }
            EditorGUILayout.EndHorizontal();
            if (FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(Strings.get_Hint_EventManager(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
        }
Esempio n. 3
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();
        }
Esempio n. 4
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();
     }
 }
Esempio n. 5
0
 public override void DoGUI()
 {
     if (Event.get_current().get_type() == null && Event.get_current().get_button() == 0 && GUIUtility.get_hotControl() == 0)
     {
         GUIUtility.set_keyboardControl(0);
     }
     StateSelector.HandleKeyboardInput();
     StateSelector.DoToolbar();
     if (FsmEditorSettings.ShowHints)
     {
         GUILayout.Box(Strings.get_Hint_State_Selector(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
     }
     StateSelector.scrollPosition = GUILayout.BeginScrollView(StateSelector.scrollPosition, new GUILayoutOption[0]);
     if (SkillEditor.SelectedFsm != null)
     {
         SkillState[] states = SkillEditor.SelectedFsm.get_States();
         for (int i = 0; i < states.Length; i++)
         {
             SkillState state = states[i];
             StateSelector.DoStateRow(state);
         }
     }
     GUILayout.EndScrollView();
     this.DoAutoScroll();
     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     GUILayout.EndHorizontal();
     EditorGUILayout.Space();
 }
Esempio n. 6
0
 private void DoErrorHierarchyGUI()
 {
     this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition, new GUILayoutOption[0]);
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     using (List <FsmError> .Enumerator enumerator = FsmErrorChecker.GetErrors().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             FsmError current = enumerator.get_Current();
             if (!this.filterByFsm || current.Fsm == SkillEditor.SelectedFsm)
             {
                 GUIStyle gUIStyle = SkillEditorStyles.ActionItem;
                 if (this.selectedError == current)
                 {
                     gUIStyle = SkillEditorStyles.ActionItemSelected;
                 }
                 SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
                 if (GUILayout.Button(current.ErrorString, gUIStyle, new GUILayoutOption[0]) || GUILayout.Button(current.ToString(), gUIStyle, new GUILayoutOption[0]))
                 {
                     this.selectedError = current;
                     ErrorSelector.GotoError(this.selectedError);
                 }
             }
         }
     }
     GUILayout.EndVertical();
     EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4);
     GUILayout.EndScrollView();
 }
Esempio n. 7
0
 private void DoBottomPanel()
 {
     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
     if (SkillEditor.SelectedFsm != null)
     {
         SkillEditor.SelectedFsm.set_Description(EditorGUILayout.TextArea(SkillEditor.SelectedFsm.get_Description(), SkillEditorStyles.TextArea, new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         }));
         EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
         SkillEditor.SelectedFsm.set_DocUrl(EditorGUILayout.TextField(SkillEditor.SelectedFsm.get_DocUrl(), new GUILayoutOption[0]));
         if (string.IsNullOrEmpty(SkillEditor.SelectedFsm.get_DocUrl()))
         {
             GUI.set_enabled(false);
         }
         if (SkillEditorGUILayout.HelpButton("Online Help"))
         {
             Application.OpenURL(SkillEditor.SelectedFsm.get_DocUrl());
         }
         EditorGUILayout.EndHorizontal();
     }
     else
     {
         GUI.set_enabled(false);
         GUILayout.TextArea(Strings.get_Label_Description___(), new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         });
         EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
         GUILayout.TextField(Strings.get_FsmSelector_Label_Url_to_docs(), new GUILayoutOption[0]);
         SkillEditorGUILayout.HelpButton("Online Help");
         EditorGUILayout.EndHorizontal();
     }
     EditorGUILayout.Space();
 }
        private void DoSelectedActionPreview()
        {
            SkillEditorGUILayout.LabelWidth(150f);
            this.previewScrollViewHeight = Mathf.Min(base.get_position().get_height() - 150f - this.descriptionHeight, this.previewActionGUIHeight);
            this.previewScrollPosition   = EditorGUILayout.BeginScrollView(this.previewScrollPosition, new GUILayoutOption[]
            {
                GUILayout.Height(this.previewScrollViewHeight)
            });
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            bool enabled = GUI.get_enabled();

            GUI.set_enabled(false);
            SkillEditor.ActionEditor.OnGUI(this.previewAction);
            GUI.set_enabled(enabled);
            GUILayout.EndVertical();
            if (Event.get_current().get_type() == 7)
            {
                float num = this.previewActionGUIHeight;
                this.previewActionGUIHeight = GUILayoutUtility.GetLastRect().get_height() + 5f;
                if (Math.Abs(this.previewActionGUIHeight - num) > 1f)
                {
                    base.Repaint();
                    this.autoScroll = true;
                }
            }
            EditorGUILayout.EndScrollView();
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            EditorGUILayout.Space();
        }
Esempio n. 9
0
 private void DoMainToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     SkillEditorGUILayout.ToolbarSettingsButton();
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
Esempio n. 10
0
 private static void EndVariableEditor(INamedVariable variable)
 {
     EditorGUILayout.EndHorizontal();
     if (variable != null && VariableEditor.DebugVariables && variable.get_UseVariable() && !string.IsNullOrEmpty(variable.get_Name()))
     {
         SkillEditorGUILayout.ReadonlyTextField(variable.ToString(), new GUILayoutOption[0]);
     }
 }
 public static void UnlockFSM(Skill fsm)
 {
     fsm.Unlock(SkillEditorGUILayout.Md5Sum(SkillEditorGUILayout.password));
     if (fsm.get_Locked())
     {
         Dialogs.OkDialog(Strings.get_ProductName(), Strings.get_Dialog_UnlockFSM_Wrong_Password());
         return;
     }
     SkillEditor.SetFsmDirty(fsm, false, false, true);
 }
Esempio n. 12
0
 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();
     }
 }
Esempio n. 13
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();
        }
Esempio n. 14
0
 private static void DoBottomPanel()
 {
     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Label(string.Format(Strings.get_ErrorSelector_Setup_Errors(), FsmErrorChecker.CountSetupErrors()), new GUILayoutOption[0]);
     GUILayout.Space(20f);
     GUILayout.Label(string.Format(Strings.get_ErrorSelector_Runtime_Errors(), FsmErrorChecker.CountRuntimeErrors()), new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     GUILayout.Label(string.Format(Strings.get_ErrorSelector_Total_Errors(), FsmErrorChecker.CountAllErrors()), new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
 }
Esempio n. 15
0
 private void DoToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     this.searchBox.OnGUI();
     if (SkillEditorGUILayout.ToolbarSettingsButton())
     {
         GlobalEventsWindow.GenerateEventManagerMenu().ShowAsContext();
     }
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
Esempio n. 16
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();
 }
Esempio n. 17
0
 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 static void OnGUI()
        {
            if (!FsmEditorSettings.EnableWatermarks)
            {
                GUILayout.Label(Strings.get_Label_Watermarks_Are_Disabled(), new GUILayoutOption[0]);
                if (GUILayout.Button(Strings.get_Command_Enable_Watermarks(), new GUILayoutOption[0]))
                {
                    FsmEditorSettings.EnableWatermarks = true;
                }
                if (GUILayout.Button(Strings.get_Command_Finished(), new GUILayoutOption[0]))
                {
                    WatermarkSelector.Cancel();
                }
                GUILayout.FlexibleSpace();
                return;
            }
            GUILayout.Label(Strings.get_Label_Select_A_Watermark(), new GUILayoutOption[0]);
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            WatermarkSelector.scrollViewPosition = GUILayout.BeginScrollView(WatermarkSelector.scrollViewPosition, new GUILayoutOption[0]);
            Color color = GUI.get_color();

            GUI.set_contentColor(SkillEditorStyles.WatermarkTintSolid);
            int num = GUILayout.SelectionGrid(WatermarkSelector.selectedWatermarkIndex, WatermarkSelector.watermarkThumbs, 4, new GUILayoutOption[]
            {
                GUILayout.Width(WatermarkSelector.gridWidth),
                GUILayout.Height(WatermarkSelector.gridHeight)
            });

            if (num != WatermarkSelector.selectedWatermarkIndex)
            {
                WatermarkSelector.SelectWatermark(num);
            }
            GUI.set_contentColor(color);
            GUILayout.EndScrollView();
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            if (GUILayout.Button(Strings.get_Command_Clear_Watermark(), new GUILayoutOption[0]))
            {
                Watermarks.Set(SkillEditor.SelectedFsm, "");
                WatermarkSelector.Cancel();
            }
            if (GUILayout.Button(Strings.get_Command_Finished(), new GUILayoutOption[0]))
            {
                WatermarkSelector.Cancel();
            }
            if (FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(Strings.get_Hint_Watermarks(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
            EditorGUILayout.Space();
        }
Esempio n. 19
0
 private void DoSortedByFSM()
 {
     this.currentFSM    = null;
     this.currentState  = null;
     this.currentAction = null;
     using (List <ActionReport> .Enumerator enumerator = ActionReport.ActionReportList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             ActionReport current = enumerator.get_Current();
             if (!(current.fsm == null) && current.state != null && current.action != null)
             {
                 if (current.fsm != this.currentFSM)
                 {
                     this.currentFSM = current.fsm;
                     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
                     if (GUILayout.Button(Labels.GetFullFsmLabel(current.fsm.get_Fsm()), EditorStyles.get_label(), new GUILayoutOption[0]))
                     {
                         ActionReportWindow.SelectReport(current);
                         break;
                     }
                     EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4);
                 }
                 if (current.state != this.currentState)
                 {
                     this.currentState = current.state;
                     SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
                     if (GUILayout.Button(Strings.get_Tab() + current.state.get_Name(), EditorStyles.get_label(), new GUILayoutOption[0]))
                     {
                         ActionReportWindow.SelectReport(current);
                         break;
                     }
                     EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4);
                 }
                 if (current.action != this.currentAction)
                 {
                     SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
                     this.currentAction = current.action;
                     if (GUILayout.Button(Strings.get_Tab2() + Labels.GetActionLabel(current.action), EditorStyles.get_label(), new GUILayoutOption[0]))
                     {
                         ActionReportWindow.SelectReport(current);
                         break;
                     }
                     EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4);
                 }
                 ActionReportWindow.DoReportLine(Strings.get_Tab3(), current);
             }
         }
     }
 }
Esempio n. 20
0
 private void DoToolbar()
 {
     GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     SkillSelector.FsmFilter fsmFilter = (SkillSelector.FsmFilter)EditorGUILayout.EnumPopup(this.fsmFilter, EditorStyles.get_toolbarPopup(), new GUILayoutOption[0]);
     if (this.fsmFilter != fsmFilter)
     {
         this.SetFilterMode(fsmFilter);
     }
     if (SkillEditorGUILayout.ToolbarSettingsButton())
     {
         this.GenerateSettingsMenu().ShowAsContext();
     }
     GUILayout.Space(-10f);
     GUILayout.EndHorizontal();
 }
Esempio n. 21
0
 public static SkillFloat FsmFloatSlider(GUIContent label, Skill fsm, SkillFloat fsmFloat, float minSliderValue, float maxSliderValue)
 {
     EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (fsmFloat.get_UseVariable())
     {
         fsmFloat = VariableEditor.DoFsmFloatPopup(label, fsm, fsmFloat);
     }
     else
     {
         fsmFloat.set_Value(SkillEditorGUILayout.FloatSlider(label, fsmFloat.get_Value(), minSliderValue, maxSliderValue));
     }
     fsmFloat = (SkillFloat)VariableEditor.VariableToggle(fsmFloat, label.get_text());
     VariableEditor.EndVariableEditor(fsmFloat);
     return(fsmFloat);
 }
Esempio n. 22
0
        private void DoBottomPanel()
        {
            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            if (this.selectedAction != null)
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.Label(Labels.GetActionLabel(this.selectedAction), SkillEditorStyles.ActionPreviewTitle, new GUILayoutOption[]
                {
                    GUILayout.MaxWidth(base.get_position().get_width() - 30f)
                });
                GUILayout.FlexibleSpace();
                if (SkillEditorGUILayout.HelpButton("Online Help"))
                {
                    EditorCommands.OpenWikiPage(this.previewAction);
                }
                GUILayout.EndHorizontal();
                string tooltip = Actions.GetTooltip(this.selectedAction);
                GUILayout.Box(tooltip, SkillEditorStyles.LabelWithWordWrap, new GUILayoutOption[0]);
                if (Event.get_current().get_type() == 7)
                {
                    this.descriptionHeight = GUILayoutUtility.GetLastRect().get_height();
                }
                ActionEditor.PreviewMode = true;
                EditorGUILayout.Space();
                SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
                if (FsmEditorSettings.ShowActionPreview)
                {
                    this.DoSelectedActionPreview();
                }
                ActionEditor.PreviewMode = false;
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            bool flag = GUILayout.Toggle(FsmEditorSettings.ShowActionPreview, Strings.get_ActionSelector_Preview(), new GUILayoutOption[0]);

            if (flag != FsmEditorSettings.ShowActionPreview)
            {
                FsmEditorSettings.ShowActionPreview = flag;
                FsmEditorSettings.SaveSettings();
            }
            EditorGUI.BeginDisabledGroup(SkillEditor.SelectedState == null || this.selectedAction == null || FsmGraphView.EditingDisable);
            if (GUILayout.Button(new GUIContent(Strings.get_ActionSelector_Add_Action_To_State(), Strings.get_ActionSelector_Add_Action_To_State_Tooltip()), new GUILayoutOption[0]))
            {
                this.AddSelectedActionToState();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }
Esempio n. 23
0
        private void DoMainToolbar()
        {
            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(false, false).ShowAsContext();
            }
            if (SkillEditorGUILayout.ToolbarSettingsButton())
            {
                SkillLogger.GenerateSettingsMenu().ShowAsContext();
            }
            GUILayout.Space(-5f);
            GUILayout.EndHorizontal();
        }
 public void OnGUI()
 {
     if (this.justEnabled)
     {
         this.Initialize();
         this.justEnabled = false;
         this.Initialized = true;
     }
     if (this.isToolWindow && !SkillEditorGUILayout.ToolWindowsCommonGUI(this))
     {
         return;
     }
     this.currentEvent = Event.get_current();
     this.eventType    = this.currentEvent.get_type();
     this.DoGUI();
 }
Esempio n. 25
0
        private void DoGlobalVariablesTable()
        {
            if (SkillSearch.GetGlobalVariablesUsedCount(SkillEditor.SelectedFsm) == 0)
            {
                return;
            }
            GUILayout.Space(10f);
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(SkillEditorStyles.TableRowBox, new GUILayoutOption[0]);
            GUILayout.Label(SkillEditorContent.GlobalsLabel, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            GUILayout.Label(SkillEditorContent.VariableUseCountLabel, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            List <NamedVariable> globalVariablesUsed = SkillSearch.GetGlobalVariablesUsed(SkillEditor.SelectedFsm);

            using (List <NamedVariable> .Enumerator enumerator = globalVariablesUsed.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    NamedVariable current = enumerator.get_Current();
                    GUILayout.BeginHorizontal(SkillEditorStyles.TableRowBox, new GUILayoutOption[0]);
                    GUIStyle tableRowText = SkillEditorStyles.TableRowText;
                    if (GUILayout.Button(new GUIContent(current.get_Name(), current.get_Tooltip()), tableRowText, new GUILayoutOption[]
                    {
                        GUILayout.MinWidth(155f)
                    }))
                    {
                        Keyboard.ResetFocus();
                        this.Deselect();
                        if (Event.get_current().get_button() == 1 || EditorGUI.get_actionKey())
                        {
                            FsmVariablesEditor.DoGlobalVariableContextMenu(current);
                        }
                    }
                    int globalVariablesUsageCount = SkillSearch.GetGlobalVariablesUsageCount(current);
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(globalVariablesUsageCount.ToString(CultureInfo.get_CurrentCulture()), tableRowText, new GUILayoutOption[0]);
                    GUILayout.Space(10f);
                    GUILayout.EndHorizontal();
                    if (FsmEditorSettings.DebugVariables)
                    {
                        SkillEditorGUILayout.ReadonlyTextField(current.ToString(), new GUILayoutOption[0]);
                    }
                }
            }
        }
 public static void UnlockFsmGUI(Skill fsm)
 {
     if (fsm != null && fsm.get_Locked())
     {
         EditorGUILayout.HelpBox(Strings.get_Label_This_FSM_is_Locked(), 1);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         SkillEditorGUILayout.password = EditorGUILayout.TextField(SkillEditorGUILayout.password, new GUILayoutOption[0]);
         if (GUILayout.Button(Strings.get_Label_Unlock(), new GUILayoutOption[]
         {
             GUILayout.MaxWidth(60f)
         }))
         {
             SkillEditorGUILayout.UnlockFSM(fsm);
         }
         GUILayout.EndHorizontal();
     }
 }
Esempio n. 27
0
 private void DoToolbar()
 {
     EditorGUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]);
     if (GUILayout.Button(Strings.get_ErrorSelector_Refresh(), EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         FsmErrorChecker.Refresh();
     }
     GUILayout.FlexibleSpace();
     this.filterByFsm = GUILayout.Toggle(this.filterByFsm, new GUIContent(Strings.get_ErrorSelector_Filter_Selected_FSM_Only(), Strings.get_ErrorSelector_Filter_Selected_FSM()), EditorStyles.get_toolbarButton(), new GUILayoutOption[0]);
     GUILayout.Space(5f);
     if (SkillEditorGUILayout.ToolbarSettingsButton())
     {
         ErrorSelector.GenerateSettingsMenu().ShowAsContext();
     }
     GUILayout.Space(-5f);
     EditorGUILayout.EndHorizontal();
 }
 private static bool DoToolWindowsDisabledGUI()
 {
     if (SkillEditorGUILayout.DoEditorDisabledGUI())
     {
         return(true);
     }
     if (EditorApplication.get_isPlaying() && FsmEditorSettings.DisableToolWindowsWhenPlaying)
     {
         GUILayout.Label(Strings.get_Label_Tool_Windows_disabled_when_playing(), new GUILayoutOption[0]);
         FsmEditorSettings.DisableToolWindowsWhenPlaying = !GUILayout.Toggle(!FsmEditorSettings.DisableToolWindowsWhenPlaying, Strings.get_Label_Enable_Tool_Windows_When_Playing(), new GUILayoutOption[0]);
         if (GUI.get_changed())
         {
             FsmEditorSettings.SaveSettings();
         }
         return(FsmEditorSettings.DisableToolWindowsWhenPlaying);
     }
     return(false);
 }
Esempio n. 29
0
 private void DoBottomPanel()
 {
     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
     if (this.selectedTemplate == null)
     {
         EditorGUI.BeginDisabledGroup(true);
         GUILayout.TextField(Strings.get_Label_Category___(), new GUILayoutOption[0]);
         EditorGUILayout.TextArea(Strings.get_Label_Description___(), new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         });
         EditorGUI.EndDisabledGroup();
     }
     else
     {
         EditorGUI.BeginChangeCheck();
         this.selectedTemplate.set_Category(EditorGUILayout.TextField(this.selectedTemplate.get_Category(), new GUILayoutOption[0]));
         this.selectedTemplate.fsm.set_Description(EditorGUILayout.TextArea(this.selectedTemplate.fsm.get_Description(), SkillEditorStyles.TextArea, new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         }));
         if (EditorGUI.EndChangeCheck())
         {
             EditorUtility.SetDirty(this.selectedTemplate);
             Templates.InitList();
         }
         if (this.eventType != 12 && this.currentEvent.get_clickCount() == 2 && SkillEditor.SelectedTemplate != this.selectedTemplate)
         {
             SkillTemplateSelector.AddTemplateToFsm();
             this.currentEvent.Use();
         }
     }
     if (GUILayout.Button(Strings.get_Label_New_Template(), new GUILayoutOption[0]))
     {
         SkillTemplate template = SkillBuilder.CreateTemplate();
         this.SelectTemplate(template);
         base.Repaint();
     }
     if (GUILayout.Button(Strings.get_Label_Load_All_Templates(), new GUILayoutOption[0]))
     {
         Templates.LoadAll();
         base.Repaint();
     }
 }
Esempio n. 30
0
        private void DoEventLine(SkillEvent fsmEvent)
        {
            int eventUseCount = SkillSearch.GetEventUseCount(SkillEditor.SelectedFsm, fsmEvent.get_Name());

            GUILayout.BeginHorizontal((this.selectedEvent != null && fsmEvent.get_Name() == this.selectedEvent.get_Name()) ? SkillEditorStyles.SelectedEventBox : SkillEditorStyles.TableRowBox, new GUILayoutOption[0]);
            EditorGUI.BeginDisabledGroup(fsmEvent.get_IsSystemEvent());
            bool flag = GUILayout.Toggle(fsmEvent.get_IsGlobal(), SkillEditorContent.GlobalEventTooltipLabel, SkillEditorStyles.TableRowCheckBox, new GUILayoutOption[]
            {
                GUILayout.MaxWidth(17f),
                GUILayout.MinWidth(17f)
            });

            if (flag != fsmEvent.get_IsGlobal())
            {
                SkillEditor.Builder.SetEventIsGlobal(SkillEditor.SelectedFsm, fsmEvent, flag);
                GlobalEventsWindow.ResetView();
            }
            EditorGUI.EndDisabledGroup();
            GUIStyle gUIStyle = (this.selectedEvent != null && fsmEvent.get_Name() == this.selectedEvent.get_Name()) ? SkillEditorStyles.TableRowTextSelected : SkillEditorStyles.TableRowText;

            if (GUILayout.Button(fsmEvent.get_Name(), gUIStyle, new GUILayoutOption[]
            {
                GUILayout.MinWidth(244f)
            }))
            {
                this.SelectEvent(fsmEvent, true);
                GUIUtility.set_keyboardControl(0);
                if (Event.get_current().get_button() == 1 || EditorGUI.get_actionKey())
                {
                    this.GenerateStateListMenu(this.selectedEvent).ShowAsContext();
                }
            }
            GUILayout.FlexibleSpace();
            GUILayout.Label(eventUseCount.ToString(CultureInfo.get_CurrentCulture()), gUIStyle, new GUILayoutOption[0]);
            GUILayout.Space(5f);
            if (SkillEditorGUILayout.DeleteButton())
            {
                EditorCommands.DeleteEvent(fsmEvent);
                this.Reset();
            }
            GUILayout.EndHorizontal();
        }