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(); }
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(); }
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(); }
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); } } } }
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(); }
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(); }
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(); } }
public static void LockFsmGUI(Skill fsm) { if (fsm.get_Locked()) { return; } SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(Strings.get_Label_Password(), new GUILayoutOption[] { GUILayout.MaxWidth(70f) }); SkillEditorGUILayout.password = EditorGUILayout.TextField(SkillEditorGUILayout.password, new GUILayoutOption[0]); if (GUILayout.Button(SkillEditorContent.LockFsmButton, new GUILayoutOption[] { GUILayout.MaxWidth(60f) })) { SkillEditorGUILayout.LockFSM(fsm); } GUILayout.EndHorizontal(); }
private void DoEventEditor() { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (EditorWindow.get_focusedWindow() != this) { return; } if (this.selectedEvent == null || this.selectedEvent.get_IsSystemEvent()) { return; } EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(Strings.get_Command_Rename(), new GUILayoutOption[] { GUILayout.MaxWidth(80f) }); this.newEventName = EditorGUILayout.TextField(this.newEventName, new GUILayoutOption[0]); EditorGUILayout.EndHorizontal(); string text = SkillEditor.Builder.ValidateRenameEvent(this.selectedEvent, this.newEventName); bool flag = string.IsNullOrEmpty(text); if (!flag) { GUILayout.Box(text, SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } if (Event.get_current().get_isKey()) { if (flag && Keyboard.EnterKeyPressed()) { this.RenameEvent(); GUIUtility.ExitGUI(); } if (Event.get_current().get_keyCode() == 27) { this.newEventName = this.selectedEvent.get_Name(); } } }
private void DoLogLine(SkillLogEntry entry, int index) { if (!this.EntryIsVisible(entry)) { return; } if (entry.get_LogType() == 6) { this.currentState = entry.get_State(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); } if (this.selectedEntry != null && index > this.selectedEntryIndex) { GUI.set_color(new Color(1f, 1f, 1f, 0.3f)); } if (entry.get_LogType() == 9 || entry.get_LogType() == 10) { GUI.set_backgroundColor(SkillEditorStyles.DefaultBackgroundColor); } else { GUI.set_backgroundColor((this.currentState != null) ? PlayMakerPrefs.get_Colors()[this.currentState.get_ColorIndex()] : Color.get_grey()); } GUILayout.BeginVertical(SkillEditorStyles.LogBackground, new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); Color backgroundColor = GUI.get_backgroundColor(); GUI.set_backgroundColor(Color.get_white()); GUIStyle gUIStyle = SkillEditorStyles.GetLogTypeStyles()[entry.get_LogType()]; GUILayout.Label("", gUIStyle, new GUILayoutOption[] { GUILayout.MaxWidth(20f) }); GUI.set_backgroundColor(backgroundColor); gUIStyle = SkillEditorStyles.LogLine; if (GUILayout.Button(FsmEditorSettings.LogShowTimecode ? entry.get_TextWithTimecode() : entry.get_Text(), gUIStyle, new GUILayoutOption[0])) { this.SelectLogEntry(entry); } GUILayout.EndHorizontal(); if (this.ShowSentBy(entry)) { if (string.IsNullOrEmpty(entry.get_Text2())) { entry.set_Text2(Strings.get_FsmLog_Label_Sent_By() + Labels.GetFullStateLabel(entry.get_SentByState())); if (entry.get_Action() != null) { entry.set_Text2(entry.get_Text2() + " : " + Labels.GetActionLabel(entry.get_Action())); } } if (GUILayout.Button(entry.get_Text2(), SkillEditorStyles.LogLine2, new GUILayoutOption[0])) { SkillLogger.OnClickSentBy(entry); } EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4); } else { if (this.ShowEventTarget(entry)) { if (string.IsNullOrEmpty(entry.get_Text2())) { entry.set_Text2(Strings.get_FsmLog_Label_Target() + SkillLogger.GetEventTargetLabel(entry)); } if (GUILayout.Button(entry.get_Text2(), SkillEditorStyles.LogLine2, new GUILayoutOption[0])) { this.OnClickEventTarget(entry); GUIUtility.ExitGUI(); return; } EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4); } else { if (this.ShowHitGameObject(entry)) { if (string.IsNullOrEmpty(entry.get_Text2())) { entry.set_Text2("WITH: " + entry.get_GameObjectName()); entry.set_GameObjectIcon(EditorHacks.GetIconForObject(entry.get_GameObject())); } if (entry.get_GameObject() != null) { if (GUILayout.Button(entry.get_Text2(), SkillEditorStyles.LogLine2, new GUILayoutOption[0])) { Selection.set_activeGameObject(entry.get_GameObject()); GUIUtility.ExitGUI(); return; } Rect lastRect = GUILayoutUtility.GetLastRect(); EditorGUIUtility.AddCursorRect(lastRect, 4); if (entry.get_GameObjectIcon() != null) { lastRect.Set(lastRect.get_xMin(), lastRect.get_yMin() + 2f, 27f, lastRect.get_height() - 2f); GUI.Label(lastRect, entry.get_GameObjectIcon()); } } else { GUILayout.Label(entry.get_Text2() + " (Destroyed)", SkillEditorStyles.LogLine2, new GUILayoutOption[0]); } } } } GUILayout.EndVertical(); if (entry == this.selectedEntry) { this.beforeSelected = this.prevEntry; GUI.set_backgroundColor(Color.get_white()); GUILayout.Box(GUIContent.none, SkillEditorStyles.LogLineTimeline, new GUILayoutOption[0]); } if (this.prevEntry == this.selectedEntry) { this.afterSelected = entry; } this.prevEntry = entry; this.numEntriesDrawn++; }
private void DoVariableEditor() { SkillEditorGUILayout.LabelWidth(100f); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (this.isVariableSelected) { EditorGUI.BeginDisabledGroup(this.editingGlobalVariables); this.editNameTextField.OnGUI(new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); EditorGUI.BeginChangeCheck(); this.selectedFsmVariable.DoEditorGUI(null, this.editingAsset); this.selectedFsmVariable.Tooltip = EditorGUILayout.TextField(SkillEditorContent.TooltipLabel, this.selectedFsmVariable.Tooltip, new GUILayoutOption[0]); this.categoryTextField.OnGUI(new GUILayoutOption[0]); if (!this.editingGlobalVariables) { this.selectedFsmVariable.ShowInInspector = EditorGUILayout.Toggle(SkillEditorContent.InspectorLabel, this.selectedFsmVariable.ShowInInspector, new GUILayoutOption[0]); } if (SkillVariable.CanNetworkSync(this.selectedFsmVariable.NamedVar)) { this.selectedFsmVariable.NetworkSync = EditorGUILayout.Toggle(SkillEditorContent.NetworkSyncLabel, this.selectedFsmVariable.NetworkSync, new GUILayoutOption[0]); if (FsmEditorSettings.CheckForNetworkSetupErrors && this.selectedFsmVariable.NetworkSync) { this.CheckForNetworkSyncErrors(); } } else { bool enabled = GUI.get_enabled(); GUI.set_enabled(false); EditorGUILayout.Toggle(SkillEditorContent.NetworkSyncNotSupportedLabel, false, new GUILayoutOption[0]); GUI.set_enabled(enabled); } if (EditorGUI.EndChangeCheck()) { this.UpdateVariable(this.selectedFsmVariable, ""); } if (!this.editNameTextField.IsValid) { GUILayout.Box(Strings.get_Error_Variable_Name_Taken(), SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } } else { this.addVariableTextField.OnGUI(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); this.newVariableType = EditorGUILayout.Popup(SkillEditorContent.EditVariableTypeLabel, this.newVariableType, SkillVariable.VariableTypeNames, new GUILayoutOption[0]); EditorGUI.BeginDisabledGroup(!this.addVariableTextField.IsValid || this.addVariableTextField.Text.get_Length() == 0); if (GUILayout.Button(SkillEditorContent.AddLabel, new GUILayoutOption[] { GUILayout.MaxWidth(35f), GUILayout.MaxHeight(15f) })) { this.AddVariable(this.addVariableTextField); } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); if (!this.addVariableTextField.IsValid) { GUILayout.Box(Strings.get_Error_Variable_Name_Taken(), SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } } if (FsmEditorSettings.ShowHints) { GUILayout.Box((!string.IsNullOrEmpty(this.editNameTextField.Text)) ? Strings.get_Hint_Inspector_Usage() : Strings.get_Hint_Variable_Usage(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } }
public static bool BoldFoldout(bool state, GUIContent content) { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); return(EditorGUILayout.Foldout(state, content, SkillEditorStyles.BoldFoldout)); }
public override void DoGUI() { SkillEditorStyles.Init(); SkillEditorGUILayout.ToolWindowLargeTitle(this, Strings.get_CustomActionWizard_Full_Title()); SkillEditorGUILayout.LabelWidth(200f); this.HandleDragPreviewDivider(); this.controlsScrollPosition = EditorGUILayout.BeginScrollView(this.controlsScrollPosition, new GUILayoutOption[0]); EditorGUI.set_indentLevel(1); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Group_Name_and_Description()); this.actionName = SkillEditorGUILayout.TextFieldWithHint(this.actionName, Strings.get_CustomActionWizard_Label_Action_Name(), new GUILayoutOption[0]); this.tooltip = SkillEditorGUILayout.TextAreaWithHint(this.tooltip, Strings.get_CustomActionWizard_Label_Description(), new GUILayoutOption[] { GUILayout.Height(80f) }); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Group_Category()); GUI.set_enabled(string.IsNullOrEmpty(this.customCategory)); this.selectedCategory = EditorGUILayout.Popup(Strings.get_CustomActionWizard_Select_Category(), this.selectedCategory, this.actionCategories, new GUILayoutOption[0]); GUI.set_enabled(true); this.customCategory = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Custom_Category(), this.customCategory, new GUILayoutOption[0]); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Generated_Code_Folder()); this.rootFolder = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Root_Folder(), this.rootFolder, new GUILayoutOption[0]); GUI.set_enabled(!this.folderSameAsCategory); this.actionFolder = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Action_Folder(), this.actionFolder, new GUILayoutOption[0]); GUI.set_enabled(true); this.folderSameAsCategory = EditorGUILayout.Toggle(Strings.get_CustomActionWizard_Same_as_Category(), this.folderSameAsCategory, new GUILayoutOption[0]); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Add_Methods()); this.handlesOnEnter = EditorGUILayout.Toggle("OnEnter", this.handlesOnEnter, new GUILayoutOption[0]); this.handlesOnUpdate = EditorGUILayout.Toggle("OnUpdate", this.handlesOnUpdate, new GUILayoutOption[0]); this.handlesOnFixedUpdate = EditorGUILayout.Toggle("OnFixedUpdate", this.handlesOnFixedUpdate, new GUILayoutOption[0]); this.handlesOnLateUpdate = EditorGUILayout.Toggle("OnLateUpdate", this.handlesOnLateUpdate, new GUILayoutOption[0]); this.handlesOnExit = EditorGUILayout.Toggle("OnExit", this.handlesOnExit, new GUILayoutOption[0]); this.hasCustomErrorChecker = EditorGUILayout.Toggle(Strings.get_CustomActionWizard_Custom_Error_Checker(), this.hasCustomErrorChecker, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); if (!this.isValid) { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); EditorGUI.set_indentLevel(0); EditorGUILayout.HelpBox(this.errorString, 3, true); } GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]); GUILayout.Label(Strings.get_CustomActionWizard_Code_Preview(), new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); if (Event.get_current().get_type() == 7) { this.previewDividerRect = GUILayoutUtility.GetLastRect(); } EditorGUIUtility.AddCursorRect(this.previewDividerRect, 2); this.previewScrollPosition = EditorGUILayout.BeginScrollView(this.previewScrollPosition, new GUILayoutOption[] { GUILayout.MinHeight(this.previewHeight) }); GUILayout.Label(this.code, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.Label(Strings.get_CustomActionWizard_File_Path_Prefix() + this.localAssetFilename, new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUI.set_enabled(this.isValid); if (GUILayout.Button(Strings.get_CustomActionWizard_Save_Button(), new GUILayoutOption[0])) { this.SaveCustomAction(); GUIUtility.ExitGUI(); return; } GUI.set_enabled(true); if (GUILayout.Button(new GUIContent(Strings.get_CustomActionWizard_Find_File(), Strings.get_CustomActionWizard_Find_File_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.PingScriptFile(); } if (GUILayout.Button(new GUIContent(Strings.get_CustomActionWizard_Copy_Code(), Strings.get_CustomActionWizard_Copy_Code_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.CopyCodeToClipboard(); } GUILayout.EndHorizontal(); GUILayout.Space(10f); EditorGUI.set_indentLevel(0); if (GUI.get_changed()) { this.UpdateGUI(); GUIUtility.ExitGUI(); } }
private void DoEventEditor() { if (EditorWindow.get_focusedWindow() != SkillEditor.Window) { return; } SkillEditorGUILayout.LabelWidth(86f); bool flag = !SkillEvent.IsNullOrEmpty(this.selectedEvent); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (flag && FsmEditorSettings.ShowHints) { GUILayout.Box(this.selectedEvent.get_IsSystemEvent() ? Strings.get_Hint_System_Events_cannot_be_renamed() : Strings.get_Hint_Use_Event_Browser_to_rename_globally(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } if (flag && this.selectedEvent.get_IsGlobal()) { SkillEditorGUILayout.ReadonlyTextField(SkillEditorContent.GlobalEventName, 82f, this.newEventName, new GUILayoutOption[0]); } else { if (!flag || !this.selectedEvent.get_IsSystemEvent()) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(flag ? SkillEditorContent.EditEventNameLabel : SkillEditorContent.AddEventLabel, new GUILayoutOption[] { GUILayout.MaxWidth(80f) }); this.newEventName = EditorGUILayout.TextField(this.newEventName, new GUILayoutOption[0]); string text = SkillEditorGUILayout.FsmEventListPopup(); if (text != "") { this.AddEvent(text); return; } EditorGUILayout.EndHorizontal(); if (!flag && FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Tooltip_EventManager_Add_Event(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } } } if (flag) { bool flag2 = false; using (List <SkillEvent> .Enumerator enumerator = SkillEditor.SelectedFsm.ExposedEvents.GetEnumerator()) { while (enumerator.MoveNext()) { SkillEvent current = enumerator.get_Current(); if (current.get_Name() == this.selectedEvent.get_Name()) { flag2 = true; break; } } } bool flag3 = EditorGUILayout.Toggle(SkillEditorContent.EventInspectorLabel, flag2, new GUILayoutOption[0]); if (flag2 != flag3) { if (!flag3) { EditorCommands.RemoveExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent); } else { EditorCommands.AddExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent); } SkillEditor.SetFsmDirty(false, false); } if (FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Hint_EventManager_Expose_Events(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } } string text2 = this.ValidateEventName(flag); bool flag4 = string.IsNullOrEmpty(text2); if (!flag4) { GUILayout.Box(text2, SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } if (Event.get_current().get_isKey()) { if (flag4 && Keyboard.EnterKeyPressed()) { if (!flag) { this.AddEvent(this.newEventName); } else { this.RenameEvent(this.selectedEvent, this.newEventName); } Event.get_current().Use(); GUIUtility.ExitGUI(); return; } if (Event.get_current().get_keyCode() == 27) { this.Reset(); } } }
private void DoSortedByAction() { List <Type> list = new List <Type>(); using (List <ActionReport> .Enumerator enumerator = ActionReport.ActionReportList.GetEnumerator()) { while (enumerator.MoveNext()) { ActionReport current = enumerator.get_Current(); Type type = current.action.GetType(); if (!list.Contains(type)) { list.Add(type); } } } this.currentAction = null; using (List <Type> .Enumerator enumerator2 = list.GetEnumerator()) { while (enumerator2.MoveNext()) { Type current2 = enumerator2.get_Current(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.Label(Labels.GetActionLabel(current2), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); this.currentFSM = null; this.currentState = null; List <SkillState> list2 = new List <SkillState>(); List <ActionReport> list3 = new List <ActionReport>(); List <string> list4 = new List <string>(); SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label(Strings.get_ActionReportWindow_Action_Changes_Title(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); using (List <ActionReport> .Enumerator enumerator3 = ActionReport.ActionReportList.GetEnumerator()) { while (enumerator3.MoveNext()) { ActionReport current3 = enumerator3.get_Current(); Type type2 = current3.action.GetType(); if (type2 == current2) { if (!list2.Contains(current3.state)) { list3.Add(current3); list2.Add(current3.state); } if (!list4.Contains(current3.logText)) { ActionReportWindow.DoReportLine(Strings.get_Tab(), current3); list4.Add(current3.logText); } } } } SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label(Strings.get_ActionReportWindow_Effected_States_Title(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); using (List <ActionReport> .Enumerator enumerator4 = list3.GetEnumerator()) { while (enumerator4.MoveNext()) { ActionReport current4 = enumerator4.get_Current(); if (current4.state != null && !(current4.fsm == null)) { if (GUILayout.Button(Strings.get_Tab() + Labels.GetFullStateLabel(current4.state), EditorStyles.get_label(), new GUILayoutOption[0])) { ActionReportWindow.SelectReport(current4); return; } EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), 4); } } } } } }
public override void DoGUI() { SkillEditorStyles.Init(); SkillEditorGUILayout.ToolWindowLargeTitle(this, Strings.get_BugReportWindow_Title()); SkillEditorGUILayout.LabelWidth(200f); this.controlsScrollPosition = EditorGUILayout.BeginScrollView(this.controlsScrollPosition, new GUILayoutOption[0]); GUILayout.Label(Strings.get_BugReportWindow_Bug_Title_Label(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); this.description = EditorGUILayout.TextField(this.description, new GUILayoutOption[0]); GUILayout.Label(Strings.get_BugReportWindow_Bug_Description_Label(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); this.extra = EditorGUILayout.TextArea(this.extra, SkillEditorStyles.TextAreaWithWordWrap, new GUILayoutOption[] { GUILayout.ExpandHeight(true) }); this.area = (BugReportWindow.ScoutArea)EditorGUILayout.EnumPopup(Strings.get_BugReportWindow_Where_does_it_happen(), this.area, new GUILayoutOption[0]); this.frequencyIndex = EditorGUILayout.Popup(Strings.get_BugReportWindow_How_often_does_it_happen(), this.frequencyIndex, BugReportWindow.frequencyChoices, new GUILayoutOption[0]); this.email = EditorGUILayout.TextField(new GUIContent(Strings.get_BugReportWindow_Your_E_mail(), Strings.get_BugReportWindow_Your_E_mail_Tooltip()), this.email, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label("PlayMaker: " + VersionInfo.AssemblyVersion, new GUILayoutOption[0]); GUILayout.Label("Unity: " + Application.get_unityVersion(), new GUILayoutOption[0]); GUILayout.Label("Build Target: " + EditorUserBuildSettings.get_activeBuildTarget(), new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(Strings.get_BugReportWindow_Submit_Button(), new GUILayoutOption[0])) { if (!this.isValid) { EditorUtility.DisplayDialog(Strings.get_BugReportWindow_Title(), this.errorString, Strings.get_OK()); } else { this.SubmitBugReportByMail(); } GUIUtility.ExitGUI(); return; } if (GUILayout.Button(new GUIContent(Strings.get_Command_Copy(), Strings.get_BugReportWindow_Copy_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.CopyReportToClipboard(); } if (GUILayout.Button(new GUIContent(Strings.get_Command_Reset()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { GUIUtility.set_keyboardControl(0); this.Reset(); } GUILayout.EndHorizontal(); GUILayout.Space(10f); if (GUI.get_changed()) { this.UpdateGUI(); GUIUtility.ExitGUI(); } }